@revoengine/sdk 1.5.8 → 1.6.3

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