@revoengine/sdk 1.6.8 → 3.0.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/README.md CHANGED
@@ -8,10 +8,10 @@ Requirements: Node.js 22 or newer.
8
8
 
9
9
  Development and GitLab CI use Node.js 24.21.0. Run `nvm use` to select the checked-in `.nvmrc`.
10
10
 
11
- ## SDK 1.6.8 compatibility
11
+ ## SDK 3.0.0 compatibility
12
12
 
13
- This release synchronizes the complete public SDK contract with the current
14
- platform low-code declarations. Remote calls require a platform runtime that admits
13
+ This major release synchronizes the complete public SDK contract with RevoEngine
14
+ 1.7.1 and removes deprecated compatibility methods and legacy Files types. Remote calls require a platform runtime that admits
15
15
  the bundled contract revision; publishing the SDK alone does not deploy that runtime.
16
16
  Use the SDK version supported by the target platform deployment until its contract is upgraded.
17
17
 
@@ -38,9 +38,10 @@ for Secret formats and file-transfer examples.
38
38
 
39
39
  This release retains portable Component digest declarations and one readable-relation
40
40
  contract for Databases, live Views, and Materialized Views. Use `api.exportDatabase()`
41
- for all three relation types. `api.getDatabaseViewData()` remains a deprecated
42
- read alias; `api.exportDatabaseView()` and separate REST View export operations
43
- are removed. Existing integrations should update these calls before rollout.
41
+ for all three relation types, and `api.getDatabaseData()` for structured reads.
42
+ Account data uses `metadata` and `metadataAdvanced`; use `vault.get()` for Secret
43
+ values and `storage.*` for file content. The instance-data source list excludes
44
+ legacy Files resources.
44
45
 
45
46
  Database exports can select CSV, TSV, NDJSON, or XLSX. An asynchronous export
46
47
  returns its job ID for operation tracking. The import workflow starts with
@@ -56,7 +57,7 @@ Remote MCP server configurations in this contract use public HTTPS destinations.
56
57
  Private-network access is not an accepted SDK setting; review the server URL,
57
58
  provider consent, Vault binding, and tool permissions before enabling a plugin.
58
59
 
59
- SDK 1.6.8 adds `agents.createResponse()` and the saved Assistant conversation
60
+ The SDK includes `agents.createResponse()` and the saved Assistant conversation
60
61
  contract: `instructions`, `contextMode` and text or validated JSON `responseFormat`.
61
62
  The typed answer is in `output.text` or `output.json`; retain the returned thread
62
63
  for an ordinary `agents.sendMessage()` continuation. Provider refusal, incomplete
@@ -145,14 +146,16 @@ JavaScript ignores the additional runtime argument.
145
146
 
146
147
  Hosted context comes from the current execution snapshot and is synchronous, just
147
148
  like the low-code surface. Only platform-backed work returns a promise.
149
+ Account metadata is available through `currentUser.metadata` and
150
+ `currentUser.metadataAdvanced`.
148
151
 
149
152
  ```js
150
153
  export async function init(runtime) {
151
- const { api } = runtime;
154
+ const { api, vault } = runtime;
152
155
  const input = api.input();
153
156
  const currentUser = api.currentUser();
154
157
  const instance = api.getInstanceDetails();
155
- const signingSecret = await api.getSecret('WEBHOOK_SIGNING_SECRET');
158
+ const signingSecret = (await vault.get('WEBHOOK_SIGNING_SECRET', { scope: 'instance' })).revision.value;
156
159
 
157
160
  api.log({
158
161
  message: 'Processing custom component',
@@ -241,7 +244,7 @@ There is no `init()` or connection method.
241
244
  ## Execute active low-code libraries
242
245
 
243
246
  `execute(code, options)` runs one transient JavaScript or TypeScript component inside
244
- RevoEngine. The source has the normal low-code `api` and active tenant `libs.*`
247
+ RevoEngine. The source has the normal low-code `api` and active tenant `lib.*`
245
248
  surface. Library functions and source never move into the Node.js process; only the
246
249
  JSON-serializable request and execution result cross the runtime transport.
247
250
 
@@ -254,8 +257,8 @@ export async function init(runtime) {
254
257
  const execution = await runtime.execute(
255
258
  `
256
259
  const customerId = api.input('customerId');
257
- const customer = await libs.Customers.Queries.get(customerId);
258
- const balance = await libs.Billing.Balance.current(customerId);
260
+ const customer = await lib.Customers.Queries.get(customerId);
261
+ const balance = await lib.Billing.Balance.current(customerId);
259
262
  return { customer, balance };
260
263
  `,
261
264
  {
@@ -290,7 +293,7 @@ type CustomerSummary = {
290
293
  const execution = await revo.execute<CustomerSummary>(
291
294
  `
292
295
  const customerId = api.input('customerId');
293
- return libs.Customers.Summary.build(customerId);
296
+ return lib.Customers.Summary.build(customerId);
294
297
  `,
295
298
  {
296
299
  inputs: { customerId: 'customer-1' },
@@ -304,7 +307,7 @@ console.log(execution.results);
304
307
  JavaScript is selected with `language: 'javascript'`; TypeScript is the default.
305
308
  The default timeout is 60 seconds. Standalone `executionDefaults` set reusable
306
309
  language, timeout, or memory defaults, and per-call options override them.
307
- One `execute()` call creates one isolated execution. Put related `libs.*`
310
+ One `execute()` call creates one isolated execution. Put related `lib.*`
308
311
  operations in the same source when they belong to one workflow. Concurrent separate
309
312
  calls still use the SDK's automatic JSON-RPC batching but execute in separate isolates.
310
313
  Low-code runtime batches are not retried because source can perform writes.
@@ -362,11 +365,12 @@ Calls queued in the same microtask are grouped. `Promise.all` is the normal way
362
365
  to issue a batch:
363
366
 
364
367
  ```ts
365
- const [customers, crmToken, activeAgents] = await Promise.all([
368
+ const [customers, crmSecret, activeAgents] = await Promise.all([
366
369
  revo.api.getDatabaseData('Customers', { take: 100 }),
367
- revo.api.getSecret('CRM_API_TOKEN'),
370
+ revo.vault.get('CRM_API_TOKEN', { scope: 'instance' }),
368
371
  revo.agents.list(),
369
372
  ]);
373
+ const crmToken = crmSecret.revision.value;
370
374
  ```
371
375
 
372
376
  Sequential `await` statements naturally produce separate batches:
@@ -432,7 +436,8 @@ export async function init(runtime) {
432
436
  args: { userId: currentUser.userId, instanceId, hasInput: input != null },
433
437
  });
434
438
 
435
- return runtime.api.getSecret('SIGNING_SECRET');
439
+ const signingSecret = await runtime.vault.get('SIGNING_SECRET', { scope: 'instance' });
440
+ return { configured: Boolean(signingSecret.revision.value) };
436
441
  }
437
442
  ```
438
443
 
@@ -1,9 +1,9 @@
1
1
  import * as node_worker_threads from 'node:worker_threads';
2
2
  import { Buffer as Buffer$1 } from 'node:buffer';
3
3
 
4
- declare const SDK_VERSION: "1.6.8";
4
+ declare const SDK_VERSION: "3.0.0";
5
5
  declare const PROTOCOL_VERSION: 1;
6
- declare const CONTRACT_REVISION: "cda216e308d857954aa46b31185a8b653015dd1e3d84996bdf3a93745e72bd43";
6
+ declare const CONTRACT_REVISION: "a8b45833ea1fa202798a2c8c009e07955b31c0cce159767844f96b9ca85b500a";
7
7
  type RuntimeSurfaceName = 'api' | 'storage' | 'transport' | 'vault' | 'serviceAccount' | 'agents' | 'lowCode';
8
8
 
9
9
  // AUTO-GENERATED FILE. DO NOT EDIT DIRECTLY.
@@ -422,7 +422,7 @@ interface SwaggerAssistantResponseFormatDto {
422
422
  }
423
423
  interface SwaggerAssistantThreadlessResponseContextDto {
424
424
  /** Current Revo UI component hint included in the response context. It does not automatically select tools or skills. */
425
- "componentContext"?: "PREFERENCES" | "USERS" | "SERVICE_ACCOUNTS" | "GROUPS" | "ROLE_GROUPS" | "SECRETS" | "REVISIONS" | "DATABASES" | "DATABASE_OPERATIONS" | "DATABASE_VIEWS" | "DATA" | "DATA_ITEMS" | "ENDPOINTS" | "TEMPLATES" | "SCHEDULE" | "SCHEDULE_HISTORY" | "EVENTS" | "JOBS" | "AGENTS" | "AGENT_RUNS" | "AGENT_INBOX" | "AGENT_PLUGINS" | "AGENT_TERMINALS" | "WEBHOOKS" | "COMPONENTS" | "COMPONENT_ELEMENTS" | "EVENTS_HISTORY" | "USER_KEYS" | "FILES" | "STORAGE" | "REALTIME" | "LOGS" | "MONITORING" | "THREAD" | "SECURITY_SETTINGS" | "ME_SETTINGS" | "ME_KEYS" | "USER_DETAILS" | "PLAYGROUND" | "WEB_IDE";
425
+ "componentContext"?: "PREFERENCES" | "USERS" | "SERVICE_ACCOUNTS" | "GROUPS" | "ROLE_GROUPS" | "SECRETS" | "REVISIONS" | "DATABASES" | "DATABASE_OPERATIONS" | "DATABASE_VIEWS" | "DATA" | "DATA_ITEMS" | "ENDPOINTS" | "TEMPLATES" | "SCHEDULE" | "SCHEDULE_HISTORY" | "EVENTS" | "JOBS" | "AGENTS" | "AGENT_RUNS" | "AGENT_INBOX" | "AGENT_PLUGINS" | "AGENT_TERMINALS" | "WEBHOOKS" | "COMPONENTS" | "COMPONENT_ELEMENTS" | "EVENTS_HISTORY" | "USER_KEYS" | "STORAGE" | "REALTIME" | "LOGS" | "MONITORING" | "THREAD" | "SECURITY_SETTINGS" | "ME_SETTINGS" | "ME_KEYS" | "USER_DETAILS" | "PLAYGROUND" | "WEB_IDE";
426
426
  /** UI-level intent hint for the lightweight response. */
427
427
  "kind"?: "suggestion" | "code_refactor" | "code_explain" | "completion" | "generic";
428
428
  /** Additional UI instruction for this lightweight response. */
@@ -940,12 +940,8 @@ interface ServiceAccountCreateInput {
940
940
  "name": string;
941
941
  /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
942
942
  "metadata"?: Record<string, unknown> | null;
943
- /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
944
- "metaData"?: Record<string, unknown> | null;
945
943
  /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
946
944
  "metadataAdvanced"?: Record<string, unknown> | null;
947
- /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
948
- "advancedData"?: Record<string, unknown> | null;
949
945
  }
950
946
  interface StorageFolderInput {
951
947
  /** Folder name. */
@@ -1349,12 +1345,8 @@ interface ServiceAccountUpdateInput {
1349
1345
  "name"?: string;
1350
1346
  /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1351
1347
  "metadata"?: Record<string, unknown> | null;
1352
- /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1353
- "metaData"?: Record<string, unknown> | null;
1354
1348
  /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1355
1349
  "metadataAdvanced"?: Record<string, unknown> | null;
1356
- /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1357
- "advancedData"?: Record<string, unknown> | null;
1358
1350
  "access"?: SwaggerUpdateServiceAccountAccessDto;
1359
1351
  /** Current account version for optimistic concurrency. */
1360
1352
  "version": number;
@@ -2358,11 +2350,7 @@ interface LoggedUser {
2358
2350
  groups: string[];
2359
2351
  roles: string[];
2360
2352
  metadata: LooseObject<any>;
2361
- /** @deprecated Use metadata instead. */
2362
- metaData: LooseObject<any>;
2363
2353
  metadataAdvanced: LooseObject<any>;
2364
- /** @deprecated Use metadataAdvanced instead. */
2365
- advancedData: LooseObject<any>;
2366
2354
  /** Avatar storage entry ID; `/me` separately returns a signed download URL. */
2367
2355
  avatar: string;
2368
2356
  platformAccess: boolean;
@@ -3510,12 +3498,8 @@ interface RevoApi {
3510
3498
  exit(): void;
3511
3499
  throw(code: number, body?: any): void;
3512
3500
  getCurrentInstance(): string;
3513
- getInstanceData(dataSource: 'Users' | 'Groups' | 'RoleGroups' | 'Keys' | 'Secrets' | 'SecretsData' | 'Templates' | 'Events' | 'Schedule' | 'Jobs' | 'Webhooks' | 'Components' | 'Logs' | 'Files' | 'EventsHistory' | 'Endpoints' | 'Databases' | 'DatabaseData', request?: InstanceData): Promise<any>;
3501
+ getInstanceData(dataSource: 'Users' | 'Groups' | 'RoleGroups' | 'Keys' | 'Secrets' | 'SecretsData' | 'Templates' | 'Events' | 'Schedule' | 'Jobs' | 'Webhooks' | 'Components' | 'Logs' | 'EventsHistory' | 'Endpoints' | 'Databases' | 'DatabaseData', request?: InstanceData): Promise<any>;
3514
3502
  getInstanceDetails(): InstanceDetails;
3515
- getSecret(name: string): Promise<string>;
3516
- getSecrets(name: string[]): Promise<{
3517
- [key: string]: string;
3518
- }>;
3519
3503
  publishMessage(channel: string, message: any): Promise<void>;
3520
3504
  getInstanceCache(key: string): Promise<any>;
3521
3505
  setInstanceCache(key: string, value: any, seconds?: number): Promise<void>;
@@ -1,9 +1,9 @@
1
1
  import * as node_worker_threads from 'node:worker_threads';
2
2
  import { Buffer as Buffer$1 } from 'node:buffer';
3
3
 
4
- declare const SDK_VERSION: "1.6.8";
4
+ declare const SDK_VERSION: "3.0.0";
5
5
  declare const PROTOCOL_VERSION: 1;
6
- declare const CONTRACT_REVISION: "cda216e308d857954aa46b31185a8b653015dd1e3d84996bdf3a93745e72bd43";
6
+ declare const CONTRACT_REVISION: "a8b45833ea1fa202798a2c8c009e07955b31c0cce159767844f96b9ca85b500a";
7
7
  type RuntimeSurfaceName = 'api' | 'storage' | 'transport' | 'vault' | 'serviceAccount' | 'agents' | 'lowCode';
8
8
 
9
9
  // AUTO-GENERATED FILE. DO NOT EDIT DIRECTLY.
@@ -422,7 +422,7 @@ interface SwaggerAssistantResponseFormatDto {
422
422
  }
423
423
  interface SwaggerAssistantThreadlessResponseContextDto {
424
424
  /** Current Revo UI component hint included in the response context. It does not automatically select tools or skills. */
425
- "componentContext"?: "PREFERENCES" | "USERS" | "SERVICE_ACCOUNTS" | "GROUPS" | "ROLE_GROUPS" | "SECRETS" | "REVISIONS" | "DATABASES" | "DATABASE_OPERATIONS" | "DATABASE_VIEWS" | "DATA" | "DATA_ITEMS" | "ENDPOINTS" | "TEMPLATES" | "SCHEDULE" | "SCHEDULE_HISTORY" | "EVENTS" | "JOBS" | "AGENTS" | "AGENT_RUNS" | "AGENT_INBOX" | "AGENT_PLUGINS" | "AGENT_TERMINALS" | "WEBHOOKS" | "COMPONENTS" | "COMPONENT_ELEMENTS" | "EVENTS_HISTORY" | "USER_KEYS" | "FILES" | "STORAGE" | "REALTIME" | "LOGS" | "MONITORING" | "THREAD" | "SECURITY_SETTINGS" | "ME_SETTINGS" | "ME_KEYS" | "USER_DETAILS" | "PLAYGROUND" | "WEB_IDE";
425
+ "componentContext"?: "PREFERENCES" | "USERS" | "SERVICE_ACCOUNTS" | "GROUPS" | "ROLE_GROUPS" | "SECRETS" | "REVISIONS" | "DATABASES" | "DATABASE_OPERATIONS" | "DATABASE_VIEWS" | "DATA" | "DATA_ITEMS" | "ENDPOINTS" | "TEMPLATES" | "SCHEDULE" | "SCHEDULE_HISTORY" | "EVENTS" | "JOBS" | "AGENTS" | "AGENT_RUNS" | "AGENT_INBOX" | "AGENT_PLUGINS" | "AGENT_TERMINALS" | "WEBHOOKS" | "COMPONENTS" | "COMPONENT_ELEMENTS" | "EVENTS_HISTORY" | "USER_KEYS" | "STORAGE" | "REALTIME" | "LOGS" | "MONITORING" | "THREAD" | "SECURITY_SETTINGS" | "ME_SETTINGS" | "ME_KEYS" | "USER_DETAILS" | "PLAYGROUND" | "WEB_IDE";
426
426
  /** UI-level intent hint for the lightweight response. */
427
427
  "kind"?: "suggestion" | "code_refactor" | "code_explain" | "completion" | "generic";
428
428
  /** Additional UI instruction for this lightweight response. */
@@ -940,12 +940,8 @@ interface ServiceAccountCreateInput {
940
940
  "name": string;
941
941
  /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
942
942
  "metadata"?: Record<string, unknown> | null;
943
- /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
944
- "metaData"?: Record<string, unknown> | null;
945
943
  /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
946
944
  "metadataAdvanced"?: Record<string, unknown> | null;
947
- /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
948
- "advancedData"?: Record<string, unknown> | null;
949
945
  }
950
946
  interface StorageFolderInput {
951
947
  /** Folder name. */
@@ -1349,12 +1345,8 @@ interface ServiceAccountUpdateInput {
1349
1345
  "name"?: string;
1350
1346
  /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1351
1347
  "metadata"?: Record<string, unknown> | null;
1352
- /** Custom service-account metadata. Top-level keys starting with "__" are reserved for backend use. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1353
- "metaData"?: Record<string, unknown> | null;
1354
1348
  /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1355
1349
  "metadataAdvanced"?: Record<string, unknown> | null;
1356
- /** Extended account data with separate permissions. Same JSON format as Metadata. Maximum 16 KiB of UTF-8 JSON and 64 top-level keys. */
1357
- "advancedData"?: Record<string, unknown> | null;
1358
1350
  "access"?: SwaggerUpdateServiceAccountAccessDto;
1359
1351
  /** Current account version for optimistic concurrency. */
1360
1352
  "version": number;
@@ -2358,11 +2350,7 @@ interface LoggedUser {
2358
2350
  groups: string[];
2359
2351
  roles: string[];
2360
2352
  metadata: LooseObject<any>;
2361
- /** @deprecated Use metadata instead. */
2362
- metaData: LooseObject<any>;
2363
2353
  metadataAdvanced: LooseObject<any>;
2364
- /** @deprecated Use metadataAdvanced instead. */
2365
- advancedData: LooseObject<any>;
2366
2354
  /** Avatar storage entry ID; `/me` separately returns a signed download URL. */
2367
2355
  avatar: string;
2368
2356
  platformAccess: boolean;
@@ -3510,12 +3498,8 @@ interface RevoApi {
3510
3498
  exit(): void;
3511
3499
  throw(code: number, body?: any): void;
3512
3500
  getCurrentInstance(): string;
3513
- getInstanceData(dataSource: 'Users' | 'Groups' | 'RoleGroups' | 'Keys' | 'Secrets' | 'SecretsData' | 'Templates' | 'Events' | 'Schedule' | 'Jobs' | 'Webhooks' | 'Components' | 'Logs' | 'Files' | 'EventsHistory' | 'Endpoints' | 'Databases' | 'DatabaseData', request?: InstanceData): Promise<any>;
3501
+ getInstanceData(dataSource: 'Users' | 'Groups' | 'RoleGroups' | 'Keys' | 'Secrets' | 'SecretsData' | 'Templates' | 'Events' | 'Schedule' | 'Jobs' | 'Webhooks' | 'Components' | 'Logs' | 'EventsHistory' | 'Endpoints' | 'Databases' | 'DatabaseData', request?: InstanceData): Promise<any>;
3514
3502
  getInstanceDetails(): InstanceDetails;
3515
- getSecret(name: string): Promise<string>;
3516
- getSecrets(name: string[]): Promise<{
3517
- [key: string]: string;
3518
- }>;
3519
3503
  publishMessage(channel: string, message: any): Promise<void>;
3520
3504
  getInstanceCache(key: string): Promise<any>;
3521
3505
  setInstanceCache(key: string, value: any, seconds?: number): Promise<void>;