@revoengine/sdk 1.6.2 → 1.6.4

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
@@ -1,12 +1,12 @@
1
1
  # @revoengine/sdk
2
2
 
3
3
  Official Node.js SDK for RevoEngine. It provides the modern `api`, `utils`,
4
- `storage`, `transport`, and `agents` namespaces, top-level `execute()`, and the `batch` controller in both
4
+ `storage`, `transport`, `vault`, `serviceAccount`, and `agents` namespaces, top-level `execute()`, and the `batch` controller in both
5
5
  Revo-hosted `CUSTOM_NODEJS` components and standalone Node.js applications.
6
6
 
7
7
  Requirements: Node.js 22 or newer.
8
8
 
9
- ## SDK 1.6.2 compatibility
9
+ ## SDK 1.6.4 compatibility
10
10
 
11
11
  This release synchronizes the complete public SDK contract with the current
12
12
  platform low-code declarations. Remote calls require a platform runtime that admits
@@ -28,7 +28,7 @@ Legacy SFTP helpers and the removed thread-goal methods are not exposed by the
28
28
  current SDK contract. Refer to the [transfer guide](https://docs.revoengine.com/low-code/sftp)
29
29
  for Secret formats and file-transfer examples.
30
30
 
31
- SDK 1.6.2 retains portable Component digest declarations and one readable-relation
31
+ SDK 1.6.4 retains portable Component digest declarations and one readable-relation
32
32
  contract for Databases, live Views, and Materialized Views. Use `api.exportDatabase()`
33
33
  for all three relation types. `api.getDatabaseViewData()` remains a deprecated
34
34
  read alias; `api.exportDatabaseView()` and separate REST View export operations
@@ -41,6 +41,9 @@ returns its job ID for operation tracking. The import workflow starts with
41
41
  describe the current request and response shapes; the platform still enforces
42
42
  permissions and validates source and target state before committing an import.
43
43
 
44
+ Assistant model inputs follow the current platform: `gpt-6.1-sol` and
45
+ `gpt-6-luna`; Fast mode is supported for Luna. Update older Sol model identifiers.
46
+
44
47
  Remote MCP server configurations in this contract use public HTTPS destinations.
45
48
  Private-network access is not an accepted SDK setting; review the server URL,
46
49
  provider consent, Vault binding, and tool permissions before enabling a plugin.
@@ -52,14 +55,14 @@ provider consent, Vault binding, and tool permissions before enabling a plugin.
52
55
  | Revo-hosted `CUSTOM_NODEJS` | Export `async function init(runtime)` | Revo injects an execution-bound runtime; user code receives no API key. |
53
56
  | Standalone Node.js | Create `new RevoClient(options)` | Supply a RevoEngine API key explicitly or through an environment variable. |
54
57
 
55
- Both modes expose the same `api`, `utils`, `storage`, `transport`, `agents`, `execute`, and `batch`
58
+ Both modes expose the same `api`, `utils`, `storage`, `transport`, `vault`, `serviceAccount`, `agents`, `execute`, and `batch`
56
59
  properties, but return types reflect where the work happens:
57
60
 
58
61
  | Call kind | Revo-hosted | Standalone |
59
62
  | --- | --- | --- |
60
63
  | Execution snapshot, cache, debug, and logging | Synchronous | Throws synchronously because no execution context exists |
61
64
  | Current user and instance | Synchronous injected snapshot | Asynchronous lazy `/api/v1/me` discovery |
62
- | Remote `api`, `storage`, `agents`, and `execute()` calls | Asynchronous | Asynchronous |
65
+ | Remote `api`, `storage`, `transport`, `vault`, `serviceAccount`, `agents`, and `execute()` calls | Asynchronous | Asynchronous |
63
66
  | Local `utils` and `batch.configure()` | Synchronous unless the utility is inherently asynchronous | Same |
64
67
 
65
68
  ## Installation
@@ -76,7 +79,7 @@ RevoEngine pins that version again in the deployment package and injects the
76
79
  runtime into the component entrypoint. Component code does not construct a
77
80
  `RevoClient`.
78
81
 
79
- The platform chooses the hosted package version; publishing SDK 1.6.2 does not
82
+ The platform chooses the hosted package version; publishing SDK 1.6.4 does not
80
83
  upgrade existing hosted deployments or their generated package pins.
81
84
 
82
85
  Hosted user code receives neither a tenant API key nor the private runtime
@@ -95,7 +98,7 @@ separate initialization method.
95
98
  ```js
96
99
  /** @param {import('@revoengine/sdk').RevoRuntime} runtime */
97
100
  export async function init(runtime) {
98
- const { api, utils, storage, agents, execute, batch } = runtime;
101
+ const { api, utils, storage, vault, agents, execute, batch } = runtime;
99
102
  const { data: rows, next } = await api.getDatabaseData('Sales', {
100
103
  fields: ['saleId', 'customerId', 'total', 'createdAt'],
101
104
  sort: ['-createdAt'],
@@ -153,6 +156,8 @@ Execution-only methods such as `api.input()`, `api.getContext()`,
153
156
  `api.getExecutionId()`, and `api.getOperationId()` are available only in hosted
154
157
  executions.
155
158
 
159
+ Use `runtime.execute(code, { readOnly: true })` for transient code that must not write platform state. `readOnly: false` selects full execution for an authorized standalone client; a hosted execution inherits its mode and cannot escalate a restricted parent.
160
+
156
161
  ### Configure hosted batching
157
162
 
158
163
  Configure batching before the first remote call:
@@ -787,3 +792,85 @@ Common subclasses include:
787
792
  - Deprecated low-code methods and aliases are excluded.
788
793
  - `api.transactionDatabaseData` is excluded.
789
794
  - Runtime batches are non-transactional and are not retried automatically.
795
+
796
+ ## Vault manager
797
+
798
+ The native `client.vault` manager uses the same get/create/update/delete/rotate
799
+ contract for instance (default) and verified user scope. Get alone returns
800
+ `secret.revision.value` as a Buffer containing the stored UTF-8 text; Rotate returns metadata without values.
801
+ Revision versions are normalized validFrom timestamps. validFrom accepts null,
802
+ Date, ISO or epoch milliseconds; a future Rotate preserves current availability.
803
+ `listRevisions` exposes paginated metadata history.
804
+
805
+ ```ts
806
+ const secret = await client.vault.get('TOKEN', { scope: 'user' });
807
+ const token = secret.revision.value.toString('utf8');
808
+ await client.vault.rotate('TOKEN', { value: replacement }, { scope: 'user', validFrom: null });
809
+ ```
810
+
811
+ Do not log values or access tokens. Instance access requires Secret roles and
812
+ creator ownership or administrator rights. User scope uses the verified account;
813
+ management requires owner rights and does not inherit saved Component/Tool grants.
814
+ Writes throw `READ_ONLY_OPERATION_FORBIDDEN` when the execution has `readOnly: true`. See the
815
+ [Vault guide](https://docs.revoengine.com/low-code/reference/vault) for all methods.
816
+
817
+ The same flat manager exposes `getAccessToken`, `getIntegrationMetadata`,
818
+ `discoverIntegration`, `connectIntegration`, and `disconnectIntegration`. Token reads
819
+ return the access token with its matching ISO expiry and refresh when necessary.
820
+ Connect requires nullable `expectedRevision` (null to create) and returns an
821
+ authorization URL for interactive consent through the existing frontend callback.
822
+ Disconnect retains definition/history/grants and does not revoke provider access.
823
+ Saved Component/Tool reads preserve exact personal grants; direct SDK owner/admin
824
+ reads and management are authorized separately.
825
+
826
+
827
+ ## Bulk Jobs and Webhooks
828
+
829
+ Use `api.cancelJobs`, `retryJobs`, `deleteJobs`, `cancelWebhooks`, `retryWebhooks`,
830
+ and `deleteWebhooks` with exactly one non-empty platform `filter` or an ID array
831
+ (`jobIds` / `webhookIds`, 1–1000 IDs). A filter selects every matching row beyond
832
+ list pagination. An optional actor-scoped `idempotencyKey` protects repeat admission.
833
+ The SDK never automatically retries mutations.
834
+
835
+ ```ts
836
+ const input = {
837
+ filter: { field: 'status', op: 'eq', value: 'ERROR' },
838
+ idempotencyKey: 'retry-errors-2026-10-01',
839
+ };
840
+ const preview = await client.api.previewAutomationOperation('jobs', 'retry', input);
841
+ // Review advisory preview.matched / preview.eligible before submitting.
842
+ const operation = await client.api.retryJobs(input);
843
+ const progress = await client.api.getAutomationOperation(operation.operationId);
844
+ const outcomes = await client.api.getAutomationOperationItems(operation.operationId);
845
+ // Fetch subsequent pages with outcomes.nextCursor as the second argument.
846
+ ```
847
+
848
+ Operations report `PENDING`, `PROCESSING`, `FINISHED`, or `ERROR`, plus
849
+ `total`, `processed`, `skipped`, and `failed`. `FINISHED` means lifecycle requests
850
+ were processed; downstream execution/delivery may continue and failed can be non-zero.
851
+ Item pages contain safe source/result IDs and error codes. Preview is advisory;
852
+ admission freezes selection and the worker rechecks state and permissions.
853
+ Cancel/delete require Automation Admin; retry accepts Automation Runner/Admin.
854
+
855
+ `retryWebhooks` accepts `requestPatch`: url/method/body replace whole fields;
856
+ headers/query accept `set` and `remove`, and `maskDetails` adds masks while preserving
857
+ existing masks. Masked original values cannot be recovered: provide explicit
858
+ replacements or the item fails with `REPLAY_PAYLOAD_UNAVAILABLE`. If the entire
859
+ headers section was masked, `headers.set` supplies its complete replacement.
860
+ Request patches are limited to 1 MiB of serialized JSON. Never log replacement
861
+ credentials. The operation result does not expose saved request bodies.
862
+
863
+ ```ts
864
+ await client.api.retryWebhooks({
865
+ webhookIds: selectedWebhookIds,
866
+ idempotencyKey: retryAdmissionKey,
867
+ requestPatch: {
868
+ headers: { set: { Authorization: `Bearer ${replacementToken}` }, remove: ['X-Old-Key'] },
869
+ query: { set: { apiVersion: '2' }, remove: ['legacy'] },
870
+ maskDetails: ['headers.Authorization'],
871
+ },
872
+ });
873
+ ```
874
+
875
+ The target platform requires the bulk-operation migration and an active API worker
876
+ lane. Publishing this SDK does not deploy them or change the hosted SDK pin.