@zarel-ai/sdk 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +29 -31
- package/dist/_internal/auth-headers.d.ts +3 -3
- package/dist/_internal/auth-headers.d.ts.map +1 -1
- package/dist/_internal/auth-headers.js +5 -3
- package/dist/_internal/auth-headers.js.map +1 -1
- package/dist/_internal/confirmation.d.ts +1 -1
- package/dist/_internal/confirmation.d.ts.map +1 -1
- package/dist/_internal/confirmation.js +3 -1
- package/dist/_internal/confirmation.js.map +1 -1
- package/dist/_internal/event-iterator.d.ts.map +1 -1
- package/dist/_internal/event-iterator.js +3 -1
- package/dist/_internal/event-iterator.js.map +1 -1
- package/dist/_internal/fetch-client.d.ts +26 -18
- package/dist/_internal/fetch-client.d.ts.map +1 -1
- package/dist/_internal/fetch-client.js +40 -35
- package/dist/_internal/fetch-client.js.map +1 -1
- package/dist/_internal/interceptors.d.ts.map +1 -1
- package/dist/_internal/interceptors.js.map +1 -1
- package/dist/_internal/mcp.d.ts.map +1 -1
- package/dist/_internal/mcp.js +6 -4
- package/dist/_internal/mcp.js.map +1 -1
- package/dist/_internal/pagination.d.ts +5 -5
- package/dist/_internal/pagination.d.ts.map +1 -1
- package/dist/_internal/pagination.js +7 -5
- package/dist/_internal/pagination.js.map +1 -1
- package/dist/_internal/require-token.d.ts +4 -4
- package/dist/_internal/require-token.d.ts.map +1 -1
- package/dist/_internal/require-token.js +6 -4
- package/dist/_internal/require-token.js.map +1 -1
- package/dist/_internal/retry-after.d.ts.map +1 -1
- package/dist/_internal/retry-after.js +2 -0
- package/dist/_internal/retry-after.js.map +1 -1
- package/dist/_internal/sse-client.d.ts.map +1 -1
- package/dist/_internal/sse-client.js +4 -3
- package/dist/_internal/sse-client.js.map +1 -1
- package/dist/_internal/version.d.ts +2 -2
- package/dist/_internal/version.d.ts.map +1 -1
- package/dist/_internal/version.js +4 -2
- package/dist/_internal/version.js.map +1 -1
- package/dist/client.d.ts +8 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -10
- package/dist/client.js.map +1 -1
- package/dist/contract/_singleton.d.ts +31 -6
- package/dist/contract/_singleton.d.ts.map +1 -1
- package/dist/contract/_singleton.js +30 -6
- package/dist/contract/_singleton.js.map +1 -1
- package/dist/contract/actions.d.ts +16 -4
- package/dist/contract/actions.d.ts.map +1 -1
- package/dist/contract/actions.js +13 -12
- package/dist/contract/actions.js.map +1 -1
- package/dist/contract/assistant.d.ts +3 -3
- package/dist/contract/assistant.d.ts.map +1 -1
- package/dist/contract/assistant.js +13 -11
- package/dist/contract/assistant.js.map +1 -1
- package/dist/contract/batch.d.ts +9 -20
- package/dist/contract/batch.d.ts.map +1 -1
- package/dist/contract/batch.js +14 -6
- package/dist/contract/batch.js.map +1 -1
- package/dist/contract/capabilities.d.ts +7 -13
- package/dist/contract/capabilities.d.ts.map +1 -1
- package/dist/contract/capabilities.js +10 -8
- package/dist/contract/capabilities.js.map +1 -1
- package/dist/contract/constraints.d.ts +7 -13
- package/dist/contract/constraints.d.ts.map +1 -1
- package/dist/contract/constraints.js +10 -8
- package/dist/contract/constraints.js.map +1 -1
- package/dist/contract/events.d.ts +9 -13
- package/dist/contract/events.d.ts.map +1 -1
- package/dist/contract/events.js +12 -13
- package/dist/contract/events.js.map +1 -1
- package/dist/contract/flows.d.ts +30 -19
- package/dist/contract/flows.d.ts.map +1 -1
- package/dist/contract/flows.js +46 -29
- package/dist/contract/flows.js.map +1 -1
- package/dist/contract/index.d.ts +207 -32
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +13 -14
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/metadata.d.ts +6 -20
- package/dist/contract/metadata.d.ts.map +1 -1
- package/dist/contract/metadata.js +16 -8
- package/dist/contract/metadata.js.map +1 -1
- package/dist/contract/process-model.d.ts +10 -15
- package/dist/contract/process-model.d.ts.map +1 -1
- package/dist/contract/process-model.js +11 -9
- package/dist/contract/process-model.js.map +1 -1
- package/dist/contract/roots/channels.d.ts.map +1 -1
- package/dist/contract/roots/channels.js +12 -10
- package/dist/contract/roots/channels.js.map +1 -1
- package/dist/contract/roots/events.d.ts.map +1 -1
- package/dist/contract/roots/events.js +2 -0
- package/dist/contract/roots/events.js.map +1 -1
- package/dist/contract/roots/index.d.ts +3 -2
- package/dist/contract/roots/index.d.ts.map +1 -1
- package/dist/contract/roots/index.js +13 -12
- package/dist/contract/roots/index.js.map +1 -1
- package/dist/contract/roots/mcp-servers.d.ts +11 -29
- package/dist/contract/roots/mcp-servers.d.ts.map +1 -1
- package/dist/contract/roots/mcp-servers.js +22 -18
- package/dist/contract/roots/mcp-servers.js.map +1 -1
- package/dist/contract/roots/profiles.d.ts +13 -12
- package/dist/contract/roots/profiles.d.ts.map +1 -1
- package/dist/contract/roots/profiles.js +18 -7
- package/dist/contract/roots/profiles.js.map +1 -1
- package/dist/contract/roots/timezone.d.ts +3 -3
- package/dist/contract/roots/timezone.d.ts.map +1 -1
- package/dist/contract/roots/timezone.js +5 -2
- package/dist/contract/roots/timezone.js.map +1 -1
- package/dist/contract/roots/treatment.d.ts +3 -2
- package/dist/contract/roots/treatment.d.ts.map +1 -1
- package/dist/contract/roots/treatment.js +8 -8
- package/dist/contract/roots/treatment.js.map +1 -1
- package/dist/contract/roots/vocabulary.d.ts +20 -13
- package/dist/contract/roots/vocabulary.d.ts.map +1 -1
- package/dist/contract/roots/vocabulary.js +28 -9
- package/dist/contract/roots/vocabulary.js.map +1 -1
- package/dist/contract/schemas.d.ts +7 -10
- package/dist/contract/schemas.d.ts.map +1 -1
- package/dist/contract/schemas.js +10 -8
- package/dist/contract/schemas.js.map +1 -1
- package/dist/contract/skills.d.ts +14 -4
- package/dist/contract/skills.d.ts.map +1 -1
- package/dist/contract/skills.js +11 -11
- package/dist/contract/skills.js.map +1 -1
- package/dist/errors.d.ts +4 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -4
- package/dist/errors.js.map +1 -1
- package/dist/generated/contract.d.ts +4494 -706
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/index.d.ts +119 -7
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/runtime.d.ts +1490 -368
- package/dist/generated/runtime.d.ts.map +1 -1
- package/dist/generated/unwrap-map.d.ts +5 -2
- package/dist/generated/unwrap-map.d.ts.map +1 -1
- package/dist/generated/unwrap-map.js +5 -5
- package/dist/generated/unwrap-map.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/actions.d.ts +5 -6
- package/dist/resources/actions.d.ts.map +1 -1
- package/dist/resources/actions.js +9 -10
- package/dist/resources/actions.js.map +1 -1
- package/dist/resources/audit.d.ts +6 -6
- package/dist/resources/audit.d.ts.map +1 -1
- package/dist/resources/audit.js +3 -25
- package/dist/resources/audit.js.map +1 -1
- package/dist/resources/authorization-ceiling.d.ts +2 -2
- package/dist/resources/authorization-ceiling.d.ts.map +1 -1
- package/dist/resources/authorization-ceiling.js +8 -7
- package/dist/resources/authorization-ceiling.js.map +1 -1
- package/dist/resources/authorization-operation-ids.d.ts +1 -1
- package/dist/resources/authorization-operation-ids.d.ts.map +1 -1
- package/dist/resources/authorization-operation-ids.js +4 -2
- package/dist/resources/authorization-operation-ids.js.map +1 -1
- package/dist/resources/authorization.d.ts +53 -19
- package/dist/resources/authorization.d.ts.map +1 -1
- package/dist/resources/authorization.js +24 -6
- package/dist/resources/authorization.js.map +1 -1
- package/dist/resources/authorizations.d.ts +3 -5
- package/dist/resources/authorizations.d.ts.map +1 -1
- package/dist/resources/authorizations.js +4 -2
- package/dist/resources/authorizations.js.map +1 -1
- package/dist/resources/channels.d.ts +7 -7
- package/dist/resources/channels.d.ts.map +1 -1
- package/dist/resources/channels.js +10 -10
- package/dist/resources/channels.js.map +1 -1
- package/dist/resources/contracts.d.ts +2 -2
- package/dist/resources/contracts.d.ts.map +1 -1
- package/dist/resources/contracts.js +15 -14
- package/dist/resources/contracts.js.map +1 -1
- package/dist/resources/conversation-sessions.d.ts +19 -20
- package/dist/resources/conversation-sessions.d.ts.map +1 -1
- package/dist/resources/conversation-sessions.js +17 -22
- package/dist/resources/conversation-sessions.js.map +1 -1
- package/dist/resources/conversation.d.ts +4 -4
- package/dist/resources/conversation.d.ts.map +1 -1
- package/dist/resources/conversation.js +13 -11
- package/dist/resources/conversation.js.map +1 -1
- package/dist/resources/embedding-credentials.d.ts +3 -3
- package/dist/resources/embedding-credentials.d.ts.map +1 -1
- package/dist/resources/embedding-credentials.js +8 -6
- package/dist/resources/embedding-credentials.js.map +1 -1
- package/dist/resources/entities.d.ts +50 -32
- package/dist/resources/entities.d.ts.map +1 -1
- package/dist/resources/entities.js +51 -32
- package/dist/resources/entities.js.map +1 -1
- package/dist/resources/events.d.ts +4 -5
- package/dist/resources/events.d.ts.map +1 -1
- package/dist/resources/events.js +12 -11
- package/dist/resources/events.js.map +1 -1
- package/dist/resources/flows.d.ts +18 -15
- package/dist/resources/flows.d.ts.map +1 -1
- package/dist/resources/flows.js +41 -27
- package/dist/resources/flows.js.map +1 -1
- package/dist/resources/imports.d.ts.map +1 -1
- package/dist/resources/imports.js +1 -1
- package/dist/resources/imports.js.map +1 -1
- package/dist/resources/index.d.ts +3 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +6 -2
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/llm-credentials.d.ts +21 -6
- package/dist/resources/llm-credentials.d.ts.map +1 -1
- package/dist/resources/llm-credentials.js +25 -10
- package/dist/resources/llm-credentials.js.map +1 -1
- package/dist/resources/llm-services.d.ts +8 -8
- package/dist/resources/llm-services.d.ts.map +1 -1
- package/dist/resources/llm-services.js +11 -9
- package/dist/resources/llm-services.js.map +1 -1
- package/dist/resources/mcp.d.ts.map +1 -1
- package/dist/resources/mcp.js +5 -3
- package/dist/resources/mcp.js.map +1 -1
- package/dist/resources/receipts.d.ts +1 -1
- package/dist/resources/receipts.d.ts.map +1 -1
- package/dist/resources/receipts.js +1 -1
- package/dist/resources/receipts.js.map +1 -1
- package/dist/resources/records.d.ts +1 -1
- package/dist/resources/records.d.ts.map +1 -1
- package/dist/resources/records.js +7 -5
- package/dist/resources/records.js.map +1 -1
- package/dist/resources/role-assignments.d.ts +4 -5
- package/dist/resources/role-assignments.d.ts.map +1 -1
- package/dist/resources/role-assignments.js +8 -7
- package/dist/resources/role-assignments.js.map +1 -1
- package/dist/resources/roles.d.ts +23 -23
- package/dist/resources/roles.d.ts.map +1 -1
- package/dist/resources/roles.js +20 -14
- package/dist/resources/roles.js.map +1 -1
- package/dist/resources/runtime-entities.d.ts +12 -9
- package/dist/resources/runtime-entities.d.ts.map +1 -1
- package/dist/resources/runtime-entities.js +5 -8
- package/dist/resources/runtime-entities.js.map +1 -1
- package/dist/resources/state-machine.d.ts +6 -12
- package/dist/resources/state-machine.d.ts.map +1 -1
- package/dist/resources/state-machine.js +17 -21
- package/dist/resources/state-machine.js.map +1 -1
- package/dist/resources/system.d.ts.map +1 -1
- package/dist/resources/system.js +5 -5
- package/dist/resources/system.js.map +1 -1
- package/dist/resources/tools.d.ts +2 -2
- package/dist/resources/tools.d.ts.map +1 -1
- package/dist/resources/tools.js +7 -5
- package/dist/resources/tools.js.map +1 -1
- package/dist/resources/traces.d.ts +1 -7
- package/dist/resources/traces.d.ts.map +1 -1
- package/dist/resources/traces.js +4 -29
- package/dist/resources/traces.js.map +1 -1
- package/dist/runtime/index.d.ts +4 -2
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +21 -17
- package/dist/runtime/index.js.map +1 -1
- package/dist/types/actions.d.ts +7 -8
- package/dist/types/actions.d.ts.map +1 -1
- package/dist/types/actions.js +4 -2
- package/dist/types/actions.js.map +1 -1
- package/dist/types/audit.d.ts +5 -7
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js +6 -6
- package/dist/types/audit.js.map +1 -1
- package/dist/types/channels.d.ts +1 -1
- package/dist/types/channels.d.ts.map +1 -1
- package/dist/types/channels.js +5 -3
- package/dist/types/channels.js.map +1 -1
- package/dist/types/collections-contract.d.ts +50 -0
- package/dist/types/collections-contract.d.ts.map +1 -0
- package/dist/types/collections-contract.js +22 -0
- package/dist/types/collections-contract.js.map +1 -0
- package/dist/types/confirmation.d.ts +4 -4
- package/dist/types/confirmation.d.ts.map +1 -1
- package/dist/types/confirmation.js +6 -4
- package/dist/types/confirmation.js.map +1 -1
- package/dist/types/contracts.d.ts +12 -15
- package/dist/types/contracts.d.ts.map +1 -1
- package/dist/types/contracts.js +5 -4
- package/dist/types/contracts.js.map +1 -1
- package/dist/types/conversation-sessions.d.ts +1 -1
- package/dist/types/conversation-sessions.d.ts.map +1 -1
- package/dist/types/conversation-sessions.js +3 -1
- package/dist/types/conversation-sessions.js.map +1 -1
- package/dist/types/conversation.d.ts +13 -40
- package/dist/types/conversation.d.ts.map +1 -1
- package/dist/types/entities.d.ts +52 -16
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/entities.js +12 -0
- package/dist/types/entities.js.map +1 -1
- package/dist/types/events-stream.d.ts +2 -2
- package/dist/types/events-stream.d.ts.map +1 -1
- package/dist/types/events-stream.js +6 -4
- package/dist/types/events-stream.js.map +1 -1
- package/dist/types/flows-contract.d.ts +28 -7
- package/dist/types/flows-contract.d.ts.map +1 -1
- package/dist/types/flows-contract.js +11 -4
- package/dist/types/flows-contract.js.map +1 -1
- package/dist/types/flows.d.ts +27 -58
- package/dist/types/flows.d.ts.map +1 -1
- package/dist/types/flows.js +8 -20
- package/dist/types/flows.js.map +1 -1
- package/dist/types/imports.d.ts +9 -0
- package/dist/types/imports.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/locale.d.ts +2 -2
- package/dist/types/locale.d.ts.map +1 -1
- package/dist/types/locale.js +4 -2
- package/dist/types/locale.js.map +1 -1
- package/dist/types/mcp-and-events-contract.d.ts +51 -0
- package/dist/types/mcp-and-events-contract.d.ts.map +1 -0
- package/dist/types/mcp-and-events-contract.js +20 -0
- package/dist/types/mcp-and-events-contract.js.map +1 -0
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +3 -1
- package/dist/types/mcp.js.map +1 -1
- package/dist/types/platform.d.ts +12 -12
- package/dist/types/platform.d.ts.map +1 -1
- package/dist/types/platform.js +0 -1
- package/dist/types/platform.js.map +1 -1
- package/dist/types/receipt.d.ts +3 -5
- package/dist/types/receipt.d.ts.map +1 -1
- package/dist/types/receipt.js +5 -5
- package/dist/types/receipt.js.map +1 -1
- package/dist/types/records.d.ts +3 -3
- package/dist/types/records.d.ts.map +1 -1
- package/dist/types/records.js +2 -0
- package/dist/types/records.js.map +1 -1
- package/dist/types/spec.d.ts +2 -2
- package/dist/types/spec.d.ts.map +1 -1
- package/dist/types/state-machine.d.ts +48 -84
- package/dist/types/state-machine.d.ts.map +1 -1
- package/dist/types/state-machine.js +9 -4
- package/dist/types/state-machine.js.map +1 -1
- package/dist/types/system.d.ts.map +1 -1
- package/dist/types/tools.d.ts +36 -28
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/types/tools.js +6 -6
- package/dist/types/tools.js.map +1 -1
- package/dist/types/traces.d.ts +6 -9
- package/dist/types/traces.d.ts.map +1 -1
- package/dist/types/traces.js +5 -5
- package/dist/types/traces.js.map +1 -1
- package/dist/types/treatment-contract.d.ts +70 -0
- package/dist/types/treatment-contract.d.ts.map +1 -0
- package/dist/types/treatment-contract.js +20 -0
- package/dist/types/treatment-contract.js.map +1 -0
- package/dist/types/workflows.d.ts +14 -0
- package/dist/types/workflows.d.ts.map +1 -1
- package/dist/types/workflows.js +7 -6
- package/dist/types/workflows.js.map +1 -1
- package/package.json +93 -96
- package/dist/contract/governance.d.ts +0 -6
- package/dist/contract/governance.d.ts.map +0 -1
- package/dist/contract/governance.js +0 -17
- package/dist/contract/governance.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/_internal/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/_internal/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC;qEACqE;AACrE,eAAO,MAAM,UAAU,wBAAiC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.USER_AGENT = exports.SDK_VERSION = void 0;
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
6
|
// The SDK's self-identifying version. Hand-maintained and kept in sync with
|
|
5
|
-
// `package.json` by
|
|
7
|
+
// `package.json` by a drift-guard test —
|
|
6
8
|
// a runtime `import` of package.json is avoided so nothing third-party / JSON
|
|
7
9
|
// enters the runtime graph (zero-runtime-deps invariant).
|
|
8
|
-
exports.SDK_VERSION = '0.
|
|
10
|
+
exports.SDK_VERSION = '0.7.0';
|
|
9
11
|
/** Sent as the `User-Agent` header on every request (Node-effective; browsers
|
|
10
12
|
* drop it — `User-Agent` is a forbidden header name in `fetch`). */
|
|
11
13
|
exports.USER_AGENT = `@zarel-ai/sdk/${exports.SDK_VERSION}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/_internal/version.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/_internal/version.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,gCAAgC;AAChC,4EAA4E;AAC5E,yCAAyC;AACzC,8EAA8E;AAC9E,0DAA0D;AAC7C,QAAA,WAAW,GAAG,OAAO,CAAC;AAEnC;qEACqE;AACxD,QAAA,UAAU,GAAG,iBAAiB,mBAAW,EAAE,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface ZarelOptions {
|
|
|
6
6
|
/**
|
|
7
7
|
* Tenant slug. When set and `runtimeBaseUrl` / `contractBaseUrl` are
|
|
8
8
|
* not provided, hosts are derived as
|
|
9
|
-
* `https://{tenant}.zarel.
|
|
10
|
-
* `https://{tenant}.admin.zarel.
|
|
9
|
+
* `https://{tenant}.zarel.ai/v1` (runtime) and
|
|
10
|
+
* `https://{tenant}.admin.zarel.ai/v1` (contract).
|
|
11
11
|
*/
|
|
12
12
|
tenant?: string;
|
|
13
13
|
/**
|
|
@@ -28,19 +28,19 @@ export interface ZarelOptions {
|
|
|
28
28
|
contractToken?: TokenInput;
|
|
29
29
|
/**
|
|
30
30
|
* Transport-managed (no-token) mode for BOTH planes: a credential-injecting
|
|
31
|
-
* transport (e.g. the
|
|
31
|
+
* transport (e.g. a backend proxy that holds the user's session) sets `Authorization` server-side,
|
|
32
32
|
* so the SDK omits the header and skips the token-presence guard. Opt-in —
|
|
33
|
-
* direct consumers keep the token-required guard
|
|
33
|
+
* direct consumers keep the token-required guard.
|
|
34
34
|
*/
|
|
35
35
|
transportManaged?: boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Override the derived runtime baseUrl
|
|
38
|
-
* (default: `https://{tenant}.zarel.
|
|
38
|
+
* (default: `https://{tenant}.zarel.ai/v1`).
|
|
39
39
|
*/
|
|
40
40
|
runtimeBaseUrl?: string;
|
|
41
41
|
/**
|
|
42
42
|
* Override the derived contract baseUrl
|
|
43
|
-
* (default: `https://{tenant}.admin.zarel.
|
|
43
|
+
* (default: `https://{tenant}.admin.zarel.ai/v1`).
|
|
44
44
|
*/
|
|
45
45
|
contractBaseUrl?: string;
|
|
46
46
|
/** Request timeout in milliseconds (default: 30000). Applied to both planes. */
|
|
@@ -52,13 +52,13 @@ export interface ZarelOptions {
|
|
|
52
52
|
/** Custom fetch implementation. Applied to both planes. */
|
|
53
53
|
fetch?: typeof globalThis.fetch;
|
|
54
54
|
/**
|
|
55
|
-
* Opt-in API version
|
|
55
|
+
* Opt-in API version. When set, every request carries
|
|
56
56
|
* `X-Zarel-Api-Version: <value>`. Applied to both planes. Forward-looking —
|
|
57
57
|
* no backend reads it today; unset ⇒ header omitted.
|
|
58
58
|
*/
|
|
59
59
|
apiVersion?: string;
|
|
60
60
|
/**
|
|
61
|
-
* Opt-in per-attempt request/response/error interceptors
|
|
61
|
+
* Opt-in per-attempt request/response/error interceptors. Applied to
|
|
62
62
|
* both planes. `onRequest` may mutate outgoing headers (throw aborts);
|
|
63
63
|
* `onResponse`/`onError` are read-only observers (throw swallowed).
|
|
64
64
|
*/
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAsB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA6B/C,MAAM,WAAW,YAAY;IACzB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAE1B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAID,qBAAa,KAAK;IACd,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAc;IAC7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAc;gBAElC,OAAO,EAAE,YAAY;CA+CpC"}
|
package/dist/client.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Zarel = void 0;
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
6
|
const fetch_client_1 = require("./_internal/fetch-client");
|
|
5
7
|
const unwrap_map_1 = require("./generated/unwrap-map");
|
|
6
8
|
const runtime_1 = require("./runtime");
|
|
7
9
|
const contract_1 = require("./contract");
|
|
8
10
|
// ── Public configuration ────────────────────────────────────────────────
|
|
9
|
-
// The
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
// future tenant-customizable website.
|
|
16
|
-
const DEFAULT_BASE_URL = 'https://api.zarel.ia/v1';
|
|
11
|
+
// The Zarel API is served under a `/v1/` prefix on each host
|
|
12
|
+
// (`https://{tenant}.zarel.ai/v1/`, or `https://api.zarel.ai/v1/` for the
|
|
13
|
+
// alias host). The rest of a tenant host serves other things, so only paths
|
|
14
|
+
// under `/v1/` reach the API — which is why the default base URL carries the
|
|
15
|
+
// prefix.
|
|
16
|
+
const DEFAULT_BASE_URL = 'https://api.zarel.ai/v1';
|
|
17
17
|
/**
|
|
18
18
|
* Insert `.admin.` after the first dot in the runtime host to derive the
|
|
19
19
|
* contract host. Returns `undefined` when the URL has no dotted host
|
|
@@ -43,11 +43,11 @@ class Zarel {
|
|
|
43
43
|
// ── Resolve runtime base URL ──────────────────────────────────
|
|
44
44
|
const runtimeBaseUrl = options.runtimeBaseUrl
|
|
45
45
|
?? (options.tenant
|
|
46
|
-
? `https://${options.tenant}.zarel.
|
|
46
|
+
? `https://${options.tenant}.zarel.ai/v1`
|
|
47
47
|
: DEFAULT_BASE_URL);
|
|
48
48
|
const contractBaseUrl = options.contractBaseUrl
|
|
49
49
|
?? (options.tenant
|
|
50
|
-
? `https://${options.tenant}.admin.zarel.
|
|
50
|
+
? `https://${options.tenant}.admin.zarel.ai/v1`
|
|
51
51
|
: undefined)
|
|
52
52
|
?? deriveContractFromRuntime(runtimeBaseUrl)
|
|
53
53
|
?? runtimeBaseUrl;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAGvD,uDAAiF;AACjF,uCAA6C;AAC7C,yCAA+C;AAE/C,2EAA2E;AAE3E,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
import type { FetchClient } from '../_internal/fetch-client';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Any JSON object: the default document type of `SingletonAccessor`, exported so every
|
|
4
|
+
* section accessor names the same type.
|
|
5
|
+
*/
|
|
6
|
+
export type JsonObject = Record<string, unknown>;
|
|
3
7
|
export interface SingletonOperationIds {
|
|
4
8
|
readonly get: string;
|
|
5
9
|
readonly put: string;
|
|
6
10
|
readonly patch: string;
|
|
7
11
|
}
|
|
8
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `Doc` / `Write` default to `JsonObject`, which says nothing, in both directions. A section
|
|
14
|
+
* that has a published schema names it here instead.
|
|
15
|
+
*
|
|
16
|
+
* `/contract/llm` and `/contract/process-model` are typed on the write: each takes the section
|
|
17
|
+
* MINUS a child that has its own endpoints, a type derived from the section's own schema.
|
|
18
|
+
* `/contract/events/delivery` is the one still on the default.
|
|
19
|
+
*
|
|
20
|
+
* THE READS ARE STILL `JsonObject` ON THOSE TWO, which is not an oversight: `getLlm` and
|
|
21
|
+
* `getProcessModel` publish a bare `OkEnvelope`, so there is no read shape to point at, and a
|
|
22
|
+
* `Write` type doubling as a `Doc` would claim a response body nothing binds.
|
|
23
|
+
*
|
|
24
|
+
* `Doc` and `Write` are SEPARATE parameters because a read and a write are not the same
|
|
25
|
+
* shape: `/contract/treatment` answers a `vocabulary` its own PUT refuses.
|
|
26
|
+
*
|
|
27
|
+
* `Patch` IS A THIRD, and it defaults to `Write` for sections with no separate patch body. A
|
|
28
|
+
* replace and an RFC 7396 merge patch are not the same body either: the patch requires nothing
|
|
29
|
+
* (the required key comes from the merge base) and it admits `null`, which REMOVES a key and is
|
|
30
|
+
* the only way to clear one. Typed as `Write`, `patch({})` would not compile on a route that
|
|
31
|
+
* answers 200, and neither would `patch({temperature: null})`, the only spelling that clears a
|
|
32
|
+
* tunable.
|
|
33
|
+
*/
|
|
34
|
+
export declare class SingletonAccessor<Doc = JsonObject, Write = JsonObject, Patch = Write> {
|
|
9
35
|
private readonly client;
|
|
10
36
|
private readonly path;
|
|
11
37
|
private readonly operationIds;
|
|
12
38
|
constructor(client: FetchClient, path: string, operationIds: SingletonOperationIds);
|
|
13
|
-
get(): Promise<
|
|
14
|
-
put(input:
|
|
15
|
-
patch(patch:
|
|
39
|
+
get(): Promise<Doc>;
|
|
40
|
+
put(input: Write): Promise<Doc>;
|
|
41
|
+
patch(patch: Patch): Promise<Doc>;
|
|
16
42
|
}
|
|
17
|
-
export {};
|
|
18
43
|
//# sourceMappingURL=_singleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_singleton.d.ts","sourceRoot":"","sources":["../../src/contract/_singleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_singleton.d.ts","sourceRoot":"","sources":["../../src/contract/_singleton.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,iBAAiB,CAAC,GAAG,GAAG,UAAU,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,GAAG,KAAK;IAE1E,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,qBAAqB;IAGlD,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAInB,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;IAI/B,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;CAG1C"}
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
|
+
// Shared accessor for contract-API sections that are a single document
|
|
5
|
+
// (the process-model document, the contract roots that carry one, events/delivery).
|
|
6
|
+
// Each is one JSON document with get/put/patch.
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.SingletonAccessor = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* `Doc` / `Write` default to `JsonObject`, which says nothing, in both directions. A section
|
|
11
|
+
* that has a published schema names it here instead.
|
|
12
|
+
*
|
|
13
|
+
* `/contract/llm` and `/contract/process-model` are typed on the write: each takes the section
|
|
14
|
+
* MINUS a child that has its own endpoints, a type derived from the section's own schema.
|
|
15
|
+
* `/contract/events/delivery` is the one still on the default.
|
|
16
|
+
*
|
|
17
|
+
* THE READS ARE STILL `JsonObject` ON THOSE TWO, which is not an oversight: `getLlm` and
|
|
18
|
+
* `getProcessModel` publish a bare `OkEnvelope`, so there is no read shape to point at, and a
|
|
19
|
+
* `Write` type doubling as a `Doc` would claim a response body nothing binds.
|
|
20
|
+
*
|
|
21
|
+
* `Doc` and `Write` are SEPARATE parameters because a read and a write are not the same
|
|
22
|
+
* shape: `/contract/treatment` answers a `vocabulary` its own PUT refuses.
|
|
23
|
+
*
|
|
24
|
+
* `Patch` IS A THIRD, and it defaults to `Write` for sections with no separate patch body. A
|
|
25
|
+
* replace and an RFC 7396 merge patch are not the same body either: the patch requires nothing
|
|
26
|
+
* (the required key comes from the merge base) and it admits `null`, which REMOVES a key and is
|
|
27
|
+
* the only way to clear one. Typed as `Write`, `patch({})` would not compile on a route that
|
|
28
|
+
* answers 200, and neither would `patch({temperature: null})`, the only spelling that clears a
|
|
29
|
+
* tunable.
|
|
30
|
+
*/
|
|
7
31
|
class SingletonAccessor {
|
|
8
32
|
client;
|
|
9
33
|
path;
|
|
@@ -14,13 +38,13 @@ class SingletonAccessor {
|
|
|
14
38
|
this.operationIds = operationIds;
|
|
15
39
|
}
|
|
16
40
|
async get() {
|
|
17
|
-
return this.client.get(this.path, undefined, { operationId: this.operationIds.get });
|
|
41
|
+
return await this.client.get(this.path, undefined, { operationId: this.operationIds.get });
|
|
18
42
|
}
|
|
19
43
|
async put(input) {
|
|
20
|
-
return this.client.put(this.path, input, { operationId: this.operationIds.put });
|
|
44
|
+
return await this.client.put(this.path, input, { operationId: this.operationIds.put });
|
|
21
45
|
}
|
|
22
46
|
async patch(patch) {
|
|
23
|
-
return this.client.patch(this.path, patch, { operationId: this.operationIds.patch });
|
|
47
|
+
return await this.client.patch(this.path, patch, { operationId: this.operationIds.patch });
|
|
24
48
|
}
|
|
25
49
|
}
|
|
26
50
|
exports.SingletonAccessor = SingletonAccessor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_singleton.js","sourceRoot":"","sources":["../../src/contract/_singleton.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"_singleton.js","sourceRoot":"","sources":["../../src/contract/_singleton.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,gCAAgC;AAChC,uEAAuE;AACvE,oFAAoF;AACpF,gDAAgD;;;AAgBhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,iBAAiB;IAEL;IACA;IACA;IAHrB,YACqB,MAAmB,EACnB,IAAY,EACZ,YAAmC;QAFnC,WAAM,GAAN,MAAM,CAAa;QACnB,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAuB;IACrD,CAAC;IAEJ,KAAK,CAAC,GAAG;QACL,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAM,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAY;QAClB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAM,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,KAAY;QACpB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;IACpG,CAAC;CACJ;AAlBD,8CAkBC"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { FetchClient } from '../_internal/fetch-client';
|
|
2
|
+
import type { ActionPatchPayload, ActionWritePayload } from '../generated';
|
|
3
|
+
import type { ContractDeletedAck } from '../types/flows-contract';
|
|
4
|
+
/**
|
|
5
|
+
* `POST /contract/actions` and `PUT /contract/actions/{name}` — one shape, DERIVED from the
|
|
6
|
+
* published request body.
|
|
7
|
+
*
|
|
8
|
+
* `expose_as_mcp_tool` IS carried here: both writes accept it and the server stores it.
|
|
9
|
+
*/
|
|
10
|
+
export type ContractActionWriteInput = ActionWritePayload;
|
|
11
|
+
/** `PATCH /contract/actions/{name}` — every key optional, `name` restatable and not changeable. */
|
|
12
|
+
export type ContractActionPatchInput = ActionPatchPayload;
|
|
2
13
|
export interface ContractActionDefinition {
|
|
3
14
|
readonly name: string;
|
|
4
15
|
readonly entity: string;
|
|
@@ -10,9 +21,10 @@ export declare class ContractActionsResource {
|
|
|
10
21
|
constructor(client: FetchClient);
|
|
11
22
|
list(): Promise<ContractActionDefinition[]>;
|
|
12
23
|
get(name: string): Promise<ContractActionDefinition>;
|
|
13
|
-
create(input:
|
|
14
|
-
put(name: string, input:
|
|
15
|
-
patch(name: string, patch:
|
|
16
|
-
|
|
24
|
+
create(input: ContractActionWriteInput): Promise<ContractActionDefinition>;
|
|
25
|
+
put(name: string, input: ContractActionWriteInput): Promise<ContractActionDefinition>;
|
|
26
|
+
patch(name: string, patch: ContractActionPatchInput): Promise<ContractActionDefinition>;
|
|
27
|
+
/** `ContractDeletedAck`, not `void`: this route answers `{success, data: {message}}`. */
|
|
28
|
+
delete(name: string): Promise<ContractDeletedAck>;
|
|
17
29
|
}
|
|
18
30
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/contract/actions.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/contract/actions.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAC1D,mGAAmG;AACnG,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACnC;AAED,qBAAa,uBAAuB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,IAAI,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAI3C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIpD,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI1E,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIrF,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI7F,yFAAyF;IACnF,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG1D"}
|
package/dist/contract/actions.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
|
+
// contract.actions CRUD.
|
|
3
5
|
//
|
|
4
|
-
// Maps to contract
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// action is `runtime.actions.dispatch()` on the runtime namespace —
|
|
8
|
-
// distinct from this surface, which manages the action definitions.
|
|
6
|
+
// Maps to the contract API's `/contract/actions` routes. Runtime invocation of an action
|
|
7
|
+
// is `runtime.actions.dispatch()` on the runtime namespace — distinct from this
|
|
8
|
+
// surface, which manages the action definitions.
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ContractActionsResource = void 0;
|
|
11
11
|
class ContractActionsResource {
|
|
@@ -14,22 +14,23 @@ class ContractActionsResource {
|
|
|
14
14
|
this.client = client;
|
|
15
15
|
}
|
|
16
16
|
async list() {
|
|
17
|
-
return this.client.get('/contract/actions', undefined, { operationId: 'listActions' });
|
|
17
|
+
return await this.client.get('/contract/actions', undefined, { operationId: 'listActions' });
|
|
18
18
|
}
|
|
19
19
|
async get(name) {
|
|
20
|
-
return this.client.get(`/contract/actions/${encodeURIComponent(name)}`, undefined, { operationId: 'getAction' });
|
|
20
|
+
return await this.client.get(`/contract/actions/${encodeURIComponent(name)}`, undefined, { operationId: 'getAction' });
|
|
21
21
|
}
|
|
22
22
|
async create(input) {
|
|
23
|
-
return this.client.post('/contract/actions', input, { operationId: 'createAction' });
|
|
23
|
+
return await this.client.post('/contract/actions', input, { operationId: 'createAction' });
|
|
24
24
|
}
|
|
25
25
|
async put(name, input) {
|
|
26
|
-
return this.client.put(`/contract/actions/${encodeURIComponent(name)}`, input, { operationId: 'replaceAction' });
|
|
26
|
+
return await this.client.put(`/contract/actions/${encodeURIComponent(name)}`, input, { operationId: 'replaceAction' });
|
|
27
27
|
}
|
|
28
28
|
async patch(name, patch) {
|
|
29
|
-
return this.client.patch(`/contract/actions/${encodeURIComponent(name)}`, patch, { operationId: 'patchAction' });
|
|
29
|
+
return await this.client.patch(`/contract/actions/${encodeURIComponent(name)}`, patch, { operationId: 'patchAction' });
|
|
30
30
|
}
|
|
31
|
+
/** `ContractDeletedAck`, not `void`: this route answers `{success, data: {message}}`. */
|
|
31
32
|
async delete(name) {
|
|
32
|
-
return this.client.del(`/contract/actions/${encodeURIComponent(name)}`, { operationId: 'deleteAction' });
|
|
33
|
+
return await this.client.del(`/contract/actions/${encodeURIComponent(name)}`, { operationId: 'deleteAction' });
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.ContractActionsResource = ContractActionsResource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/contract/actions.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/contract/actions.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,gCAAgC;AAChC,yBAAyB;AACzB,EAAE;AACF,yFAAyF;AACzF,gFAAgF;AAChF,iDAAiD;;;AAuBjD,MAAa,uBAAuB;IACH;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI;QACN,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAY;QAClB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAC3H,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAA+B;QACxC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAA+B;QACnD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAC3H,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,KAA+B;QACrD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;IAC3H,CAAC;IAED,yFAAyF;IACzF,KAAK,CAAC,MAAM,CAAC,IAAY;QACrB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAqB,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IACvI,CAAC;CACJ;AA3BD,0DA2BC"}
|
|
@@ -48,15 +48,15 @@ export declare class AssistantResource {
|
|
|
48
48
|
constructor(client: FetchClient);
|
|
49
49
|
/** POST /contract/assistant/conversation/sessions — opens a contract-scope conversation. */
|
|
50
50
|
createSession(input?: CreateSessionInput): Promise<CreateSessionResult>;
|
|
51
|
-
/** POST /contract/assistant/conversation/send — one turn. Stages but NEVER applies
|
|
51
|
+
/** POST /contract/assistant/conversation/send — one turn. Stages but NEVER applies. */
|
|
52
52
|
conversationSend(input: ConversationSendInput): Promise<ConversationSendResult>;
|
|
53
53
|
/** GET /contract/assistant/changesets/:id — live preview of the staged delta. */
|
|
54
54
|
getChangeset(id: string): Promise<ChangesetPreview>;
|
|
55
55
|
/**
|
|
56
56
|
* POST /contract/assistant/changesets/:id/apply — the SOLE contract-mutation
|
|
57
|
-
* entry point. `base_hash` is deliberate consent over a known base
|
|
57
|
+
* entry point. `base_hash` is deliberate consent over a known base.
|
|
58
58
|
* On staleness throws a `ZarelAPIError` whose `details` carries
|
|
59
|
-
* `reseeded_changeset_id`/`base_hash
|
|
59
|
+
* `reseeded_changeset_id`/`base_hash`.
|
|
60
60
|
*/
|
|
61
61
|
applyChangeset(id: string, input: ApplyChangesetInput): Promise<ApplyResult>;
|
|
62
62
|
/** POST /contract/assistant/changesets/:id/discard — shelve a pending/stale changeset. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../src/contract/assistant.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../src/contract/assistant.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+GAA+G;IAC/G,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC/B;AAID,qBAAa,iBAAiB;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,4FAA4F;IACtF,aAAa,CAAC,KAAK,GAAE,kBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIjF,uFAAuF;IACjF,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIrF,iFAAiF;IAC3E,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIzD;;;;;OAKG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAIlF,0FAA0F;IACpF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAG7D"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
|
+
// contract.assistant.* — ergonomic accessors over the contract authoring assistant.
|
|
3
5
|
//
|
|
4
6
|
// Maps the 5 `/contract/assistant/*` paths (contract plane) to typed methods.
|
|
5
7
|
// The transport unwraps the `{success,data}` envelope via the codegen unwrap
|
|
6
8
|
// map (operationIds assistantCreateSession/ConversationSend/GetChangeset/ApplyChangeset/
|
|
7
|
-
// DiscardChangeset). The conversation turn NEVER mutates
|
|
8
|
-
// mutation entry point and carries `base_hash
|
|
9
|
+
// DiscardChangeset). The conversation turn NEVER mutates; apply is the sole
|
|
10
|
+
// mutation entry point and carries `base_hash`.
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
12
|
exports.AssistantResource = void 0;
|
|
11
13
|
const BASE = '/contract/assistant';
|
|
@@ -16,28 +18,28 @@ class AssistantResource {
|
|
|
16
18
|
}
|
|
17
19
|
/** POST /contract/assistant/conversation/sessions — opens a contract-scope conversation. */
|
|
18
20
|
async createSession(input = {}) {
|
|
19
|
-
return this.client.post(`${BASE}/conversation/sessions`, input, { operationId: 'assistantCreateSession' });
|
|
21
|
+
return await this.client.post(`${BASE}/conversation/sessions`, input, { operationId: 'assistantCreateSession' });
|
|
20
22
|
}
|
|
21
|
-
/** POST /contract/assistant/conversation/send — one turn. Stages but NEVER applies
|
|
23
|
+
/** POST /contract/assistant/conversation/send — one turn. Stages but NEVER applies. */
|
|
22
24
|
async conversationSend(input) {
|
|
23
|
-
return this.client.post(`${BASE}/conversation/send`, input, { operationId: 'assistantConversationSend' });
|
|
25
|
+
return await this.client.post(`${BASE}/conversation/send`, input, { operationId: 'assistantConversationSend' });
|
|
24
26
|
}
|
|
25
27
|
/** GET /contract/assistant/changesets/:id — live preview of the staged delta. */
|
|
26
28
|
async getChangeset(id) {
|
|
27
|
-
return this.client.get(`${BASE}/changesets/${encodeURIComponent(id)}`, undefined, { operationId: 'assistantGetChangeset' });
|
|
29
|
+
return await this.client.get(`${BASE}/changesets/${encodeURIComponent(id)}`, undefined, { operationId: 'assistantGetChangeset' });
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* POST /contract/assistant/changesets/:id/apply — the SOLE contract-mutation
|
|
31
|
-
* entry point. `base_hash` is deliberate consent over a known base
|
|
33
|
+
* entry point. `base_hash` is deliberate consent over a known base.
|
|
32
34
|
* On staleness throws a `ZarelAPIError` whose `details` carries
|
|
33
|
-
* `reseeded_changeset_id`/`base_hash
|
|
35
|
+
* `reseeded_changeset_id`/`base_hash`.
|
|
34
36
|
*/
|
|
35
37
|
async applyChangeset(id, input) {
|
|
36
|
-
return this.client.post(`${BASE}/changesets/${encodeURIComponent(id)}/apply`, input, { operationId: 'assistantApplyChangeset' });
|
|
38
|
+
return await this.client.post(`${BASE}/changesets/${encodeURIComponent(id)}/apply`, input, { operationId: 'assistantApplyChangeset' });
|
|
37
39
|
}
|
|
38
40
|
/** POST /contract/assistant/changesets/:id/discard — shelve a pending/stale changeset. */
|
|
39
41
|
async discardChangeset(id) {
|
|
40
|
-
return this.client.post(`${BASE}/changesets/${encodeURIComponent(id)}/discard`, {}, { operationId: 'assistantDiscardChangeset' });
|
|
42
|
+
return await this.client.post(`${BASE}/changesets/${encodeURIComponent(id)}/discard`, {}, { operationId: 'assistantDiscardChangeset' });
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
exports.AssistantResource = AssistantResource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.js","sourceRoot":"","sources":["../../src/contract/assistant.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"assistant.js","sourceRoot":"","sources":["../../src/contract/assistant.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,gCAAgC;AAChC,oFAAoF;AACpF,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,yFAAyF;AACzF,4EAA4E;AAC5E,gDAAgD;;;AA0DhD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAEnC,MAAa,iBAAiB;IACG;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,4FAA4F;IAC5F,KAAK,CAAC,aAAa,CAAC,QAA4B,EAAE;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,wBAAwB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACrH,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,gBAAgB,CAAC,KAA4B;QAC/C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,oBAAoB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC,CAAC;IACpH,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,YAAY,CAAC,EAAU;QACzB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACtI,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,KAA0B;QACvD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,eAAe,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC,CAAC;IAC3I,CAAC;IAED,0FAA0F;IAC1F,KAAK,CAAC,gBAAgB,CAAC,EAAU;QAC7B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,eAAe,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC,CAAC;IAC5I,CAAC;CACJ;AAhCD,8CAgCC"}
|
package/dist/contract/batch.d.ts
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import type { FetchClient } from '../_internal/fetch-client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
readonly requests: readonly BatchOperation[];
|
|
12
|
-
}
|
|
13
|
-
export interface BatchResponseItem {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly status: number;
|
|
16
|
-
readonly headers?: Record<string, string>;
|
|
17
|
-
readonly body?: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface BatchResponse {
|
|
20
|
-
readonly responses: readonly BatchResponseItem[];
|
|
21
|
-
}
|
|
2
|
+
import type { BatchOperationPayload, BatchRequestPayload, BatchResponseItemPayload, BatchResponsePayload } from '../generated';
|
|
3
|
+
/** One operation in a batch. `path`, not `url`; must begin with `/`. */
|
|
4
|
+
export type BatchOperation = BatchOperationPayload;
|
|
5
|
+
/** The batch body. The key is `operations`, and at most 50. */
|
|
6
|
+
export type BatchRequest = BatchRequestPayload;
|
|
7
|
+
/** One settled operation. `status` is a number, or the literal `'skipped'`. */
|
|
8
|
+
export type BatchResponseItem = BatchResponseItemPayload;
|
|
9
|
+
/** The batch result, returned WHOLE — this operation is not envelope-wrapped. */
|
|
10
|
+
export type BatchResponse = BatchResponsePayload;
|
|
22
11
|
export declare class BatchResource {
|
|
23
12
|
private readonly client;
|
|
24
13
|
constructor(client: FetchClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/contract/batch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/contract/batch.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EACR,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAEtB,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEnD,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEzD,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAEjD,qBAAa,aAAa;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;CAG/D"}
|
package/dist/contract/batch.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright 2026 Nicolas Moreno
|
|
4
|
+
// contract.batch.execute()
|
|
3
5
|
//
|
|
4
|
-
// Top-level infrastructure endpoint
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// the
|
|
6
|
+
// Top-level infrastructure endpoint. The body is the batch envelope the server
|
|
7
|
+
// validates; the SDK forwards it and returns what the server produces.
|
|
8
|
+
//
|
|
9
|
+
// EVERY TYPE HERE IS DERIVED from the published schema:
|
|
10
|
+
//
|
|
11
|
+
// - the request is `{operations: [{id, method, path, …}]}` — the validator answers
|
|
12
|
+
// `batch_operations_missing` to a body without `operations`;
|
|
13
|
+
// - each operation names a `path`, not a `url` — anything else is `batch_path_invalid`;
|
|
14
|
+
// - BOTH the 200 and the 207 answer `{responses: [{id, status, headers, body}]}`, which is
|
|
15
|
+
// not a {success,data} envelope, so the result is returned whole.
|
|
8
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
17
|
exports.BatchResource = void 0;
|
|
10
18
|
class BatchResource {
|
|
@@ -13,7 +21,7 @@ class BatchResource {
|
|
|
13
21
|
this.client = client;
|
|
14
22
|
}
|
|
15
23
|
async execute(request) {
|
|
16
|
-
return this.client.post('/contract/batch', request, { operationId: 'batchMutate' });
|
|
24
|
+
return await this.client.post('/contract/batch', request, { operationId: 'batchMutate' });
|
|
17
25
|
}
|
|
18
26
|
}
|
|
19
27
|
exports.BatchResource = BatchResource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/contract/batch.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/contract/batch.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,gCAAgC;AAChC,2BAA2B;AAC3B,EAAE;AACF,+EAA+E;AAC/E,uEAAuE;AACvE,EAAE;AACF,wDAAwD;AACxD,EAAE;AACF,qFAAqF;AACrF,iEAAiE;AACjE,0FAA0F;AAC1F,6FAA6F;AAC7F,sEAAsE;;;AAsBtE,MAAa,aAAa;IACO;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,OAAO,CAAC,OAAqB;QAC/B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgB,iBAAiB,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;IAC7G,CAAC;CACJ;AAND,sCAMC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import type { FetchClient } from '../_internal/fetch-client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly description?: string;
|
|
6
|
-
readonly action_ref?: string;
|
|
7
|
-
readonly entity?: string;
|
|
8
|
-
readonly config?: Record<string, unknown>;
|
|
9
|
-
readonly [key: string]: unknown;
|
|
10
|
-
}
|
|
2
|
+
import type { CapabilityCreate, CapabilityRecord, CapabilityWrite } from '../types/collections-contract';
|
|
3
|
+
import type { ContractDeletedAck } from '../types/flows-contract';
|
|
4
|
+
export type { CapabilityCreate, CapabilityRecord, CapabilityWrite };
|
|
11
5
|
export declare class CapabilitiesResource {
|
|
12
6
|
private readonly client;
|
|
13
7
|
constructor(client: FetchClient);
|
|
14
8
|
list(): Promise<CapabilityRecord[]>;
|
|
15
9
|
get(name: string): Promise<CapabilityRecord>;
|
|
16
|
-
create(input:
|
|
17
|
-
put(name: string, input:
|
|
18
|
-
patch(name: string, patch:
|
|
19
|
-
delete(name: string): Promise<
|
|
10
|
+
create(input: CapabilityCreate): Promise<CapabilityRecord>;
|
|
11
|
+
put(name: string, input: CapabilityWrite): Promise<CapabilityRecord>;
|
|
12
|
+
patch(name: string, patch: CapabilityWrite): Promise<CapabilityRecord>;
|
|
13
|
+
delete(name: string): Promise<ContractDeletedAck>;
|
|
20
14
|
}
|
|
21
15
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/contract/capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/contract/capabilities.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AAEpE,qBAAa,oBAAoB;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAInC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI5C,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIpE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAItE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG1D"}
|