new IService(build)
A service with schema, documents, endpoints, middleware and tasks. Provide either paths to source files for compilation or provided a pre-built service to import.
Parameters:
Name | Type | Description |
---|---|---|
options.name | * | |
options.version | * | |
options.githash | * | |
options.branch | * | |
build | * |
- Source
Methods
(static) addDocument(document_path)
Add a document class implementation to the service
Parameters:
Name | Type | Description |
---|---|---|
document_path | string |
- Source
(static) addEndpoint(endpoint_path)
Add a dataparty endpoint to the service by pather
Parameters:
Name | Type | Description |
---|---|---|
endpoint_path | string |
- Source
(static) addEndpoint(middleware_path)
Add a middleware to this service
Parameters:
Name | Type | Description |
---|---|---|
middleware_path | string |
- Source
(static) addSchema(schema_path)
Add a dataparty schema implementation to the service
Parameters:
Name | Type | Description |
---|---|---|
schema_path | module:Service. |
- Source
(static) addTask(task_path)
Add a tasker
task implementation to the service
Parameters:
Name | Type | Description |
---|---|---|
task_path | string |
- Source
(async, static) compile(outputPath, writeFile)
Compile a service. This will build two output files, one for host usage -service.json
and another for client usage -schema.json
.
Parameters:
Name | Type | Description |
---|---|---|
outputPath | string | Path where the built service should be written |
writeFile | boolean | When true, files will be written. Defaults to |
- Source
Returns:
(static) importBuild(buildOutput)
Import a pre-build service
Parameters:
Name | Type | Description |
---|---|---|
buildOutput | Object |
- Source