@calimero-network/mero-js 7.3.1 → 8.0.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.
Files changed (127) hide show
  1. package/dist/admin-api/admin-client.d.ts +1 -3
  2. package/dist/admin-api/admin-client.js +0 -4
  3. package/dist/admin-api/admin-factory.d.ts +10 -4
  4. package/dist/admin-api/admin-factory.js +14 -34
  5. package/dist/admin-api/admin-types.d.ts +65 -32
  6. package/dist/admin-api/admin-types.js +0 -1
  7. package/dist/admin-api/index.d.ts +0 -1
  8. package/dist/admin-api/index.js +0 -1
  9. package/dist/auth/index.d.ts +0 -1
  10. package/dist/auth/index.js +0 -1
  11. package/dist/auth-api/auth-client.d.ts +0 -1
  12. package/dist/auth-api/auth-client.js +0 -1
  13. package/dist/auth-api/auth-factory.d.ts +0 -1
  14. package/dist/auth-api/auth-factory.js +0 -1
  15. package/dist/auth-api/auth-types.d.ts +0 -1
  16. package/dist/auth-api/auth-types.js +0 -1
  17. package/dist/auth-api/index.d.ts +0 -1
  18. package/dist/auth-api/index.js +0 -1
  19. package/dist/capabilities.d.ts +0 -1
  20. package/dist/capabilities.js +0 -1
  21. package/dist/cloud/cloud-client.d.ts +0 -1
  22. package/dist/cloud/cloud-client.js +0 -1
  23. package/dist/cloud/index.d.ts +0 -1
  24. package/dist/cloud/index.js +0 -1
  25. package/dist/events/group.d.ts +0 -1
  26. package/dist/events/group.js +0 -1
  27. package/dist/events/index.d.ts +0 -1
  28. package/dist/events/index.js +0 -1
  29. package/dist/events/sse.d.ts +0 -1
  30. package/dist/events/sse.js +0 -1
  31. package/dist/events/ws.d.ts +0 -1
  32. package/dist/events/ws.js +0 -1
  33. package/dist/http-client/api-response.d.ts +0 -1
  34. package/dist/http-client/api-response.js +0 -1
  35. package/dist/http-client/http-factory.d.ts +0 -1
  36. package/dist/http-client/http-factory.js +0 -1
  37. package/dist/http-client/http-types.d.ts +0 -1
  38. package/dist/http-client/http-types.js +0 -1
  39. package/dist/http-client/index.d.ts +0 -1
  40. package/dist/http-client/index.js +0 -1
  41. package/dist/http-client/retry.d.ts +0 -1
  42. package/dist/http-client/retry.js +0 -1
  43. package/dist/http-client/signal-utils.d.ts +0 -1
  44. package/dist/http-client/signal-utils.js +0 -1
  45. package/dist/http-client/web-client.d.ts +0 -1
  46. package/dist/http-client/web-client.js +26 -2
  47. package/dist/index.browser.mjs +2 -2
  48. package/dist/index.browser.mjs.map +3 -3
  49. package/dist/index.cjs +26 -51
  50. package/dist/index.cjs.map +3 -3
  51. package/dist/index.d.ts +0 -1
  52. package/dist/index.js +0 -1
  53. package/dist/index.mjs +26 -51
  54. package/dist/index.mjs.map +3 -3
  55. package/dist/mero-js.d.ts +8 -1
  56. package/dist/mero-js.js +8 -3
  57. package/dist/nodeDiscovery.d.ts +0 -1
  58. package/dist/nodeDiscovery.js +0 -1
  59. package/dist/rpc/index.d.ts +0 -1
  60. package/dist/rpc/index.js +0 -1
  61. package/dist/token-store/index.d.ts +0 -1
  62. package/dist/token-store/index.js +0 -1
  63. package/dist/types/api-response.d.ts +0 -1
  64. package/dist/types/api-response.js +0 -1
  65. package/dist/types/index.d.ts +0 -1
  66. package/dist/types/index.js +0 -1
  67. package/package.json +3 -5
  68. package/dist/admin-api/admin-client.d.ts.map +0 -1
  69. package/dist/admin-api/admin-client.js.map +0 -1
  70. package/dist/admin-api/admin-factory.d.ts.map +0 -1
  71. package/dist/admin-api/admin-factory.js.map +0 -1
  72. package/dist/admin-api/admin-types.d.ts.map +0 -1
  73. package/dist/admin-api/admin-types.js.map +0 -1
  74. package/dist/admin-api/index.d.ts.map +0 -1
  75. package/dist/admin-api/index.js.map +0 -1
  76. package/dist/auth/index.d.ts.map +0 -1
  77. package/dist/auth/index.js.map +0 -1
  78. package/dist/auth-api/auth-client.d.ts.map +0 -1
  79. package/dist/auth-api/auth-client.js.map +0 -1
  80. package/dist/auth-api/auth-factory.d.ts.map +0 -1
  81. package/dist/auth-api/auth-factory.js.map +0 -1
  82. package/dist/auth-api/auth-types.d.ts.map +0 -1
  83. package/dist/auth-api/auth-types.js.map +0 -1
  84. package/dist/auth-api/index.d.ts.map +0 -1
  85. package/dist/auth-api/index.js.map +0 -1
  86. package/dist/capabilities.d.ts.map +0 -1
  87. package/dist/capabilities.js.map +0 -1
  88. package/dist/cloud/cloud-client.d.ts.map +0 -1
  89. package/dist/cloud/cloud-client.js.map +0 -1
  90. package/dist/cloud/index.d.ts.map +0 -1
  91. package/dist/cloud/index.js.map +0 -1
  92. package/dist/events/group.d.ts.map +0 -1
  93. package/dist/events/group.js.map +0 -1
  94. package/dist/events/index.d.ts.map +0 -1
  95. package/dist/events/index.js.map +0 -1
  96. package/dist/events/sse.d.ts.map +0 -1
  97. package/dist/events/sse.js.map +0 -1
  98. package/dist/events/ws.d.ts.map +0 -1
  99. package/dist/events/ws.js.map +0 -1
  100. package/dist/http-client/api-response.d.ts.map +0 -1
  101. package/dist/http-client/api-response.js.map +0 -1
  102. package/dist/http-client/http-factory.d.ts.map +0 -1
  103. package/dist/http-client/http-factory.js.map +0 -1
  104. package/dist/http-client/http-types.d.ts.map +0 -1
  105. package/dist/http-client/http-types.js.map +0 -1
  106. package/dist/http-client/index.d.ts.map +0 -1
  107. package/dist/http-client/index.js.map +0 -1
  108. package/dist/http-client/retry.d.ts.map +0 -1
  109. package/dist/http-client/retry.js.map +0 -1
  110. package/dist/http-client/signal-utils.d.ts.map +0 -1
  111. package/dist/http-client/signal-utils.js.map +0 -1
  112. package/dist/http-client/web-client.d.ts.map +0 -1
  113. package/dist/http-client/web-client.js.map +0 -1
  114. package/dist/index.d.ts.map +0 -1
  115. package/dist/index.js.map +0 -1
  116. package/dist/mero-js.d.ts.map +0 -1
  117. package/dist/mero-js.js.map +0 -1
  118. package/dist/nodeDiscovery.d.ts.map +0 -1
  119. package/dist/nodeDiscovery.js.map +0 -1
  120. package/dist/rpc/index.d.ts.map +0 -1
  121. package/dist/rpc/index.js.map +0 -1
  122. package/dist/token-store/index.d.ts.map +0 -1
  123. package/dist/token-store/index.js.map +0 -1
  124. package/dist/types/api-response.d.ts.map +0 -1
  125. package/dist/types/api-response.js.map +0 -1
  126. package/dist/types/index.d.ts.map +0 -1
  127. package/dist/types/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '../http-client/index.js';
2
- import type { HealthStatus, AdminAuthStatus, InstallApplicationRequest, InstallApplicationResponseData, InstallDevApplicationRequest, UninstallApplicationResponseData, ListApplicationsResponseData, GetApplicationResponseData, ApplicationVersionEntry, GetApplicationAbiResponseData, GetLatestVersionResponseData, ListPackagesResponseData, ListVersionsResponseData, CreateContextRequest, CreateContextResponseData, DeleteContextRequest, DeleteContextResponseData, GetContextsResponseData, Context, GenerateContextIdentityResponseData, GetContextIdentitiesResponseData, JoinContextResponseData, JoinSubgroupInheritanceResponseData, ContextGroupResponseData, ContextStorageResponseData, InviteSpecializedNodeRequest, InviteSpecializedNodeResponseData, UpdateContextApplicationRequest, ResyncContextRequest, ResyncContextResponseData, ContextsWithExecutorsResponseData, UploadBlobRequest, UploadBlobResponseData, DeleteBlobResponseData, ListBlobsResponseData, GetBlobInfoResponseData, CreateContextAliasRequest, CreateApplicationAliasRequest, CreateContextIdentityAliasRequest, CreateAliasResponseData, LookupAliasResponseData, DeleteAliasResponseData, ListAliasesResponseData, ListContextIdentityAliasesResponseData, CreateContextIdentityAliasResponseData, LookupContextIdentityAliasResponseData, DeleteContextIdentityAliasResponseData, ListNamespacesResponseData, CreateNamespaceRequest, CreateNamespaceResponseData, DeleteNamespaceRequest, DeleteNamespaceResponseData, CreateNamespaceInvitationRequest, CreateNamespaceInvitationResponseData, CreateRecursiveInvitationResponseData, JoinNamespaceRequest, JoinNamespaceResponseData, CreateGroupInNamespaceRequest, CreateGroupInNamespaceResponseData, SubgroupEntry, Namespace, NamespaceIdentity, GroupInfoResponseData, DeleteGroupRequest, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, UpdateGroupSettingsRequest, SetGroupMetadataRequest, SetMemberMetadataRequest, SetContextMetadataRequest, MetadataRecord, SyncGroupRequest, SyncGroupResponseData, RegisterGroupSigningKeyRequest, RegisterGroupSigningKeyResponseData, UpgradeGroupRequest, UpgradeGroupResponseData, GroupUpgradeStatusResponseData, MigrationStatus, CascadeStatusEntry, RetryGroupUpgradeRequest, RetryGroupUpgradeResponseData, ReparentGroupRequest, ReparentGroupResponseData, DetachContextFromGroupRequest, CreateGroupInvitationRequest, CreateGroupInvitationResponseData, CreateRecursiveGroupInvitationResponseData, JoinGroupRequest, JoinGroupResponseData, TeeInfoResponseData, TeeAttestRequest, TeeAttestResponseData, TeeVerifyQuoteRequest, TeeVerifyQuoteResponseData } from './admin-types.js';
2
+ import type { HealthStatus, AdminAuthStatus, InstallApplicationRequest, InstallApplicationResponseData, InstallDevApplicationRequest, UninstallApplicationResponseData, ListApplicationsResponseData, GetApplicationResponseData, ApplicationVersionEntry, GetApplicationAbiResponseData, GetLatestVersionResponseData, ListPackagesResponseData, ListVersionsResponseData, CreateContextRequest, CreateContextResponseData, DeleteContextRequest, DeleteContextResponseData, GetContextsResponseData, Context, GenerateContextIdentityResponseData, GetContextIdentitiesResponseData, JoinContextResponseData, JoinSubgroupInheritanceResponseData, ContextGroupResponseData, ContextStorageResponseData, InviteSpecializedNodeRequest, InviteSpecializedNodeResponseData, UpdateContextApplicationRequest, ResyncContextRequest, ResyncContextResponseData, ContextsWithExecutorsResponseData, UploadBlobRequest, UploadBlobResponseData, DeleteBlobResponseData, ListBlobsResponseData, GetBlobInfoResponseData, CreateContextAliasRequest, CreateApplicationAliasRequest, CreateContextIdentityAliasRequest, CreateAliasResponseData, LookupAliasResponseData, DeleteAliasResponseData, ListAliasesResponseData, ListContextIdentityAliasesResponseData, CreateContextIdentityAliasResponseData, LookupContextIdentityAliasResponseData, DeleteContextIdentityAliasResponseData, ListNamespacesResponseData, CreateNamespaceRequest, CreateNamespaceResponseData, DeleteNamespaceRequest, DeleteNamespaceResponseData, CreateNamespaceInvitationRequest, CreateNamespaceInvitationResponseData, CreateRecursiveInvitationResponseData, JoinNamespaceRequest, JoinNamespaceResponseData, CreateGroupInNamespaceRequest, CreateGroupInNamespaceResponseData, SubgroupEntry, Namespace, NamespaceIdentity, GroupInfoResponseData, DeleteGroupRequest, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, SetGroupMetadataRequest, SetMemberMetadataRequest, SetContextMetadataRequest, MetadataRecord, SyncGroupRequest, SyncGroupResponseData, RegisterGroupSigningKeyRequest, RegisterGroupSigningKeyResponseData, UpgradeGroupRequest, UpgradeGroupResponseData, GroupUpgradeStatusResponseData, MigrationStatus, CascadeStatusEntry, RetryGroupUpgradeRequest, RetryGroupUpgradeResponseData, ReparentGroupRequest, ReparentGroupResponseData, DetachContextFromGroupRequest, CreateGroupInvitationRequest, CreateGroupInvitationResponseData, CreateRecursiveGroupInvitationResponseData, JoinGroupRequest, JoinGroupResponseData, TeeInfoResponseData, TeeAttestRequest, TeeAttestResponseData, TeeVerifyQuoteRequest, TeeVerifyQuoteResponseData } from './admin-types.js';
3
3
  /**
4
4
  * Compare two version strings by SemVer 2.0 precedence, ascending: negative if
5
5
  * `a < b`, positive if `a > b`, `0` if equal. Build metadata (`+...`) is stripped
@@ -128,7 +128,6 @@ export declare class AdminApiClient {
128
128
  setSubgroupVisibility(groupId: string, request: SetSubgroupVisibilityRequest): Promise<void>;
129
129
  setTeeAdmissionPolicy(groupId: string, request: SetTeeAdmissionPolicyRequest): Promise<void>;
130
130
  getTeeAdmissionPolicy(groupId: string): Promise<GetTeeAdmissionPolicyResponseData>;
131
- updateGroupSettings(groupId: string, request: UpdateGroupSettingsRequest): Promise<void>;
132
131
  setGroupMetadata(groupId: string, request: SetGroupMetadataRequest): Promise<void>;
133
132
  getGroupMetadata(groupId: string): Promise<MetadataRecord | null>;
134
133
  setMemberMetadata(groupId: string, identity: string, request: SetMemberMetadataRequest): Promise<void>;
@@ -186,4 +185,3 @@ export declare class AdminApiClient {
186
185
  /** Abort a namespace migration (POST /admin-api/groups/:namespace_id/migration/abort). */
187
186
  abortMigration(namespaceId: string, request?: Record<string, unknown>): Promise<unknown>;
188
187
  }
189
- //# sourceMappingURL=admin-client.d.ts.map
@@ -485,9 +485,6 @@ export class AdminApiClient {
485
485
  const response = await this.httpClient.get(`/admin-api/groups/${groupId}/settings/tee-admission-policy`);
486
486
  return response.data ?? response;
487
487
  }
488
- async updateGroupSettings(groupId, request) {
489
- await this.httpClient.patch(`/admin-api/groups/${groupId}`, request);
490
- }
491
488
  // ---- Group / member / context metadata ----
492
489
  async setGroupMetadata(groupId, request) {
493
490
  await this.httpClient.put(`/admin-api/groups/${groupId}/metadata`, request);
@@ -628,4 +625,3 @@ export class AdminApiClient {
628
625
  return this.httpClient.post(`/admin-api/groups/${namespaceId}/migration/abort`, request ?? {});
629
626
  }
630
627
  }
631
- //# sourceMappingURL=admin-client.js.map
@@ -1,8 +1,14 @@
1
1
  import { AdminApiClient } from './admin-client.js';
2
2
  import { AdminApiClientConfig } from './admin-types.js';
3
3
  import { HttpClient } from '../http-client/index.js';
4
- export declare function createBrowserAdminApiClient(_config: AdminApiClientConfig): AdminApiClient;
5
- export declare function createNodeAdminApiClient(_config: AdminApiClientConfig): AdminApiClient;
6
- export declare function createAdminApiClient(_config: AdminApiClientConfig): AdminApiClient;
4
+ /** Admin client over a browser HTTP transport (global `fetch`). */
5
+ export declare function createBrowserAdminApiClient(config: AdminApiClientConfig): AdminApiClient;
6
+ /** Admin client over a Node HTTP transport (Node 18+ `fetch`). */
7
+ export declare function createNodeAdminApiClient(config: AdminApiClientConfig): AdminApiClient;
8
+ /** Admin client over whichever transport suits the current runtime. */
9
+ export declare function createAdminApiClient(config: AdminApiClientConfig): AdminApiClient;
10
+ /**
11
+ * Admin client over a caller-supplied HTTP client — use this to share one
12
+ * transport (and its token handling) with the other API clients.
13
+ */
7
14
  export declare function createAdminApiClientFromHttpClient(httpClient: HttpClient, _config: AdminApiClientConfig): AdminApiClient;
8
- //# sourceMappingURL=admin-factory.d.ts.map
@@ -1,42 +1,22 @@
1
1
  import { AdminApiClient } from './admin-client.js';
2
- // Mock HTTP client for testing
3
- class MockHttpClient {
4
- async get() {
5
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
6
- }
7
- async post() {
8
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
9
- }
10
- async put() {
11
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
12
- }
13
- async delete() {
14
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
15
- }
16
- async patch() {
17
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
18
- }
19
- async head() {
20
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
21
- }
22
- async request() {
23
- throw new Error('HTTP client not implemented - use createAdminApiClientFromHttpClient with a real HTTP client');
24
- }
25
- }
2
+ import { createBrowserHttpClient, createNodeHttpClient, createUniversalHttpClient, } from '../http-client/index.js';
26
3
  // Factory functions for creating Admin API clients
27
- export function createBrowserAdminApiClient(_config) {
28
- const httpClient = new MockHttpClient();
29
- return new AdminApiClient(httpClient);
4
+ /** Admin client over a browser HTTP transport (global `fetch`). */
5
+ export function createBrowserAdminApiClient(config) {
6
+ return new AdminApiClient(createBrowserHttpClient(config));
30
7
  }
31
- export function createNodeAdminApiClient(_config) {
32
- const httpClient = new MockHttpClient();
33
- return new AdminApiClient(httpClient);
8
+ /** Admin client over a Node HTTP transport (Node 18+ `fetch`). */
9
+ export function createNodeAdminApiClient(config) {
10
+ return new AdminApiClient(createNodeHttpClient(config));
34
11
  }
35
- export function createAdminApiClient(_config) {
36
- const httpClient = new MockHttpClient();
37
- return new AdminApiClient(httpClient);
12
+ /** Admin client over whichever transport suits the current runtime. */
13
+ export function createAdminApiClient(config) {
14
+ return new AdminApiClient(createUniversalHttpClient(config));
38
15
  }
16
+ /**
17
+ * Admin client over a caller-supplied HTTP client — use this to share one
18
+ * transport (and its token handling) with the other API clients.
19
+ */
39
20
  export function createAdminApiClientFromHttpClient(httpClient, _config) {
40
21
  return new AdminApiClient(httpClient);
41
22
  }
42
- //# sourceMappingURL=admin-factory.js.map
@@ -26,18 +26,24 @@ export interface InstallApplicationResponseData {
26
26
  export interface UninstallApplicationResponseData {
27
27
  applicationId: string;
28
28
  }
29
+ export interface ApplicationBlob {
30
+ bytecode: string;
31
+ compiled: string;
32
+ }
29
33
  export interface Application {
30
34
  id: string;
31
- blob: {
32
- bytecode: string;
33
- compiled: string;
34
- };
35
+ blob: ApplicationBlob;
35
36
  size: number;
36
37
  source: string;
37
38
  metadata: number[];
38
- signer_id: string;
39
- package: string;
40
- version: string;
39
+ /** Absent for a raw-wasm install (no signed bundle) and for bootstrap stubs. */
40
+ signer_id?: string;
41
+ /** Absent on a bootstrap stub row, written before the app's blob arrives. */
42
+ package?: string;
43
+ /** Absent when the stored version is empty or not valid semver. */
44
+ version?: string;
45
+ /** Named services of a multi-service bundle; absent for single-service apps. */
46
+ services?: Record<string, ApplicationBlob>;
41
47
  }
42
48
  export interface ListApplicationsResponseData {
43
49
  apps: Application[];
@@ -70,9 +76,9 @@ export interface ListVersionsResponseData {
70
76
  /**
71
77
  * Per-service migration descriptor carried in a multi-service bundle manifest,
72
78
  * emitted from the app's `#[app::migrate]` declaration. `toSchemaVersion` is the
73
- * CRDT schema version the migrate targets (the engine's gate); `toVersion` is
74
- * the user-facing bundle semver an admin matches on; `method` is the migrate
75
- * entrypoint.
79
+ * ABI state version the migrate targets (from `#[app::state(version = N)]`,
80
+ * the engine's gate) — NOT the bundle semver, which is `toVersion`, the
81
+ * user-facing string an admin matches on; `method` is the migrate entrypoint.
76
82
  */
77
83
  export interface BundleMigration {
78
84
  method: string;
@@ -122,7 +128,8 @@ export interface Context {
122
128
  * namespaceStateHash). Renamed from `rootHash`, which never populated.
123
129
  */
124
130
  contextStateHash: string;
125
- dagHeads: number[][];
131
+ /** Absent while the context has no deltas yet (core omits an empty list). */
132
+ dagHeads?: number[][];
126
133
  /** Bundle semver of the installed application (skew #2). Absent on older nodes. */
127
134
  applicationVersion?: string;
128
135
  }
@@ -214,13 +221,12 @@ export interface CreateContextIdentityAliasRequest {
214
221
  alias: string;
215
222
  identity: string;
216
223
  }
217
- export interface AliasEntry {
218
- name: string;
219
- value: string;
220
- }
221
- export interface ListAliasesResponseData {
222
- aliases: AliasEntry[];
223
- }
224
+ /**
225
+ * Core's `ListAliasesResponse` is `{ data: BTreeMap<Alias<T>, T> }`, so once the
226
+ * `data` envelope is stripped the payload is a flat `{ alias: id }` map — not a
227
+ * list of entries. Applies to context, application and context-identity aliases.
228
+ */
229
+ export type ListAliasesResponseData = Record<string, string>;
224
230
  export type CreateAliasResponseData = Record<string, never>;
225
231
  export type DeleteAliasResponseData = Record<string, never>;
226
232
  export interface LookupAliasResponseData {
@@ -232,16 +238,44 @@ export interface LookupContextIdentityAliasResponseData {
232
238
  value?: string;
233
239
  }
234
240
  export type DeleteContextIdentityAliasResponseData = Record<string, never>;
241
+ /**
242
+ * The signed half of an invitation. Wire keys are snake_case: this type mirrors
243
+ * a core primitive (`calimero_context_config::types`), which carries no
244
+ * camelCase rename — unlike the admin DTOs that wrap it.
245
+ */
235
246
  export interface GroupInvitationFromAdmin {
236
- inviterIdentity: number[];
237
- groupId: number[];
238
- expirationTimestamp: number;
239
- secretSalt: number[];
240
- invitedRole?: number;
247
+ readonly inviter_identity: number[];
248
+ readonly group_id: number[];
249
+ readonly expiration_timestamp: number;
250
+ /** Per-invitation nonce; core keeps the legacy `secret_salt` wire name. */
251
+ readonly secret_salt: number[];
252
+ readonly invited_role: number;
241
253
  }
254
+ /**
255
+ * An invitation blob the node signed. **Opaque: pass it through unchanged.**
256
+ *
257
+ * `inviter_signature` covers `invitation`, and the trailing bootstrap fields
258
+ * (`application_id`, `app_key`) are needed by the joiner even though they sit
259
+ * outside the signature — so a value that has been rebuilt field-by-field is
260
+ * not the value the node signed. Rebuilding is what a schema derived from these
261
+ * declarations does: an object schema drops the keys it wasn't told about, and
262
+ * core may add more (both trailing fields were added this way). Carry the value
263
+ * verbatim from the call that produced it to {@link JoinGroupRequest}, and treat
264
+ * the fields below as read-only detail for display.
265
+ *
266
+ * The `never`-typed brand makes that structural: an object literal or a schema
267
+ * result cannot satisfy this type, while a value the SDK returned — or one
268
+ * recovered with `JSON.parse` after transport — still does.
269
+ */
242
270
  export interface SignedGroupOpenInvitation {
243
- invitation: GroupInvitationFromAdmin;
244
- inviterSignature: string;
271
+ readonly invitation: GroupInvitationFromAdmin;
272
+ readonly inviter_signature: string;
273
+ /** Unsigned bootstrap field; absent on invitations from older nodes. */
274
+ readonly application_id?: number[];
275
+ /** Unsigned bootstrap field; absent on invitations from older nodes. */
276
+ readonly app_key?: number[];
277
+ /** @internal Brand — never present at runtime, never write it. */
278
+ readonly __nodeSigned: never;
245
279
  }
246
280
  export interface RecursiveInvitationEntry {
247
281
  groupId: string;
@@ -258,6 +292,12 @@ export interface Namespace {
258
292
  memberCount: number;
259
293
  contextCount: number;
260
294
  subgroupCount: number;
295
+ /**
296
+ * Bundle version of this namespace's `appKey` blob — the per-namespace truth,
297
+ * where the application row only says "latest fetched". Absent when core
298
+ * cannot resolve it (raw-wasm app, legacy key, blob not retained locally).
299
+ */
300
+ appVersion?: string;
261
301
  }
262
302
  export type ListNamespacesResponseData = Namespace[];
263
303
  export interface NamespaceIdentity {
@@ -342,7 +382,6 @@ export type MigrationFailureReason = 'check_aborted' | 'apply_failed' | 'no_migr
342
382
  export interface MemberMigrationReport {
343
383
  schemaVersion: number;
344
384
  residueAuto: number;
345
- residueIdentity: number;
346
385
  syncedUpToHlc: number;
347
386
  reportedAt: number;
348
387
  /** Member's self-reported pending-authored count (best-effort; skew #1). */
@@ -483,11 +522,6 @@ export interface GetTeeAdmissionPolicyResponseData {
483
522
  allowedTcbStatuses: string[];
484
523
  acceptMock: boolean;
485
524
  }
486
- export interface UpdateGroupSettingsRequest {
487
- upgradePolicy: string;
488
- requester?: string;
489
- }
490
- export type UpdateGroupSettingsResponseData = Record<string, never>;
491
525
  /**
492
526
  * Generic metadata record attached to a group, group member, or
493
527
  * context-registered-in-a-group (core `calimero_primitives::metadata::MetadataRecord`).
@@ -665,4 +699,3 @@ export interface AdminApiClientConfig {
665
699
  getAuthToken?: () => Promise<string | undefined>;
666
700
  timeoutMs?: number;
667
701
  }
668
- //# sourceMappingURL=admin-types.d.ts.map
@@ -1,4 +1,3 @@
1
1
  // Admin API Types — aligned with core server routes
2
2
  // All types use camelCase to match core's #[serde(rename_all = "camelCase")]
3
3
  export {};
4
- //# sourceMappingURL=admin-types.js.map
@@ -1,4 +1,3 @@
1
1
  export * from './admin-client.js';
2
2
  export * from './admin-types.js';
3
3
  export * from './admin-factory.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  export * from './admin-client.js';
3
3
  export * from './admin-types.js';
4
4
  export * from './admin-factory.js';
5
- //# sourceMappingURL=index.js.map
@@ -23,4 +23,3 @@ export declare function parseAuthCallback(url: string): AuthCallbackResult | nul
23
23
  * Build the auth login URL for redirecting users to the node's auth page.
24
24
  */
25
25
  export declare function buildAuthLoginUrl(nodeUrl: string, opts: AuthLoginOptions): string;
26
- //# sourceMappingURL=index.d.ts.map
@@ -48,4 +48,3 @@ export function buildAuthLoginUrl(nodeUrl, opts) {
48
48
  const base = nodeUrl.replace(/\/+$/, '');
49
49
  return `${base}/auth/login?${params.toString()}`;
50
50
  }
51
- //# sourceMappingURL=index.js.map
@@ -29,4 +29,3 @@ export declare class AuthApiClient {
29
29
  getKeyPermissions(keyId: string): Promise<PermissionResponse>;
30
30
  updateKeyPermissions(keyId: string, changes: UpdateKeyPermissionsRequest): Promise<PermissionResponse>;
31
31
  }
32
- //# sourceMappingURL=auth-client.d.ts.map
@@ -114,4 +114,3 @@ export class AuthApiClient {
114
114
  return this.httpClient.put(`/admin/keys/${keyId}/permissions`, { add: changes.add, remove: changes.remove });
115
115
  }
116
116
  }
117
- //# sourceMappingURL=auth-client.js.map
@@ -5,4 +5,3 @@ export declare function createBrowserAuthApiClient(_config: AuthApiClientConfig)
5
5
  export declare function createNodeAuthApiClient(_config: AuthApiClientConfig): AuthApiClient;
6
6
  export declare function createAuthApiClient(_config: AuthApiClientConfig): AuthApiClient;
7
7
  export declare function createAuthApiClientFromHttpClient(httpClient: HttpClient, _config: AuthApiClientConfig): AuthApiClient;
8
- //# sourceMappingURL=auth-factory.d.ts.map
@@ -39,4 +39,3 @@ export function createAuthApiClient(_config) {
39
39
  export function createAuthApiClientFromHttpClient(httpClient, _config) {
40
40
  return new AuthApiClient(httpClient);
41
41
  }
42
- //# sourceMappingURL=auth-factory.js.map
@@ -120,4 +120,3 @@ export interface AuthApiClientConfig {
120
120
  getAuthToken?: () => Promise<string | undefined>;
121
121
  timeoutMs?: number;
122
122
  }
123
- //# sourceMappingURL=auth-types.d.ts.map
@@ -1,3 +1,2 @@
1
1
  // Auth API Types - Generated from OpenAPI 3.0.3 specification
2
2
  export {};
3
- //# sourceMappingURL=auth-types.js.map
@@ -1,4 +1,3 @@
1
1
  export * from './auth-client.js';
2
2
  export * from './auth-types.js';
3
3
  export * from './auth-factory.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  export * from './auth-client.js';
3
3
  export * from './auth-types.js';
4
4
  export * from './auth-factory.js';
5
- //# sourceMappingURL=index.js.map
@@ -28,4 +28,3 @@ export declare function hasCap(mask: number, cap: number): boolean;
28
28
  export declare function withCap(mask: number, cap: number): number;
29
29
  /** Returns `mask` with every bit of `cap` cleared (u32-normalized). */
30
30
  export declare function withoutCap(mask: number, cap: number): number;
31
- //# sourceMappingURL=capabilities.d.ts.map
@@ -39,4 +39,3 @@ export function withCap(mask, cap) {
39
39
  export function withoutCap(mask, cap) {
40
40
  return (mask & ~cap) >>> 0;
41
41
  }
42
- //# sourceMappingURL=capabilities.js.map
@@ -17,4 +17,3 @@ export declare class CloudClient {
17
17
  enableHA(options: EnableHAOptions): void;
18
18
  disableHA(options: DisableHAOptions): void;
19
19
  }
20
- //# sourceMappingURL=cloud-client.d.ts.map
@@ -23,4 +23,3 @@ export class CloudClient {
23
23
  window.open(`${this.baseUrl}/disable-ha?${params.toString()}`);
24
24
  }
25
25
  }
26
- //# sourceMappingURL=cloud-client.js.map
@@ -1,3 +1,2 @@
1
1
  export { CloudClient } from './cloud-client.js';
2
2
  export type { CloudClientConfig, EnableHAOptions, DisableHAOptions } from './cloud-client.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { CloudClient } from './cloud-client.js';
2
- //# sourceMappingURL=index.js.map
@@ -7,4 +7,3 @@ export interface GroupMembershipEventData {
7
7
  role?: string;
8
8
  };
9
9
  }
10
- //# sourceMappingURL=group.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=group.js.map
@@ -3,4 +3,3 @@ export type { SseEventData, AppVersionChangedEvent } from './sse.js';
3
3
  export { WsClient } from './ws.js';
4
4
  export type { WsEventData } from './ws.js';
5
5
  export type { GroupMembershipEventData } from './group.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { SseClient } from './sse.js';
2
2
  export { WsClient } from './ws.js';
3
- //# sourceMappingURL=index.js.map
@@ -61,4 +61,3 @@ export declare class SseClient {
61
61
  private scheduleReconnect;
62
62
  close(): void;
63
63
  }
64
- //# sourceMappingURL=sse.d.ts.map
@@ -285,4 +285,3 @@ export class SseClient {
285
285
  this.subscribedGroupIds.clear();
286
286
  }
287
287
  }
288
- //# sourceMappingURL=sse.js.map
@@ -52,4 +52,3 @@ export declare class WsClient {
52
52
  private scheduleReconnect;
53
53
  close(): void;
54
54
  }
55
- //# sourceMappingURL=ws.d.ts.map
package/dist/events/ws.js CHANGED
@@ -209,4 +209,3 @@ export class WsClient {
209
209
  }
210
210
  }
211
211
  WsClient.MAX_BACKOFF_MS = 30000;
212
- //# sourceMappingURL=ws.js.map
@@ -13,4 +13,3 @@ export type ApiResponse<D = unknown> = Promise<ResponseData<D>>;
13
13
  export interface SuccessResponse {
14
14
  success: boolean;
15
15
  }
16
- //# sourceMappingURL=api-response.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=api-response.js.map
@@ -65,4 +65,3 @@ export declare function createUniversalHttpClient(options: {
65
65
  credentials?: RequestCredentials;
66
66
  defaultAbortSignal?: AbortSignal;
67
67
  }): HttpClient;
68
- //# sourceMappingURL=http-factory.d.ts.map
@@ -64,4 +64,3 @@ export function createUniversalHttpClient(options) {
64
64
  return createNodeHttpClient(options);
65
65
  }
66
66
  }
67
- //# sourceMappingURL=http-factory.js.map
@@ -52,4 +52,3 @@ export interface HeadResponse {
52
52
  export interface LegacyRequestOptions {
53
53
  responseType?: 'arraybuffer' | 'blob' | 'json';
54
54
  }
55
- //# sourceMappingURL=http-types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=http-types.js.map
@@ -5,4 +5,3 @@ export { createHttpClient, createBrowserHttpClient, createNodeHttpClient, create
5
5
  export { withRetry, createRetryableMethod } from './retry.js';
6
6
  export type { RetryOptions } from './retry.js';
7
7
  export { combineSignals, createTimeoutSignal } from './signal-utils.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -9,4 +9,3 @@ export { createHttpClient, createBrowserHttpClient, createNodeHttpClient, create
9
9
  export { withRetry, createRetryableMethod } from './retry.js';
10
10
  // Signal utilities
11
11
  export { combineSignals, createTimeoutSignal } from './signal-utils.js';
12
- //# sourceMappingURL=index.js.map
@@ -3,4 +3,3 @@ export interface RetryOptions {
3
3
  }
4
4
  export declare function withRetry<T>(fn: (attempt: number) => Promise<T>, options?: RetryOptions): Promise<T>;
5
5
  export declare function createRetryableMethod<T extends unknown[], R>(method: (...args: T) => Promise<R>, retryOptions?: RetryOptions): (...args: T) => Promise<R>;
6
- //# sourceMappingURL=retry.d.ts.map
@@ -80,4 +80,3 @@ export function createRetryableMethod(method, retryOptions = {}) {
80
80
  return withRetry(() => method(...args), retryOptions);
81
81
  };
82
82
  }
83
- //# sourceMappingURL=retry.js.map
@@ -1,3 +1,2 @@
1
1
  export declare function combineSignals(signals: Array<AbortSignal | undefined>): AbortSignal | undefined;
2
2
  export declare function createTimeoutSignal(timeoutMs: number): AbortSignal;
3
- //# sourceMappingURL=signal-utils.d.ts.map
@@ -39,4 +39,3 @@ export function createTimeoutSignal(timeoutMs) {
39
39
  }, timeoutMs);
40
40
  return controller.signal;
41
41
  }
42
- //# sourceMappingURL=signal-utils.js.map
@@ -52,4 +52,3 @@ export declare class WebHttpClient implements HttpClient {
52
52
  private parseResponse;
53
53
  private getBodyText;
54
54
  }
55
- //# sourceMappingURL=web-client.d.ts.map
@@ -8,10 +8,35 @@ import { combineSignals, createTimeoutSignal } from './signal-utils.js';
8
8
  * a fresh login.
9
9
  */
10
10
  const TERMINAL_AUTH_ERRORS = new Set(['token_reuse', 'token_revoked']);
11
+ /**
12
+ * Pull the node's explanation out of an error body. Core answers every handled
13
+ * failure with `{"error": "<message>"}` (`ApiError::into_response`); the nested
14
+ * `{"error": {"message": ...}}` form is what proxies in front of a node emit.
15
+ * Returns undefined for a non-JSON, empty, or envelope-less body.
16
+ */
17
+ function extractErrorMessage(bodyText) {
18
+ if (!bodyText)
19
+ return undefined;
20
+ try {
21
+ const error = JSON.parse(bodyText)?.error;
22
+ if (typeof error === 'string' && error.trim() !== '')
23
+ return error;
24
+ const nested = error?.message;
25
+ if (typeof nested === 'string' && nested.trim() !== '')
26
+ return nested;
27
+ }
28
+ catch {
29
+ // Not JSON — the status line is all we can honestly report.
30
+ }
31
+ return undefined;
32
+ }
11
33
  // Custom error class for HTTP errors
12
34
  export class HTTPError extends Error {
13
35
  constructor(status, statusText, url, headers, bodyText) {
14
- super(`HTTP ${status} ${statusText}`);
36
+ const explanation = extractErrorMessage(bodyText);
37
+ super(explanation
38
+ ? `HTTP ${status} ${statusText}: ${explanation}`
39
+ : `HTTP ${status} ${statusText}`);
15
40
  this.status = status;
16
41
  this.statusText = statusText;
17
42
  this.url = url;
@@ -424,4 +449,3 @@ export class WebHttpClient {
424
449
  }
425
450
  }
426
451
  }
427
- //# sourceMappingURL=web-client.js.map