@tinycloud/web-sdk 1.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 (65) hide show
  1. package/LICENSE.md +320 -0
  2. package/README.md +151 -0
  3. package/dist/625.index.js +1 -0
  4. package/dist/authorization/WebSpaceCreationHandler.d.ts +40 -0
  5. package/dist/authorization/WebSpaceCreationHandler.d.ts.map +1 -0
  6. package/dist/authorization/WebUserAuthorization.d.ts +295 -0
  7. package/dist/authorization/WebUserAuthorization.d.ts.map +1 -0
  8. package/dist/authorization/index.d.ts +12 -0
  9. package/dist/authorization/index.d.ts.map +1 -0
  10. package/dist/delegation.d.ts +85 -0
  11. package/dist/delegation.d.ts.map +1 -0
  12. package/dist/index.d.ts +16 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +1 -0
  15. package/dist/modules/Storage/index.d.ts +2 -0
  16. package/dist/modules/Storage/index.d.ts.map +1 -0
  17. package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts +24 -0
  18. package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts.map +1 -0
  19. package/dist/modules/Storage/tinycloud/index.d.ts +3 -0
  20. package/dist/modules/Storage/tinycloud/index.d.ts.map +1 -0
  21. package/dist/modules/Storage/tinycloud/module.d.ts +10 -0
  22. package/dist/modules/Storage/tinycloud/module.d.ts.map +1 -0
  23. package/dist/modules/Storage/tinycloud/types.d.ts +64 -0
  24. package/dist/modules/Storage/tinycloud/types.d.ts.map +1 -0
  25. package/dist/modules/Storage/tinycloud/types.schema.d.ts +159 -0
  26. package/dist/modules/Storage/tinycloud/types.schema.d.ts.map +1 -0
  27. package/dist/modules/UserAuthorization.d.ts +361 -0
  28. package/dist/modules/UserAuthorization.d.ts.map +1 -0
  29. package/dist/modules/WasmInitializer.d.ts +26 -0
  30. package/dist/modules/WasmInitializer.d.ts.map +1 -0
  31. package/dist/modules/index.d.ts +6 -0
  32. package/dist/modules/index.d.ts.map +1 -0
  33. package/dist/modules/keys/WasmKeyProvider.d.ts +126 -0
  34. package/dist/modules/keys/WasmKeyProvider.d.ts.map +1 -0
  35. package/dist/modules/keys/index.d.ts +7 -0
  36. package/dist/modules/keys/index.d.ts.map +1 -0
  37. package/dist/modules/registry/Registry.d.ts +59 -0
  38. package/dist/modules/registry/Registry.d.ts.map +1 -0
  39. package/dist/modules/tcw.d.ts +718 -0
  40. package/dist/modules/tcw.d.ts.map +1 -0
  41. package/dist/notifications/ErrorHandler.d.ts +32 -0
  42. package/dist/notifications/ErrorHandler.d.ts.map +1 -0
  43. package/dist/notifications/ModalManager.d.ts +15 -0
  44. package/dist/notifications/ModalManager.d.ts.map +1 -0
  45. package/dist/notifications/NodeSelectionModal.d.ts +29 -0
  46. package/dist/notifications/NodeSelectionModal.d.ts.map +1 -0
  47. package/dist/notifications/SpaceCreationModal.d.ts +28 -0
  48. package/dist/notifications/SpaceCreationModal.d.ts.map +1 -0
  49. package/dist/notifications/ToastContainer.d.ts +16 -0
  50. package/dist/notifications/ToastContainer.d.ts.map +1 -0
  51. package/dist/notifications/ToastElement.d.ts +22 -0
  52. package/dist/notifications/ToastElement.d.ts.map +1 -0
  53. package/dist/notifications/ToastManager.d.ts +36 -0
  54. package/dist/notifications/ToastManager.d.ts.map +1 -0
  55. package/dist/notifications/index.d.ts +9 -0
  56. package/dist/notifications/index.d.ts.map +1 -0
  57. package/dist/notifications/types.d.ts +37 -0
  58. package/dist/notifications/types.d.ts.map +1 -0
  59. package/dist/notifications/types.schema.d.ts +224 -0
  60. package/dist/notifications/types.schema.d.ts.map +1 -0
  61. package/dist/utils/debug.d.ts +9 -0
  62. package/dist/utils/debug.d.ts.map +1 -0
  63. package/dist/utils/multiaddr.d.ts +36 -0
  64. package/dist/utils/multiaddr.d.ts.map +1 -0
  65. package/package.json +82 -0
@@ -0,0 +1,2 @@
1
+ export * from './tinycloud';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/Storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { IKVService } from "@tinycloud/sdk-core";
2
+ import { Session } from "./types";
3
+ /**
4
+ * Create a KVService instance from web-sdk Session.
5
+ *
6
+ * This adapter bridges the web-sdk Session type to the sdk-core KVService,
7
+ * allowing platform-agnostic code to use the shared KV service implementation.
8
+ *
9
+ * @param host - The TinyCloud host URL
10
+ * @param session - The web-sdk Session
11
+ * @returns An IKVService instance
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const session = await tinycloud.space();
16
+ * const kvService = createKVService("https://tinycloud.example.com", session);
17
+ *
18
+ * // Use the KV service
19
+ * await kvService.put("key", { data: "value" });
20
+ * const result = await kvService.get("key");
21
+ * ```
22
+ */
23
+ export declare function createKVService(host: string, session: Session): IKVService;
24
+ //# sourceMappingURL=KVServiceAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KVServiceAdapter.d.ts","sourceRoot":"","sources":["../../../../src/modules/Storage/tinycloud/KVServiceAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAkB,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,CAc1E"}
@@ -0,0 +1,3 @@
1
+ export { SessionConfig, Session, HostConfig } from './types';
2
+ export { createKVService } from './KVServiceAdapter';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/Storage/tinycloud/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { tinycloud } from '@tinycloud/web-sdk-wasm';
2
+ type TinyCloudModule = typeof tinycloud;
3
+ export declare const makeSpaceId: TinyCloudModule['makeSpaceId'];
4
+ export declare const prepareSession: TinyCloudModule['prepareSession'];
5
+ export declare const completeSessionSetup: TinyCloudModule['completeSessionSetup'];
6
+ export declare const invoke: TinyCloudModule['invoke'];
7
+ export declare const generateHostSIWEMessage: TinyCloudModule['generateHostSIWEMessage'];
8
+ export declare const siweToDelegationHeaders: TinyCloudModule['siweToDelegationHeaders'];
9
+ export {};
10
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/modules/Storage/tinycloud/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,KAAK,eAAe,GAAG,OAAO,SAAS,CAAC;AAYxC,eAAO,MAAM,WAAW,EAAE,eAAe,CAAC,aAAa,CAMtD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAM5D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,sBAAsB,CAQxE,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,eAAe,CAAC,QAAQ,CAM5C,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,yBAAyB,CAO5E,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,yBAAyB,CAO5E,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Configuration object for starting a TinyCloud session.
3
+ */
4
+ export type SessionConfig = {
5
+ /** Actions that the session key will be permitted to perform, organized by service and path */
6
+ actions: {
7
+ [service: string]: {
8
+ [key: string]: string[];
9
+ };
10
+ };
11
+ /** Ethereum address. */
12
+ address: string;
13
+ /** Chain ID. */
14
+ chainId: number;
15
+ /** Domain of the webpage. */
16
+ domain: string;
17
+ /** Current time for SIWE message. */
18
+ issuedAt: string;
19
+ /** The space that is the target resource of the delegation. */
20
+ spaceId: string;
21
+ /** The earliest time that the session will be valid from. */
22
+ notBefore?: string;
23
+ /** The latest time that the session will be valid until. */
24
+ expirationTime: string;
25
+ /** Optional parent delegations to inherit and attenuate */
26
+ parents?: string[];
27
+ /** Optional jwk to delegate to */
28
+ jwk?: object;
29
+ };
30
+ /**
31
+ * A TinyCloud session.
32
+ */
33
+ export type Session = {
34
+ /** The delegation from the user to the session key. */
35
+ delegationHeader: {
36
+ Authorization: string;
37
+ };
38
+ /** The delegation reference from the user to the session key. */
39
+ delegationCid: string;
40
+ /** The session key. */
41
+ jwk: object;
42
+ /** The space that the session key is permitted to perform actions against. */
43
+ spaceId: string;
44
+ /** The verification method of the session key. */
45
+ verificationMethod: string;
46
+ };
47
+ /**
48
+ * Configuration object for generating a Space Host Delegation SIWE message.
49
+ */
50
+ export type HostConfig = {
51
+ /** Ethereum address. */
52
+ address: string;
53
+ /** Chain ID. */
54
+ chainId: number;
55
+ /** Domain of the webpage. */
56
+ domain: string;
57
+ /** Current time for SIWE message. */
58
+ issuedAt: string;
59
+ /** The space that is the target resource of the delegation. */
60
+ spaceId: string;
61
+ /** The peer that is the target/invoker in the delegation. */
62
+ peerId: string;
63
+ };
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modules/Storage/tinycloud/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,+FAA+F;IAC/F,OAAO,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;IAC5D,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,kCAAkC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,uDAAuD;IACvD,gBAAgB,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Zod schemas for TinyCloud storage session and configuration types.
3
+ *
4
+ * These schemas provide runtime validation for session configuration,
5
+ * active sessions, and host configuration. Types are derived from
6
+ * schemas using z.infer<>.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ import { z } from "zod";
11
+ /**
12
+ * Configuration object for starting a TinyCloud session.
13
+ */
14
+ export declare const SessionConfigSchema: z.ZodObject<{
15
+ /** Actions that the session key will be permitted to perform, organized by service and path */
16
+ actions: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
17
+ /** Ethereum address. */
18
+ address: z.ZodString;
19
+ /** Chain ID. */
20
+ chainId: z.ZodNumber;
21
+ /** Domain of the webpage. */
22
+ domain: z.ZodString;
23
+ /** Current time for SIWE message (ISO 8601 format). */
24
+ issuedAt: z.ZodString;
25
+ /** The space that is the target resource of the delegation. */
26
+ spaceId: z.ZodString;
27
+ /** The earliest time that the session will be valid from. */
28
+ notBefore: z.ZodOptional<z.ZodString>;
29
+ /** The latest time that the session will be valid until. */
30
+ expirationTime: z.ZodString;
31
+ /** Optional parent delegations to inherit and attenuate */
32
+ parents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
33
+ /** Optional jwk to delegate to */
34
+ jwk: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ spaceId?: string;
37
+ actions?: Record<string, Record<string, string[]>>;
38
+ address?: string;
39
+ chainId?: number;
40
+ domain?: string;
41
+ issuedAt?: string;
42
+ expirationTime?: string;
43
+ notBefore?: string;
44
+ jwk?: Record<string, unknown>;
45
+ parents?: string[];
46
+ }, {
47
+ spaceId?: string;
48
+ actions?: Record<string, Record<string, string[]>>;
49
+ address?: string;
50
+ chainId?: number;
51
+ domain?: string;
52
+ issuedAt?: string;
53
+ expirationTime?: string;
54
+ notBefore?: string;
55
+ jwk?: Record<string, unknown>;
56
+ parents?: string[];
57
+ }>;
58
+ export type SessionConfig = z.infer<typeof SessionConfigSchema>;
59
+ /**
60
+ * A TinyCloud session.
61
+ */
62
+ export declare const SessionSchema: z.ZodObject<{
63
+ /** The delegation from the user to the session key. */
64
+ delegationHeader: z.ZodObject<{
65
+ Authorization: z.ZodString;
66
+ }, "strip", z.ZodTypeAny, {
67
+ Authorization?: string;
68
+ }, {
69
+ Authorization?: string;
70
+ }>;
71
+ /** The delegation reference from the user to the session key. */
72
+ delegationCid: z.ZodString;
73
+ /** The session key (JWK format). */
74
+ jwk: z.ZodRecord<z.ZodString, z.ZodUnknown>;
75
+ /** The space that the session key is permitted to perform actions against. */
76
+ spaceId: z.ZodString;
77
+ /** The verification method of the session key. */
78
+ verificationMethod: z.ZodString;
79
+ }, "strip", z.ZodTypeAny, {
80
+ spaceId?: string;
81
+ delegationHeader?: {
82
+ Authorization?: string;
83
+ };
84
+ jwk?: Record<string, unknown>;
85
+ delegationCid?: string;
86
+ verificationMethod?: string;
87
+ }, {
88
+ spaceId?: string;
89
+ delegationHeader?: {
90
+ Authorization?: string;
91
+ };
92
+ jwk?: Record<string, unknown>;
93
+ delegationCid?: string;
94
+ verificationMethod?: string;
95
+ }>;
96
+ export type Session = z.infer<typeof SessionSchema>;
97
+ /**
98
+ * Configuration object for generating a Space Host Delegation SIWE message.
99
+ */
100
+ export declare const HostConfigSchema: z.ZodObject<{
101
+ /** Ethereum address. */
102
+ address: z.ZodString;
103
+ /** Chain ID. */
104
+ chainId: z.ZodNumber;
105
+ /** Domain of the webpage. */
106
+ domain: z.ZodString;
107
+ /** Current time for SIWE message (ISO 8601 format). */
108
+ issuedAt: z.ZodString;
109
+ /** The space that is the target resource of the delegation. */
110
+ spaceId: z.ZodString;
111
+ /** The peer that is the target/invoker in the delegation. */
112
+ peerId: z.ZodString;
113
+ }, "strip", z.ZodTypeAny, {
114
+ spaceId?: string;
115
+ address?: string;
116
+ chainId?: number;
117
+ domain?: string;
118
+ issuedAt?: string;
119
+ peerId?: string;
120
+ }, {
121
+ spaceId?: string;
122
+ address?: string;
123
+ chainId?: number;
124
+ domain?: string;
125
+ issuedAt?: string;
126
+ peerId?: string;
127
+ }>;
128
+ export type HostConfig = z.infer<typeof HostConfigSchema>;
129
+ /**
130
+ * Validation error type.
131
+ */
132
+ export interface ValidationError {
133
+ code: string;
134
+ message: string;
135
+ issues?: unknown[];
136
+ }
137
+ /**
138
+ * Result type for validation operations.
139
+ */
140
+ export type ValidationResult<T> = {
141
+ ok: true;
142
+ data: T;
143
+ } | {
144
+ ok: false;
145
+ error: ValidationError;
146
+ };
147
+ /**
148
+ * Validates SessionConfig.
149
+ */
150
+ export declare function validateSessionConfig(data: unknown): ValidationResult<SessionConfig>;
151
+ /**
152
+ * Validates Session.
153
+ */
154
+ export declare function validateSession(data: unknown): ValidationResult<Session>;
155
+ /**
156
+ * Validates HostConfig.
157
+ */
158
+ export declare function validateHostConfig(data: unknown): ValidationResult<HostConfig>;
159
+ //# sourceMappingURL=types.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.schema.d.ts","sourceRoot":"","sources":["../../../../src/modules/Storage/tinycloud/types.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAC9B,+FAA+F;;IAE/F,wBAAwB;;IAExB,gBAAgB;;IAEhB,6BAA6B;;IAE7B,uDAAuD;;IAEvD,+DAA+D;;IAE/D,6DAA6D;;IAE7D,4DAA4D;;IAE5D,2DAA2D;;IAE3D,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,uDAAuD;;;;;;;;IAIvD,iEAAiE;;IAEjE,oCAAoC;;IAEpC,8EAA8E;;IAE9E,kDAAkD;;;;;;;;;;;;;;;;;;EAElD,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAMpD;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,wBAAwB;;IAExB,gBAAgB;;IAEhB,6BAA6B;;IAE7B,uDAAuD;;IAEvD,+DAA+D;;IAE/D,6DAA6D;;;;;;;;;;;;;;;;EAE7D,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GACrB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,CAAC;AAE1C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAapF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAaxE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAa9E"}
@@ -0,0 +1,361 @@
1
+ import { providers, Signer } from "ethers";
2
+ import { tcwSession } from "@tinycloud/web-sdk-wasm";
3
+ import { AxiosInstance } from "axios";
4
+ import { SiweMessage } from "siwe";
5
+ import { EnsData } from "@tinycloud/web-core";
6
+ import type { ClientSession, ClientConfig, IConnected, Extension } from "@tinycloud/web-core/client";
7
+ import { IUserAuthorization as ICoreUserAuthorization, PartialSiweMessage } from "@tinycloud/sdk-core";
8
+ import { Session } from "./Storage/tinycloud";
9
+ /**
10
+ * Extended Client Config with TinyCloud options
11
+ */
12
+ declare module "@tinycloud/web-core/client" {
13
+ interface ClientConfig {
14
+ /** Whether to automatically create space if it doesn't exist (default: true) */
15
+ autoCreateSpace?: boolean;
16
+ /** TinyCloud server endpoints (default: ["https://node.tinycloud.xyz"]) */
17
+ tinycloudHosts?: string[];
18
+ /** Space prefix for new sessions (default: "default") */
19
+ spacePrefix?: string;
20
+ }
21
+ }
22
+ /**
23
+ * Interface for tracking session state during SIWE message generation
24
+ */
25
+ interface PendingSession {
26
+ /** Instance of SessionManager (null if consumed by build()) */
27
+ sessionManager: tcwSession.TCWSessionManager | null;
28
+ /** Session key JWK string (stored before build() consumes sessionManager) */
29
+ sessionKey?: string;
30
+ /** Ethereum address for the session */
31
+ address: string;
32
+ /** Timestamp when session was generated */
33
+ generatedAt: number;
34
+ /** Extensions that were applied to the session */
35
+ extensions: Extension[];
36
+ }
37
+ /** UserAuthorization Module
38
+ *
39
+ * Handles the capabilities that a user can provide a app, specifically
40
+ * authentication and authorization. This resource handles all key and
41
+ * signing capabilities including:
42
+ * - ethereum provider, wallet connection, SIWE message creation and signing
43
+ * - session key management
44
+ * - creates, manages, and handles session data
45
+ * - manages/provides capabilities
46
+ */
47
+ interface IUserAuthorization {
48
+ provider: providers.Web3Provider;
49
+ session?: ClientSession;
50
+ extend: (extension: Extension) => void;
51
+ connect(): Promise<any>;
52
+ signIn(): Promise<any>;
53
+ /**
54
+ * ENS data supported by the SDK.
55
+ * @param address - User address.
56
+ * @param resolveEnsOpts - Options to resolve ENS.
57
+ * @returns Object containing ENS data.
58
+ */
59
+ resolveEns(
60
+ /** User address */
61
+ address: string): Promise<EnsData>;
62
+ address(): string | undefined;
63
+ chainId(): number | undefined;
64
+ /**
65
+ * Signs a message using the private key of the connected address.
66
+ * @returns signature;
67
+ */
68
+ signMessage(message: string): Promise<string>;
69
+ getSigner(): Signer;
70
+ signOut(): Promise<any>;
71
+ /**
72
+ * Generates a SIWE message for authentication with session key capabilities.
73
+ * @param address - Ethereum address performing the signing
74
+ * @param partial - Optional partial SIWE message to override defaults
75
+ * @returns SiweMessage object ready for signing
76
+ */
77
+ generateSiweMessage(address: string, partial?: PartialSiweMessage): Promise<SiweMessage>;
78
+ /**
79
+ * Sign in to the SDK using a pre-signed SIWE message.
80
+ * @param siweMessage - The SIWE message that was generated
81
+ * @param signature - The signature of the SIWE message
82
+ * @returns Promise with the ClientSession object
83
+ */
84
+ signInWithSignature(siweMessage: SiweMessage, signature: string): Promise<ClientSession>;
85
+ /**
86
+ * Get the space ID for the current session.
87
+ * @returns Space ID or undefined if not available
88
+ */
89
+ getSpaceId(): string | undefined;
90
+ /**
91
+ * Get the configured TinyCloud host URLs.
92
+ * @returns Array of TinyCloud host URLs
93
+ */
94
+ getTinycloudHosts(): string[];
95
+ /**
96
+ * Ensure the user's space exists on the TinyCloud server.
97
+ * Creates the space if it doesn't exist (when autoCreateSpace is true).
98
+ */
99
+ ensureSpaceExists(): Promise<void>;
100
+ /**
101
+ * Get the active TinyCloud session.
102
+ * This provides access to the session for authenticated requests.
103
+ * @returns Session object or undefined if not signed in
104
+ */
105
+ getTinycloudSession(): Session | undefined;
106
+ }
107
+ declare class UserAuthorizationInit {
108
+ private config?;
109
+ /** Extensions for the session. */
110
+ extensions: Extension[];
111
+ /** The session representation (once signed in). */
112
+ session?: ClientSession;
113
+ constructor(config?: ClientConfig);
114
+ /** Extend the session with a compatible extension. */
115
+ extend(extension: Extension): void;
116
+ /**
117
+ * Connect to the signing account using the configured provider.
118
+ * @returns UserAuthorizationConnected instance.
119
+ */
120
+ connect(): Promise<UserAuthorizationConnected>;
121
+ }
122
+ /** An intermediate state: connected, but not signed-in. */
123
+ declare class UserAuthorizationConnected implements IConnected {
124
+ /** Instance of SessionManager */
125
+ builder: tcwSession.TCWSessionManager;
126
+ /** Config object. */
127
+ config: ClientConfig;
128
+ /** Enabled extensions. */
129
+ extensions: Extension[];
130
+ /** EthersJS provider. */
131
+ provider: providers.Web3Provider;
132
+ /**
133
+ * Promise that is initialized on construction of this class to run the "afterConnect" methods
134
+ * of the extensions.
135
+ */
136
+ afterConnectHooksPromise: Promise<void>;
137
+ /** Verifies if extension is enabled. */
138
+ isExtensionEnabled: (namespace: string) => boolean;
139
+ /** Axios instance. */
140
+ api?: AxiosInstance;
141
+ /** Ethereum Provider */
142
+ constructor(
143
+ /** Instance of SessionManager */
144
+ builder: tcwSession.TCWSessionManager,
145
+ /** Config object. */
146
+ config: ClientConfig,
147
+ /** Enabled extensions. */
148
+ extensions: Extension[],
149
+ /** EthersJS provider. */
150
+ provider: providers.Web3Provider);
151
+ /**
152
+ * Default KV actions for TinyCloud services.
153
+ * These are added to every session to enable basic KV operations.
154
+ */
155
+ private static readonly DEFAULT_KV_ACTIONS;
156
+ /**
157
+ * Default capabilities actions (for reading user capabilities).
158
+ */
159
+ private static readonly DEFAULT_CAPABILITIES_ACTIONS;
160
+ /** Applies the "afterConnect" methods and the delegated capabilities of the extensions. */
161
+ applyExtensions(): Promise<void>;
162
+ /**
163
+ * Adds default KV capabilities for the given user address and chainId.
164
+ * Must be called after we have address/chainId but before build().
165
+ * @param address - User's Ethereum address
166
+ * @param chainId - Chain ID
167
+ * @param spacePrefix - Space prefix (default: "default")
168
+ * @param kvPrefix - KV path prefix for scoping access (default: "" for all paths)
169
+ */
170
+ addDefaultCapabilities(address: string, chainId: number, spacePrefix?: string, kvPrefix?: string): void;
171
+ /**
172
+ * Applies the "afterSignIn" methods of the extensions.
173
+ * @param session - ClientSession object.
174
+ */
175
+ afterSignIn(session: ClientSession): Promise<void>;
176
+ /**
177
+ * Requests the user to sign in.
178
+ * Generates the SIWE message for this session, requests the configured
179
+ * Signer to sign the message, calls the "afterSignIn" methods of the
180
+ * extensions.
181
+ * @returns Promise with the ClientSession object.
182
+ */
183
+ signIn(): Promise<ClientSession>;
184
+ /**
185
+ * Requests the user to sign out.
186
+ * @param session - ClientSession object.
187
+ */
188
+ signOut(session: ClientSession): Promise<void>;
189
+ }
190
+ declare class UserAuthorization implements IUserAuthorization, ICoreUserAuthorization {
191
+ private _config;
192
+ /** The Ethereum provider */
193
+ provider: providers.Web3Provider;
194
+ /** The session representation (once signed in). */
195
+ session?: ClientSession;
196
+ /** Session builder. */
197
+ private init;
198
+ /** Current connection */
199
+ private connection?;
200
+ /** The config object. */
201
+ private config;
202
+ /** Pending session state for signature-based initialization */
203
+ private pendingSession?;
204
+ /** Whether to automatically create space if it doesn't exist */
205
+ private autoCreateSpace;
206
+ /** TinyCloud server endpoints */
207
+ private tinycloudHosts;
208
+ /** Space prefix for new sessions */
209
+ private spacePrefix;
210
+ /** KV path prefix for scoping access */
211
+ private kvPrefix;
212
+ /** The space ID for the current session */
213
+ private _spaceId?;
214
+ /** Delegation header for the current session */
215
+ private _delegationHeader?;
216
+ /** The TinyCloud session containing delegation and space info */
217
+ private _tinycloudSession?;
218
+ /** The host where the user's space was found or created */
219
+ private _activeHost?;
220
+ constructor(_config?: ClientConfig);
221
+ /**
222
+ * Extends with functions that are called after connecting and signing in.
223
+ */
224
+ extend(extension: Extension): void;
225
+ connect(): Promise<void>;
226
+ signIn(): Promise<ClientSession>;
227
+ /**
228
+ * ENS data supported by the SDK.
229
+ * @param address - User address.
230
+ * @param resolveEnsOpts - Options to resolve ENS.
231
+ * @returns Object containing ENS data.
232
+ */
233
+ resolveEns(
234
+ /** User address */
235
+ address: string): Promise<EnsData>;
236
+ /**
237
+ * Invalidates user's session.
238
+ */
239
+ signOut(): Promise<void>;
240
+ /**
241
+ * Gets the address that is connected and signed in.
242
+ * @returns Address.
243
+ */
244
+ address: () => string | undefined;
245
+ /**
246
+ * Get the chainId that the address is connected and signed in on.
247
+ * @returns chainId.
248
+ */
249
+ chainId: () => number | undefined;
250
+ /**
251
+ * Signs a message using the private key of the connected address.
252
+ * @returns signature;
253
+ */
254
+ signMessage(message: string): Promise<string>;
255
+ /**
256
+ * Gets the provider that is connected and signed in.
257
+ * @returns Provider.
258
+ */
259
+ getProvider(): providers.Web3Provider | undefined;
260
+ /**
261
+ * Returns the signer of the connected address.
262
+ * @returns ethers.Signer
263
+ * @see https://docs.ethers.io/v5/api/signer/#Signer
264
+ */
265
+ getSigner(): Signer;
266
+ /**
267
+ * Generates a SIWE message for authentication with session key capabilities.
268
+ * This method initializes a SessionManager, generates a session key,
269
+ * applies extension capabilities, and builds a SIWE message for signing.
270
+ *
271
+ * @param address - Ethereum address performing the signing
272
+ * @param partial - Optional partial SIWE message to override defaults
273
+ * @returns SiweMessage object ready for signing
274
+ */
275
+ generateSiweMessage(address: string, partial?: PartialSiweMessage): Promise<SiweMessage>;
276
+ /**
277
+ * Sign in to the SDK using a pre-signed SIWE message.
278
+ * This method must be called after generateSiweMessage().
279
+ * @param siweMessage - The SIWE message that was generated
280
+ * @param signature - The signature of the SIWE message
281
+ * @returns Promise with the ClientSession object
282
+ */
283
+ signInWithSignature(siweMessage: SiweMessage, signature: string): Promise<ClientSession>;
284
+ /**
285
+ * Default KV actions for TinyCloud services.
286
+ * These are added to every session to enable basic KV operations.
287
+ */
288
+ private static readonly DEFAULT_KV_ACTIONS;
289
+ /**
290
+ * Default capabilities actions (for reading user capabilities).
291
+ */
292
+ private static readonly DEFAULT_CAPABILITIES_ACTIONS;
293
+ /**
294
+ * Applies extension capabilities (defaultActions/targetedActions) to the session manager.
295
+ * This method also adds default KV and capabilities actions.
296
+ *
297
+ * @private
298
+ * @param sessionManager - SessionManager instance to apply capabilities to
299
+ * @param extensions - Array of extensions to apply
300
+ * @param address - User's Ethereum address (for building target URIs)
301
+ * @param chainId - Chain ID (for building target URIs)
302
+ * @param spacePrefix - Space prefix (default: "default")
303
+ * @param kvPrefix - KV path prefix for scoping access (default: "" for all paths)
304
+ */
305
+ private applyExtensionCapabilities;
306
+ /**
307
+ * Get the space ID for the current session.
308
+ * @returns Space ID or undefined if not available
309
+ */
310
+ getSpaceId(): string | undefined;
311
+ /**
312
+ * Get the configured TinyCloud host URLs.
313
+ * @returns Array of TinyCloud host URLs
314
+ */
315
+ getTinycloudHosts(): string[];
316
+ /**
317
+ * Get the active TinyCloud session.
318
+ * This provides access to the session for authenticated requests.
319
+ * @returns Session object or undefined if not signed in
320
+ */
321
+ getTinycloudSession(): Session | undefined;
322
+ /**
323
+ * Create the space on the TinyCloud server (host delegation).
324
+ * This registers the user as the owner of the space.
325
+ * Uses a modal to confirm with the user before creating.
326
+ * @param host - The host to create the space on
327
+ * @returns Promise resolving to true if space was created, false if user dismissed
328
+ */
329
+ private hostSpace;
330
+ /**
331
+ * Ensure the user's space exists on the TinyCloud server.
332
+ * Creates the space if it doesn't exist and autoCreateSpace is enabled.
333
+ *
334
+ * Strategy:
335
+ * 1. Try to activate the session on the first (primary) host.
336
+ * 2. If activation succeeds, set it as the `_activeHost` and return.
337
+ * 3. If the primary host returns 404, create the space there (don't skip
338
+ * because it might exist on other hosts - there is no replication).
339
+ * 4. If the primary host has a non-404 error, try remaining hosts.
340
+ *
341
+ * @throws Error if space creation fails or is disabled and space doesn't exist.
342
+ */
343
+ ensureSpaceExists(): Promise<void>;
344
+ /**
345
+ * Create the space on a specific host and activate the session there.
346
+ */
347
+ private createSpaceOnHost;
348
+ /**
349
+ * Apply extension afterSignIn hooks to the session.
350
+ * @param session - The ClientSession object
351
+ */
352
+ private applyAfterSignInHooks;
353
+ /**
354
+ * Generate space ID and delegation header for the current session.
355
+ * This sets up the internal state needed for ensureSpaceExists() and SpaceConnection.
356
+ * @param session - The ClientSession object
357
+ */
358
+ private setupSpaceSession;
359
+ }
360
+ export { IUserAuthorization, UserAuthorization, UserAuthorizationInit, UserAuthorizationConnected, PendingSession, };
361
+ //# sourceMappingURL=UserAuthorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserAuthorization.d.ts","sourceRoot":"","sources":["../../src/modules/UserAuthorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAe,UAAU,EAAa,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAiB,WAAW,EAAE,MAAM,MAAM,CAAC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