@hyperscale0/sdk 3.2.1 → 4.0.1
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 +4 -3
- package/client.d.ts +2 -4
- package/client.js +1 -11
- package/package.json +2 -2
- package/platform.d.ts +38 -87
- package/portal.d.ts +73 -133
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ const client = createClient({
|
|
|
11
11
|
apiKey: process.env.HYPERSCALE_API_KEY,
|
|
12
12
|
productId,
|
|
13
13
|
});
|
|
14
|
-
const discovery = await client.
|
|
14
|
+
const discovery = await client.discover();
|
|
15
15
|
// Choose a kind and supply metadata according to its createSchema.
|
|
16
16
|
const kind = discovery.kinds[0].kind;
|
|
17
17
|
const object = await client.call(
|
|
@@ -58,8 +58,9 @@ const result = await client.call(
|
|
|
58
58
|
`chosenActionName`, `collectedFields` and `collectedInput` are application inputs
|
|
59
59
|
from that review. Object creation does not create an agreement or move money.
|
|
60
60
|
Use `product.objects.list` and `product.objects.retrieve` to read stored objects.
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
`discover()` returns the authored object contract in one request, including fields
|
|
62
|
+
and exposed actions. All six operations also use the descriptor-backed generic
|
|
63
|
+
operation transport in `client.call`. Names and types match the operation descriptors.
|
|
63
64
|
|
|
64
65
|
Copy the whole target, including `instanceId` when present. Refresh availability
|
|
65
66
|
after a revision or Build conflict. Reuse the same key and body for an uncertain
|
package/client.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Operations,
|
|
3
|
+
product_objects_discoverOutput,
|
|
3
4
|
product_instruments_listOutput,
|
|
4
5
|
product_actions_listOutput,
|
|
5
6
|
} from "./platform.js";
|
|
@@ -32,10 +33,7 @@ export interface Client {
|
|
|
32
33
|
reminderDelivery(
|
|
33
34
|
operationId: string,
|
|
34
35
|
): Promise<payment_reminder_delivery_retrieveOutput>;
|
|
35
|
-
discover(): Promise<
|
|
36
|
-
instruments: product_instruments_listOutput;
|
|
37
|
-
actions: product_actions_listOutput;
|
|
38
|
-
}>;
|
|
36
|
+
discover(): Promise<product_objects_discoverOutput>;
|
|
39
37
|
call<Name extends keyof Operations>(
|
|
40
38
|
name: Name,
|
|
41
39
|
input: Operations[Name]["input"],
|
package/client.js
CHANGED
|
@@ -75,17 +75,7 @@ export function createClient({
|
|
|
75
75
|
request(
|
|
76
76
|
`${productPath}/payment-reminders/${encodeURIComponent(operationId)}`,
|
|
77
77
|
),
|
|
78
|
-
discover:
|
|
79
|
-
const [instruments, actions] = await Promise.all([
|
|
80
|
-
request(`${productPath}/instruments`),
|
|
81
|
-
request(`${productPath}/actions`),
|
|
82
|
-
]);
|
|
83
|
-
if (instruments.buildDigest !== actions.buildDigest)
|
|
84
|
-
throw new Error(
|
|
85
|
-
"Product Build changed during discovery; discover again",
|
|
86
|
-
);
|
|
87
|
-
return { instruments, actions };
|
|
88
|
-
},
|
|
78
|
+
discover: () => request(`${productPath}/objects`),
|
|
89
79
|
call: (name, input, { idempotencyKey } = {}) =>
|
|
90
80
|
request(
|
|
91
81
|
`/v1/operations/${encodeURIComponent(name)}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperscale0/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
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": "8e13de507f47ba25ac23662235302e643fa2267c"
|
|
26
26
|
}
|