@safetech/inheriti-client-sdk 1.17.13 → 1.17.15
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/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/inheriti-client-sdk.umd.js +41 -41
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/sdk-types.d.ts +24 -25
- package/dist/src/business/plan-edit/http-plan-edit-port.d.ts +1 -0
- package/dist/src/business/plan-edit/plan-edit-asset-access.d.ts +4 -2
- package/dist/src/business/plan-edit/quick-plan-editor.d.ts +15 -4
- package/dist/src/elements/elements-api-port.d.ts +7 -7
- package/dist/src/elements/elements-client.d.ts +6 -6
- package/dist/src/elements/http-elements-api-port.d.ts +7 -7
- package/dist/src/elements/relay-master-key-source.d.ts +2 -2
- package/dist/src/elements/scoped-reveal.d.ts +2 -3
- package/dist/test/index.js +1 -1
- package/package.json +3 -3
package/dist/sdk-types.d.ts
CHANGED
|
@@ -368,8 +368,8 @@ interface ElementsApiPort {
|
|
|
368
368
|
* SafeKey request; there is no separate "notify" step.
|
|
369
369
|
*/
|
|
370
370
|
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
371
|
-
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
372
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
371
|
+
readMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<MasterKeyRelaySessionState>;
|
|
372
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
373
373
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
374
374
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
375
375
|
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
@@ -391,7 +391,7 @@ interface ElementsApiPort {
|
|
|
391
391
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
392
392
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
393
393
|
}) | null>;
|
|
394
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
394
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
395
395
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
396
396
|
/** The host declaring it holds the storage-layer shares. Governed reveals only. */
|
|
397
397
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
@@ -401,13 +401,13 @@ interface ElementsApiPort {
|
|
|
401
401
|
*/
|
|
402
402
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
403
403
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
404
|
-
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
405
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
406
|
-
getRevealCustodianClaimable(revealId: string): Promise<ProCustodianShare>;
|
|
404
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<CustodianShareAccess>;
|
|
405
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
406
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<ProCustodianShare>;
|
|
407
407
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
408
408
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
409
409
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
410
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
410
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
411
411
|
/**
|
|
412
412
|
* Gives up the governed access this operator holds on a plan.
|
|
413
413
|
*
|
|
@@ -720,11 +720,11 @@ interface MasterKeyRelayPort {
|
|
|
720
720
|
sessionId: string;
|
|
721
721
|
expiresAt: string | Date;
|
|
722
722
|
}>;
|
|
723
|
-
readRelaySession(sessionId: string): Promise<{
|
|
723
|
+
readRelaySession(sessionId: string, signal?: AbortSignal): Promise<{
|
|
724
724
|
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
725
725
|
sealedMasterKey?: string;
|
|
726
726
|
}>;
|
|
727
|
-
cancelRelaySession?(sessionId: string): Promise<void>;
|
|
727
|
+
cancelRelaySession?(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
728
728
|
}
|
|
729
729
|
declare class MasterKeyRelayTimedOut extends Error {
|
|
730
730
|
readonly sessionId: string;
|
|
@@ -937,9 +937,8 @@ type RevealPhase =
|
|
|
937
937
|
/**
|
|
938
938
|
* The key that opens the plan is being asked of the device holding it.
|
|
939
939
|
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
* through in a single call — so its presence means a person has to answer on SafeKey Mobile.
|
|
940
|
+
* Reported when a relay request starts, before governance or material release. Cached and
|
|
941
|
+
* locally derived keys do not report a device wait.
|
|
943
942
|
*/
|
|
944
943
|
'WAITING_FOR_MASTER_KEY' | 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_AUTHENTICATION' | 'WAITING_FOR_MODERATION' | 'RELEASING_MATERIAL' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN' | 'CONNECTING_SAFEKEY_PRO' | 'CUSTODIAN_SHARE_DISTRIBUTED' | 'RECONSTRUCTING' | 'OPEN' | 'DENIED' | 'EXPIRED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'STOPPED_BY_DMS' | 'ENDED'
|
|
945
944
|
/** A stage this build has not been taught to name. Stages are additive, so it is a wait. */
|
|
@@ -1172,7 +1171,7 @@ declare class ElementsClient {
|
|
|
1172
1171
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
1173
1172
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
1174
1173
|
}) | null>;
|
|
1175
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
1174
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
1176
1175
|
openReveal(planId: string, options?: OpenRevealOptions): Promise<RevealHandle>;
|
|
1177
1176
|
withReveal<TResult>(planId: string, options: OpenRevealOptions, work: (reveal: RevealHandle) => Promise<TResult>): Promise<TResult>;
|
|
1178
1177
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
@@ -1186,17 +1185,17 @@ declare class ElementsClient {
|
|
|
1186
1185
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
1187
1186
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
1188
1187
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
1189
|
-
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
1190
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
1191
|
-
getRevealCustodianClaimable(revealId: string): Promise<ProCustodianShare>;
|
|
1188
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<CustodianShareAccess>;
|
|
1189
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
1190
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<ProCustodianShare>;
|
|
1192
1191
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
1193
1192
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
1194
1193
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
1195
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
1194
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
1196
1195
|
abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
|
|
1197
1196
|
aborted: boolean;
|
|
1198
1197
|
}>;
|
|
1199
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
1198
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
1200
1199
|
authorizeRevealAction(revealId: string, input: AuthorizeRevealActionInput): Promise<RevealAction>;
|
|
1201
1200
|
reportRevealActionOutcome(revealId: string, actionId: string, input: ReportRevealActionOutcomeInput): Promise<RevealAction>;
|
|
1202
1201
|
getCustodianShare(processId: string, stepUp?: StepUpReadContext): Promise<CustodianShareResult>;
|
|
@@ -1274,8 +1273,8 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1274
1273
|
masterKeyAcquisition(): Promise<MasterKeyAcquisition>;
|
|
1275
1274
|
foreignMasterKeyAcquisition(system: string, contextId: string): Promise<MasterKeyAcquisition>;
|
|
1276
1275
|
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
1277
|
-
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
1278
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
1276
|
+
readMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<MasterKeyRelaySessionState>;
|
|
1277
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
1279
1278
|
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
1280
1279
|
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
1281
1280
|
initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
|
|
@@ -1290,18 +1289,18 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1290
1289
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
1291
1290
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
1292
1291
|
}) | null>;
|
|
1293
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
1292
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
1294
1293
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
1295
1294
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
1296
1295
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
1297
1296
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
1298
|
-
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
1299
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
1300
|
-
getRevealCustodianClaimable(revealId: string): Promise<ProCustodianShare>;
|
|
1297
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<CustodianShareAccess>;
|
|
1298
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
1299
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<ProCustodianShare>;
|
|
1301
1300
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
1302
1301
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
1303
1302
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
1304
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
1303
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
1305
1304
|
abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
|
|
1306
1305
|
aborted: boolean;
|
|
1307
1306
|
}>;
|
|
@@ -75,6 +75,7 @@ export declare class HttpPlanEditPort {
|
|
|
75
75
|
start(organizationId: string, planId: string, mode: 'DIRECT' | 'GOVERNED', idempotencyKey: string): Promise<EditSession>;
|
|
76
76
|
listEligibleCandidates(organizationId: string, cursor?: string, namePrefix?: string): Promise<PlanEditCandidatePage>;
|
|
77
77
|
context(organizationId: string, planId: string): Promise<PlanEditContext>;
|
|
78
|
+
moderatorNames(organizationId: string, planId: string): Promise<ReadonlyMap<string, string>>;
|
|
78
79
|
startRelaySession(organizationId: string, context: PlanEditContext['masterKeyAcquisition'], clientPublicKey: string): Promise<{
|
|
79
80
|
sessionId: string;
|
|
80
81
|
expiresAt: string | Date;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SDKContainer, DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
2
2
|
import type { HttpPlanEditPort } from './http-plan-edit-port';
|
|
3
|
-
import type { EditRecoveryStore, PlanEditAssetReference,
|
|
3
|
+
import type { EditRecoveryStore, PlanEditAssetReference, QuickPlanEditProgress } from './quick-plan-editor';
|
|
4
4
|
type Plan = {
|
|
5
5
|
withCustodian: boolean;
|
|
6
6
|
masterKeyEncrypted: boolean;
|
|
@@ -14,7 +14,7 @@ export declare class PlanEditAssetAccess {
|
|
|
14
14
|
constructor(port: HttpPlanEditPort, coreSdk: SDKContainer, recoveryStore: EditRecoveryStore);
|
|
15
15
|
clearRevealedAssets(planId: string): void;
|
|
16
16
|
private configurationRepository;
|
|
17
|
-
loadAssets(input: PlanEditAssetReference, onProgress?:
|
|
17
|
+
loadAssets(input: PlanEditAssetReference, onProgress?: QuickPlanEditProgress): Promise<{
|
|
18
18
|
plan: Plan;
|
|
19
19
|
masterKey?: string;
|
|
20
20
|
assets: DataAsset[];
|
|
@@ -22,6 +22,8 @@ export declare class PlanEditAssetAccess {
|
|
|
22
22
|
private assertEditSession;
|
|
23
23
|
private resolveMasterKey;
|
|
24
24
|
private revealAssets;
|
|
25
|
+
private assertApprovalOutcome;
|
|
26
|
+
private approvalError;
|
|
25
27
|
private assertShare;
|
|
26
28
|
private assertNotAborted;
|
|
27
29
|
}
|
|
@@ -4,6 +4,17 @@ import { HttpPlanEditPort } from './http-plan-edit-port';
|
|
|
4
4
|
import type { ReconfigureMaterial } from './http-plan-edit-port';
|
|
5
5
|
import type { EditReference } from './plan-edit-reconfiguration';
|
|
6
6
|
export type QuickPlanEditPhase = 'checking_edit' | 'acquiring_key' | 'opening_plan' | 'revealing' | 'pending_dms' | 'pending_approvals' | 'pending_auth' | 'pending_moderation' | 'distributing_custodian_share' | 'configuring_custodian_share' | 'claiming_custodian_share' | 'releasing_custodian_share' | 'connecting_safekey_pro' | 'collecting_validators' | 'collecting_shares' | 'reconstructing' | 'opening_window' | 'preparing_view' | 'preparing' | 'preflighting' | 'distributing_validators' | 'distributing_data' | 'finalizing' | 'verifying';
|
|
7
|
+
export interface QuickPlanEditApprovalProgress {
|
|
8
|
+
requiredApprovals: number;
|
|
9
|
+
approvedModerators: number;
|
|
10
|
+
moderators: readonly {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
status: 'IDLE' | 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELED';
|
|
14
|
+
expiresAt?: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
export type QuickPlanEditProgress = (phase: QuickPlanEditPhase, approvals?: QuickPlanEditApprovalProgress) => void;
|
|
7
18
|
export interface AddPlanAssetInput {
|
|
8
19
|
organizationId: string;
|
|
9
20
|
planId: string;
|
|
@@ -62,13 +73,13 @@ export declare class QuickPlanEditor {
|
|
|
62
73
|
constructor(port: HttpPlanEditPort, coreSdk: SDKContainer, recoveryStore: EditRecoveryStore);
|
|
63
74
|
clearRevealedAssets(planId: string): void;
|
|
64
75
|
start(organizationId: string, planId: string, mode: 'DIRECT' | 'GOVERNED', idempotencyKey: string): Promise<EditSession>;
|
|
65
|
-
listAssets(input: PlanEditAssetReference, onProgress?:
|
|
66
|
-
getAsset(input: PlanEditAssetReference, assetId: string, onProgress?:
|
|
67
|
-
replaceAsset(input: ReplacePlanAssetInput, onProgress?:
|
|
76
|
+
listAssets(input: PlanEditAssetReference, onProgress?: QuickPlanEditProgress): Promise<PlanEditAssetSummary[]>;
|
|
77
|
+
getAsset(input: PlanEditAssetReference, assetId: string, onProgress?: QuickPlanEditProgress): Promise<DataAsset>;
|
|
78
|
+
replaceAsset(input: ReplacePlanAssetInput, onProgress?: QuickPlanEditProgress): Promise<{
|
|
68
79
|
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
69
80
|
assetId: string;
|
|
70
81
|
}>;
|
|
71
|
-
addAsset(input: AddPlanAssetInput, onProgress?:
|
|
82
|
+
addAsset(input: AddPlanAssetInput, onProgress?: QuickPlanEditProgress): Promise<{
|
|
72
83
|
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
73
84
|
assetId: string;
|
|
74
85
|
}>;
|
|
@@ -66,8 +66,8 @@ export interface ElementsApiPort {
|
|
|
66
66
|
* SafeKey request; there is no separate "notify" step.
|
|
67
67
|
*/
|
|
68
68
|
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
69
|
-
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
70
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
69
|
+
readMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<MasterKeyRelaySessionState>;
|
|
70
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
71
71
|
listPlans(input?: import('./plan-operations').ListPlansInput): Promise<import('./plan-operations').PlanPage>;
|
|
72
72
|
getPlan(planId: string): Promise<import('./plan-operations').PlanDetail>;
|
|
73
73
|
listPlanLogs(planId: string, input?: import('./plan-operations').ListPlanLogsInput): Promise<import('./plan-operations').PlanLogPage>;
|
|
@@ -89,7 +89,7 @@ export interface ElementsApiPort {
|
|
|
89
89
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
90
90
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
91
91
|
}) | null>;
|
|
92
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
92
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
93
93
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
94
94
|
/** The host declaring it holds the storage-layer shares. Governed reveals only. */
|
|
95
95
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
@@ -99,13 +99,13 @@ export interface ElementsApiPort {
|
|
|
99
99
|
*/
|
|
100
100
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
101
101
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
102
|
-
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
103
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
104
|
-
getRevealCustodianClaimable(revealId: string): Promise<ProCustodianShare>;
|
|
102
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<CustodianShareAccess>;
|
|
103
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
104
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<ProCustodianShare>;
|
|
105
105
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
106
106
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
107
107
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
108
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
108
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
109
109
|
/**
|
|
110
110
|
* Gives up the governed access this operator holds on a plan.
|
|
111
111
|
*
|
|
@@ -170,7 +170,7 @@ export default class ElementsClient {
|
|
|
170
170
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
171
171
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
172
172
|
}) | null>;
|
|
173
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
173
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
174
174
|
openReveal(planId: string, options?: OpenRevealOptions): Promise<RevealHandle>;
|
|
175
175
|
withReveal<TResult>(planId: string, options: OpenRevealOptions, work: (reveal: RevealHandle) => Promise<TResult>): Promise<TResult>;
|
|
176
176
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
@@ -184,17 +184,17 @@ export default class ElementsClient {
|
|
|
184
184
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
185
185
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
186
186
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
187
|
-
getRevealCustodianAccess(revealId: string): Promise<import("./elements-api-port").CustodianShareAccess>;
|
|
188
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
189
|
-
getRevealCustodianClaimable(revealId: string): Promise<import("./elements-api-port").ProCustodianShare>;
|
|
187
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<import("./elements-api-port").CustodianShareAccess>;
|
|
188
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
189
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<import("./elements-api-port").ProCustodianShare>;
|
|
190
190
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
191
191
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
192
192
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
193
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
193
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
194
194
|
abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
|
|
195
195
|
aborted: boolean;
|
|
196
196
|
}>;
|
|
197
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
197
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
198
198
|
authorizeRevealAction(revealId: string, input: AuthorizeRevealActionInput): Promise<RevealAction>;
|
|
199
199
|
reportRevealActionOutcome(revealId: string, actionId: string, input: ReportRevealActionOutcomeInput): Promise<RevealAction>;
|
|
200
200
|
getCustodianShare(processId: string, stepUp?: StepUpReadContext): Promise<CustodianShareResult>;
|
|
@@ -53,8 +53,8 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
53
53
|
masterKeyAcquisition(): Promise<MasterKeyAcquisition>;
|
|
54
54
|
foreignMasterKeyAcquisition(system: string, contextId: string): Promise<MasterKeyAcquisition>;
|
|
55
55
|
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
56
|
-
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
57
|
-
cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
|
|
56
|
+
readMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<MasterKeyRelaySessionState>;
|
|
57
|
+
cancelMasterKeyRelaySession(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
58
58
|
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
59
59
|
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
60
60
|
initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
|
|
@@ -69,18 +69,18 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
69
69
|
getActivePlanReveal(planId: string): Promise<(RevealSession & {
|
|
70
70
|
recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
|
|
71
71
|
}) | null>;
|
|
72
|
-
getReveal(revealId: string): Promise<RevealSession>;
|
|
72
|
+
getReveal(revealId: string, signal?: AbortSignal): Promise<RevealSession>;
|
|
73
73
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
74
74
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
75
75
|
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
76
76
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
77
|
-
getRevealCustodianAccess(revealId: string): Promise<import('./elements-api-port').CustodianShareAccess>;
|
|
78
|
-
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
79
|
-
getRevealCustodianClaimable(revealId: string): Promise<import('./elements-api-port').ProCustodianShare>;
|
|
77
|
+
getRevealCustodianAccess(revealId: string, signal?: AbortSignal): Promise<import('./elements-api-port').CustodianShareAccess>;
|
|
78
|
+
getRevealCustodianShare(revealId: string, signal?: AbortSignal): Promise<CustodianShareResult>;
|
|
79
|
+
getRevealCustodianClaimable(revealId: string, signal?: AbortSignal): Promise<import('./elements-api-port').ProCustodianShare>;
|
|
80
80
|
claimRevealCustodianShare(revealId: string, shareId: string, deviceId: string): Promise<void>;
|
|
81
81
|
collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
|
|
82
82
|
reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
|
|
83
|
-
closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
|
|
83
|
+
closeReveal(revealId: string, reason: RevealCloseReason, signal?: AbortSignal): Promise<RevealSession>;
|
|
84
84
|
abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
|
|
85
85
|
aborted: boolean;
|
|
86
86
|
}>;
|
|
@@ -4,11 +4,11 @@ export interface MasterKeyRelayPort {
|
|
|
4
4
|
sessionId: string;
|
|
5
5
|
expiresAt: string | Date;
|
|
6
6
|
}>;
|
|
7
|
-
readRelaySession(sessionId: string): Promise<{
|
|
7
|
+
readRelaySession(sessionId: string, signal?: AbortSignal): Promise<{
|
|
8
8
|
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
9
9
|
sealedMasterKey?: string;
|
|
10
10
|
}>;
|
|
11
|
-
cancelRelaySession?(sessionId: string): Promise<void>;
|
|
11
|
+
cancelRelaySession?(sessionId: string, signal?: AbortSignal): Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
export declare class MasterKeyRelayTimedOut extends Error {
|
|
14
14
|
readonly sessionId: string;
|
|
@@ -40,9 +40,8 @@ export type RevealPhase =
|
|
|
40
40
|
/**
|
|
41
41
|
* The key that opens the plan is being asked of the device holding it.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* through in a single call — so its presence means a person has to answer on SafeKey Mobile.
|
|
43
|
+
* Reported when a relay request starts, before governance or material release. Cached and
|
|
44
|
+
* locally derived keys do not report a device wait.
|
|
46
45
|
*/
|
|
47
46
|
'WAITING_FOR_MASTER_KEY' | 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_AUTHENTICATION' | 'WAITING_FOR_MODERATION' | 'RELEASING_MATERIAL' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN' | 'CONNECTING_SAFEKEY_PRO' | 'CUSTODIAN_SHARE_DISTRIBUTED' | 'RECONSTRUCTING' | 'OPEN' | 'DENIED' | 'EXPIRED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'STOPPED_BY_DMS' | 'ENDED'
|
|
48
47
|
/** A stage this build has not been taught to name. Stages are additive, so it is a wait. */
|
package/dist/test/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TestUtils as
|
|
1
|
+
import{TestUtils as m}from"@safetech/inheriti-core-sdk/test";import{DataAssetBuilder as r}from"@safetech/inheriti-core-sdk";function a(e){return`${e.system}:${e.contextId}`}var n=class{keys=new Map;async store(t,s){let o=a(t),c=s.slice();this.keys.get(o)?.fill(0),this.keys.set(o,c)}async load(t){return this.keys.get(a(t))?.slice()}async remove(t){let s=a(t);this.keys.get(s)?.fill(0),this.keys.delete(s)}};var i=class{values=new Map;async set(t,s){this.values.set(t,s)}async get(t){return this.values.get(t)}async remove(t){this.values.delete(t)}};var d=class extends n{},y=class extends i{};var f=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","afford","afraid","again","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert"],u={plainText:e=>r.plainText({name:e?.name??"Plain text asset",id:e?.id,secret:e?.secret??{text:"Sample plain text"}}),onlineAccount:e=>r.userAndPassword({name:e?.name??"Online account",id:e?.id,secret:e?.secret??{appOrWebsite:"example.com",email:"user@example.com",username:"sampleuser",password:"SamplePass123!"}}),recoveryCode:e=>r.recoveryCode({name:e?.name??"Recovery code",id:e?.id,secret:e?.secret??{appOrWebsite:"example.com",code:"XXXX-XXXX-XXXX-XXXX"}}),pinCode:e=>r.pinCode({name:e?.name??"PIN code",id:e?.id,secret:e?.secret??{deviceOrApp:"My Device",code:"1234"}}),apiKey:e=>r.apiKey({name:e?.name??"API key",id:e?.id,secret:e?.secret??{app:"My App",apiKey:"sk-sample-api-key-12345"}}),privateKey:e=>r.privateKey({name:e?.name??"Private key",id:e?.id,secret:e?.secret??{publicAddress:"0x0000000000000000000000000000000000000000",privateKey:"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"}}),seedPhrase:e=>{let t=e?.typeLength??12,s=e?.secret?.words??Array.from({length:t},(o,c)=>f[c%f.length]);return r.seedPhrase({name:e?.name??"Seed phrase",id:e?.id,secret:{words:s}})},paymentDebitCard:e=>r.paymentDebitCard({name:e?.name??"Debit card",id:e?.id,secret:e?.secret??{cardNumber:"4111 1111 1111 1111",expiryDate:"12/28"}}),paymentCreditCard:e=>r.paymentCreditCard({name:e?.name??"Credit card",id:e?.id,secret:e?.secret??{cardNumber:"4111 1111 1111 1111",expiryDate:"12/28"}})},M={...m,ProtectionPlan:{...m.ProtectionPlan,PlanDataAssetInputGenerator:u}};export{d as TestKeyVault,y as TestStatePort,M as TestUtils};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safetech/inheriti-client-sdk",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"private": false,
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@safetech/safekey-sdk": "
|
|
45
|
-
"@safetech/inheriti-core-sdk": "4.0.
|
|
44
|
+
"@safetech/safekey-sdk": "1.0.1",
|
|
45
|
+
"@safetech/inheriti-core-sdk": "4.0.34"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@rollup/plugin-alias": "^5.1.1",
|