@sap-ai-sdk/context-registry 2.18.1-20261204013110.0 → 2.19.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/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './client/context-registry/index.ts';
2
+ export { contextRegistryStatus } from './poll-status.ts';
3
+ export type { ContextRegistryLifecycle } from './poll-status.ts';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './client/context-registry/index.js';
2
+ export { contextRegistryStatus } from './poll-status.js';
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { PollStatus } from '@sap-ai-sdk/core';
2
+ /**
3
+ * The lifecycle fields the Context Registry create/update resources share
4
+ * (data destinations, scenario configurations, tabular artifacts).
5
+ */
6
+ export interface ContextRegistryLifecycle {
7
+ status?: string;
8
+ errorMessage?: string | null;
9
+ }
10
+ /**
11
+ * A reusable `checkStatus` preset for Context Registry create/update polling: the resource is
12
+ * done once its `status` is `ACTIVE`, failed on `ERROR` (surfacing `errorMessage`), and still
13
+ * pending otherwise. The three resource types share this lifecycle, so pass this directly to
14
+ * `waitUntilDone` instead of repeating the check per call.
15
+ * @param resource - The polled status resource.
16
+ * @returns The {@link PollStatus} for the resource.
17
+ */
18
+ export declare function contextRegistryStatus(resource: ContextRegistryLifecycle): PollStatus;
19
+ //# sourceMappingURL=poll-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll-status.d.ts","sourceRoot":"","sources":["../src/poll-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,wBAAwB,GACjC,UAAU,CAQZ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A reusable `checkStatus` preset for Context Registry create/update polling: the resource is
3
+ * done once its `status` is `ACTIVE`, failed on `ERROR` (surfacing `errorMessage`), and still
4
+ * pending otherwise. The three resource types share this lifecycle, so pass this directly to
5
+ * `waitUntilDone` instead of repeating the check per call.
6
+ * @param resource - The polled status resource.
7
+ * @returns The {@link PollStatus} for the resource.
8
+ */
9
+ export function contextRegistryStatus(resource) {
10
+ if (resource.status === 'ACTIVE') {
11
+ return 'done';
12
+ }
13
+ if (resource.status === 'ERROR') {
14
+ return { failed: resource.errorMessage || 'resource creation failed' };
15
+ }
16
+ return 'pending';
17
+ }
18
+ //# sourceMappingURL=poll-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll-status.js","sourceRoot":"","sources":["../src/poll-status.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAkC;IAElC,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,IAAI,0BAA0B,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ai-sdk/context-registry",
3
- "version": "2.18.1-20261204013110.0",
3
+ "version": "2.19.0",
4
4
  "description": "This package provides a client for the SAP AI Core Context Registry service.",
5
5
  "keywords": [
6
6
  "context-registry",
@@ -32,7 +32,7 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@sap-ai-sdk/core": "^2.18.1-20261204013110.0"
35
+ "@sap-ai-sdk/core": "^2.19.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "vitest": "5.1.2"