@vertesia/client 1.6.0-dev.20261014.015055Z → 1.6.0-dev.20261022.120426Z

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.
Files changed (82) hide show
  1. package/lib/ApiKeysApi.d.ts +4 -7
  2. package/lib/ApiKeysApi.d.ts.map +1 -1
  3. package/lib/ApiKeysApi.js +5 -4
  4. package/lib/ApiKeysApi.js.map +1 -1
  5. package/lib/AppsApi.d.ts +35 -2
  6. package/lib/AppsApi.d.ts.map +1 -1
  7. package/lib/AppsApi.js +76 -1
  8. package/lib/AppsApi.js.map +1 -1
  9. package/lib/InteractionsApi.d.ts +3 -1
  10. package/lib/InteractionsApi.d.ts.map +1 -1
  11. package/lib/InteractionsApi.js +2 -1
  12. package/lib/InteractionsApi.js.map +1 -1
  13. package/lib/OAuthServerApi.d.ts +7 -1
  14. package/lib/OAuthServerApi.d.ts.map +1 -1
  15. package/lib/OAuthServerApi.js +21 -0
  16. package/lib/OAuthServerApi.js.map +1 -1
  17. package/lib/OidcFederationApi.d.ts +11 -0
  18. package/lib/OidcFederationApi.d.ts.map +1 -0
  19. package/lib/OidcFederationApi.js +22 -0
  20. package/lib/OidcFederationApi.js.map +1 -0
  21. package/lib/RunsApi.d.ts +3 -2
  22. package/lib/RunsApi.d.ts.map +1 -1
  23. package/lib/RunsApi.js +3 -2
  24. package/lib/RunsApi.js.map +1 -1
  25. package/lib/client.d.ts +2 -0
  26. package/lib/client.d.ts.map +1 -1
  27. package/lib/client.js +3 -0
  28. package/lib/client.js.map +1 -1
  29. package/lib/execute.d.ts +16 -2
  30. package/lib/execute.d.ts.map +1 -1
  31. package/lib/execute.js +13 -2
  32. package/lib/execute.js.map +1 -1
  33. package/lib/index.d.ts +2 -0
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/index.js +1 -0
  36. package/lib/index.js.map +1 -1
  37. package/lib/nodejs/NodeStreamSource.d.ts +1 -0
  38. package/lib/nodejs/NodeStreamSource.d.ts.map +1 -1
  39. package/lib/nodejs/NodeStreamSource.js +17 -15
  40. package/lib/nodejs/NodeStreamSource.js.map +1 -1
  41. package/lib/store/AgentsApi.d.ts +3 -0
  42. package/lib/store/AgentsApi.d.ts.map +1 -1
  43. package/lib/store/AgentsApi.js +7 -1
  44. package/lib/store/AgentsApi.js.map +1 -1
  45. package/lib/store/FilesApi.d.ts.map +1 -1
  46. package/lib/store/FilesApi.js +8 -2
  47. package/lib/store/FilesApi.js.map +1 -1
  48. package/lib/store/IndexingApi.d.ts +0 -6
  49. package/lib/store/IndexingApi.d.ts.map +1 -1
  50. package/lib/store/IndexingApi.js +3 -17
  51. package/lib/store/IndexingApi.js.map +1 -1
  52. package/lib/store/ObjectsApi.d.ts +0 -6
  53. package/lib/store/ObjectsApi.d.ts.map +1 -1
  54. package/lib/store/ObjectsApi.js +2 -16
  55. package/lib/store/ObjectsApi.js.map +1 -1
  56. package/lib/store/ProcessApi.d.ts +4 -0
  57. package/lib/store/ProcessApi.d.ts.map +1 -1
  58. package/lib/store/ProcessApi.js +8 -1
  59. package/lib/store/ProcessApi.js.map +1 -1
  60. package/lib/store/zeno-bulk.d.ts +9 -0
  61. package/lib/store/zeno-bulk.d.ts.map +1 -0
  62. package/lib/store/zeno-bulk.js +26 -0
  63. package/lib/store/zeno-bulk.js.map +1 -0
  64. package/lib/vertesia-client.js +4 -4
  65. package/lib/vertesia-client.js.map +1 -1
  66. package/package.json +13 -8
  67. package/src/ApiKeysApi.ts +4 -12
  68. package/src/AppsApi.ts +106 -0
  69. package/src/InteractionsApi.ts +9 -2
  70. package/src/OAuthServerApi.ts +31 -0
  71. package/src/OidcFederationApi.ts +23 -0
  72. package/src/RunsApi.ts +7 -2
  73. package/src/client.ts +3 -0
  74. package/src/execute.ts +30 -3
  75. package/src/index.ts +2 -0
  76. package/src/nodejs/NodeStreamSource.ts +28 -24
  77. package/src/store/AgentsApi.ts +10 -1
  78. package/src/store/FilesApi.ts +8 -2
  79. package/src/store/IndexingApi.ts +3 -18
  80. package/src/store/ObjectsApi.ts +2 -17
  81. package/src/store/ProcessApi.ts +8 -1
  82. package/src/store/zeno-bulk.ts +30 -0
@@ -63,6 +63,7 @@ import { AnalyzeDocApi } from './AnalyzeDocApi.js';
63
63
  import type { ZenoClient } from './client.js';
64
64
  import { fetchSignedUrl } from './signed-url.js';
65
65
  import { getUploadMimeTypeHint, resolveUploadMimeType } from './uploadMimeType.js';
66
+ import { zenoBulkBaseUrl } from './zeno-bulk.js';
66
67
 
67
68
  /**
68
69
  * The two write payloads, each widened at `content` so callers can hand us a browser `File` or a
@@ -215,24 +216,8 @@ export class ObjectsApi extends ApiTopic {
215
216
  return this.zenoBulkPost('/export/compose', payload, timeoutMs);
216
217
  }
217
218
 
218
- /**
219
- * Get the zeno-bulk base URL.
220
- * Dev branches: store URL contains "zeno-server" -> replace with "zeno-bulk".
221
- * Production/preview: same domain, LB routes /export to zeno-bulk.
222
- */
223
- private get zenoBulkBaseUrl(): string {
224
- const storeBaseUrl = this.client.baseUrl;
225
- if (storeBaseUrl.includes('localhost:') || storeBaseUrl.includes('127.0.0.1:')) {
226
- return 'https://zeno-bulk-dev-main.api.dev1.vertesia.io';
227
- }
228
- if (storeBaseUrl.includes('zeno-server')) {
229
- return storeBaseUrl.replace(/zeno-server/, 'zeno-bulk');
230
- }
231
- return storeBaseUrl;
232
- }
233
-
234
219
  private zenoBulkPost<T>(path: string, body: object, timeoutMs?: number | false | null): Promise<T> {
235
- return this.client.post(this.zenoBulkBaseUrl + path, { payload: body, timeoutMs });
220
+ return this.client.post(zenoBulkBaseUrl(this.client.baseUrl) + path, { payload: body, timeoutMs });
236
221
  }
237
222
 
238
223
  listFolders(_path: string = '/') {
@@ -50,8 +50,15 @@ export class ProcessApi extends ApiTopic {
50
50
  return this.get(`/${id}/versions`);
51
51
  }
52
52
 
53
+ /**
54
+ * Publish a draft revision. Set `idempotency_key` to make the call safe to retry: without one, a
55
+ * replay of a publish that already succeeded is rejected, so no client retry applies.
56
+ */
53
57
  publish(id: string, payload: PublishProcessDefinitionPayload): Promise<ProcessDefinition> {
54
- return this.post(`/${id}/publish`, { payload });
58
+ return this.post(`/${id}/publish`, {
59
+ payload,
60
+ retryPolicy: payload.idempotency_key ? undefined : false,
61
+ });
55
62
  }
56
63
 
57
64
  revert(id: string, payload: RevertProcessDefinitionPayload): Promise<ProcessDefinition> {
@@ -0,0 +1,30 @@
1
+ type RuntimeProcess = {
2
+ env?: Record<string, string | undefined>;
3
+ };
4
+
5
+ /** The ZENO_BULK_URL environment variable, in a runtime that has one. */
6
+ function getRuntimeZenoBulkUrl() {
7
+ const runtimeProcess = (globalThis as typeof globalThis & { process?: RuntimeProcess }).process;
8
+ return runtimeProcess?.env?.ZENO_BULK_URL || undefined;
9
+ }
10
+
11
+ /**
12
+ * The base URL of zeno-bulk, the service behind the bulk export and reindex endpoints, for a store base URL.
13
+ * - ZENO_BULK_URL, when the runtime sets it: a local stack that runs its own zeno-bulk, or none, points it there.
14
+ * - A store on localhost: the dev1 zeno-bulk, which serves the database a default local stack uses.
15
+ * - A dev-branch store, whose host names zeno-server: the matching zeno-bulk host.
16
+ * - Any other store: its own domain, whose load balancer routes the bulk paths to zeno-bulk.
17
+ */
18
+ export function zenoBulkBaseUrl(storeBaseUrl: string): string {
19
+ const override = getRuntimeZenoBulkUrl();
20
+ if (override) {
21
+ return override.replace(/\/+$/, '');
22
+ }
23
+ if (storeBaseUrl.includes('localhost:') || storeBaseUrl.includes('127.0.0.1:')) {
24
+ return 'https://zeno-bulk-dev-main.api.dev1.vertesia.io';
25
+ }
26
+ if (storeBaseUrl.includes('zeno-server')) {
27
+ return storeBaseUrl.replace(/zeno-server/, 'zeno-bulk');
28
+ }
29
+ return storeBaseUrl;
30
+ }