@calimero-network/mero-js 35.4.0 → 35.6.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.
@@ -335,8 +335,11 @@ export declare function withdrawConsent(scope: ReportScope, version: string, ret
335
335
  export declare function upgradeConsent(app: string, toVersion: string, returnTo: string): ConsentRequest & {
336
336
  kind: 'upgrade';
337
337
  };
338
- /** The consent request that creates an organization named `name`; its outcome names the new `orgId`. */
339
- export declare function createOrgConsent(name: string, returnTo: string): ConsentRequest & {
338
+ /**
339
+ * The consent request that creates an organization named `name`; its outcome names the new `orgId`.
340
+ * `capabilities` (`ORG_CAPABILITIES` bits) is what members get unless set for them, in place of the default.
341
+ */
342
+ export declare function createOrgConsent(name: string, returnTo: string, capabilities?: number): ConsentRequest & {
340
343
  kind: 'createOrg';
341
344
  };
342
345
  /** The consent request that creates an invite to `subject.org`; its outcome carries the invite's `token`. */
@@ -207,9 +207,12 @@ export function withdrawConsent(scope, version, returnTo) {
207
207
  export function upgradeConsent(app, toVersion, returnTo) {
208
208
  return { kind: 'upgrade', subject: { app, toVersion }, returnTo };
209
209
  }
210
- /** The consent request that creates an organization named `name`; its outcome names the new `orgId`. */
211
- export function createOrgConsent(name, returnTo) {
212
- return { kind: 'createOrg', subject: { name }, returnTo };
210
+ /**
211
+ * The consent request that creates an organization named `name`; its outcome names the new `orgId`.
212
+ * `capabilities` (`ORG_CAPABILITIES` bits) is what members get unless set for them, in place of the default.
213
+ */
214
+ export function createOrgConsent(name, returnTo, capabilities) {
215
+ return { kind: 'createOrg', subject: capabilities === undefined ? { name } : { name, capabilities }, returnTo };
213
216
  }
214
217
  /** The consent request that creates an invite to `subject.org`; its outcome carries the invite's `token`. */
215
218
  export function createInviteConsent(subject, returnTo) {
@@ -29,6 +29,8 @@ export declare const ORG_CAPABILITIES: {
29
29
  * (`client.orgs.publisher`). Organization-wide only. Bit 9 is left unused.
30
30
  */
31
31
  readonly APPROVE_RELEASES: number;
32
+ /** Create a restricted team below a team one writes, without leading it; the creator leads the new team. */
33
+ readonly CREATE_CHILD_TEAM: number;
32
34
  };
33
35
  export type OrgCapability = keyof typeof ORG_CAPABILITIES;
34
36
  /** What a member holds unless an admin says otherwise. */
@@ -29,6 +29,8 @@ export const ORG_CAPABILITIES = {
29
29
  * (`client.orgs.publisher`). Organization-wide only. Bit 9 is left unused.
30
30
  */
31
31
  APPROVE_RELEASES: 1 << 10,
32
+ /** Create a restricted team below a team one writes, without leading it; the creator leads the new team. */
33
+ CREATE_CHILD_TEAM: 1 << 11,
32
34
  };
33
35
  /** What a member holds unless an admin says otherwise. */
34
36
  export const DEFAULT_ORG_CAPABILITIES = ORG_CAPABILITIES.JOIN_OPEN_TEAMS;
@@ -2728,7 +2728,7 @@ export interface paths {
2728
2728
  put?: never;
2729
2729
  /**
2730
2730
  * Create an organization
2731
- * @description `recoveryKey` is the public half of an organization recovery key. Every account also has a personal organization from sign-up (`personal` in `/auth/me`), which this does not make.
2731
+ * @description `recoveryKey` is the public half of an organization recovery key. `capabilities` (bits) is what members can do unless set for them, in place of the default; `409 FEATURE_NOT_ACTIVE` below cluster version 1.0.0-rc.29. Every account also has a personal organization from sign-up (`personal` in `/auth/me`), which this does not make.
2732
2732
  *
2733
2733
  * **Who:** a passkey session (an API key is refused).
2734
2734
  */
@@ -2906,7 +2906,7 @@ export interface paths {
2906
2906
  put?: never;
2907
2907
  /**
2908
2908
  * Make an invite
2909
- * @description A token for `role` and `teams`, `uses` times within `ttlSecs`; `allApps` (an admin's) also gives every app added later. `412` first.
2909
+ * @description A token for `role` and `teams`, `uses` times within `ttlSecs`; `allApps` (an admin's) also gives every app added later; `capabilities` (bits) is what a new member gets as their own setting, no more than the creator holds (`403`), and `409 FEATURE_NOT_ACTIVE` below cluster version 1.0.0-rc.29. `412` first.
2910
2910
  *
2911
2911
  * **Who:** a passkey session (an API key is refused). **Step-up:** answers `412 CONFIRM_REQUIRED` first; send the same request again with `confirm`, a passkey assertion over `details.challenge`.
2912
2912
  */
@@ -3571,6 +3571,28 @@ export interface paths {
3571
3571
  patch?: never;
3572
3572
  trace?: never;
3573
3573
  };
3574
+ "/packages/{package}/{version}/capabilities": {
3575
+ parameters: {
3576
+ query?: never;
3577
+ header?: never;
3578
+ path?: never;
3579
+ cookie?: never;
3580
+ };
3581
+ /**
3582
+ * A release's capabilities
3583
+ * @description What the release is and may do, read from its signed manifest and the ABI its service component embeds, before any app of it exists: `bundle` is the service WASM's hash, `outbound` the sorted prefixes it may call out to and `abi` the embedded `calimero:abi` verbatim (`null` when it embeds none). `service` names the service whose card to read (default: the release's only one). A session bound to the package reads every release of it. `404` for a release the caller may not see, `400 NO_SUCH_SERVICE` for an unknown service or no `service` on a release with several, `400 BAD_REQUEST` for an over-long `service`.
3584
+ *
3585
+ * **Who:** signed in (a session or an API key).
3586
+ */
3587
+ get: operations["package_capabilities"];
3588
+ put?: never;
3589
+ post?: never;
3590
+ delete?: never;
3591
+ options?: never;
3592
+ head?: never;
3593
+ patch?: never;
3594
+ trace?: never;
3595
+ };
3574
3596
  "/packages/{package}/{version}/pipelines": {
3575
3597
  parameters: {
3576
3598
  query?: never;
@@ -10288,6 +10310,8 @@ export interface operations {
10288
10310
  kind: "createOrg";
10289
10311
  subject: {
10290
10312
  name: string;
10313
+ /** Format: int64 */
10314
+ capabilities?: number;
10291
10315
  };
10292
10316
  returnTo: string;
10293
10317
  } | {
@@ -10303,6 +10327,8 @@ export interface operations {
10303
10327
  /** Format: int64 */
10304
10328
  uses?: number;
10305
10329
  allApps?: boolean;
10330
+ /** Format: int64 */
10331
+ capabilities?: number;
10306
10332
  };
10307
10333
  returnTo: string;
10308
10334
  } | {
@@ -10423,7 +10449,7 @@ export interface operations {
10423
10449
  };
10424
10450
  };
10425
10451
  };
10426
- /** @description `BAD_REQUEST`: the request is malformed */
10452
+ /** @description `BAD_REQUEST`: the request is malformed; `UNKNOWN_CAPABILITIES` */
10427
10453
  400: {
10428
10454
  headers: {
10429
10455
  [name: string]: unknown;
@@ -10441,7 +10467,7 @@ export interface operations {
10441
10467
  "application/json": components["schemas"]["Error"];
10442
10468
  };
10443
10469
  };
10444
- /** @description `FORBIDDEN`: the credential may not do this (scope, role, governance, read-only) */
10470
+ /** @description `CANNOT_GRANT_UNHELD`; `FORBIDDEN`: the credential may not do this (scope, role, governance, read-only) */
10445
10471
  403: {
10446
10472
  headers: {
10447
10473
  [name: string]: unknown;
@@ -10450,6 +10476,15 @@ export interface operations {
10450
10476
  "application/json": components["schemas"]["Error"];
10451
10477
  };
10452
10478
  };
10479
+ /** @description `FEATURE_NOT_ACTIVE`. `details` of `FEATURE_NOT_ACTIVE`: a `FeatureNotActive`. */
10480
+ 409: {
10481
+ headers: {
10482
+ [name: string]: unknown;
10483
+ };
10484
+ content: {
10485
+ "application/json": components["schemas"]["Error"];
10486
+ };
10487
+ };
10453
10488
  /** @description `TOO_LARGE` */
10454
10489
  413: {
10455
10490
  headers: {
@@ -14035,6 +14070,8 @@ export interface operations {
14035
14070
  "application/json": {
14036
14071
  name: string;
14037
14072
  recoveryKey?: string;
14073
+ /** Format: int64 */
14074
+ capabilities?: number;
14038
14075
  };
14039
14076
  };
14040
14077
  };
@@ -14050,7 +14087,7 @@ export interface operations {
14050
14087
  };
14051
14088
  };
14052
14089
  };
14053
- /** @description `BAD_REQUEST`: the request is malformed */
14090
+ /** @description `BAD_REQUEST`: the request is malformed; `UNKNOWN_CAPABILITIES` */
14054
14091
  400: {
14055
14092
  headers: {
14056
14093
  [name: string]: unknown;
@@ -14077,6 +14114,15 @@ export interface operations {
14077
14114
  "application/json": components["schemas"]["Error"];
14078
14115
  };
14079
14116
  };
14117
+ /** @description `FEATURE_NOT_ACTIVE`. `details` of `FEATURE_NOT_ACTIVE`: a `FeatureNotActive`. */
14118
+ 409: {
14119
+ headers: {
14120
+ [name: string]: unknown;
14121
+ };
14122
+ content: {
14123
+ "application/json": components["schemas"]["Error"];
14124
+ };
14125
+ };
14080
14126
  /** @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) */
14081
14127
  421: {
14082
14128
  headers: {
@@ -14851,6 +14897,8 @@ export interface operations {
14851
14897
  /** Format: int64 */
14852
14898
  uses?: number;
14853
14899
  allApps?: boolean;
14900
+ /** Format: int64 */
14901
+ capabilities?: number;
14854
14902
  confirm?: components["schemas"]["Confirm"];
14855
14903
  };
14856
14904
  };
@@ -14867,7 +14915,7 @@ export interface operations {
14867
14915
  };
14868
14916
  };
14869
14917
  };
14870
- /** @description `EXPIRED_CHALLENGE`; `UNKNOWN_CHALLENGE`; `WRONG_CHALLENGE` */
14918
+ /** @description `EXPIRED_CHALLENGE`; `UNKNOWN_CAPABILITIES`; `UNKNOWN_CHALLENGE`; `WRONG_CHALLENGE` */
14871
14919
  400: {
14872
14920
  headers: {
14873
14921
  [name: string]: unknown;
@@ -14885,7 +14933,7 @@ export interface operations {
14885
14933
  "application/json": components["schemas"]["Error"];
14886
14934
  };
14887
14935
  };
14888
- /** @description `FORBIDDEN`: the credential may not do this (scope, role, governance, read-only) */
14936
+ /** @description `CANNOT_GRANT_UNHELD`; `FORBIDDEN`: the credential may not do this (scope, role, governance, read-only) */
14889
14937
  403: {
14890
14938
  headers: {
14891
14939
  [name: string]: unknown;
@@ -17486,6 +17534,80 @@ export interface operations {
17486
17534
  };
17487
17535
  };
17488
17536
  };
17537
+ package_capabilities: {
17538
+ parameters: {
17539
+ query?: {
17540
+ service?: string;
17541
+ };
17542
+ header?: never;
17543
+ path: {
17544
+ package: string;
17545
+ version: string;
17546
+ };
17547
+ cookie?: never;
17548
+ };
17549
+ requestBody?: never;
17550
+ responses: {
17551
+ /** @description OK */
17552
+ 200: {
17553
+ headers: {
17554
+ [name: string]: unknown;
17555
+ };
17556
+ content: {
17557
+ "application/json": {
17558
+ package: string;
17559
+ version: string;
17560
+ service: string | null;
17561
+ bundle: string;
17562
+ mpk: string;
17563
+ manifestHash: string;
17564
+ signer: string;
17565
+ name: string | null;
17566
+ author: string | null;
17567
+ outbound: string[];
17568
+ /** @description Free-form JSON: its shape is not this API's (see the description around it for whose it is). */
17569
+ abi: unknown;
17570
+ };
17571
+ };
17572
+ };
17573
+ /** @description `BAD_REQUEST`: the request is malformed; `NO_SUCH_SERVICE` */
17574
+ 400: {
17575
+ headers: {
17576
+ [name: string]: unknown;
17577
+ };
17578
+ content: {
17579
+ "application/json": components["schemas"]["Error"];
17580
+ };
17581
+ };
17582
+ /** @description `UNAUTHENTICATED`: no, unknown, expired or revoked credential */
17583
+ 401: {
17584
+ headers: {
17585
+ [name: string]: unknown;
17586
+ };
17587
+ content: {
17588
+ "application/json": components["schemas"]["Error"];
17589
+ };
17590
+ };
17591
+ /** @description `NOT_FOUND`: no such object, or one the caller may not see */
17592
+ 404: {
17593
+ headers: {
17594
+ [name: string]: unknown;
17595
+ };
17596
+ content: {
17597
+ "application/json": components["schemas"]["Error"];
17598
+ };
17599
+ };
17600
+ /** @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) */
17601
+ 421: {
17602
+ headers: {
17603
+ [name: string]: unknown;
17604
+ };
17605
+ content: {
17606
+ "application/json": components["schemas"]["Error"];
17607
+ };
17608
+ };
17609
+ };
17610
+ };
17489
17611
  package_pipelines: {
17490
17612
  parameters: {
17491
17613
  query?: never;
@@ -1325,6 +1325,13 @@ export declare function createRoutes(api: RouteClient): {
1325
1325
  * A `421 WRONG_NODE` moves the client to the next node of the cluster.
1326
1326
  */
1327
1327
  bundlePut: (args: RawBody, options?: MethodOptions) => Promise<operations["bundle_put"]["responses"][200]["content"]["application/json"]>;
1328
+ /**
1329
+ * A release's capabilities.
1330
+ *
1331
+ * `GET /packages/{package}/{version}/capabilities` (`package_capabilities`). **Who:** signed in (a session or an API key).
1332
+ * A `421 WRONG_NODE` moves the client to the next node of the cluster.
1333
+ */
1334
+ capabilities: (args: operations["package_capabilities"]["parameters"]["path"] & NonNullable<operations["package_capabilities"]["parameters"]["query"]>, options?: MethodOptions) => Promise<operations["package_capabilities"]["responses"][200]["content"]["application/json"]>;
1328
1335
  /**
1329
1336
  * One package.
1330
1337
  *
@@ -1331,6 +1331,13 @@ export function createRoutes(api) {
1331
1331
  * A `421 WRONG_NODE` moves the client to the next node of the cluster.
1332
1332
  */
1333
1333
  bundlePut: (args, options) => route(api, { "method": "POST", "path": "/bundles", "pathParams": [], "query": [], "body": "raw", "optionalBody": false, "media": "application/wasm", "reply": "json" }, args, options),
1334
+ /**
1335
+ * A release's capabilities.
1336
+ *
1337
+ * `GET /packages/{package}/{version}/capabilities` (`package_capabilities`). **Who:** signed in (a session or an API key).
1338
+ * A `421 WRONG_NODE` moves the client to the next node of the cluster.
1339
+ */
1340
+ capabilities: (args, options) => route(api, { "method": "GET", "path": "/packages/{package}/{version}/capabilities", "pathParams": ["package", "version"], "query": ["service"], "body": "none", "optionalBody": false, "reply": "json" }, args, options),
1334
1341
  /**
1335
1342
  * One package.
1336
1343
  *