Service programs: close, open, pause, setCapacity
The Service Verbs close, open, pause, setCapacity as MCP do programs, with inputs, result, refusals and an example.
curl -X POST https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW/ open \
-H "Authorization: Bearer $SB_TOKEN"
Service.opennpx startup-builder do Service.open --data '{"service": "service_Eq1ssq4AOW"}'
Service.open{
"name": "do",
"arguments": {
"code": "return await $.Service.open({ service: 'service_Eq1ssq4AOW' })"
}
}
Service.openimport { $ } from 'startup-builder'
const service = await $.Service.open({ service: 'service_Eq1ssq4AOW' })
Service.openReference for Service, one group of Service programs.
Service.close
Close stops a Service taking new Orders for good, while every placed Order runs to its end. Verb page.
do: return await $.Service.close(input)Emits Service.closed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service to close. |
reason | text | required | Why it closes. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The closed Service. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
service is missing, or is not a service | invalid-input | Send service as a service, then call it again. | None. |
reason is missing, or is not a text | invalid-input | Send reason as a text, then call it again. | None. |
The Idempotency-Key was sent before with another operation or other input | idempotency-mismatch | Send a new key for new input; reuse a key only to retry the same request. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Service.close({ service: 'service_Eq1ssq4AOW', reason: 'Example reason' })",
"idempotencyKey": "catalogmend-service-close-1"
}
}Service.open
Open starts a Service taking new Orders on every published Offer that sells it. Verb page.
do: return await $.Service.open(input)Emits Service.opened.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service to open. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service, now taking new Orders. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
service is missing, or is not a service | invalid-input | Send service as a service, then call it again. | None. |
The Idempotency-Key was sent before with another operation or other input | idempotency-mismatch | Send a new key for new input; reuse a key only to retry the same request. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Service.open({ service: 'service_Eq1ssq4AOW' })",
"idempotencyKey": "catalogmend-service-open-1"
}
}Service.pause
Pause stops a Service taking new Orders until a stated time, while every placed Order runs to its end. Verb page.
do: return await $.Service.pause(input)Emits Service.paused.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service to pause. |
reason | text | required | Why it pauses, shown to buyers. |
until | datetime | When it reopens on its own. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The paused Service. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
service is missing, or is not a service | invalid-input | Send service as a service, then call it again. | None. |
reason is missing, or is not a text | invalid-input | Send reason as a text, then call it again. | None. |
The Idempotency-Key was sent before with another operation or other input | idempotency-mismatch | Send a new key for new input; reuse a key only to retry the same request. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Service.pause({ service: 'service_Eq1ssq4AOW', reason: 'Example reason' })",
"idempotencyKey": "catalogmend-service-pause-1"
}
}Service.setCapacity
SetCapacity sets the most work a Service holds in flight, in the unit its intake counts. Verb page.
do: return await $.Service.setCapacity(input)Emits Service.capacitySet.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service. |
capacity | integer | required | The most work in flight, in the intake’s unit, such as listings. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service with its new capacity. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
service is missing, or is not a service | invalid-input | Send service as a service, then call it again. | None. |
capacity is missing, or is not a integer | invalid-input | Send capacity as a integer, then call it again. | None. |
The Idempotency-Key was sent before with another operation or other input | idempotency-mismatch | Send a new key for new input; reuse a key only to retry the same request. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Service.setCapacity({ service: 'service_Eq1ssq4AOW', capacity: 1 })",
"idempotencyKey": "catalogmend-service-set-capacity-1"
}
}