@calimero-network/mero-js 35.1.0 → 35.2.0
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 +20 -9
- package/dist/generated/api.d.ts +83 -1
- package/dist/generated/methods.d.ts +7 -0
- package/dist/generated/methods.js +7 -0
- package/dist/index.browser.mjs +3 -3
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ people in with WebAuthn passkeys and machines with API keys, and calls apps that
|
|
|
7
7
|
each run on their own replicated log. It runs in the browser and Node 18+, and is
|
|
8
8
|
byte-compatible with core's `calimero-sealed` and `calimero-client`.
|
|
9
9
|
|
|
10
|
-
> **
|
|
10
|
+
> **From version 27 this is the Calimero 1.0 client only.** The v1 SDK for merod 0.x nodes
|
|
11
11
|
> (`MeroJs`, the admin and auth API clients, JSON-RPC, contexts and namespaces)
|
|
12
12
|
> is in 26.x. See [Migrating from v1](https://calimero-network.github.io/mero-js/reference/migrating-from-v1/).
|
|
13
13
|
|
|
@@ -42,6 +42,7 @@ const client = await CalimeroClient.connect({
|
|
|
42
42
|
|
|
43
43
|
await client.signUp(browserPasskey(), 'alice'); // or signIn(browserPasskey())
|
|
44
44
|
await client.packages.install({ package: 'com.example.kv', version: '1.0.0' }); // signed .mpk from the registry
|
|
45
|
+
// No `org`: the instance goes in your personal organization, which sign-up made.
|
|
45
46
|
const { appId: app } = await client.apps.create({ name: 'kv', package: 'com.example.kv', version: '1.0.0' });
|
|
46
47
|
|
|
47
48
|
await client.apps.call({ app, method: 'set', args: { key: 'a', value: '1' } });
|
|
@@ -295,9 +296,9 @@ callable (`(await client.packages.list()).packages`).
|
|
|
295
296
|
| `upgradeOrg(org, target, passkey)` | `client.orgs.upgrade({ org, ...target }, { confirm: passkeyConfirm(passkey) })` |
|
|
296
297
|
| `upgradeRun(org, run)` | `client.orgs.upgradeStatus({ org, run })` |
|
|
297
298
|
| `retryUpgradeRun(org, run, passkey)` | `client.orgs.upgradeRetry({ org, run }, { confirm: passkeyConfirm(passkey) })` |
|
|
298
|
-
| `approveRelease(org, version, passkey, approved)` | `client.
|
|
299
|
-
| `approveOutbound(org, pkg, passkey, options)` | `client.
|
|
300
|
-
| `appsReport(org, page)` | `client.
|
|
299
|
+
| `approveRelease(org, version, passkey, approved)` | `client.orgs.releaseApproval({ org, version, approved }, { confirm: passkeyConfirm(passkey) })` (an account's own apps are in its personal organization: approve there; core 1.0.0-rc.20 removed the account-level approval) |
|
|
300
|
+
| `approveOutbound(org, pkg, passkey, options)` | `client.orgs.outboundApproval({ org, package: pkg, ...options }, { confirm: passkeyConfirm(passkey) })` (the personal organization's for the account's own apps, as above) |
|
|
301
|
+
| `appsReport(org, page)` | `client.orgs.apps({ org, ...page })`; `client.auth.accountApps({ ...page })` lists the apps the account owns in any organization |
|
|
301
302
|
| `releaseRules()` | `client.public.releasesPublic()` |
|
|
302
303
|
| `requestConsent(request)` | `client.consent.pageCreate({ body: request })` |
|
|
303
304
|
| `consentResult(requestId)` | `client.consent.pageResult({ request: requestId })` |
|
|
@@ -365,11 +366,21 @@ run the client against them:
|
|
|
365
366
|
MEROD_BINARY=/path/to/merod KV_STORE_WASM=/path/to/kv_store.wasm pnpm test:cluster
|
|
366
367
|
```
|
|
367
368
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
core
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
`KV_STORE_WASM` is core's kv component (`apps/v2-fixtures/kv`, a `calimero:app`
|
|
370
|
+
component for `wasm32-wasip2`). Without the variables they use
|
|
371
|
+
`../core/target/debug/merod` and `../core/target/app-components/kv.wasm` from a
|
|
372
|
+
sibling core checkout, built there as core's `e2e.yml` builds them:
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
cargo build -p merod
|
|
376
|
+
scripts/install-mero-app-build.sh
|
|
377
|
+
mero-app-build apps/v2-fixtures/kv --out target/app-components/kv.wasm
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
`scripts/download-released-merod.sh` fetches the newest released 1.0 `merod`
|
|
381
|
+
and the `app.wasm` of its `kv-store-test-fixture.mpk` (as `./merod` and
|
|
382
|
+
`./kv_store.wasm`), which is what CI runs them against; core's `e2e.yml` runs
|
|
383
|
+
the same suite against core's own tree.
|
|
373
384
|
|
|
374
385
|
## License
|
|
375
386
|
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -805,6 +805,28 @@ export interface paths {
|
|
|
805
805
|
patch?: never;
|
|
806
806
|
trace?: never;
|
|
807
807
|
};
|
|
808
|
+
"/apps/{app}/runs/{run}/logs": {
|
|
809
|
+
parameters: {
|
|
810
|
+
query?: never;
|
|
811
|
+
header?: never;
|
|
812
|
+
path?: never;
|
|
813
|
+
cookie?: never;
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* A compute run's attempt logs
|
|
817
|
+
* @description Each attempt's module log, as a sealed file of the app: `{ attempt, id, size, sha256 }`. Only for those who may handle the app's files; the bytes are a files export.
|
|
818
|
+
*
|
|
819
|
+
* **Who:** signed in (a session or an API key).
|
|
820
|
+
*/
|
|
821
|
+
get: operations["app_run_logs"];
|
|
822
|
+
put?: never;
|
|
823
|
+
post?: never;
|
|
824
|
+
delete?: never;
|
|
825
|
+
options?: never;
|
|
826
|
+
head?: never;
|
|
827
|
+
patch?: never;
|
|
828
|
+
trace?: never;
|
|
829
|
+
};
|
|
808
830
|
"/apps/{app}/storage": {
|
|
809
831
|
parameters: {
|
|
810
832
|
query?: never;
|
|
@@ -1622,7 +1644,7 @@ export interface paths {
|
|
|
1622
1644
|
};
|
|
1623
1645
|
/**
|
|
1624
1646
|
* What became of a consent request
|
|
1625
|
-
* @description `decidedAt` (Unix seconds) is `null` while it is pending. `outcome`, once approved, is what the approval made: `{ orgId }` for `createOrg`, `{ token }` for `createInvite`, `{ org }` for `acceptInvite`, `{ orgId, name }` for `renameOrg`, `{ apps }` (the apps deleted) for `deleteOrg`; absent for the other kinds.
|
|
1647
|
+
* @description `decidedAt` (Unix seconds) is `null` while it is pending. `outcome`, once approved, is what the approval made: `{ orgId }` for `createOrg` (with `teamId`, the asking app's own team the organization starts with, when an app's frontend asked on a cluster that makes it), `{ token }` for `createInvite`, `{ org }` for `acceptInvite`, `{ orgId, name }` for `renameOrg`, `{ apps }` (the apps deleted) for `deleteOrg`; absent for the other kinds.
|
|
1626
1648
|
*
|
|
1627
1649
|
* **Who:** a passkey session (an API key is refused).
|
|
1628
1650
|
*/
|
|
@@ -7589,6 +7611,65 @@ export interface operations {
|
|
|
7589
7611
|
};
|
|
7590
7612
|
};
|
|
7591
7613
|
};
|
|
7614
|
+
app_run_logs: {
|
|
7615
|
+
parameters: {
|
|
7616
|
+
query?: never;
|
|
7617
|
+
header?: never;
|
|
7618
|
+
path: {
|
|
7619
|
+
app: string;
|
|
7620
|
+
run: string;
|
|
7621
|
+
};
|
|
7622
|
+
cookie?: never;
|
|
7623
|
+
};
|
|
7624
|
+
requestBody?: never;
|
|
7625
|
+
responses: {
|
|
7626
|
+
/** @description OK */
|
|
7627
|
+
200: {
|
|
7628
|
+
headers: {
|
|
7629
|
+
[name: string]: unknown;
|
|
7630
|
+
};
|
|
7631
|
+
content: {
|
|
7632
|
+
"application/json": {
|
|
7633
|
+
logs: {
|
|
7634
|
+
/** Format: int64 */
|
|
7635
|
+
attempt: number;
|
|
7636
|
+
id: string;
|
|
7637
|
+
/** Format: int64 */
|
|
7638
|
+
size: number;
|
|
7639
|
+
sha256: string;
|
|
7640
|
+
}[];
|
|
7641
|
+
};
|
|
7642
|
+
};
|
|
7643
|
+
};
|
|
7644
|
+
/** @description `UNAUTHENTICATED`: no, unknown, expired or revoked credential */
|
|
7645
|
+
401: {
|
|
7646
|
+
headers: {
|
|
7647
|
+
[name: string]: unknown;
|
|
7648
|
+
};
|
|
7649
|
+
content: {
|
|
7650
|
+
"application/json": components["schemas"]["Error"];
|
|
7651
|
+
};
|
|
7652
|
+
};
|
|
7653
|
+
/** @description `NOT_FOUND`: no such object, or one the caller may not see */
|
|
7654
|
+
404: {
|
|
7655
|
+
headers: {
|
|
7656
|
+
[name: string]: unknown;
|
|
7657
|
+
};
|
|
7658
|
+
content: {
|
|
7659
|
+
"application/json": components["schemas"]["Error"];
|
|
7660
|
+
};
|
|
7661
|
+
};
|
|
7662
|
+
/** @description `WRONG_NODE`: this node runs a release the account's owners have not approved, so it neither issues nor takes the account's sessions; send it to another node of the cluster (no `details`; nothing was spent) */
|
|
7663
|
+
421: {
|
|
7664
|
+
headers: {
|
|
7665
|
+
[name: string]: unknown;
|
|
7666
|
+
};
|
|
7667
|
+
content: {
|
|
7668
|
+
"application/json": components["schemas"]["Error"];
|
|
7669
|
+
};
|
|
7670
|
+
};
|
|
7671
|
+
};
|
|
7672
|
+
};
|
|
7592
7673
|
app_storage: {
|
|
7593
7674
|
parameters: {
|
|
7594
7675
|
query?: never;
|
|
@@ -10364,6 +10445,7 @@ export interface operations {
|
|
|
10364
10445
|
decidedAt: number | null;
|
|
10365
10446
|
outcome?: {
|
|
10366
10447
|
orgId?: string;
|
|
10448
|
+
teamId?: string;
|
|
10367
10449
|
token?: string;
|
|
10368
10450
|
org?: string;
|
|
10369
10451
|
name?: string;
|
|
@@ -247,6 +247,13 @@ export declare function createRoutes(api: RouteClient): {
|
|
|
247
247
|
* A `421 WRONG_NODE` moves the client to the next node of the cluster.
|
|
248
248
|
*/
|
|
249
249
|
run: (args: operations["app_run"]["parameters"]["path"], options?: MethodOptions) => Promise<operations["app_run"]["responses"][200]["content"]["application/json"]>;
|
|
250
|
+
/**
|
|
251
|
+
* A compute run's attempt logs.
|
|
252
|
+
*
|
|
253
|
+
* `GET /apps/{app}/runs/{run}/logs` (`app_run_logs`). **Who:** signed in (a session or an API key).
|
|
254
|
+
* A `421 WRONG_NODE` moves the client to the next node of the cluster.
|
|
255
|
+
*/
|
|
256
|
+
runLogs: (args: operations["app_run_logs"]["parameters"]["path"], options?: MethodOptions) => Promise<operations["app_run_logs"]["responses"][200]["content"]["application/json"]>;
|
|
250
257
|
/**
|
|
251
258
|
* An app's compute runs.
|
|
252
259
|
*
|
|
@@ -255,6 +255,13 @@ export function createRoutes(api) {
|
|
|
255
255
|
* A `421 WRONG_NODE` moves the client to the next node of the cluster.
|
|
256
256
|
*/
|
|
257
257
|
run: (args, options) => route(api, { "method": "GET", "path": "/apps/{app}/runs/{run}", "pathParams": ["app", "run"], "query": [], "body": "none", "optionalBody": false, "reply": "json" }, args, options),
|
|
258
|
+
/**
|
|
259
|
+
* A compute run's attempt logs.
|
|
260
|
+
*
|
|
261
|
+
* `GET /apps/{app}/runs/{run}/logs` (`app_run_logs`). **Who:** signed in (a session or an API key).
|
|
262
|
+
* A `421 WRONG_NODE` moves the client to the next node of the cluster.
|
|
263
|
+
*/
|
|
264
|
+
runLogs: (args, options) => route(api, { "method": "GET", "path": "/apps/{app}/runs/{run}/logs", "pathParams": ["app", "run"], "query": [], "body": "none", "optionalBody": false, "reply": "json" }, args, options),
|
|
258
265
|
/**
|
|
259
266
|
* An app's compute runs.
|
|
260
267
|
*
|