@revoengine/sdk 1.0.1 → 1.5.6
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 +69 -12
- package/dist/{errors-Y4bv4vIM.d.cts → errors-XTYAxN-H.d.cts} +542 -145
- package/dist/{errors-Y4bv4vIM.d.ts → errors-XTYAxN-H.d.ts} +542 -145
- package/dist/hosted.cjs +7416 -4210
- package/dist/hosted.cjs.map +1 -1
- package/dist/hosted.d.cts +2 -2
- package/dist/hosted.d.ts +2 -2
- package/dist/hosted.js +7422 -4216
- package/dist/hosted.js.map +1 -1
- package/dist/index.cjs +7416 -4208
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4914 -2015
- package/dist/index.d.ts +4914 -2015
- package/dist/index.js +7422 -4214
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
# @revoengine/sdk
|
|
2
2
|
|
|
3
3
|
Official Node.js SDK for RevoEngine. It provides the modern `api`, `utils`,
|
|
4
|
-
`storage`, and `agents` namespaces, top-level `execute()`, and the `batch` controller in both
|
|
4
|
+
`storage`, `transport`, 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.6 compatibility
|
|
10
|
+
|
|
11
|
+
This release synchronizes the complete public SDK contract with the current
|
|
12
|
+
platform low-code declarations. Remote calls require a platform runtime that admits
|
|
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.
|
|
15
|
+
|
|
16
|
+
HTTP Storage requests/responses now use `requestType: 'storage'` and
|
|
17
|
+
`responseType: 'storage'`, with flat Storage-only `source` / `target` objects.
|
|
18
|
+
Legacy HTTP Files references and the old Storage `stream` mode are rejected.
|
|
19
|
+
Byte/SSE response iterators remain local to V8 and are blocked by the SDK before
|
|
20
|
+
network or hosted bridge dispatch. Automation schedules use `{ scheduleFor }`
|
|
21
|
+
options instead of positional dates. Regenerated types also include the current
|
|
22
|
+
Storage and database contracts; use those declarations when migrating callers.
|
|
23
|
+
|
|
24
|
+
The `transport` namespace exposes `sftpImport`, `sftpExport`, and `sftpCommands`
|
|
25
|
+
with active Secret names or IDs instead of inline credentials. Storage references
|
|
26
|
+
use the same namespace and effective access rules as other file operations.
|
|
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)
|
|
29
|
+
for Secret formats and file-transfer examples.
|
|
30
|
+
|
|
9
31
|
## Choose your runtime
|
|
10
32
|
|
|
11
33
|
| Environment | How to start | Authentication |
|
|
@@ -13,7 +35,7 @@ Requirements: Node.js 22 or newer.
|
|
|
13
35
|
| Revo-hosted `CUSTOM_NODEJS` | Export `async function init(runtime)` | Revo injects an execution-bound runtime; user code receives no API key. |
|
|
14
36
|
| Standalone Node.js | Create `new RevoClient(options)` | Supply a RevoEngine API key explicitly or through an environment variable. |
|
|
15
37
|
|
|
16
|
-
Both modes expose the same `api`, `utils`, `storage`, `agents`, `execute`, and `batch`
|
|
38
|
+
Both modes expose the same `api`, `utils`, `storage`, `transport`, `agents`, `execute`, and `batch`
|
|
17
39
|
properties, but return types reflect where the work happens:
|
|
18
40
|
|
|
19
41
|
| Call kind | Revo-hosted | Standalone |
|
|
@@ -37,16 +59,8 @@ RevoEngine pins that version again in the deployment package and injects the
|
|
|
37
59
|
runtime into the component entrypoint. Component code does not construct a
|
|
38
60
|
`RevoClient`.
|
|
39
61
|
|
|
40
|
-
The
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"type": "module",
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@revoengine/sdk": "1.0.1"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
62
|
+
The platform chooses the hosted package version; publishing SDK 1.5.6 does not
|
|
63
|
+
upgrade existing hosted deployments or their generated package pins.
|
|
50
64
|
|
|
51
65
|
Hosted user code receives neither a tenant API key nor the private runtime
|
|
52
66
|
credential and does not perform `/api/v1/me` discovery. The generated parent
|
|
@@ -399,6 +413,49 @@ Other context methods throw `RevoRuntimeContextUnavailableError` synchronously
|
|
|
399
413
|
outside a hosted execution. The distinct `RevoApi` and `RevoStandaloneApi` types
|
|
400
414
|
make the hosted snapshot and standalone discovery behavior explicit.
|
|
401
415
|
|
|
416
|
+
## HTTP calls
|
|
417
|
+
|
|
418
|
+
`api.httpCall(request, options)` supports ordinary JSON/text/base64/document responses
|
|
419
|
+
and HTTP-to-Storage transfers through both the standalone and hosted SDK:
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
const response = await revo.api.httpCall(
|
|
423
|
+
{ url: 'https://example.com/report.pdf', method: 'GET' },
|
|
424
|
+
{ responseType: 'storage', target: { name: 'report.pdf' } },
|
|
425
|
+
);
|
|
426
|
+
if (response.status >= 200 && response.status < 300 && response.storage) {
|
|
427
|
+
console.log(response.storage.entry);
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Use `requestType: 'storage'` with `source: { storageEntryId }` for a Storage request
|
|
432
|
+
body. Request and response modes are independent. Source/target references are flat
|
|
433
|
+
Storage objects; Files, nested `storage` and raw string identifiers are rejected.
|
|
434
|
+
Targets can create an entry, replace it using `{ storageEntryId, replace: true }`,
|
|
435
|
+
or fill and finalize an existing empty direct session using `{ storageUploadSessionId }`.
|
|
436
|
+
Only 2xx responses write Storage; other statuses return bounded diagnostic data.
|
|
437
|
+
|
|
438
|
+
`responseType: 'stream'` (bytes/SSE) is deliberately absent from SDK declarations
|
|
439
|
+
and rejects before discovery, queueing or transport, including the hosted
|
|
440
|
+
`CUSTOM_NODEJS` bridge. Storage responses remain supported. Local low-code V8 and
|
|
441
|
+
agent `code_exec` do support stream iterators: consume them inside the low-code
|
|
442
|
+
body, then return bounded serializable data. An SDK `execute(...)` call may run
|
|
443
|
+
such a body; it cannot return its iterator through the JSON transport.
|
|
444
|
+
|
|
445
|
+
### Developing coordinated platform contracts
|
|
446
|
+
|
|
447
|
+
After regenerating platform declarations, synchronize this checkout with:
|
|
448
|
+
|
|
449
|
+
```sh
|
|
450
|
+
REVOENGINE_PLATFORM_PATH=/path/to/platform node scripts/sync-contract.mjs --working-tree
|
|
451
|
+
REVOENGINE_PLATFORM_PATH=/path/to/platform npm run contract:check -- --working-tree
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Working-tree snapshots are explicitly unreleasable: the normal provenance/CI check
|
|
455
|
+
continues to require committed platform sources. After committing the platform
|
|
456
|
+
changes, run `sync-contract.mjs` without `--working-tree`, then run the normal
|
|
457
|
+
`contract:check` against that pinned commit before releasing the SDK.
|
|
458
|
+
|
|
402
459
|
## Storage
|
|
403
460
|
|
|
404
461
|
### Small text or binary objects
|