@zarel-ai/sdk 0.6.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 +21 -0
- package/README.md +412 -0
- package/dist/_internal/auth-headers.d.ts +19 -0
- package/dist/_internal/auth-headers.d.ts.map +1 -0
- package/dist/_internal/auth-headers.js +30 -0
- package/dist/_internal/auth-headers.js.map +1 -0
- package/dist/_internal/confirmation.d.ts +24 -0
- package/dist/_internal/confirmation.d.ts.map +1 -0
- package/dist/_internal/confirmation.js +54 -0
- package/dist/_internal/confirmation.js.map +1 -0
- package/dist/_internal/event-iterator.d.ts +18 -0
- package/dist/_internal/event-iterator.d.ts.map +1 -0
- package/dist/_internal/event-iterator.js +151 -0
- package/dist/_internal/event-iterator.js.map +1 -0
- package/dist/_internal/fetch-client.d.ts +141 -0
- package/dist/_internal/fetch-client.d.ts.map +1 -0
- package/dist/_internal/fetch-client.js +471 -0
- package/dist/_internal/fetch-client.js.map +1 -0
- package/dist/_internal/interceptors.d.ts +40 -0
- package/dist/_internal/interceptors.d.ts.map +1 -0
- package/dist/_internal/interceptors.js +28 -0
- package/dist/_internal/interceptors.js.map +1 -0
- package/dist/_internal/mcp.d.ts +11 -0
- package/dist/_internal/mcp.d.ts.map +1 -0
- package/dist/_internal/mcp.js +79 -0
- package/dist/_internal/mcp.js.map +1 -0
- package/dist/_internal/pagination.d.ts +71 -0
- package/dist/_internal/pagination.d.ts.map +1 -0
- package/dist/_internal/pagination.js +130 -0
- package/dist/_internal/pagination.js.map +1 -0
- package/dist/_internal/require-token.d.ts +17 -0
- package/dist/_internal/require-token.d.ts.map +1 -0
- package/dist/_internal/require-token.js +25 -0
- package/dist/_internal/require-token.js.map +1 -0
- package/dist/_internal/retry-after.d.ts +2 -0
- package/dist/_internal/retry-after.d.ts.map +1 -0
- package/dist/_internal/retry-after.js +34 -0
- package/dist/_internal/retry-after.js.map +1 -0
- package/dist/_internal/sse-client.d.ts +43 -0
- package/dist/_internal/sse-client.d.ts.map +1 -0
- package/dist/_internal/sse-client.js +250 -0
- package/dist/_internal/sse-client.js.map +1 -0
- package/dist/_internal/version.d.ts +5 -0
- package/dist/_internal/version.d.ts.map +1 -0
- package/dist/_internal/version.js +12 -0
- package/dist/_internal/version.js.map +1 -0
- package/dist/client.d.ts +74 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +86 -0
- package/dist/client.js.map +1 -0
- package/dist/contract/_singleton.d.ts +18 -0
- package/dist/contract/_singleton.d.ts.map +1 -0
- package/dist/contract/_singleton.js +27 -0
- package/dist/contract/_singleton.js.map +1 -0
- package/dist/contract/actions.d.ts +18 -0
- package/dist/contract/actions.d.ts.map +1 -0
- package/dist/contract/actions.js +36 -0
- package/dist/contract/actions.js.map +1 -0
- package/dist/contract/assistant.d.ts +65 -0
- package/dist/contract/assistant.d.ts.map +1 -0
- package/dist/contract/assistant.js +44 -0
- package/dist/contract/assistant.js.map +1 -0
- package/dist/contract/batch.d.ts +27 -0
- package/dist/contract/batch.d.ts.map +1 -0
- package/dist/contract/batch.js +20 -0
- package/dist/contract/batch.js.map +1 -0
- package/dist/contract/capabilities.d.ts +21 -0
- package/dist/contract/capabilities.d.ts.map +1 -0
- package/dist/contract/capabilities.js +31 -0
- package/dist/contract/capabilities.js.map +1 -0
- package/dist/contract/constraints.d.ts +21 -0
- package/dist/contract/constraints.d.ts.map +1 -0
- package/dist/contract/constraints.js +31 -0
- package/dist/contract/constraints.js.map +1 -0
- package/dist/contract/events.d.ts +33 -0
- package/dist/contract/events.d.ts.map +1 -0
- package/dist/contract/events.js +56 -0
- package/dist/contract/events.js.map +1 -0
- package/dist/contract/flows.d.ts +44 -0
- package/dist/contract/flows.d.ts.map +1 -0
- package/dist/contract/flows.js +109 -0
- package/dist/contract/flows.js.map +1 -0
- package/dist/contract/governance.d.ts +6 -0
- package/dist/contract/governance.d.ts.map +1 -0
- package/dist/contract/governance.js +17 -0
- package/dist/contract/governance.js.map +1 -0
- package/dist/contract/index.d.ts +137 -0
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/index.js +177 -0
- package/dist/contract/index.js.map +1 -0
- package/dist/contract/metadata.d.ts +26 -0
- package/dist/contract/metadata.d.ts.map +1 -0
- package/dist/contract/metadata.js +25 -0
- package/dist/contract/metadata.js.map +1 -0
- package/dist/contract/process-model.d.ts +31 -0
- package/dist/contract/process-model.d.ts.map +1 -0
- package/dist/contract/process-model.js +51 -0
- package/dist/contract/process-model.js.map +1 -0
- package/dist/contract/roots/channels.d.ts +27 -0
- package/dist/contract/roots/channels.d.ts.map +1 -0
- package/dist/contract/roots/channels.js +53 -0
- package/dist/contract/roots/channels.js.map +1 -0
- package/dist/contract/roots/events.d.ts +7 -0
- package/dist/contract/roots/events.d.ts.map +1 -0
- package/dist/contract/roots/events.js +19 -0
- package/dist/contract/roots/events.js.map +1 -0
- package/dist/contract/roots/index.d.ts +15 -0
- package/dist/contract/roots/index.d.ts.map +1 -0
- package/dist/contract/roots/index.js +38 -0
- package/dist/contract/roots/index.js.map +1 -0
- package/dist/contract/roots/mcp-servers.d.ts +46 -0
- package/dist/contract/roots/mcp-servers.d.ts.map +1 -0
- package/dist/contract/roots/mcp-servers.js +68 -0
- package/dist/contract/roots/mcp-servers.js.map +1 -0
- package/dist/contract/roots/profiles.d.ts +18 -0
- package/dist/contract/roots/profiles.d.ts.map +1 -0
- package/dist/contract/roots/profiles.js +31 -0
- package/dist/contract/roots/profiles.js.map +1 -0
- package/dist/contract/roots/timezone.d.ts +10 -0
- package/dist/contract/roots/timezone.d.ts.map +1 -0
- package/dist/contract/roots/timezone.js +19 -0
- package/dist/contract/roots/timezone.js.map +1 -0
- package/dist/contract/roots/treatment.d.ts +11 -0
- package/dist/contract/roots/treatment.d.ts.map +1 -0
- package/dist/contract/roots/treatment.js +37 -0
- package/dist/contract/roots/treatment.js.map +1 -0
- package/dist/contract/roots/vocabulary.d.ts +18 -0
- package/dist/contract/roots/vocabulary.d.ts.map +1 -0
- package/dist/contract/roots/vocabulary.js +31 -0
- package/dist/contract/roots/vocabulary.js.map +1 -0
- package/dist/contract/schemas.d.ts +18 -0
- package/dist/contract/schemas.d.ts.map +1 -0
- package/dist/contract/schemas.js +31 -0
- package/dist/contract/schemas.js.map +1 -0
- package/dist/contract/skills.d.ts +20 -0
- package/dist/contract/skills.d.ts.map +1 -0
- package/dist/contract/skills.js +36 -0
- package/dist/contract/skills.js.map +1 -0
- package/dist/errors.d.ts +65 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +80 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/contract.d.ts +7688 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +7 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/generated/index.d.ts +41 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +3 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/runtime.d.ts +4020 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/generated/runtime.js +7 -0
- package/dist/generated/runtime.js.map +1 -0
- package/dist/generated/unwrap-map.d.ts +989 -0
- package/dist/generated/unwrap-map.d.ts.map +1 -0
- package/dist/generated/unwrap-map.js +344 -0
- package/dist/generated/unwrap-map.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/actions.d.ts +33 -0
- package/dist/resources/actions.d.ts.map +1 -0
- package/dist/resources/actions.js +52 -0
- package/dist/resources/actions.js.map +1 -0
- package/dist/resources/audit.d.ts +52 -0
- package/dist/resources/audit.d.ts.map +1 -0
- package/dist/resources/audit.js +86 -0
- package/dist/resources/audit.js.map +1 -0
- package/dist/resources/authorization-ceiling.d.ts +25 -0
- package/dist/resources/authorization-ceiling.d.ts.map +1 -0
- package/dist/resources/authorization-ceiling.js +26 -0
- package/dist/resources/authorization-ceiling.js.map +1 -0
- package/dist/resources/authorization-operation-ids.d.ts +15 -0
- package/dist/resources/authorization-operation-ids.d.ts.map +1 -0
- package/dist/resources/authorization-operation-ids.js +31 -0
- package/dist/resources/authorization-operation-ids.js.map +1 -0
- package/dist/resources/authorization.d.ts +60 -0
- package/dist/resources/authorization.d.ts.map +1 -0
- package/dist/resources/authorization.js +51 -0
- package/dist/resources/authorization.js.map +1 -0
- package/dist/resources/authorizations.d.ts +38 -0
- package/dist/resources/authorizations.d.ts.map +1 -0
- package/dist/resources/authorizations.js +19 -0
- package/dist/resources/authorizations.js.map +1 -0
- package/dist/resources/channels.d.ts +36 -0
- package/dist/resources/channels.d.ts.map +1 -0
- package/dist/resources/channels.js +61 -0
- package/dist/resources/channels.js.map +1 -0
- package/dist/resources/contracts.d.ts +46 -0
- package/dist/resources/contracts.d.ts.map +1 -0
- package/dist/resources/contracts.js +86 -0
- package/dist/resources/contracts.js.map +1 -0
- package/dist/resources/conversation-sessions.d.ts +62 -0
- package/dist/resources/conversation-sessions.d.ts.map +1 -0
- package/dist/resources/conversation-sessions.js +48 -0
- package/dist/resources/conversation-sessions.js.map +1 -0
- package/dist/resources/conversation.d.ts +48 -0
- package/dist/resources/conversation.d.ts.map +1 -0
- package/dist/resources/conversation.js +104 -0
- package/dist/resources/conversation.js.map +1 -0
- package/dist/resources/embedding-credentials.d.ts +60 -0
- package/dist/resources/embedding-credentials.d.ts.map +1 -0
- package/dist/resources/embedding-credentials.js +53 -0
- package/dist/resources/embedding-credentials.js.map +1 -0
- package/dist/resources/entities.d.ts +66 -0
- package/dist/resources/entities.d.ts.map +1 -0
- package/dist/resources/entities.js +106 -0
- package/dist/resources/entities.js.map +1 -0
- package/dist/resources/events.d.ts +45 -0
- package/dist/resources/events.d.ts.map +1 -0
- package/dist/resources/events.js +71 -0
- package/dist/resources/events.js.map +1 -0
- package/dist/resources/flows.d.ts +45 -0
- package/dist/resources/flows.d.ts.map +1 -0
- package/dist/resources/flows.js +82 -0
- package/dist/resources/flows.js.map +1 -0
- package/dist/resources/imports.d.ts +8 -0
- package/dist/resources/imports.d.ts.map +1 -0
- package/dist/resources/imports.js +14 -0
- package/dist/resources/imports.js.map +1 -0
- package/dist/resources/index.d.ts +24 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +41 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/llm-credentials.d.ts +47 -0
- package/dist/resources/llm-credentials.d.ts.map +1 -0
- package/dist/resources/llm-credentials.js +46 -0
- package/dist/resources/llm-credentials.js.map +1 -0
- package/dist/resources/llm-services.d.ts +46 -0
- package/dist/resources/llm-services.d.ts.map +1 -0
- package/dist/resources/llm-services.js +41 -0
- package/dist/resources/llm-services.js.map +1 -0
- package/dist/resources/mcp.d.ts +8 -0
- package/dist/resources/mcp.d.ts.map +1 -0
- package/dist/resources/mcp.js +25 -0
- package/dist/resources/mcp.js.map +1 -0
- package/dist/resources/receipts.d.ts +25 -0
- package/dist/resources/receipts.d.ts.map +1 -0
- package/dist/resources/receipts.js +54 -0
- package/dist/resources/receipts.js.map +1 -0
- package/dist/resources/records.d.ts +51 -0
- package/dist/resources/records.d.ts.map +1 -0
- package/dist/resources/records.js +103 -0
- package/dist/resources/records.js.map +1 -0
- package/dist/resources/role-assignments.d.ts +27 -0
- package/dist/resources/role-assignments.d.ts.map +1 -0
- package/dist/resources/role-assignments.js +40 -0
- package/dist/resources/role-assignments.js.map +1 -0
- package/dist/resources/roles.d.ts +39 -0
- package/dist/resources/roles.d.ts.map +1 -0
- package/dist/resources/roles.js +42 -0
- package/dist/resources/roles.js.map +1 -0
- package/dist/resources/runtime-entities.d.ts +23 -0
- package/dist/resources/runtime-entities.d.ts.map +1 -0
- package/dist/resources/runtime-entities.js +29 -0
- package/dist/resources/runtime-entities.js.map +1 -0
- package/dist/resources/state-machine.d.ts +45 -0
- package/dist/resources/state-machine.d.ts.map +1 -0
- package/dist/resources/state-machine.js +86 -0
- package/dist/resources/state-machine.js.map +1 -0
- package/dist/resources/system.d.ts +12 -0
- package/dist/resources/system.d.ts.map +1 -0
- package/dist/resources/system.js +26 -0
- package/dist/resources/system.js.map +1 -0
- package/dist/resources/tools.d.ts +22 -0
- package/dist/resources/tools.d.ts.map +1 -0
- package/dist/resources/tools.js +33 -0
- package/dist/resources/tools.js.map +1 -0
- package/dist/resources/traces.d.ts +65 -0
- package/dist/resources/traces.d.ts.map +1 -0
- package/dist/resources/traces.js +97 -0
- package/dist/resources/traces.js.map +1 -0
- package/dist/runtime/index.d.ts +128 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +210 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/types/actions.d.ts +32 -0
- package/dist/types/actions.d.ts.map +1 -0
- package/dist/types/actions.js +9 -0
- package/dist/types/actions.js.map +1 -0
- package/dist/types/audit.d.ts +65 -0
- package/dist/types/audit.d.ts.map +1 -0
- package/dist/types/audit.js +14 -0
- package/dist/types/audit.js.map +1 -0
- package/dist/types/channels.d.ts +37 -0
- package/dist/types/channels.d.ts.map +1 -0
- package/dist/types/channels.js +6 -0
- package/dist/types/channels.js.map +1 -0
- package/dist/types/confirmation.d.ts +53 -0
- package/dist/types/confirmation.d.ts.map +1 -0
- package/dist/types/confirmation.js +17 -0
- package/dist/types/confirmation.js.map +1 -0
- package/dist/types/contracts.d.ts +194 -0
- package/dist/types/contracts.d.ts.map +1 -0
- package/dist/types/contracts.js +10 -0
- package/dist/types/contracts.js.map +1 -0
- package/dist/types/conversation-sessions.d.ts +58 -0
- package/dist/types/conversation-sessions.d.ts.map +1 -0
- package/dist/types/conversation-sessions.js +6 -0
- package/dist/types/conversation-sessions.js.map +1 -0
- package/dist/types/conversation.d.ts +96 -0
- package/dist/types/conversation.d.ts.map +1 -0
- package/dist/types/conversation.js +3 -0
- package/dist/types/conversation.js.map +1 -0
- package/dist/types/entities.d.ts +22 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/entities.js +4 -0
- package/dist/types/entities.js.map +1 -0
- package/dist/types/events-stream.d.ts +82 -0
- package/dist/types/events-stream.d.ts.map +1 -0
- package/dist/types/events-stream.js +65 -0
- package/dist/types/events-stream.js.map +1 -0
- package/dist/types/flows-contract.d.ts +8 -0
- package/dist/types/flows-contract.d.ts.map +1 -0
- package/dist/types/flows-contract.js +7 -0
- package/dist/types/flows-contract.js.map +1 -0
- package/dist/types/flows.d.ts +66 -0
- package/dist/types/flows.d.ts.map +1 -0
- package/dist/types/flows.js +25 -0
- package/dist/types/flows.js.map +1 -0
- package/dist/types/imports.d.ts +57 -0
- package/dist/types/imports.d.ts.map +1 -0
- package/dist/types/imports.js +3 -0
- package/dist/types/imports.js.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/locale.d.ts +24 -0
- package/dist/types/locale.d.ts.map +1 -0
- package/dist/types/locale.js +17 -0
- package/dist/types/locale.js.map +1 -0
- package/dist/types/mcp.d.ts +28 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +12 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/platform.d.ts +51 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/platform.js +4 -0
- package/dist/types/platform.js.map +1 -0
- package/dist/types/receipt.d.ts +79 -0
- package/dist/types/receipt.d.ts.map +1 -0
- package/dist/types/receipt.js +15 -0
- package/dist/types/receipt.js.map +1 -0
- package/dist/types/records.d.ts +45 -0
- package/dist/types/records.d.ts.map +1 -0
- package/dist/types/records.js +4 -0
- package/dist/types/records.js.map +1 -0
- package/dist/types/spec.d.ts +6 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/spec.js +3 -0
- package/dist/types/spec.js.map +1 -0
- package/dist/types/state-machine.d.ts +100 -0
- package/dist/types/state-machine.d.ts.map +1 -0
- package/dist/types/state-machine.js +9 -0
- package/dist/types/state-machine.js.map +1 -0
- package/dist/types/system.d.ts +28 -0
- package/dist/types/system.d.ts.map +1 -0
- package/dist/types/system.js +3 -0
- package/dist/types/system.js.map +1 -0
- package/dist/types/tools.d.ts +188 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +22 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/traces.d.ts +77 -0
- package/dist/types/traces.d.ts.map +1 -0
- package/dist/types/traces.js +11 -0
- package/dist/types/traces.js.map +1 -0
- package/dist/types/workflows.d.ts +42 -0
- package/dist/types/workflows.d.ts.map +1 -0
- package/dist/types/workflows.js +11 -0
- package/dist/types/workflows.js.map +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntitiesResource = void 0;
|
|
4
|
+
const fetch_client_1 = require("../_internal/fetch-client");
|
|
5
|
+
class EntitiesResource {
|
|
6
|
+
client;
|
|
7
|
+
constructor(client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List all entities for the current tenant.
|
|
12
|
+
* spec-039: pass `{locale: 'es'}` to receive Spanish labels; omit for
|
|
13
|
+
* server-side fallback (JWT preferences.language → canonical).
|
|
14
|
+
*/
|
|
15
|
+
async list(options) {
|
|
16
|
+
return this.client.get('/contract/entities', (0, fetch_client_1.localeQuery)(options), { operationId: 'listEntities' });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a new entity.
|
|
20
|
+
*/
|
|
21
|
+
async create(input) {
|
|
22
|
+
return this.client.post('/contract/entities', input, { operationId: 'createEntity' });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a single entity by name.
|
|
26
|
+
*/
|
|
27
|
+
async get(entityName, options) {
|
|
28
|
+
return this.client.get(`/contract/entities/${entityName}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getEntity' });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Update an entity definition.
|
|
32
|
+
*/
|
|
33
|
+
async update(entityName, input) {
|
|
34
|
+
return this.client.patch(`/contract/entities/${entityName}`, input, { operationId: 'patchEntity' });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Delete an entity.
|
|
38
|
+
*/
|
|
39
|
+
async delete(entityName) {
|
|
40
|
+
await this.client.del(`/contract/entities/${entityName}`, { operationId: 'deleteEntity' });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Add a field to an entity.
|
|
44
|
+
*/
|
|
45
|
+
async addField(entityName, field) {
|
|
46
|
+
return this.client.post(`/contract/entities/${entityName}/fields`, field, { operationId: 'createEntityField' });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update a field on an entity.
|
|
50
|
+
*/
|
|
51
|
+
async updateField(entityName, fieldName, update) {
|
|
52
|
+
return this.client.patch(`/contract/entities/${entityName}/fields/${fieldName}`, update, { operationId: 'patchEntityField' });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Delete a field from an entity.
|
|
56
|
+
*/
|
|
57
|
+
async deleteField(entityName, fieldName) {
|
|
58
|
+
await this.client.del(`/contract/entities/${entityName}/fields/${fieldName}`, { operationId: 'deleteEntityField' });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Replace an entity definition wholesale (PUT). {@link update} is the partial (PATCH) counterpart.
|
|
62
|
+
*/
|
|
63
|
+
async replace(entityName, input) {
|
|
64
|
+
return this.client.put(`/contract/entities/${entityName}`, input, { operationId: 'replaceEntity' });
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List an entity's fields. The response is `{ entity_name, fields }` — the field
|
|
68
|
+
* array is nested under `fields` (the endpoint wraps it, unlike the transition/step lists).
|
|
69
|
+
*/
|
|
70
|
+
async listFields(entityName, options) {
|
|
71
|
+
return this.client.get(`/contract/entities/${entityName}/fields`, (0, fetch_client_1.localeQuery)(options), { operationId: 'listEntityFields' });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read a single field definition.
|
|
75
|
+
*/
|
|
76
|
+
async getField(entityName, fieldName, options) {
|
|
77
|
+
return this.client.get(`/contract/entities/${entityName}/fields/${fieldName}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getEntityField' });
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Replace a field definition wholesale (PUT). {@link updateField} is the partial (PATCH) counterpart.
|
|
81
|
+
*/
|
|
82
|
+
async replaceField(entityName, fieldName, input) {
|
|
83
|
+
return this.client.put(`/contract/entities/${entityName}/fields/${fieldName}`, input, { operationId: 'replaceEntityField' });
|
|
84
|
+
}
|
|
85
|
+
// ── Field transitions — state-machine rules on a field, addressed by (entity, field, from, to) ──
|
|
86
|
+
async listFieldTransitions(entityName, fieldName, options) {
|
|
87
|
+
return this.client.get(`/contract/entities/${entityName}/fields/${fieldName}/transitions`, (0, fetch_client_1.localeQuery)(options), { operationId: 'listFieldTransitions' });
|
|
88
|
+
}
|
|
89
|
+
async getFieldTransition(entityName, fieldName, from, to, options) {
|
|
90
|
+
return this.client.get(`/contract/entities/${entityName}/fields/${fieldName}/transitions/${from}/${to}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getFieldTransition' });
|
|
91
|
+
}
|
|
92
|
+
async createFieldTransition(entityName, fieldName, input) {
|
|
93
|
+
return this.client.post(`/contract/entities/${entityName}/fields/${fieldName}/transitions`, input, { operationId: 'createFieldTransition' });
|
|
94
|
+
}
|
|
95
|
+
async replaceFieldTransition(entityName, fieldName, from, to, input) {
|
|
96
|
+
return this.client.put(`/contract/entities/${entityName}/fields/${fieldName}/transitions/${from}/${to}`, input, { operationId: 'replaceFieldTransition' });
|
|
97
|
+
}
|
|
98
|
+
async patchFieldTransition(entityName, fieldName, from, to, patch) {
|
|
99
|
+
return this.client.patch(`/contract/entities/${entityName}/fields/${fieldName}/transitions/${from}/${to}`, patch, { operationId: 'patchFieldTransition' });
|
|
100
|
+
}
|
|
101
|
+
async deleteFieldTransition(entityName, fieldName, from, to) {
|
|
102
|
+
await this.client.del(`/contract/entities/${entityName}/fields/${fieldName}/transitions/${from}/${to}`, { operationId: 'deleteFieldTransition' });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.EntitiesResource = EntitiesResource;
|
|
106
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/resources/entities.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAK1E,MAAa,gBAAgB;IACI;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB,oBAAoB,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAC3H,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,KAAkB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAwB,oBAAoB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IACjH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,UAAkB,EAAE,OAAuB;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,sBAAsB,UAAU,EAAE,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAClI,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,KAA2B;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAwB,sBAAsB,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAA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W,SAAS,cAAc,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC1K,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,UAAkB,EAAE,SAAiB,EAAE,IAAY,EAAE,EAAU,EAAE,KAA8B;QACxH,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,sBAAsB,UAAU,WAAW,SAAS,gBAAgB,IAAI,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACxL,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,UAAkB,EAAE,SAAiB,EAAE,IAAY,EAAE,EAAU,EAAE,KAA8B;QACtH,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAA0B,sBAAsB,UAAU,WAAW,SAAS,gBAAgB,IAAI,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACxL,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,UAAkB,EAAE,SAAiB,EAAE,IAAY,EAAE,EAAU;QACvF,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,UAAU,WAAW,SAAS,gBAAgB,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACtJ,CAAC;CACJ;AAnHD,4CAmHC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type FetchClient } from '../_internal/fetch-client';
|
|
2
|
+
import type { EventListResponse, EventSubscriptionInput, EventSubscriptionResponse, EventSubscriptionListResponse, EventSubscriptionDeactivateResponse } from '../types/platform';
|
|
3
|
+
import type { LocaleOptions } from '../types/locale';
|
|
4
|
+
import type { EventStreamHandle, EventStreamHandlers, EventStreamOptions, EventIterateOptions, RuntimeStreamEvent } from '../types/events-stream';
|
|
5
|
+
export declare class EventsResource {
|
|
6
|
+
private readonly client;
|
|
7
|
+
constructor(client: FetchClient);
|
|
8
|
+
/**
|
|
9
|
+
* G3 — open a typed Server-Sent-Events stream of live tenant events
|
|
10
|
+
* (`GET /runtime/events/stream`, ADR-0104). Delivers typed `conversation.turn_created`
|
|
11
|
+
* events (and a generic fallback for other named events) to `handlers.onEvent`;
|
|
12
|
+
* reconnects across transient disconnects. Returns a teardown handle.
|
|
13
|
+
*/
|
|
14
|
+
stream(handlers: EventStreamHandlers, options?: EventStreamOptions): EventStreamHandle;
|
|
15
|
+
/**
|
|
16
|
+
* The async-iterable (pull) view over the same stream `stream` consumes via
|
|
17
|
+
* callbacks: `for await (const event of client.runtime.events.iterate())`.
|
|
18
|
+
* A thin bounded-buffer adapter over `stream` — it reuses the same transport
|
|
19
|
+
* (auth, reconnect, SSE parsing) verbatim and adds no transport of its own.
|
|
20
|
+
* Backpressure is bounded drop-oldest (`bufferSize`, reported via `onDropped`);
|
|
21
|
+
* a terminal error throws out of the loop; `break` tears the stream down.
|
|
22
|
+
*/
|
|
23
|
+
iterate(options?: EventIterateOptions): AsyncIterableIterator<RuntimeStreamEvent>;
|
|
24
|
+
/**
|
|
25
|
+
* List event deliveries (the runtime log of dispatched webhook events).
|
|
26
|
+
* Renamed from `.list()` in P12 to reflect the canonical
|
|
27
|
+
* `/runtime/events/delivery` surface.
|
|
28
|
+
*/
|
|
29
|
+
listDeliveries(options?: LocaleOptions): Promise<EventListResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Create a webhook event subscription.
|
|
32
|
+
*/
|
|
33
|
+
subscribe(input: EventSubscriptionInput, requestOptions?: {
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}): Promise<EventSubscriptionResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* List all event subscriptions.
|
|
38
|
+
*/
|
|
39
|
+
listSubscriptions(options?: LocaleOptions): Promise<EventSubscriptionListResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Deactivate a webhook subscription.
|
|
42
|
+
*/
|
|
43
|
+
deleteSubscription(subscriptionId: string | number): Promise<EventSubscriptionDeactivateResponse>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/resources/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,2BAA2B,CAAC;AACrF,OAAO,KAAK,EACR,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,EAC7B,mCAAmC,EACtC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EACR,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EACrB,MAAM,wBAAwB,CAAC;AAGhC,qBAAa,cAAc;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB;IAItF;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,qBAAqB,CAAC,kBAAkB,CAAC;IAcjF;;;;OAIG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOzE;;OAEG;IACG,SAAS,CACX,KAAK,EAAE,sBAAsB,EAC7B,cAAc,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC1C,OAAO,CAAC,yBAAyB,CAAC;IAIrC;;OAEG;IACG,iBAAiB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAOxF;;OAEG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,mCAAmC,CAAC;CAG1G"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventsResource = void 0;
|
|
4
|
+
const fetch_client_1 = require("../_internal/fetch-client");
|
|
5
|
+
const event_iterator_1 = require("../_internal/event-iterator");
|
|
6
|
+
class EventsResource {
|
|
7
|
+
client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* G3 — open a typed Server-Sent-Events stream of live tenant events
|
|
13
|
+
* (`GET /runtime/events/stream`, ADR-0104). Delivers typed `conversation.turn_created`
|
|
14
|
+
* events (and a generic fallback for other named events) to `handlers.onEvent`;
|
|
15
|
+
* reconnects across transient disconnects. Returns a teardown handle.
|
|
16
|
+
*/
|
|
17
|
+
stream(handlers, options) {
|
|
18
|
+
return this.client.openEventStream('/runtime/events/stream', handlers, options ?? {});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The async-iterable (pull) view over the same stream `stream` consumes via
|
|
22
|
+
* callbacks: `for await (const event of client.runtime.events.iterate())`.
|
|
23
|
+
* A thin bounded-buffer adapter over `stream` — it reuses the same transport
|
|
24
|
+
* (auth, reconnect, SSE parsing) verbatim and adds no transport of its own.
|
|
25
|
+
* Backpressure is bounded drop-oldest (`bufferSize`, reported via `onDropped`);
|
|
26
|
+
* a terminal error throws out of the loop; `break` tears the stream down.
|
|
27
|
+
*/
|
|
28
|
+
iterate(options) {
|
|
29
|
+
const { bufferSize, onDropped, ...streamOptions } = options ?? {};
|
|
30
|
+
const config = {
|
|
31
|
+
...(bufferSize !== undefined ? { bufferSize } : {}),
|
|
32
|
+
...(onDropped !== undefined ? { onDropped } : {}),
|
|
33
|
+
streamOptions,
|
|
34
|
+
};
|
|
35
|
+
return (0, event_iterator_1.createEventIterator)((handlers, streamOpts) => this.client.openEventStream('/runtime/events/stream', handlers, streamOpts), config);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* List event deliveries (the runtime log of dispatched webhook events).
|
|
39
|
+
* Renamed from `.list()` in P12 to reflect the canonical
|
|
40
|
+
* `/runtime/events/delivery` surface.
|
|
41
|
+
*/
|
|
42
|
+
async listDeliveries(options) {
|
|
43
|
+
const q = (0, fetch_client_1.localeQueryOrUndefined)(options);
|
|
44
|
+
return q
|
|
45
|
+
? this.client.get('/runtime/events/delivery', q, { operationId: 'listEventDeliveries' })
|
|
46
|
+
: this.client.get('/runtime/events/delivery', undefined, { operationId: 'listEventDeliveries' });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a webhook event subscription.
|
|
50
|
+
*/
|
|
51
|
+
async subscribe(input, requestOptions) {
|
|
52
|
+
return this.client.post('/runtime/events/subscriptions', input, { operationId: 'createEventSubscription', ...requestOptions });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* List all event subscriptions.
|
|
56
|
+
*/
|
|
57
|
+
async listSubscriptions(options) {
|
|
58
|
+
const q = (0, fetch_client_1.localeQueryOrUndefined)(options);
|
|
59
|
+
return q
|
|
60
|
+
? this.client.get('/runtime/events/subscriptions', q, { operationId: 'listEventSubscriptions' })
|
|
61
|
+
: this.client.get('/runtime/events/subscriptions', undefined, { operationId: 'listEventSubscriptions' });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Deactivate a webhook subscription.
|
|
65
|
+
*/
|
|
66
|
+
async deleteSubscription(subscriptionId) {
|
|
67
|
+
return this.client.del(`/runtime/events/subscriptions/${subscriptionId}`, { operationId: 'deactivateEventSubscription' });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.EventsResource = EventsResource;
|
|
71
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/resources/events.ts"],"names":[],"mappings":";;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,CAAC,CAAC;IAC5H,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CACX,KAA6B,EAC7B,cAAyC;QAEzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAA4B,+BAA+B,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC;IAC9J,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAuB;QAC3C,MAAM,CAAC,GAAG,IAAA,qCAAsB,EAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgC,+BAA+B,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;YAC/H,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgC,+BAA+B,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAChJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,cAA+B;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsC,iCAAiC,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC,CAAC;IACnK,CAAC;CACJ;AAzED,wCAyEC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type FetchClient } from '../_internal/fetch-client';
|
|
2
|
+
import type { FlowEventListResponse, FlowEventResponse, FlowInstanceListResponse, FlowInstanceResponse } from '../types/flows';
|
|
3
|
+
import type { FlowCallbackResponse } from '../types/platform';
|
|
4
|
+
import type { LocaleOptions } from '../types/locale';
|
|
5
|
+
/**
|
|
6
|
+
* Runtime flow instances, events, and callbacks.
|
|
7
|
+
*
|
|
8
|
+
* Backs the `/runtime/flows/*` route family. Method names follow the
|
|
9
|
+
* canonical operationIds from the OpenAPI spec (`listFlowInstances`,
|
|
10
|
+
* `getFlowInstance`, `resolveFlowCallback`).
|
|
11
|
+
*/
|
|
12
|
+
export declare class FlowsResource {
|
|
13
|
+
private readonly client;
|
|
14
|
+
constructor(client: FetchClient);
|
|
15
|
+
listInstances(options?: LocaleOptions & {
|
|
16
|
+
flow?: string;
|
|
17
|
+
}): Promise<FlowInstanceListResponse>;
|
|
18
|
+
getInstance(instanceId: string, options?: LocaleOptions): Promise<FlowInstanceResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* The appended flow lifecycle log — where per-step history lives.
|
|
21
|
+
*
|
|
22
|
+
* `GET /runtime/flows/events` has existed and been declared in the OpenAPI
|
|
23
|
+
* (`listFlowEvents`) the whole time; this resource simply never bound it, so
|
|
24
|
+
* the only per-step data the platform keeps was unreachable from the SDK.
|
|
25
|
+
* That is why consumers reached for `FlowInstance.steps`, a field the route
|
|
26
|
+
* has never sent.
|
|
27
|
+
*
|
|
28
|
+
* Pass `instanceId` for one run's trace. Events come back in CHAIN order
|
|
29
|
+
* (`seq`), not `created_at` — rows appended in one transaction share a
|
|
30
|
+
* timestamp, so only `seq` is a total order.
|
|
31
|
+
*/
|
|
32
|
+
listEvents(options?: LocaleOptions & {
|
|
33
|
+
instanceId?: string;
|
|
34
|
+
eventType?: string;
|
|
35
|
+
}): Promise<FlowEventListResponse>;
|
|
36
|
+
getEvent(eventId: string, options?: LocaleOptions): Promise<FlowEventResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve a pending flow callback. The `callbackId` is the opaque
|
|
39
|
+
* capability token supplied to the external system at flow registration;
|
|
40
|
+
* the server accepts the PATCH without a JWT, so this is typically
|
|
41
|
+
* invoked by external workers rather than authenticated clients.
|
|
42
|
+
*/
|
|
43
|
+
resolveCallback(callbackId: string, payload: Record<string, unknown>): Promise<FlowCallbackResponse>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/resources/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,2BAA2B,CAAC;AACrF,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,aAAa;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,aAAa,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAW7F,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ7F;;;;;;;;;;;;OAYG;IACG,UAAU,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAUjH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQpF;;;;;OAKG;IACG,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAU7G"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowsResource = void 0;
|
|
4
|
+
const fetch_client_1 = require("../_internal/fetch-client");
|
|
5
|
+
/**
|
|
6
|
+
* Runtime flow instances, events, and callbacks.
|
|
7
|
+
*
|
|
8
|
+
* Backs the `/runtime/flows/*` route family. Method names follow the
|
|
9
|
+
* canonical operationIds from the OpenAPI spec (`listFlowInstances`,
|
|
10
|
+
* `getFlowInstance`, `resolveFlowCallback`).
|
|
11
|
+
*/
|
|
12
|
+
class FlowsResource {
|
|
13
|
+
client;
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
async listInstances(options) {
|
|
18
|
+
// Sub-spec A (A4) gap-fill: optional `flow` filter (`?flow={name}`) for
|
|
19
|
+
// the per-flow runs view, alongside the existing locale query.
|
|
20
|
+
const q = {};
|
|
21
|
+
if (options?.locale)
|
|
22
|
+
q.locale = options.locale;
|
|
23
|
+
if (options?.flow)
|
|
24
|
+
q.flow = options.flow;
|
|
25
|
+
return Object.keys(q).length > 0
|
|
26
|
+
? this.client.get('/runtime/flows/instances', q, { operationId: 'listFlowInstances' })
|
|
27
|
+
: this.client.get('/runtime/flows/instances', undefined, { operationId: 'listFlowInstances' });
|
|
28
|
+
}
|
|
29
|
+
async getInstance(instanceId, options) {
|
|
30
|
+
const path = `/runtime/flows/instances/${encodeURIComponent(instanceId)}`;
|
|
31
|
+
const q = (0, fetch_client_1.localeQueryOrUndefined)(options);
|
|
32
|
+
return q
|
|
33
|
+
? this.client.get(path, q, { operationId: 'getFlowInstance' })
|
|
34
|
+
: this.client.get(path, undefined, { operationId: 'getFlowInstance' });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The appended flow lifecycle log — where per-step history lives.
|
|
38
|
+
*
|
|
39
|
+
* `GET /runtime/flows/events` has existed and been declared in the OpenAPI
|
|
40
|
+
* (`listFlowEvents`) the whole time; this resource simply never bound it, so
|
|
41
|
+
* the only per-step data the platform keeps was unreachable from the SDK.
|
|
42
|
+
* That is why consumers reached for `FlowInstance.steps`, a field the route
|
|
43
|
+
* has never sent.
|
|
44
|
+
*
|
|
45
|
+
* Pass `instanceId` for one run's trace. Events come back in CHAIN order
|
|
46
|
+
* (`seq`), not `created_at` — rows appended in one transaction share a
|
|
47
|
+
* timestamp, so only `seq` is a total order.
|
|
48
|
+
*/
|
|
49
|
+
async listEvents(options) {
|
|
50
|
+
const q = {};
|
|
51
|
+
if (options?.locale)
|
|
52
|
+
q.locale = options.locale;
|
|
53
|
+
if (options?.instanceId)
|
|
54
|
+
q.instance_id = options.instanceId;
|
|
55
|
+
if (options?.eventType)
|
|
56
|
+
q.event_type = options.eventType;
|
|
57
|
+
return Object.keys(q).length > 0
|
|
58
|
+
? this.client.get('/runtime/flows/events', q, { operationId: 'listFlowEvents' })
|
|
59
|
+
: this.client.get('/runtime/flows/events', undefined, { operationId: 'listFlowEvents' });
|
|
60
|
+
}
|
|
61
|
+
async getEvent(eventId, options) {
|
|
62
|
+
const path = `/runtime/flows/events/${encodeURIComponent(eventId)}`;
|
|
63
|
+
const q = (0, fetch_client_1.localeQueryOrUndefined)(options);
|
|
64
|
+
return q
|
|
65
|
+
? this.client.get(path, q, { operationId: 'getFlowEvent' })
|
|
66
|
+
: this.client.get(path, undefined, { operationId: 'getFlowEvent' });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolve a pending flow callback. The `callbackId` is the opaque
|
|
70
|
+
* capability token supplied to the external system at flow registration;
|
|
71
|
+
* the server accepts the PATCH without a JWT, so this is typically
|
|
72
|
+
* invoked by external workers rather than authenticated clients.
|
|
73
|
+
*/
|
|
74
|
+
async resolveCallback(callbackId, payload) {
|
|
75
|
+
// FlowCallbackResponse is a FLAT `{success, message?}` body (no `data`)
|
|
76
|
+
// — indistinguishable from a canonical no-data envelope by key shape, so
|
|
77
|
+
// opt out of the unwrap to return the whole body (G1).
|
|
78
|
+
return this.client.patch(`/runtime/flows/callbacks/${encodeURIComponent(callbackId)}`, payload, { operationId: 'resolveFlowCallback' });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.FlowsResource =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CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CAAC,UAAkB,EAAE,OAAgC;QACtE,wEAAwE;QACxE,yEAAyE;QACzE,uDAAuD;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACpB,4BAA4B,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAC5D,OAAO,EACP,EAAE,WAAW,EAAE,qBAAqB,EAAE,CACzC,CAAC;IACN,CAAC;CACJ;AArED,sCAqEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FetchClient } from '../_internal/fetch-client';
|
|
2
|
+
import type { SnapshotImportRequest, SnapshotImportResponse } from '../types/imports';
|
|
3
|
+
export declare class ImportsResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: FetchClient);
|
|
6
|
+
snapshot(request: SnapshotImportRequest): Promise<SnapshotImportResponse>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/resources/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EACR,qBAAqB,EACrB,sBAAsB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,eAAe;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,QAAQ,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAGlF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportsResource = void 0;
|
|
4
|
+
class ImportsResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async snapshot(request) {
|
|
10
|
+
return this.client.post('/runtime/imports/snapshot', request, { operationId: 'runtimeImportsSnapshot' });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ImportsResource = ImportsResource;
|
|
14
|
+
//# sourceMappingURL=imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/resources/imports.ts"],"names":[],"mappings":";;;AAMA,MAAa,eAAe;IACK;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,QAAQ,CAAC,OAA8B;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAyB,2BAA2B,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACrI,CAAC;CACJ;AAND,0CAMC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { ConversationResource } from './conversation';
|
|
2
|
+
export { ToolsResource } from './tools';
|
|
3
|
+
export { RecordsResource } from './records';
|
|
4
|
+
export { StateMachineResource } from './state-machine';
|
|
5
|
+
export { EntitiesResource } from './entities';
|
|
6
|
+
export { SpecResource } from './contracts';
|
|
7
|
+
export { RoleAssignmentsResource } from './role-assignments';
|
|
8
|
+
export { EventsResource } from './events';
|
|
9
|
+
export { ImportsResource } from './imports';
|
|
10
|
+
export { FlowsResource } from './flows';
|
|
11
|
+
export { SystemResource } from './system';
|
|
12
|
+
export { RolesResource } from './roles';
|
|
13
|
+
export { LlmServicesResource } from './llm-services';
|
|
14
|
+
export type { LlmService, LlmServicesListResponse, LlmServiceResponse, LlmServiceProvider, LlmServiceScope, LlmServiceQuery } from './llm-services';
|
|
15
|
+
export { LlmCredentialsResource } from './llm-credentials';
|
|
16
|
+
export type { LlmCredentialMetadata, LlmCredentialsListResponse, LlmCredentialResponse, LlmCredentialPutInput } from './llm-credentials';
|
|
17
|
+
export { EmbeddingCredentialsResource } from './embedding-credentials';
|
|
18
|
+
export type { EmbeddingCredentialMetadata, EmbeddingCredentialsListResponse, EmbeddingCredentialResponse, EmbeddingCredentialPutInput, EmbeddingApiKeyCredentialInput, EmbeddingAwsCredentialInput, } from './embedding-credentials';
|
|
19
|
+
export { ConversationSessionsResource } from './conversation-sessions';
|
|
20
|
+
export type { ConversationSessionCreateInput, ConversationSessionResponse, ConversationSessionEnvelope, ConversationScope } from './conversation-sessions';
|
|
21
|
+
export { AuthorizationResource } from './authorization';
|
|
22
|
+
export { authorizationOperationSuffix } from './authorization-operation-ids';
|
|
23
|
+
export type { AuthorizationGrant, AuthorizationStatement, RoleAuthorization } from './authorization';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACzI,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EACR,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3J,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authorizationOperationSuffix = exports.AuthorizationResource = exports.ConversationSessionsResource = exports.EmbeddingCredentialsResource = exports.LlmCredentialsResource = exports.LlmServicesResource = exports.RolesResource = exports.SystemResource = exports.FlowsResource = exports.ImportsResource = exports.EventsResource = exports.RoleAssignmentsResource = exports.SpecResource = exports.EntitiesResource = exports.StateMachineResource = exports.RecordsResource = exports.ToolsResource = exports.ConversationResource = void 0;
|
|
4
|
+
var conversation_1 = require("./conversation");
|
|
5
|
+
Object.defineProperty(exports, "ConversationResource", { enumerable: true, get: function () { return conversation_1.ConversationResource; } });
|
|
6
|
+
var tools_1 = require("./tools");
|
|
7
|
+
Object.defineProperty(exports, "ToolsResource", { enumerable: true, get: function () { return tools_1.ToolsResource; } });
|
|
8
|
+
var records_1 = require("./records");
|
|
9
|
+
Object.defineProperty(exports, "RecordsResource", { enumerable: true, get: function () { return records_1.RecordsResource; } });
|
|
10
|
+
var state_machine_1 = require("./state-machine");
|
|
11
|
+
Object.defineProperty(exports, "StateMachineResource", { enumerable: true, get: function () { return state_machine_1.StateMachineResource; } });
|
|
12
|
+
var entities_1 = require("./entities");
|
|
13
|
+
Object.defineProperty(exports, "EntitiesResource", { enumerable: true, get: function () { return entities_1.EntitiesResource; } });
|
|
14
|
+
var contracts_1 = require("./contracts");
|
|
15
|
+
Object.defineProperty(exports, "SpecResource", { enumerable: true, get: function () { return contracts_1.SpecResource; } });
|
|
16
|
+
var role_assignments_1 = require("./role-assignments");
|
|
17
|
+
Object.defineProperty(exports, "RoleAssignmentsResource", { enumerable: true, get: function () { return role_assignments_1.RoleAssignmentsResource; } });
|
|
18
|
+
var events_1 = require("./events");
|
|
19
|
+
Object.defineProperty(exports, "EventsResource", { enumerable: true, get: function () { return events_1.EventsResource; } });
|
|
20
|
+
var imports_1 = require("./imports");
|
|
21
|
+
Object.defineProperty(exports, "ImportsResource", { enumerable: true, get: function () { return imports_1.ImportsResource; } });
|
|
22
|
+
var flows_1 = require("./flows");
|
|
23
|
+
Object.defineProperty(exports, "FlowsResource", { enumerable: true, get: function () { return flows_1.FlowsResource; } });
|
|
24
|
+
var system_1 = require("./system");
|
|
25
|
+
Object.defineProperty(exports, "SystemResource", { enumerable: true, get: function () { return system_1.SystemResource; } });
|
|
26
|
+
var roles_1 = require("./roles");
|
|
27
|
+
Object.defineProperty(exports, "RolesResource", { enumerable: true, get: function () { return roles_1.RolesResource; } });
|
|
28
|
+
// SpecKit 010 / ADR-0087 (T074, T076, T078)
|
|
29
|
+
var llm_services_1 = require("./llm-services");
|
|
30
|
+
Object.defineProperty(exports, "LlmServicesResource", { enumerable: true, get: function () { return llm_services_1.LlmServicesResource; } });
|
|
31
|
+
var llm_credentials_1 = require("./llm-credentials");
|
|
32
|
+
Object.defineProperty(exports, "LlmCredentialsResource", { enumerable: true, get: function () { return llm_credentials_1.LlmCredentialsResource; } });
|
|
33
|
+
var embedding_credentials_1 = require("./embedding-credentials");
|
|
34
|
+
Object.defineProperty(exports, "EmbeddingCredentialsResource", { enumerable: true, get: function () { return embedding_credentials_1.EmbeddingCredentialsResource; } });
|
|
35
|
+
var conversation_sessions_1 = require("./conversation-sessions");
|
|
36
|
+
Object.defineProperty(exports, "ConversationSessionsResource", { enumerable: true, get: function () { return conversation_sessions_1.ConversationSessionsResource; } });
|
|
37
|
+
var authorization_1 = require("./authorization");
|
|
38
|
+
Object.defineProperty(exports, "AuthorizationResource", { enumerable: true, get: function () { return authorization_1.AuthorizationResource; } });
|
|
39
|
+
var authorization_operation_ids_1 = require("./authorization-operation-ids");
|
|
40
|
+
Object.defineProperty(exports, "authorizationOperationSuffix", { enumerable: true, get: function () { return authorization_operation_ids_1.authorizationOperationSuffix; } });
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAA7C,oHAAA,oBAAoB,OAAA;AAC7B,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,iDAAuD;AAA9C,qHAAA,oBAAoB,OAAA;AAC7B,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,yCAA2C;AAAlC,yGAAA,YAAY,OAAA;AACrB,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAChC,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,4CAA4C;AAC5C,+CAAqD;AAA5C,mHAAA,mBAAmB,OAAA;AAE5B,qDAA2D;AAAlD,yHAAA,sBAAsB,OAAA;AAE/B,iEAAuE;AAA9D,qIAAA,4BAA4B,OAAA;AASrC,iEAAuE;AAA9D,qIAAA,4BAA4B,OAAA;AAErC,iDAAwD;AAA/C,sHAAA,qBAAqB,OAAA;AAC9B,6EAA6E;AAApE,2IAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM credential management resource (T075, SpecKit 010 / ADR-0087, FR-I01–I08).
|
|
3
|
+
*
|
|
4
|
+
* Write-only on `apiKey`: `put` accepts plaintext but no read endpoint EVER
|
|
5
|
+
* returns it. `get` / `list` return only metadata (`credential_masked` is the
|
|
6
|
+
* fingerprint wrapped in dots; never the plaintext).
|
|
7
|
+
*
|
|
8
|
+
* Authorization: every method requires the tenant-wide `manage_credentials`
|
|
9
|
+
* runtime system action (ADR-0102 S3a — the former per-service
|
|
10
|
+
* `manage_credential` was retired). The wire surface returns 404 indistinguishable
|
|
11
|
+
* from "doesn't exist" when the actor is unauthorized (FR-B02 no-leak).
|
|
12
|
+
*/
|
|
13
|
+
import { type FetchClient } from '../_internal/fetch-client';
|
|
14
|
+
import type { LocaleOptions } from '../types/locale';
|
|
15
|
+
export interface LlmCredentialMetadata {
|
|
16
|
+
service_name: string;
|
|
17
|
+
/** "••••" + last 4 chars of the plaintext fingerprint. Read-only. */
|
|
18
|
+
credential_masked: string;
|
|
19
|
+
created_by: string;
|
|
20
|
+
updated_by: string;
|
|
21
|
+
created_at: string;
|
|
22
|
+
updated_at: string;
|
|
23
|
+
}
|
|
24
|
+
export type LlmCredentialsListResponse = LlmCredentialMetadata[];
|
|
25
|
+
export type LlmCredentialResponse = LlmCredentialMetadata;
|
|
26
|
+
export interface LlmCredentialPutInput {
|
|
27
|
+
/** Plaintext API key. Sent over TLS, encrypted server-side, never echoed. */
|
|
28
|
+
apiKey: string;
|
|
29
|
+
/** Optional base URL override (self-hosted endpoints). */
|
|
30
|
+
baseUrl?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class LlmCredentialsResource {
|
|
33
|
+
private readonly client;
|
|
34
|
+
constructor(client: FetchClient);
|
|
35
|
+
/** List metadata for credentials (requires tenant-wide `manage_credentials`). */
|
|
36
|
+
list(options?: LocaleOptions): Promise<LlmCredentialsListResponse>;
|
|
37
|
+
/** Fetch masked metadata for one credential. 404 if not authorized. */
|
|
38
|
+
get(serviceName: string, options?: LocaleOptions): Promise<LlmCredentialResponse>;
|
|
39
|
+
/** Set / replace the credential. Idempotent UPSERT. */
|
|
40
|
+
put(serviceName: string, input: LlmCredentialPutInput): Promise<LlmCredentialResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Remove the credential. Returns 409 `CREDENTIAL_IN_USE` if any active
|
|
43
|
+
* session is pinned to the service — close those sessions first.
|
|
44
|
+
*/
|
|
45
|
+
delete(serviceName: string): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=llm-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-credentials.d.ts","sourceRoot":"","sources":["../../src/resources/llm-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,EAAE,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IAClC,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,sBAAsB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,iFAAiF;IAC3E,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIxE,uEAAuE;IACjE,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQvF,uDAAuD;IACjD,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAU5F;;;OAGG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMnD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LLM credential management resource (T075, SpecKit 010 / ADR-0087, FR-I01–I08).
|
|
4
|
+
*
|
|
5
|
+
* Write-only on `apiKey`: `put` accepts plaintext but no read endpoint EVER
|
|
6
|
+
* returns it. `get` / `list` return only metadata (`credential_masked` is the
|
|
7
|
+
* fingerprint wrapped in dots; never the plaintext).
|
|
8
|
+
*
|
|
9
|
+
* Authorization: every method requires the tenant-wide `manage_credentials`
|
|
10
|
+
* runtime system action (ADR-0102 S3a — the former per-service
|
|
11
|
+
* `manage_credential` was retired). The wire surface returns 404 indistinguishable
|
|
12
|
+
* from "doesn't exist" when the actor is unauthorized (FR-B02 no-leak).
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LlmCredentialsResource = void 0;
|
|
16
|
+
const fetch_client_1 = require("../_internal/fetch-client");
|
|
17
|
+
class LlmCredentialsResource {
|
|
18
|
+
client;
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
/** List metadata for credentials (requires tenant-wide `manage_credentials`). */
|
|
23
|
+
async list(options) {
|
|
24
|
+
return this.client.get('/runtime/llm/credentials', (0, fetch_client_1.localeQuery)(options), { operationId: 'listLlmCredentials' });
|
|
25
|
+
}
|
|
26
|
+
/** Fetch masked metadata for one credential. 404 if not authorized. */
|
|
27
|
+
async get(serviceName, options) {
|
|
28
|
+
return this.client.get(`/runtime/llm/credentials/${encodeURIComponent(serviceName)}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getLlmCredential' });
|
|
29
|
+
}
|
|
30
|
+
/** Set / replace the credential. Idempotent UPSERT. */
|
|
31
|
+
async put(serviceName, input) {
|
|
32
|
+
const body = { apiKey: input.apiKey };
|
|
33
|
+
if (input.baseUrl !== undefined)
|
|
34
|
+
body.baseURL = input.baseUrl;
|
|
35
|
+
return this.client.put(`/runtime/llm/credentials/${encodeURIComponent(serviceName)}`, body, { operationId: 'setLlmCredential' });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Remove the credential. Returns 409 `CREDENTIAL_IN_USE` if any active
|
|
39
|
+
* session is pinned to the service — close those sessions first.
|
|
40
|
+
*/
|
|
41
|
+
async delete(serviceName) {
|
|
42
|
+
await this.client.del(`/runtime/llm/credentials/${encodeURIComponent(serviceName)}`, { operationId: 'deleteLlmCredential' });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.LlmCredentialsResource = LlmCredentialsResource;
|
|
46
|
+
//# sourceMappingURL=llm-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-credentials.js","sourceRoot":"","sources":["../../src/resources/llm-credentials.ts"],"names":[],"mappings":";AAA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