@tinycloud/web-sdk 3.0.0-beta.10 → 3.0.0-beta.11
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/dist/credentials/element.d.ts +21 -1
- package/dist/credentials/interpreter.d.ts +3 -1
- package/dist/credentials/types.d.ts +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/modules/Storage/tinycloud/types.schema.d.ts +2 -2
- package/dist/share/service.d.ts +11 -2
- package/dist/share/types.d.ts +10 -0
- package/package.json +3 -3
|
@@ -38,9 +38,9 @@ export declare const SessionConfigSchema: z.ZodObject<{
|
|
|
38
38
|
spaceId?: string;
|
|
39
39
|
address?: string;
|
|
40
40
|
chainId?: number;
|
|
41
|
-
jwk?: Record<string, unknown>;
|
|
42
41
|
issuedAt?: string;
|
|
43
42
|
notBefore?: string;
|
|
43
|
+
jwk?: Record<string, unknown>;
|
|
44
44
|
expirationTime?: string;
|
|
45
45
|
parents?: string[];
|
|
46
46
|
}, {
|
|
@@ -49,9 +49,9 @@ export declare const SessionConfigSchema: z.ZodObject<{
|
|
|
49
49
|
spaceId?: string;
|
|
50
50
|
address?: string;
|
|
51
51
|
chainId?: number;
|
|
52
|
-
jwk?: Record<string, unknown>;
|
|
53
52
|
issuedAt?: string;
|
|
54
53
|
notBefore?: string;
|
|
54
|
+
jwk?: Record<string, unknown>;
|
|
55
55
|
expirationTime?: string;
|
|
56
56
|
parents?: string[];
|
|
57
57
|
}>;
|
package/dist/share/service.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type CredentialRequirement } from "@tinycloud/sdk-core";
|
|
1
2
|
import { type ShareMetadata } from "@tinycloud/share-sdk";
|
|
2
3
|
import { type ShareEnvelopeV3 } from "@tinycloud/share-envelope";
|
|
3
4
|
import { CredentialsService } from "../credentials";
|
|
4
5
|
import { type ReceiverSessionStorage } from "./receiver-session";
|
|
5
|
-
import type { ReceivedShare, ShareImportAccountClient, ShareImportOptions, ShareImportResult, ShareReceiveOptions, ShareReceivedContent, ShareReceiverClient, ShareReceiverIdentity } from "./types";
|
|
6
|
+
import type { ReceivedShare, ShareImportAccountClient, ShareImportOptions, ShareImportResult, ShareReceiveOptions, ShareReceivedContent, ShareReceiverClient, ShareReceiverIdentity, ShareReceiverRecipient } from "./types";
|
|
6
7
|
export interface ShareReceiverServiceOptions {
|
|
7
8
|
readonly origin?: string;
|
|
8
9
|
readonly sessionStorage?: ReceiverSessionStorage;
|
|
@@ -18,11 +19,18 @@ export declare function validateShareReceiverServiceTrust(envelope: Pick<ShareEn
|
|
|
18
19
|
export declare function validateShareReceiverExpectedOrigin(shareUrl: string, expectedOrigin: string): string;
|
|
19
20
|
/** @internal */
|
|
20
21
|
export declare function selectShareReceiverAccountSession(client: ShareReceiverClient, requestedIdentity: ShareReceiveOptions["identity"]): Promise<ReturnType<ShareReceiverClient["session"]>>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal Binds the invitation's addressed recipient to the owner-signed
|
|
24
|
+
* policy's credential commitment. A matcher that does not hash to the
|
|
25
|
+
* committed requirement is rejected before anything is displayed or sent.
|
|
26
|
+
*/
|
|
27
|
+
export declare function verifiedShareRequirement(envelope: ShareEnvelopeV3): Promise<CredentialRequirement>;
|
|
21
28
|
/** @internal */
|
|
22
29
|
export declare class ReceivedShareImpl implements ReceivedShare {
|
|
23
30
|
readonly identity: ShareReceiverIdentity;
|
|
24
31
|
readonly metadata: ShareMetadata;
|
|
25
32
|
private readonly envelope;
|
|
33
|
+
private readonly requirement;
|
|
26
34
|
private readonly credentials;
|
|
27
35
|
private readonly sign;
|
|
28
36
|
private readonly options;
|
|
@@ -30,7 +38,8 @@ export declare class ReceivedShareImpl implements ReceivedShare {
|
|
|
30
38
|
private readonly credentialDiscoveryUrl;
|
|
31
39
|
private content?;
|
|
32
40
|
private getPromise?;
|
|
33
|
-
|
|
41
|
+
readonly recipient: ShareReceiverRecipient;
|
|
42
|
+
constructor(identity: ShareReceiverIdentity, metadata: ShareMetadata, envelope: ShareEnvelopeV3, requirement: CredentialRequirement, credentials: CredentialsService, sign: (bytes: Uint8Array) => Promise<Uint8Array>, options: ShareReceiveOptions, fetchFn: typeof fetch, credentialDiscoveryUrl: string);
|
|
34
43
|
get shareId(): string;
|
|
35
44
|
get(): Promise<ShareReceivedContent>;
|
|
36
45
|
private load;
|
package/dist/share/types.d.ts
CHANGED
|
@@ -69,8 +69,18 @@ export interface ShareImportAccountClient {
|
|
|
69
69
|
ensureOwnedSpaceHosted(name: string): Promise<string>;
|
|
70
70
|
kvForSpace(spaceId: string): IKVService;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* The recipient an invitation is addressed to. It comes from the signed,
|
|
74
|
+
* sealed invitation and is checked against the policy's credential
|
|
75
|
+
* requirement commitment before `receive` returns, so a host may display it.
|
|
76
|
+
*/
|
|
77
|
+
export type ShareReceiverRecipient = {
|
|
78
|
+
readonly kind: "exactEmail";
|
|
79
|
+
readonly email: string;
|
|
80
|
+
};
|
|
72
81
|
export interface ReceivedShare {
|
|
73
82
|
readonly identity: ShareReceiverIdentity;
|
|
83
|
+
readonly recipient: ShareReceiverRecipient;
|
|
74
84
|
readonly metadata: ShareMetadata;
|
|
75
85
|
readonly shareId: string;
|
|
76
86
|
get(): Promise<ShareReceivedContent>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinycloud/web-sdk",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.11",
|
|
4
4
|
"description": "A set of tools and utilities to help you build your app with TinyCloud.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@multiformats/multiaddr": "^13.0.1",
|
|
45
45
|
"@multiformats/multiaddr-to-uri": "^12.0.0",
|
|
46
|
-
"@tinycloud/node-sdk": "3.0.0-beta.
|
|
47
|
-
"@tinycloud/sdk-core": "3.0.0-beta.
|
|
46
|
+
"@tinycloud/node-sdk": "3.0.0-beta.11",
|
|
47
|
+
"@tinycloud/sdk-core": "3.0.0-beta.11",
|
|
48
48
|
"@tinycloud/share-envelope": "1.0.0-beta.4",
|
|
49
49
|
"@tinycloud/share-sdk": "1.0.0-beta.4",
|
|
50
50
|
"@tinycloud/web-sdk-wasm": "1.7.6",
|