ProjectCollection
ProjectCollection for manipulating and syncyng projects with ease
Constructor Summary
Public Constructor | ||
public |
constructor(allProjects: Object, differ: Differ) Create a new ProjectCollection instance. |
Member Summary
Public Members | ||
public |
All projects |
|
public |
All projects with resolved extend's |
|
public |
Differ |
Method Summary
Public Methods | ||
public |
changeColumnType(projectId: String, schemaId: String, columnId: String, type: String) Change type of a column |
|
public |
extendProject(projectId: String, extend: String) Extend from another project |
|
public |
extendSchema(projectId: String, schemaId: String, extend: String) Extend from another schema |
|
public |
Retrieve all projects |
|
public |
Retrieve all resolved projects |
|
public |
getChangesPerProject(changes: Changes): Object Group changes by their projectId |
|
public |
Get the current project (highest version) minimum version being 1 |
|
public |
Retrieve a unique array of projectId's, extracted from staging changes |
|
public |
Retrieve a unique array of projects that have staging changes |
|
public |
getProjectIdsFromChanges(changes: Changes): Array Get a unique array of projectId's, extracted from changes |
|
public |
getProjectVersion(projectId: String): Number Get version of a project |
|
public |
Same as getCurrentProjects but extend's are resolved. |
|
public |
Same as getStagingProjects but extend's are resolved. |
|
public |
Retrieve staging changes |
|
public |
Retrieve staging changes grouped by their projectId |
|
public |
Get the staging project (version 0) for every project |
|
public |
Retrieve project versions of all projects |
|
public |
Create or update a column |
|
public |
putProject(projectId: String, project: Project) Create or update a project |
|
public |
Create or update a schema |
|
public |
Remove all projects |
|
public |
removeColumn(projectId: String, schemaId: String, columnId: String) Remove a column |
|
public |
removeProject(projectId: String) Remove a project |
|
public |
removeSchema(projectId: String, schemaId: String) Remove a schema |
|
public |
renameColumn(projectId: String, schemaId: String, columnId: String, name: String) Rename a column |
|
public |
renameProject(projectId: String, name: String) Rename a project |
|
public |
renameSchema(projectId: String, schemaId: String, name: String) Rename a schema |
|
public |
Get all projects with resolved extends |
|
public |
resolveProject(project: Project): Project Resolve extends in a project |
|
public |
stageChange(change: Change) Stage change |
|
public |
stageChanges(changes: Changes) Stage changes |
|
public |
tagProject(projectId: String, version: Number) Tag a project |
Protected Methods | ||
protected |
applyChange(change: Change) Apply change |
|
protected |
applyChanges(changes: Changes) Apply changes |
|
protected |
applyTagProject(projectId: String) Apply tag project change |
|
protected |
Retrieve staging changes by comparing the projects with extend's resolved This produces more detailed changes that are used by storage drivers |
Public Constructors
Public Members
Public Methods
public changeColumnType(projectId: String, schemaId: String, columnId: String, type: String) source
Change type of a column
public extendSchema(projectId: String, schemaId: String, extend: String) source
Extend from another schema
public getChangesPerProject(changes: Changes): Object source
Group changes by their projectId
Params:
Name | Type | Attribute | Description |
changes | Changes | The changes to group |
public getCurrentProjects(): Projects source
Get the current project (highest version) minimum version being 1
public getDirtyStagingProjectIds(): Array source
Retrieve a unique array of projectId's, extracted from staging changes
public getDirtyStagingProjects(): Array source
Retrieve a unique array of projects that have staging changes
public getProjectIdsFromChanges(changes: Changes): Array source
Get a unique array of projectId's, extracted from changes
Params:
Name | Type | Attribute | Description |
changes | Changes | Changes |
public getProjectVersion(projectId: String): Number source
Get version of a project
Params:
Name | Type | Attribute | Description |
projectId | String | Project id |
public getResolvedCurrentProjects(): Projects source
Same as getCurrentProjects but extend's are resolved.
public getResolvedStagingProjects(): Projects source
Same as getStagingProjects but extend's are resolved.
public getStagingChangesPerProject(): Object source
Retrieve staging changes grouped by their projectId
public putColumn(projectId: String, schemaId: String, columnId: String, column: Column) source
Create or update a column
public putSchema(projectId: String, schemaId: String, schema: Schema) source
Create or update a schema
public removeProject(projectId: String) source
Remove a project
Params:
Name | Type | Attribute | Description |
projectId | String | Project id |
public renameColumn(projectId: String, schemaId: String, columnId: String, name: String) source
Rename a column
public resolveProject(project: Project): Project source
Resolve extends in a project
Params:
Name | Type | Attribute | Description |
project | Project |
public stageChange(change: Change) source
Stage change
Params:
Name | Type | Attribute | Description |
change | Change | The change to stage |
public stageChanges(changes: Changes) source
Stage changes
Params:
Name | Type | Attribute | Description |
changes | Changes | The changes to stage |
Protected Methods
protected applyChange(change: Change) source
Apply change
Params:
Name | Type | Attribute | Description |
change | Change | The change to apply |
protected applyChanges(changes: Changes) source
Apply changes
Params:
Name | Type | Attribute | Description |
changes | Changes | The changes to apply |