@tinycloud/web-sdk 0.0.0-beta-20260401001229
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/LICENSE.md +320 -0
- package/README.md +151 -0
- package/dist/adapters/BrowserENSResolver.d.ts +10 -0
- package/dist/adapters/BrowserENSResolver.d.ts.map +1 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts +11 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts.map +1 -0
- package/dist/adapters/BrowserSessionStorage.d.ts +9 -0
- package/dist/adapters/BrowserSessionStorage.d.ts.map +1 -0
- package/dist/adapters/BrowserWalletSigner.d.ts +22 -0
- package/dist/adapters/BrowserWalletSigner.d.ts.map +1 -0
- package/dist/adapters/BrowserWasmBindings.d.ts +23 -0
- package/dist/adapters/BrowserWasmBindings.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts +40 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts.map +1 -0
- package/dist/authorization/index.d.ts +10 -0
- package/dist/authorization/index.d.ts.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.LICENSE.txt +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.LICENSE.txt +21 -0
- package/dist/index.mjs.map +1 -0
- package/dist/modules/Storage/index.d.ts +2 -0
- package/dist/modules/Storage/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts +24 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/index.d.ts +3 -0
- package/dist/modules/Storage/tinycloud/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/module.d.ts +11 -0
- package/dist/modules/Storage/tinycloud/module.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.d.ts +64 -0
- package/dist/modules/Storage/tinycloud/types.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts +159 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts.map +1 -0
- package/dist/modules/WasmInitializer.d.ts +26 -0
- package/dist/modules/WasmInitializer.d.ts.map +1 -0
- package/dist/modules/index.d.ts +5 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/keys/index.d.ts +6 -0
- package/dist/modules/keys/index.d.ts.map +1 -0
- package/dist/modules/registry/Registry.d.ts +59 -0
- package/dist/modules/registry/Registry.d.ts.map +1 -0
- package/dist/modules/tcw.d.ts +142 -0
- package/dist/modules/tcw.d.ts.map +1 -0
- package/dist/notifications/ErrorHandler.d.ts +32 -0
- package/dist/notifications/ErrorHandler.d.ts.map +1 -0
- package/dist/notifications/ModalManager.d.ts +15 -0
- package/dist/notifications/ModalManager.d.ts.map +1 -0
- package/dist/notifications/NodeSelectionModal.d.ts +29 -0
- package/dist/notifications/NodeSelectionModal.d.ts.map +1 -0
- package/dist/notifications/SpaceCreationModal.d.ts +28 -0
- package/dist/notifications/SpaceCreationModal.d.ts.map +1 -0
- package/dist/notifications/ToastContainer.d.ts +16 -0
- package/dist/notifications/ToastContainer.d.ts.map +1 -0
- package/dist/notifications/ToastElement.d.ts +22 -0
- package/dist/notifications/ToastElement.d.ts.map +1 -0
- package/dist/notifications/ToastManager.d.ts +36 -0
- package/dist/notifications/ToastManager.d.ts.map +1 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +37 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/notifications/types.schema.d.ts +224 -0
- package/dist/notifications/types.schema.d.ts.map +1 -0
- package/dist/providers/config.d.ts +44 -0
- package/dist/providers/config.d.ts.map +1 -0
- package/dist/providers/extension.d.ts +64 -0
- package/dist/providers/extension.d.ts.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/types.d.ts +657 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/utils.d.ts +20 -0
- package/dist/providers/utils.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +9 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/multiaddr.d.ts +36 -0
- package/dist/utils/multiaddr.d.ts.map +1 -0
- package/package.json +94 -0
|
@@ -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 @@
|
|
|
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,11 @@
|
|
|
1
|
+
import { tinycloud } from '@tinycloud/web-sdk-wasm';
|
|
2
|
+
import type { InvokeFunction } from '@tinycloud/sdk-services';
|
|
3
|
+
type TinyCloudModule = typeof tinycloud;
|
|
4
|
+
export declare const makeSpaceId: TinyCloudModule['makeSpaceId'];
|
|
5
|
+
export declare const prepareSession: TinyCloudModule['prepareSession'];
|
|
6
|
+
export declare const completeSessionSetup: TinyCloudModule['completeSessionSetup'];
|
|
7
|
+
export declare const invoke: InvokeFunction;
|
|
8
|
+
export declare const generateHostSIWEMessage: TinyCloudModule['generateHostSIWEMessage'];
|
|
9
|
+
export declare const siweToDelegationHeaders: TinyCloudModule['siweToDelegationHeaders'];
|
|
10
|
+
export {};
|
|
11
|
+
//# 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;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,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,cAMpB,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
|
+
notBefore?: string;
|
|
43
|
+
expirationTime?: string;
|
|
44
|
+
parents?: string[];
|
|
45
|
+
jwk?: Record<string, unknown>;
|
|
46
|
+
}, {
|
|
47
|
+
spaceId?: string;
|
|
48
|
+
actions?: Record<string, Record<string, string[]>>;
|
|
49
|
+
address?: string;
|
|
50
|
+
chainId?: number;
|
|
51
|
+
domain?: string;
|
|
52
|
+
issuedAt?: string;
|
|
53
|
+
notBefore?: string;
|
|
54
|
+
expirationTime?: string;
|
|
55
|
+
parents?: string[];
|
|
56
|
+
jwk?: Record<string, unknown>;
|
|
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
|
+
jwk?: Record<string, unknown>;
|
|
82
|
+
delegationHeader?: {
|
|
83
|
+
Authorization?: string;
|
|
84
|
+
};
|
|
85
|
+
delegationCid?: string;
|
|
86
|
+
verificationMethod?: string;
|
|
87
|
+
}, {
|
|
88
|
+
spaceId?: string;
|
|
89
|
+
jwk?: Record<string, unknown>;
|
|
90
|
+
delegationHeader?: {
|
|
91
|
+
Authorization?: string;
|
|
92
|
+
};
|
|
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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized WASM initialization for the TinyCloud SDK.
|
|
3
|
+
* Ensures WASM modules are loaded before any extension operations.
|
|
4
|
+
*/
|
|
5
|
+
export declare class WasmInitializer {
|
|
6
|
+
private static isInitialized;
|
|
7
|
+
private static tinycloudModule;
|
|
8
|
+
private static sessionManager;
|
|
9
|
+
/**
|
|
10
|
+
* Ensures WASM modules are initialized. Safe to call multiple times.
|
|
11
|
+
* @returns Promise resolving to initialized WASM modules
|
|
12
|
+
*/
|
|
13
|
+
static ensureInitialized(): Promise<{
|
|
14
|
+
tinycloudModule: any;
|
|
15
|
+
sessionManager: any;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the initialized WASM modules if available.
|
|
19
|
+
* @returns The WASM modules or null if not initialized
|
|
20
|
+
*/
|
|
21
|
+
static getModules(): {
|
|
22
|
+
tinycloudModule: any;
|
|
23
|
+
sessionManager: any;
|
|
24
|
+
} | null;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=WasmInitializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WasmInitializer.d.ts","sourceRoot":"","sources":["../../src/modules/WasmInitializer.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAM;IACpC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAM;IAEnC;;;OAGG;WACU,iBAAiB,IAAI,OAAO,CAAC;QACxC,eAAe,EAAE,GAAG,CAAC;QACrB,cAAc,EAAE,GAAG,CAAC;KACrB,CAAC;IAeF;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI;QAAE,eAAe,EAAE,GAAG,CAAC;QAAC,cAAc,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI;CAS1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,EACL,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/keys/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import { providers } from "ethers";
|
|
3
|
+
export declare const REGISTRY_CONTRACT_ADDRESS: {
|
|
4
|
+
1: string;
|
|
5
|
+
11155111: string;
|
|
6
|
+
};
|
|
7
|
+
export interface RegistryConfig {
|
|
8
|
+
provider: providers.Web3Provider;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Registry provides access to the TinyCloud Registry contract for resolving
|
|
12
|
+
* account addresses to their associated node identifiers.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Registry {
|
|
15
|
+
provider: providers.Web3Provider;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of the Registry class.
|
|
18
|
+
*
|
|
19
|
+
* @param config - Configuration options for the Registry
|
|
20
|
+
* @param config.rpcUrl - The RPC URL to connect to the blockchain
|
|
21
|
+
* @param config.contractAddress - The address of the Registry contract
|
|
22
|
+
*/
|
|
23
|
+
constructor(config: RegistryConfig);
|
|
24
|
+
/**
|
|
25
|
+
* Gets the node identifier associated with an account address.
|
|
26
|
+
*
|
|
27
|
+
* @param account - The account address to look up
|
|
28
|
+
* @returns A Promise containing the node identifier string
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const registry = new Registry({
|
|
33
|
+
* rpcUrl: 'https://mainnet.base.org',
|
|
34
|
+
* contractAddress: '0x...'
|
|
35
|
+
* });
|
|
36
|
+
* const node = await registry.getNode('0x1234...');
|
|
37
|
+
* console.log(node); // 'my-node-id'
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
getNode(account: Address): Promise<string>;
|
|
41
|
+
addressNode(): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if an account has a registered node.
|
|
44
|
+
*
|
|
45
|
+
* @param account - The account address to check
|
|
46
|
+
* @returns A Promise containing a boolean indicating if the account has a node
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const hasNode = await registry.hasNode('0x1234...');
|
|
51
|
+
* if (hasNode) {
|
|
52
|
+
* const node = await registry.getNode('0x1234...');
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
hasNode(account: Address): Promise<boolean>;
|
|
57
|
+
}
|
|
58
|
+
export default Registry;
|
|
59
|
+
//# sourceMappingURL=Registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Registry.d.ts","sourceRoot":"","sources":["../../../src/modules/registry/Registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAExF,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAkBnC,eAAO,MAAM,yBAAyB;;;CAGrC,CAAA;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,QAAQ;IAEnB,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC;IACjC;;;;;;OAMG;gBACS,MAAM,EAAE,cAAc;IAIlC;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAyB1C,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAWpC;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAclD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TinyCloudWeb — thin browser wrapper around TinyCloudNode.
|
|
3
|
+
*
|
|
4
|
+
* All core logic (auth, services, delegations) is handled by TinyCloudNode.
|
|
5
|
+
* This wrapper provides:
|
|
6
|
+
* - Browser-specific adapters (wallet signer, notifications, WASM bindings)
|
|
7
|
+
* - The familiar TinyCloudWeb public API surface
|
|
8
|
+
* - Static receiveShare() using browser WASM
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import { IKVService, ISQLService, IDuckDbService, IDataVaultService, ISpaceService, ISpace, ISharingService, ICapabilityKeyRegistry, DelegationManager, Delegation, CreateDelegationParams, Result, DelegationError, ClientSession, Extension, ISpaceCreationHandler } from "@tinycloud/sdk-core";
|
|
13
|
+
import type { providers } from "ethers";
|
|
14
|
+
import { RPCProviders, ClientConfig } from "../providers";
|
|
15
|
+
import type { NotificationConfig } from "../notifications/types";
|
|
16
|
+
import type { PortableDelegation, DelegatedAccess } from "@tinycloud/node-sdk/core";
|
|
17
|
+
declare global {
|
|
18
|
+
interface Window {
|
|
19
|
+
ethereum?: any;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for TinyCloudWeb.
|
|
24
|
+
*
|
|
25
|
+
* Extends ClientConfig with browser-specific options.
|
|
26
|
+
*/
|
|
27
|
+
export interface Config extends ClientConfig {
|
|
28
|
+
/** Notification configuration for error popups and toasts */
|
|
29
|
+
notifications?: NotificationConfig;
|
|
30
|
+
/** Optional prefix for KV service keys */
|
|
31
|
+
kvPrefix?: string;
|
|
32
|
+
/** Prefix for space names when creating spaces */
|
|
33
|
+
spacePrefix?: string;
|
|
34
|
+
/** TinyCloud server hosts (default: ['https://node.tinycloud.xyz']) */
|
|
35
|
+
tinycloudHosts?: string[];
|
|
36
|
+
/** Whether to auto-create space on sign-in (default: true) */
|
|
37
|
+
autoCreateSpace?: boolean;
|
|
38
|
+
/** Space creation handler (default: ModalSpaceCreationHandler) */
|
|
39
|
+
spaceCreationHandler?: ISpaceCreationHandler;
|
|
40
|
+
/** Session expiration time in milliseconds (default: 1 hour) */
|
|
41
|
+
sessionExpirationMs?: number;
|
|
42
|
+
/** Shorthand for passing a Web3 provider */
|
|
43
|
+
provider?: any;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Result of receiving a share link.
|
|
47
|
+
*/
|
|
48
|
+
export interface ShareReceiveResult<T = unknown> {
|
|
49
|
+
data: T;
|
|
50
|
+
delegation: Delegation;
|
|
51
|
+
path: string;
|
|
52
|
+
spaceId: string;
|
|
53
|
+
}
|
|
54
|
+
export declare class TinyCloudWeb {
|
|
55
|
+
/** The Ethereum provider */
|
|
56
|
+
provider: providers.Web3Provider;
|
|
57
|
+
/** Supported RPC Providers */
|
|
58
|
+
static RPCProviders: typeof RPCProviders;
|
|
59
|
+
/** Underlying TinyCloudNode (created after WASM init) */
|
|
60
|
+
private _node;
|
|
61
|
+
/** Browser notification handler */
|
|
62
|
+
private notificationHandler;
|
|
63
|
+
/** Browser WASM bindings */
|
|
64
|
+
private wasmBindings;
|
|
65
|
+
/** Browser wallet signer */
|
|
66
|
+
private walletSigner?;
|
|
67
|
+
/** Promise that resolves when WASM + node are ready */
|
|
68
|
+
private _initPromise;
|
|
69
|
+
/** User config */
|
|
70
|
+
private config;
|
|
71
|
+
constructor(config?: Config);
|
|
72
|
+
/**
|
|
73
|
+
* Async initialization: ensure WASM is ready, then create TinyCloudNode.
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
private _init;
|
|
77
|
+
/**
|
|
78
|
+
* Get the TinyCloudNode instance, awaiting init if necessary.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
private ensureNode;
|
|
82
|
+
/**
|
|
83
|
+
* Get the TinyCloudNode instance synchronously.
|
|
84
|
+
* Throws if called before WASM initialization completes.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
private get node();
|
|
88
|
+
/**
|
|
89
|
+
* Factory method for guaranteed correct initialization.
|
|
90
|
+
* Awaits WASM loading before returning the instance.
|
|
91
|
+
*/
|
|
92
|
+
static create(config?: Config): Promise<TinyCloudWeb>;
|
|
93
|
+
get kv(): IKVService;
|
|
94
|
+
get sql(): ISQLService;
|
|
95
|
+
get duckdb(): IDuckDbService;
|
|
96
|
+
get vault(): IDataVaultService;
|
|
97
|
+
get spaces(): ISpaceService;
|
|
98
|
+
get sharing(): ISharingService;
|
|
99
|
+
get delegations(): DelegationManager;
|
|
100
|
+
get capabilityRegistry(): ICapabilityKeyRegistry;
|
|
101
|
+
space(nameOrUri: string): ISpace;
|
|
102
|
+
get kvPrefix(): string;
|
|
103
|
+
signIn: () => Promise<ClientSession>;
|
|
104
|
+
signOut: () => Promise<void>;
|
|
105
|
+
session: () => ClientSession | undefined;
|
|
106
|
+
address: () => string | undefined;
|
|
107
|
+
chainId: () => number | undefined;
|
|
108
|
+
get did(): string;
|
|
109
|
+
get sessionDid(): string;
|
|
110
|
+
get isSessionOnly(): boolean;
|
|
111
|
+
get isWalletConnected(): boolean;
|
|
112
|
+
extend(_extension: Extension): void;
|
|
113
|
+
cleanup(): void;
|
|
114
|
+
connectWallet(provider: providers.ExternalProvider | providers.Web3Provider, options?: {
|
|
115
|
+
spacePrefix?: string;
|
|
116
|
+
}): void;
|
|
117
|
+
createDelegation(params: {
|
|
118
|
+
path: string;
|
|
119
|
+
actions: string[];
|
|
120
|
+
delegateDID: string;
|
|
121
|
+
disableSubDelegation?: boolean;
|
|
122
|
+
expiryMs?: number;
|
|
123
|
+
}): Promise<PortableDelegation>;
|
|
124
|
+
useDelegation(delegation: PortableDelegation): Promise<DelegatedAccess>;
|
|
125
|
+
createSubDelegation(parentDelegation: PortableDelegation, params: {
|
|
126
|
+
path: string;
|
|
127
|
+
actions: string[];
|
|
128
|
+
delegateDID: string;
|
|
129
|
+
disableSubDelegation?: boolean;
|
|
130
|
+
expiryMs?: number;
|
|
131
|
+
}): Promise<PortableDelegation>;
|
|
132
|
+
delegate(params: CreateDelegationParams): Promise<Result<Delegation, DelegationError>>;
|
|
133
|
+
revokeDelegation(cid: string): Promise<Result<void, DelegationError>>;
|
|
134
|
+
listDelegations(): Promise<Result<Delegation[], DelegationError>>;
|
|
135
|
+
checkPermission(path: string, action: string): Promise<Result<boolean, DelegationError>>;
|
|
136
|
+
/**
|
|
137
|
+
* Receive and retrieve data from a v2 share link.
|
|
138
|
+
* Static method — no auth required. Uses browser WASM.
|
|
139
|
+
*/
|
|
140
|
+
static receiveShare<T = unknown>(link: string, key?: string): Promise<Result<ShareReceiveResult<T>, DelegationError>>;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=tcw.d.ts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AAC;IAKtF,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAKrE,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,eAAe,CAAC,CAAC;IAKjE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAS9F;;;OAGG;WACiB,YAAY,CAAC,CAAC,GAAG,OAAO,EAC1C,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;CA4H3D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare class SDKErrorHandler {
|
|
2
|
+
private static instance;
|
|
3
|
+
private toastManager;
|
|
4
|
+
private config;
|
|
5
|
+
private isInitialized;
|
|
6
|
+
private boundHandlers;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance(config?: {
|
|
9
|
+
popups: boolean;
|
|
10
|
+
throwErrors: boolean;
|
|
11
|
+
}): SDKErrorHandler;
|
|
12
|
+
static reset(): void;
|
|
13
|
+
setupErrorHandling(): void;
|
|
14
|
+
cleanup(): void;
|
|
15
|
+
updateConfig(config: {
|
|
16
|
+
popups: boolean;
|
|
17
|
+
throwErrors: boolean;
|
|
18
|
+
}): void;
|
|
19
|
+
private handleError;
|
|
20
|
+
private handleWarning;
|
|
21
|
+
private handleSuccess;
|
|
22
|
+
private getErrorMessage;
|
|
23
|
+
private retryWalletConnection;
|
|
24
|
+
private handleUnhandledRejection;
|
|
25
|
+
}
|
|
26
|
+
export declare const dispatchSDKEvent: {
|
|
27
|
+
error: any;
|
|
28
|
+
warning: any;
|
|
29
|
+
success: any;
|
|
30
|
+
cleanup: any;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ErrorHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorHandler.d.ts","sourceRoot":"","sources":["../../src/notifications/ErrorHandler.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgC;IACvD,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO;WAaO,WAAW,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,eAAe;WAShF,KAAK,IAAI,IAAI;IAOpB,kBAAkB,IAAI,IAAI;IAiB1B,OAAO,IAAI,IAAI;IAWf,YAAY,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAc5E,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,wBAAwB;CAajC;AA4CD,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SpaceCreationModalOptions, type SpaceCreationResult } from './SpaceCreationModal';
|
|
2
|
+
import { type NodeSelectionModalOptions, type NodeSelectionResult } from './NodeSelectionModal';
|
|
3
|
+
export declare class ModalManager {
|
|
4
|
+
private static instance;
|
|
5
|
+
private activeModal;
|
|
6
|
+
private constructor();
|
|
7
|
+
static getInstance(): ModalManager;
|
|
8
|
+
showSpaceCreationModal(options: SpaceCreationModalOptions): Promise<SpaceCreationResult>;
|
|
9
|
+
showNodeSelectionModal(options: NodeSelectionModalOptions): Promise<NodeSelectionResult>;
|
|
10
|
+
closeActiveModal(): void;
|
|
11
|
+
hasActiveModal(): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const showSpaceCreationModal: (options: SpaceCreationModalOptions) => Promise<SpaceCreationResult>;
|
|
14
|
+
export declare const showNodeSelectionModal: (options: NodeSelectionModalOptions) => Promise<NodeSelectionResult>;
|
|
15
|
+
//# sourceMappingURL=ModalManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalManager.d.ts","sourceRoot":"","sources":["../../src/notifications/ModalManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACrH,OAAO,EAA+B,KAAK,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE7H,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,WAAW,CAAkE;IAErF,OAAO;WAEO,WAAW,IAAI,YAAY;IAOlC,sBAAsB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAuBxF,sBAAsB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAuBxF,gBAAgB,IAAI,IAAI;IAOxB,cAAc,IAAI,OAAO;CAGjC;AAGD,eAAO,MAAM,sBAAsB,YAAa,yBAAyB,KAAG,OAAO,CAAC,mBAAmB,CAEtG,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,yBAAyB,KAAG,OAAO,CAAC,mBAAmB,CAEtG,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface NodeSelectionModalOptions {
|
|
2
|
+
onCreateNode: (host: string) => Promise<void>;
|
|
3
|
+
onDismiss?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface NodeSelectionResult {
|
|
6
|
+
host?: string;
|
|
7
|
+
dismissed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class TinyCloudNodeSelectionModal extends HTMLElement {
|
|
10
|
+
private options;
|
|
11
|
+
private isVisible;
|
|
12
|
+
private isCreating;
|
|
13
|
+
private resolveResult;
|
|
14
|
+
private completionPromise;
|
|
15
|
+
private selectedHost;
|
|
16
|
+
constructor(options: NodeSelectionModalOptions);
|
|
17
|
+
getCompletionPromise(): Promise<NodeSelectionResult>;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
private render;
|
|
21
|
+
private getModalStyles;
|
|
22
|
+
private setupEventListeners;
|
|
23
|
+
private handleKeyDown;
|
|
24
|
+
private handleCreateSpace;
|
|
25
|
+
private show;
|
|
26
|
+
private hide;
|
|
27
|
+
private dismiss;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=NodeSelectionModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSelectionModal.d.ts","sourceRoot":"","sources":["../../src/notifications/NodeSelectionModal.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,2BAA4B,SAAQ,WAAW;IAC1D,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,aAAa,CAAwD;IAC7E,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,YAAY,CAAwC;gBAEhD,OAAO,EAAE,yBAAyB;IAWvC,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI3D,iBAAiB;IAKjB,oBAAoB;IAIpB,OAAO,CAAC,MAAM;IAwDd,OAAO,CAAC,cAAc;IA4QtB,OAAO,CAAC,mBAAmB;IAgC3B,OAAO,CAAC,aAAa,CAInB;YAEY,iBAAiB;IAoB/B,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,IAAI;IAaZ,OAAO,CAAC,OAAO;CAKhB"}
|