@econ-v1/ports 7.6.172 → 7.6.174
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/gift-wallet.d.ts +87 -0
- package/dist/gift-wallet.d.ts.map +1 -0
- package/dist/identity.d.ts +34 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gift-wallet.js +68 -0
- package/src/identity.js +21 -0
- package/src/index.js +8 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For compositions with no authenticated home-node client (tests, headless kernels): there is
|
|
3
|
+
* never a gift, which is the safe direction — onboarding then runs exactly the flow it ran
|
|
4
|
+
* before the gift step existed.
|
|
5
|
+
* @returns {GiftWalletPort}
|
|
6
|
+
*/
|
|
7
|
+
export function createNullGiftWallet(): GiftWalletPort;
|
|
8
|
+
/**
|
|
9
|
+
* The three rows the gift step shows, in order: the LSP holds the wallet for this node
|
|
10
|
+
* (`reserved`), the node downloads and imports it (`moving`), the imported wallet waits for a
|
|
11
|
+
* usable channel (`spendable`).
|
|
12
|
+
*/
|
|
13
|
+
export type GiftWalletStep = "reserved" | "moving" | "spendable";
|
|
14
|
+
/**
|
|
15
|
+
* Why there is no gift. The first four are the node's own words (`wallet.gift.*`).
|
|
16
|
+
* `unavailable` is never sent by a node: it is what this side reports when the call failed,
|
|
17
|
+
* timed out or answered a shape it does not understand.
|
|
18
|
+
*/
|
|
19
|
+
export type GiftWalletNoneReason = "not_configured" | "unreachable" | "none" | "already_claimed" | "unavailable";
|
|
20
|
+
/**
|
|
21
|
+
* `wallet.gift.check` — "is a gift wallet available for this node?".
|
|
22
|
+
*/
|
|
23
|
+
export type GiftWalletCheckOutcome = {
|
|
24
|
+
readonly status: "available";
|
|
25
|
+
readonly amountSats: number;
|
|
26
|
+
readonly giftId: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly status: "installed";
|
|
29
|
+
readonly amountSats: number;
|
|
30
|
+
readonly walletId: string;
|
|
31
|
+
readonly spendable: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
readonly status: "none";
|
|
34
|
+
readonly reason: GiftWalletNoneReason;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* `wallet.gift.redeem` — runs the whole transfer on the node; safe to call again, it resumes.
|
|
38
|
+
* `ready` = imported and a channel is usable. `installed` = imported, not usable yet.
|
|
39
|
+
* `errorCode` is a machine code for the details disclosure, never a sentence for a person.
|
|
40
|
+
*/
|
|
41
|
+
export type GiftWalletRedeemOutcome = {
|
|
42
|
+
readonly status: "ready";
|
|
43
|
+
readonly amountSats: number;
|
|
44
|
+
readonly walletId: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly status: "installed";
|
|
47
|
+
readonly amountSats: number;
|
|
48
|
+
readonly walletId: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly status: "failed";
|
|
51
|
+
readonly amountSats?: number;
|
|
52
|
+
readonly step?: "reserved" | "moving";
|
|
53
|
+
readonly errorCode: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly status: "none";
|
|
56
|
+
readonly reason: GiftWalletNoneReason;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* `wallet.gift.status` — cheap, from the node's persisted state, callable while a redeem is in
|
|
60
|
+
* flight. `unavailable` (never sent by a node) means the read itself did not answer, which is
|
|
61
|
+
* a different fact from the node's own `none`.
|
|
62
|
+
*/
|
|
63
|
+
export type GiftWalletStatusOutcome = {
|
|
64
|
+
readonly status: "none" | "available" | "redeeming" | "installed" | "ready" | "failed";
|
|
65
|
+
readonly step?: GiftWalletStep;
|
|
66
|
+
readonly amountSats?: number;
|
|
67
|
+
readonly walletId?: string;
|
|
68
|
+
readonly giftId?: string;
|
|
69
|
+
readonly errorCode?: string;
|
|
70
|
+
} | {
|
|
71
|
+
readonly status: "unavailable";
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The gift wallet a new node may receive at the end of onboarding.
|
|
75
|
+
*
|
|
76
|
+
* A centralized LSP node can hold a pre-made wallet for a freshly claimed node. The node's
|
|
77
|
+
* wallet app owns the whole transfer (`wallet.gift.check / redeem / status`); this port is how
|
|
78
|
+
* the onboarding flow asks for it. Every member resolves — a failed call, a timeout or an
|
|
79
|
+
* unexpected answer is an outcome (`none` / `failed` / `unavailable`), never a rejection, so a
|
|
80
|
+
* gift can never be the reason onboarding does not finish.
|
|
81
|
+
*/
|
|
82
|
+
export type GiftWalletPort = {
|
|
83
|
+
check: () => Promise<GiftWalletCheckOutcome>;
|
|
84
|
+
redeem: () => Promise<GiftWalletRedeemOutcome>;
|
|
85
|
+
status: () => Promise<GiftWalletStatusOutcome>;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=gift-wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gift-wallet.d.ts","sourceRoot":"","sources":["../src/gift-wallet.js"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,wCAFa,cAAc,CAQ1B;;;;;;6BAKY,UAAU,GAAG,QAAQ,GAAG,WAAW;;;;;;mCAMnC,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,iBAAiB,GAAG,aAAa;;;;qCAI3E;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9F;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACrH;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE;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
|
|
27
27
|
export type DeviceIdentity = DevicePublicIdentity & {
|
|
28
28
|
readonly keyHandle: DeviceKeyHandle;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* One row of the paired client-device list, projected by an adapter's device session client
|
|
32
|
+
* from the home node's `/api/v2/client-devices` rows. Owned by ports so `@econ-v1/rpc` can
|
|
33
|
+
* re-export it to `client/ui` (rule B2) without depending on adapters-web.
|
|
34
|
+
*/
|
|
35
|
+
export type ClientDeviceListItem = {
|
|
36
|
+
/**
|
|
37
|
+
* Mirrors
|
|
38
|
+
* `@econ-v1/rpc`'s `ClientDeviceAgentAccess` (the `CLIENT_DEVICE_AGENT_ACCESS_STATES` union
|
|
39
|
+
* across the RPC seam) — keep in sync with it.
|
|
40
|
+
*/
|
|
41
|
+
agentAccess?: "granted" | "requested" | "refused" | "not_requested";
|
|
42
|
+
/**
|
|
43
|
+
* Mirrors
|
|
44
|
+
* `@econ-v1/rpc`'s `ClientDeviceRequestedGrant` — keep in sync with it.
|
|
45
|
+
*/
|
|
46
|
+
requestedGrant?: {
|
|
47
|
+
readonly workerClasses: readonly string[];
|
|
48
|
+
readonly collaborator: boolean;
|
|
49
|
+
};
|
|
50
|
+
deviceId: string;
|
|
51
|
+
deviceName?: string;
|
|
52
|
+
deviceType: string;
|
|
53
|
+
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether this row is the device the caller is currently authenticated as — derived
|
|
56
|
+
* client-side from the adapter's already-established local device session, never a
|
|
57
|
+
* server-sent marker, so it stays correct even if two tabs list devices against the same
|
|
58
|
+
* paired set but hold different sessions.
|
|
59
|
+
*/
|
|
60
|
+
isCurrent: boolean;
|
|
61
|
+
publicKeyMultibase: string;
|
|
62
|
+
status: string;
|
|
63
|
+
};
|
|
30
64
|
export type IdentityDiagnostics = {
|
|
31
65
|
readonly custodyMode?: KeyCustodyMode;
|
|
32
66
|
readonly hasDelegation: boolean;
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|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AO,CAAC,cAAc,CAAC;+BAC7B,MAAM,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;wBAC/C,MAAM,OAAO,CAAC,OAAO,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
2
|
+
export { createNullGiftWallet } from "./gift-wallet.js";
|
|
2
3
|
export { createNullInstallEnvironment } from "./install-environment.js";
|
|
3
4
|
export { createNullLcdTreeSource } from "./lcd-tree-source.js";
|
|
4
5
|
export { createNullOnboardingPresence } from "./onboarding-presence.js";
|
|
@@ -41,6 +42,7 @@ export type CredentialHandoffOpenResult = import("./credential-handoff.js").Cred
|
|
|
41
42
|
export type CredentialHandoffPort = import("./credential-handoff.js").CredentialHandoffPort;
|
|
42
43
|
export type CryptoPort = import("./crypto.js").CryptoPort;
|
|
43
44
|
export type IdPort = import("./id.js").IdPort;
|
|
45
|
+
export type ClientDeviceListItem = import("./identity.js").ClientDeviceListItem;
|
|
44
46
|
export type DeviceConnectionMetadata = import("./identity.js").DeviceConnectionMetadata;
|
|
45
47
|
export type DeviceDelegation = import("./identity.js").DeviceDelegation;
|
|
46
48
|
export type DeviceIdentity = import("./identity.js").DeviceIdentity;
|
|
@@ -212,6 +214,12 @@ export type CertificateTrustPlatform = import("./network/certificate-trust.js").
|
|
|
212
214
|
export type CertificateTrustProbePort = import("./network/certificate-trust.js").CertificateTrustProbePort;
|
|
213
215
|
export type CertificateTrustProbeResult = import("./network/certificate-trust.js").CertificateTrustProbeResult;
|
|
214
216
|
export type PlatformTrustPort = import("./network/certificate-trust.js").PlatformTrustPort;
|
|
217
|
+
export type GiftWalletCheckOutcome = import("./gift-wallet.js").GiftWalletCheckOutcome;
|
|
218
|
+
export type GiftWalletNoneReason = import("./gift-wallet.js").GiftWalletNoneReason;
|
|
219
|
+
export type GiftWalletPort = import("./gift-wallet.js").GiftWalletPort;
|
|
220
|
+
export type GiftWalletRedeemOutcome = import("./gift-wallet.js").GiftWalletRedeemOutcome;
|
|
221
|
+
export type GiftWalletStatusOutcome = import("./gift-wallet.js").GiftWalletStatusOutcome;
|
|
222
|
+
export type GiftWalletStep = import("./gift-wallet.js").GiftWalletStep;
|
|
215
223
|
export type OnboardingAccessCodeStore = import("./onboarding-access-code.js").OnboardingAccessCodeStore;
|
|
216
224
|
export type OnboardingCheckpointStoragePort = import("./onboarding-checkpoint.js").OnboardingCheckpointStoragePort;
|
|
217
225
|
export type OnboardingPresencePhase = import("./onboarding-presence.js").OnboardingPresencePhase;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;wBAEc,OAAO,mBAAmB,EAAE,SAAS;wCACrC,OAAO,mBAAmB,EAAE,yBAAyB;6BACrD,OAAO,mBAAmB,EAAE,cAAc;0BAC1C,OAAO,mBAAmB,EAAE,WAAW;gCACvC,OAAO,mBAAmB,EAAE,iBAAiB;gCAC7C,OAAO,mBAAmB,EAAE,iBAAiB;+BAC7C,OAAO,mBAAmB,EAAE,gBAAgB;mCAC5C,OAAO,mBAAmB,EAAE,oBAAoB;6CAChD,OAAO,mBAAmB,EAAE,8BAA8B;gCAC1D,OAAO,mBAAmB,EAAE,iBAAiB;gCAC7C,OAAO,mBAAmB,EAAE,iBAAiB;sCAC7C,OAAO,mBAAmB,EAAE,uBAAuB;6CACnD,OAAO,mBAAmB,EAAE,8BAA8B;wBAE1D,OAAO,YAAY,EAAE,SAAS;wBAC9B,OAAO,YAAY,EAAE,SAAS;wBAC9B,OAAO,YAAY,EAAE,SAAS;iCAC9B,OAAO,eAAe,EAAE,kBAAkB;sCAC1C,OAAO,eAAe,EAAE,uBAAuB;iCA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OAAO,cAAc,EAAE,eAAe;+BACtC,OAAO,cAAc,EAAE,gBAAgB;iCACvC,OAAO,cAAc,EAAE,kBAAkB;8BACzC,OAAO,cAAc,EAAE,eAAe;6BACtC,OAAO,cAAc,EAAE,cAAc;yBAGrC,OAAO,kBAAkB,EAAE,UAAU;sBACrC,OAAO,kBAAkB,EAAE,OAAO;2BAClC,OAAO,kBAAkB,EAAE,YAAY;oCAEvC,OAAO,kBAAkB,EAAE,qBAAqB;8BAEhD,OAAO,cAAc,EAAE,eAAe;4BACtC,OAAO,cAAc,EAAE,aAAa;mCACpC,OAAO,cAAc,EAAE,oBAAoB;gCAC3C,OAAO,cAAc,EAAE,iBAAiB;8BACxC,OAAO,cAAc,EAAE,eAAe;6BACtC,OAAO,cAAc,EAAE,cAAc;8BACrC,OAAO,cAAc,EAAE,eAAe;kCACtC,OAAO,cAAc,EAAE,mBAAmB;mCAG1C,OAAO,wBAAwB,EAAE,oBAAoB;mCACrD,OAAO,wBAAwB,EAAE,oBAAoB;0BACrD,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,iBAAiB,EAAE,eAAe;iCACzC,OAAO,iBAAiB,EAAE,kBAAkB;+BAE5C,OAAO,cAAc,EAAE,gBAAgB;gCACvC,OAAO,cAAc,EAAE,iBAAiB;oCAExC,OAAO,mBAAmB,EAAE,qBAAqB;yCACjD,OAAO,mBAAmB,EAAE,0BAA0B;gCACtD,OAAO,cAAc,EAAE,iBAAiB;iCAExC,OAAO,6BAA6B,EAAE,kBAAkB;kCACxD,OAAO,6BAA6B,EAAE,mBAAmB;0BACzD,OAAO,6BAA6B,EAAE,WAAW;4BACjD,OAAO,6BAA6B,EAAE,aAAa;mCACnD,OAAO,6BAA6B,EAAE,oBAAoB;8BAC1D,OAAO,cAAc,EAAE,eAAe"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
/**
|
|
3
|
+
* For compositions with no authenticated home-node client (tests, headless kernels): there is
|
|
4
|
+
* never a gift, which is the safe direction — onboarding then runs exactly the flow it ran
|
|
5
|
+
* before the gift step existed.
|
|
6
|
+
* @returns {GiftWalletPort}
|
|
7
|
+
*/
|
|
8
|
+
export function createNullGiftWallet() {
|
|
9
|
+
return {
|
|
10
|
+
check: async () => ({ reason: "unavailable", status: "none" }),
|
|
11
|
+
redeem: async () => ({ reason: "unavailable", status: "none" }),
|
|
12
|
+
status: async () => ({ status: "unavailable" }),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The three rows the gift step shows, in order: the LSP holds the wallet for this node
|
|
17
|
+
* (`reserved`), the node downloads and imports it (`moving`), the imported wallet waits for a
|
|
18
|
+
* usable channel (`spendable`).
|
|
19
|
+
* @typedef {"reserved" | "moving" | "spendable"} GiftWalletStep
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Why there is no gift. The first four are the node's own words (`wallet.gift.*`).
|
|
23
|
+
* `unavailable` is never sent by a node: it is what this side reports when the call failed,
|
|
24
|
+
* timed out or answered a shape it does not understand.
|
|
25
|
+
* @typedef {"not_configured" | "unreachable" | "none" | "already_claimed" | "unavailable"} GiftWalletNoneReason
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* `wallet.gift.check` — "is a gift wallet available for this node?".
|
|
29
|
+
* @typedef {| { readonly status: "available"; readonly amountSats: number; readonly giftId: string }
|
|
30
|
+
* | { readonly status: "installed"; readonly amountSats: number; readonly walletId: string; readonly spendable: boolean }
|
|
31
|
+
* | { readonly status: "none"; readonly reason: GiftWalletNoneReason }} GiftWalletCheckOutcome
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* `wallet.gift.redeem` — runs the whole transfer on the node; safe to call again, it resumes.
|
|
35
|
+
* `ready` = imported and a channel is usable. `installed` = imported, not usable yet.
|
|
36
|
+
* `errorCode` is a machine code for the details disclosure, never a sentence for a person.
|
|
37
|
+
* @typedef {| { readonly status: "ready"; readonly amountSats: number; readonly walletId: string }
|
|
38
|
+
* | { readonly status: "installed"; readonly amountSats: number; readonly walletId: string }
|
|
39
|
+
* | { readonly status: "failed"; readonly amountSats?: number; readonly step?: "reserved" | "moving"; readonly errorCode: string }
|
|
40
|
+
* | { readonly status: "none"; readonly reason: GiftWalletNoneReason }} GiftWalletRedeemOutcome
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* `wallet.gift.status` — cheap, from the node's persisted state, callable while a redeem is in
|
|
44
|
+
* flight. `unavailable` (never sent by a node) means the read itself did not answer, which is
|
|
45
|
+
* a different fact from the node's own `none`.
|
|
46
|
+
* @typedef {| {
|
|
47
|
+
* readonly status: "none" | "available" | "redeeming" | "installed" | "ready" | "failed";
|
|
48
|
+
* readonly step?: GiftWalletStep;
|
|
49
|
+
* readonly amountSats?: number;
|
|
50
|
+
* readonly walletId?: string;
|
|
51
|
+
* readonly giftId?: string;
|
|
52
|
+
* readonly errorCode?: string;
|
|
53
|
+
* }
|
|
54
|
+
* | { readonly status: "unavailable" }} GiftWalletStatusOutcome
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* The gift wallet a new node may receive at the end of onboarding.
|
|
58
|
+
*
|
|
59
|
+
* A centralized LSP node can hold a pre-made wallet for a freshly claimed node. The node's
|
|
60
|
+
* wallet app owns the whole transfer (`wallet.gift.check / redeem / status`); this port is how
|
|
61
|
+
* the onboarding flow asks for it. Every member resolves — a failed call, a timeout or an
|
|
62
|
+
* unexpected answer is an outcome (`none` / `failed` / `unavailable`), never a rejection, so a
|
|
63
|
+
* gift can never be the reason onboarding does not finish.
|
|
64
|
+
* @typedef {object} GiftWalletPort
|
|
65
|
+
* @property {() => Promise<GiftWalletCheckOutcome>} check
|
|
66
|
+
* @property {() => Promise<GiftWalletRedeemOutcome>} redeem
|
|
67
|
+
* @property {() => Promise<GiftWalletStatusOutcome>} status
|
|
68
|
+
*/
|
package/src/identity.js
CHANGED
|
@@ -8,6 +8,27 @@
|
|
|
8
8
|
/** @typedef {{ readonly credential: string, readonly expiresAt: string, readonly issuedAt: string, readonly revocationId: string, readonly scopes: readonly string[] }} DeviceDelegation */
|
|
9
9
|
/** @typedef {{ readonly directAddresses: readonly string[], readonly homeNodeId?: string, readonly lastConnectedAt?: string, readonly relayUrl?: string, readonly wanOrigin?: string, readonly wanOrigins?: readonly string[] }} DeviceConnectionMetadata */
|
|
10
10
|
/** @typedef {DevicePublicIdentity & { readonly keyHandle: DeviceKeyHandle }} DeviceIdentity */
|
|
11
|
+
/**
|
|
12
|
+
* One row of the paired client-device list, projected by an adapter's device session client
|
|
13
|
+
* from the home node's `/api/v2/client-devices` rows. Owned by ports so `@econ-v1/rpc` can
|
|
14
|
+
* re-export it to `client/ui` (rule B2) without depending on adapters-web.
|
|
15
|
+
* @typedef {Object} ClientDeviceListItem
|
|
16
|
+
* @property {"granted" | "requested" | "refused" | "not_requested"} [agentAccess] Mirrors
|
|
17
|
+
* `@econ-v1/rpc`'s `ClientDeviceAgentAccess` (the `CLIENT_DEVICE_AGENT_ACCESS_STATES` union
|
|
18
|
+
* across the RPC seam) — keep in sync with it.
|
|
19
|
+
* @property {{ readonly workerClasses: readonly string[], readonly collaborator: boolean }} [requestedGrant] Mirrors
|
|
20
|
+
* `@econ-v1/rpc`'s `ClientDeviceRequestedGrant` — keep in sync with it.
|
|
21
|
+
* @property {string} deviceId
|
|
22
|
+
* @property {string} [deviceName]
|
|
23
|
+
* @property {string} deviceType
|
|
24
|
+
* @property {string} id
|
|
25
|
+
* @property {boolean} isCurrent Whether this row is the device the caller is currently authenticated as — derived
|
|
26
|
+
* client-side from the adapter's already-established local device session, never a
|
|
27
|
+
* server-sent marker, so it stays correct even if two tabs list devices against the same
|
|
28
|
+
* paired set but hold different sessions.
|
|
29
|
+
* @property {string} publicKeyMultibase
|
|
30
|
+
* @property {string} status
|
|
31
|
+
*/
|
|
11
32
|
/** @typedef {{ readonly custodyMode?: KeyCustodyMode, readonly hasDelegation: boolean, readonly keyId?: string }} IdentityDiagnostics */
|
|
12
33
|
/** @typedef {"active" | "revoked" | "unusable"} IdentityLifecycle */
|
|
13
34
|
/**
|
package/src/index.js
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
/** @typedef {import("./credential-handoff.js").CredentialHandoffPort} CredentialHandoffPort */
|
|
34
34
|
/** @typedef {import("./crypto.js").CryptoPort} CryptoPort */
|
|
35
35
|
/** @typedef {import("./id.js").IdPort} IdPort */
|
|
36
|
+
/** @typedef {import("./identity.js").ClientDeviceListItem} ClientDeviceListItem */
|
|
36
37
|
/** @typedef {import("./identity.js").DeviceConnectionMetadata} DeviceConnectionMetadata */
|
|
37
38
|
/** @typedef {import("./identity.js").DeviceDelegation} DeviceDelegation */
|
|
38
39
|
/** @typedef {import("./identity.js").DeviceIdentity} DeviceIdentity */
|
|
@@ -205,6 +206,12 @@ export { StorageOperationError } from "./storage.js";
|
|
|
205
206
|
/** @typedef {import("./network/certificate-trust.js").CertificateTrustProbePort} CertificateTrustProbePort */
|
|
206
207
|
/** @typedef {import("./network/certificate-trust.js").CertificateTrustProbeResult} CertificateTrustProbeResult */
|
|
207
208
|
/** @typedef {import("./network/certificate-trust.js").PlatformTrustPort} PlatformTrustPort */
|
|
209
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletCheckOutcome} GiftWalletCheckOutcome */
|
|
210
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletNoneReason} GiftWalletNoneReason */
|
|
211
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletPort} GiftWalletPort */
|
|
212
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletRedeemOutcome} GiftWalletRedeemOutcome */
|
|
213
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletStatusOutcome} GiftWalletStatusOutcome */
|
|
214
|
+
/** @typedef {import("./gift-wallet.js").GiftWalletStep} GiftWalletStep */
|
|
208
215
|
/** @typedef {import("./onboarding-access-code.js").OnboardingAccessCodeStore} OnboardingAccessCodeStore */
|
|
209
216
|
/** @typedef {import("./onboarding-checkpoint.js").OnboardingCheckpointStoragePort} OnboardingCheckpointStoragePort */
|
|
210
217
|
/** @typedef {import("./onboarding-presence.js").OnboardingPresencePhase} OnboardingPresencePhase */
|
|
@@ -270,6 +277,7 @@ export { StorageOperationError } from "./storage.js";
|
|
|
270
277
|
/** @typedef {import("./stage-performance.js").StageResourceSample} StageResourceSample */
|
|
271
278
|
|
|
272
279
|
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
280
|
+
export { createNullGiftWallet } from "./gift-wallet.js";
|
|
273
281
|
export { createNullInstallEnvironment } from "./install-environment.js";
|
|
274
282
|
export { createNullLcdTreeSource } from "./lcd-tree-source.js";
|
|
275
283
|
export { createNullOnboardingPresence } from "./onboarding-presence.js";
|