@hyperscale0/sdk 1.0.125 → 1.0.130
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 +10 -2
- package/client.d.ts +1 -9
- package/client.js +0 -19
- package/package.json +2 -2
- package/platform.d.ts +14 -19
- package/portal.d.ts +0 -758
package/README.md
CHANGED
|
@@ -28,13 +28,15 @@ const available = await client.call("product.objects.actions", {
|
|
|
28
28
|
});
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
Choose the intended action by name
|
|
31
|
+
Choose the intended action by name and check `availability.status`. An
|
|
32
|
+
`unavailable` action lists its `blockers`. A `requires_input` action is runnable
|
|
33
|
+
once you supply what it names in `subjectFields` and `actionInputs`: collect its
|
|
32
34
|
`requiredNow` fields and requirements against `fieldsSchema` and `inputSchema`.
|
|
33
35
|
After that review, execute it with the complete context returned by the server:
|
|
34
36
|
|
|
35
37
|
```js
|
|
36
38
|
const action = available.actions.find((item) => item.name === chosenActionName);
|
|
37
|
-
if (!action || action.availability.status
|
|
39
|
+
if (!action || action.availability.status === "unavailable") {
|
|
38
40
|
throw new Error("The selected action is unavailable");
|
|
39
41
|
}
|
|
40
42
|
const result = await client.call(
|
|
@@ -62,6 +64,12 @@ Use `product.objects.list` and `product.objects.retrieve` to read stored objects
|
|
|
62
64
|
and exposed actions. All six operations also use the descriptor-backed generic
|
|
63
65
|
operation transport in `client.call`. Names and types match the operation descriptors.
|
|
64
66
|
|
|
67
|
+
To take a customer's step, such as a buyer paying into escrow, add
|
|
68
|
+
`onBehalfOf: "<customer id>"` to `product.objects.create`, `actions`, `execute`
|
|
69
|
+
or `preview`. The call runs with that customer's accounts, the Product key keeps
|
|
70
|
+
its view of every record, and the agreement records both the key and the
|
|
71
|
+
customer. A create with `onBehalfOf` makes that customer the owner.
|
|
72
|
+
|
|
65
73
|
Copy the whole target, including `instanceId` when present. Refresh availability
|
|
66
74
|
after a revision or Build conflict. Reuse the same key and body for an uncertain
|
|
67
75
|
request. The client never retries a mutation automatically.
|
package/client.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Operations,
|
|
3
|
+
payment_reminder_delivery_retrieveOutput,
|
|
3
4
|
product_objects_discoverOutput,
|
|
4
5
|
product_instruments_listOutput,
|
|
5
6
|
product_actions_listOutput,
|
|
6
7
|
} from "./platform.js";
|
|
7
8
|
export type * from "./platform.js";
|
|
8
9
|
|
|
9
|
-
import type {
|
|
10
|
-
sandbox_rehearsal_createOutput,
|
|
11
|
-
payment_reminder_delivery_retrieveOutput,
|
|
12
|
-
} from "./portal.js";
|
|
13
|
-
|
|
14
10
|
export interface ClientOptions {
|
|
15
11
|
apiKey?: string;
|
|
16
12
|
sessionToken?: string;
|
|
@@ -26,10 +22,6 @@ export interface ActionInput {
|
|
|
26
22
|
input?: Record<string, unknown>;
|
|
27
23
|
}
|
|
28
24
|
export interface Client {
|
|
29
|
-
rehearse(
|
|
30
|
-
name: string,
|
|
31
|
-
options: { idempotencyKey: string },
|
|
32
|
-
): Promise<sandbox_rehearsal_createOutput>;
|
|
33
25
|
reminderDelivery(
|
|
34
26
|
operationId: string,
|
|
35
27
|
): Promise<payment_reminder_delivery_retrieveOutput>;
|
package/client.js
CHANGED
|
@@ -300,14 +300,6 @@ const routes = {
|
|
|
300
300
|
],
|
|
301
301
|
"idempotency": "not_required"
|
|
302
302
|
},
|
|
303
|
-
"product.balance_sheet.retrieve": {
|
|
304
|
-
"method": "GET",
|
|
305
|
-
"path": "/v1/products/{productId}/balance-sheet",
|
|
306
|
-
"pathParams": [
|
|
307
|
-
"productId"
|
|
308
|
-
],
|
|
309
|
-
"idempotency": "not_required"
|
|
310
|
-
},
|
|
311
303
|
"product.blocks.summary": {
|
|
312
304
|
"method": "GET",
|
|
313
305
|
"path": "/v1/products/{productId}/blocks/summary",
|
|
@@ -742,17 +734,6 @@ export function createClient({
|
|
|
742
734
|
? `${productPath}/operations`
|
|
743
735
|
: "/v1/operations";
|
|
744
736
|
return {
|
|
745
|
-
rehearse: (name, { idempotencyKey } = {}) => {
|
|
746
|
-
if (!sessionToken || !idempotencyKey)
|
|
747
|
-
throw new Error(
|
|
748
|
-
"rehearse requires a tenant session and idempotency key",
|
|
749
|
-
);
|
|
750
|
-
return request(
|
|
751
|
-
"/v1/sandbox/rehearsals",
|
|
752
|
-
{ productId, name },
|
|
753
|
-
idempotencyKey,
|
|
754
|
-
);
|
|
755
|
-
},
|
|
756
737
|
reminderDelivery: (operationId) =>
|
|
757
738
|
request(
|
|
758
739
|
`${productPath}/payment-reminders/${encodeURIComponent(operationId)}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperscale0/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.130",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "LicenseRef-Hyperscale-Proprietary",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "3d768e3b8dd85648cb01257a02fef3b1e0b1ff57"
|
|
26
26
|
}
|