@revoengine/sdk 1.0.1 → 1.5.5

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
@@ -6,6 +6,21 @@ Revo-hosted `CUSTOM_NODEJS` components and standalone Node.js applications.
6
6
 
7
7
  Requirements: Node.js 22 or newer.
8
8
 
9
+ ## SDK 2.0.0 compatibility
10
+
11
+ This major 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
+
9
24
  ## Choose your runtime
10
25
 
11
26
  | Environment | How to start | Authentication |
@@ -37,16 +52,8 @@ RevoEngine pins that version again in the deployment package and injects the
37
52
  runtime into the component entrypoint. Component code does not construct a
38
53
  `RevoClient`.
39
54
 
40
- The relevant generated `package.json` fields are:
41
-
42
- ```json
43
- {
44
- "type": "module",
45
- "dependencies": {
46
- "@revoengine/sdk": "1.0.1"
47
- }
48
- }
49
- ```
55
+ The platform chooses the hosted package version; publishing SDK 2.0.0 does not
56
+ upgrade existing hosted deployments or their generated package pins.
50
57
 
51
58
  Hosted user code receives neither a tenant API key nor the private runtime
52
59
  credential and does not perform `/api/v1/me` discovery. The generated parent
@@ -399,6 +406,49 @@ Other context methods throw `RevoRuntimeContextUnavailableError` synchronously
399
406
  outside a hosted execution. The distinct `RevoApi` and `RevoStandaloneApi` types
400
407
  make the hosted snapshot and standalone discovery behavior explicit.
401
408
 
409
+ ## HTTP calls
410
+
411
+ `api.httpCall(request, options)` supports ordinary JSON/text/base64/document responses
412
+ and HTTP-to-Storage transfers through both the standalone and hosted SDK:
413
+
414
+ ```ts
415
+ const response = await revo.api.httpCall(
416
+ { url: 'https://example.com/report.pdf', method: 'GET' },
417
+ { responseType: 'storage', target: { name: 'report.pdf' } },
418
+ );
419
+ if (response.status >= 200 && response.status < 300 && response.storage) {
420
+ console.log(response.storage.entry);
421
+ }
422
+ ```
423
+
424
+ Use `requestType: 'storage'` with `source: { storageEntryId }` for a Storage request
425
+ body. Request and response modes are independent. Source/target references are flat
426
+ Storage objects; Files, nested `storage` and raw string identifiers are rejected.
427
+ Targets can create an entry, replace it using `{ storageEntryId, replace: true }`,
428
+ or fill and finalize an existing empty direct session using `{ storageUploadSessionId }`.
429
+ Only 2xx responses write Storage; other statuses return bounded diagnostic data.
430
+
431
+ `responseType: 'stream'` (bytes/SSE) is deliberately absent from SDK declarations
432
+ and rejects before discovery, queueing or transport, including the hosted
433
+ `CUSTOM_NODEJS` bridge. Storage responses remain supported. Local low-code V8 and
434
+ agent `code_exec` do support stream iterators: consume them inside the low-code
435
+ body, then return bounded serializable data. An SDK `execute(...)` call may run
436
+ such a body; it cannot return its iterator through the JSON transport.
437
+
438
+ ### Developing coordinated platform contracts
439
+
440
+ After regenerating platform declarations, synchronize this checkout with:
441
+
442
+ ```sh
443
+ REVOENGINE_PLATFORM_PATH=/path/to/platform node scripts/sync-contract.mjs --working-tree
444
+ REVOENGINE_PLATFORM_PATH=/path/to/platform npm run contract:check -- --working-tree
445
+ ```
446
+
447
+ Working-tree snapshots are explicitly unreleasable: the normal provenance/CI check
448
+ continues to require committed platform sources. After committing the platform
449
+ changes, run `sync-contract.mjs` without `--working-tree`, then run the normal
450
+ `contract:check` against that pinned commit before releasing the SDK.
451
+
402
452
  ## Storage
403
453
 
404
454
  ### Small text or binary objects