@safetech/inheriti-client-sdk 1.17.6 → 1.17.8
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/README.md +17 -1
- package/dist/browser.d.ts +14 -6
- package/dist/browser.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/inheriti-client-sdk.umd.js +53 -75
- package/dist/node.d.ts +13 -5
- package/dist/node.js +1 -1
- package/dist/sdk-types.d.ts +87 -20
- package/dist/src/business/organizations.d.ts +11 -0
- package/dist/src/elements/core-plan-material-builder.d.ts +0 -3
- package/dist/src/elements/elements-api-port.d.ts +12 -4
- package/dist/src/elements/elements-client.d.ts +9 -2
- package/dist/src/elements/http-elements-api-port.d.ts +12 -4
- package/dist/src/elements/index.d.ts +2 -1
- package/dist/src/elements/master-key-acquisition.d.ts +8 -4
- package/dist/src/elements/node-plan-material-reconstructor.d.ts +1 -1
- package/dist/src/elements/plan-operation-codec.d.ts +2 -1
- package/dist/src/elements/plan-operations.d.ts +22 -3
- package/dist/src/elements/scoped-reveal.d.ts +8 -1
- package/dist/src/elements/ssdp-v2-plan-material-reconstructor.d.ts +7 -0
- package/dist/test.d.ts +184 -1
- package/package.json +3 -8
- package/docs/docs.json +0 -18331
- package/docs/elements-shared-mode.md +0 -28
- package/docs/operator-auth.md +0 -76
- package/docs/plan-operations.md +0 -41
- package/index.ts +0 -10
- package/node.ts +0 -74
package/dist/sdk-types.d.ts
CHANGED
|
@@ -105,6 +105,27 @@ interface PlanPage {
|
|
|
105
105
|
items: PlanSummary[];
|
|
106
106
|
nextCursor: string | null;
|
|
107
107
|
}
|
|
108
|
+
interface ListPlanLogsInput {
|
|
109
|
+
limit?: number;
|
|
110
|
+
offset?: number;
|
|
111
|
+
}
|
|
112
|
+
interface PlanLog {
|
|
113
|
+
id: string;
|
|
114
|
+
planId: string;
|
|
115
|
+
tenantId: string;
|
|
116
|
+
event: string;
|
|
117
|
+
occurredOn: string;
|
|
118
|
+
status?: string;
|
|
119
|
+
title: string;
|
|
120
|
+
details: Array<{
|
|
121
|
+
label: string;
|
|
122
|
+
value: string;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
interface PlanLogPage {
|
|
126
|
+
items: PlanLog[];
|
|
127
|
+
total: number;
|
|
128
|
+
}
|
|
108
129
|
interface ListPlansInput {
|
|
109
130
|
cursor?: string;
|
|
110
131
|
limit?: number;
|
|
@@ -135,7 +156,7 @@ interface PlanDetail extends PlanSummary {
|
|
|
135
156
|
}>;
|
|
136
157
|
revealPolicy: {
|
|
137
158
|
masterKeyRelease: CompatibleValue<'REQUIRED'>;
|
|
138
|
-
custodian: CompatibleValue<'FORCE'
|
|
159
|
+
custodian: CompatibleValue<'FORCE'>;
|
|
139
160
|
};
|
|
140
161
|
dms?: {
|
|
141
162
|
subjectEmail: string;
|
|
@@ -212,8 +233,6 @@ interface PlanGovernancePolicy {
|
|
|
212
233
|
countdownHours?: number;
|
|
213
234
|
countdownMinutes?: number;
|
|
214
235
|
};
|
|
215
|
-
masterKeyRelease?: 'REQUIRED';
|
|
216
|
-
custodian?: 'FORCE' | 'BYPASS';
|
|
217
236
|
}
|
|
218
237
|
declare const PLAN_CREATION_SERVER_STAGES: readonly ["VALIDATED", "PLAN_CREATED", "PARTICIPANTS_PERSISTED", "STORAGE_PREPARED", "AWAITING_ENCRYPTED_MATERIAL", "VALIDATOR_SHARES_DISTRIBUTED", "CONFIGURED", "COMPLETED"];
|
|
219
238
|
type PlanCreationServerStage = (typeof PLAN_CREATION_SERVER_STAGES)[number];
|
|
@@ -328,6 +347,10 @@ interface MasterKeyRelaySessionOpened {
|
|
|
328
347
|
sessionId: string;
|
|
329
348
|
expiresAt: string | Date;
|
|
330
349
|
}
|
|
350
|
+
interface MasterKeyRelayContext {
|
|
351
|
+
system: string;
|
|
352
|
+
contextId: string;
|
|
353
|
+
}
|
|
331
354
|
interface MasterKeyRelaySessionState {
|
|
332
355
|
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
333
356
|
sealedMasterKey?: string;
|
|
@@ -341,10 +364,11 @@ interface ElementsApiPort {
|
|
|
341
364
|
* Asks the device holding the key to release it to this host. Creating the session *is* the
|
|
342
365
|
* SafeKey request; there is no separate "notify" step.
|
|
343
366
|
*/
|
|
344
|
-
startMasterKeyRelaySession(clientPublicKey: string): Promise<MasterKeyRelaySessionOpened>;
|
|
367
|
+
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
345
368
|
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
346
369
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
347
370
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
371
|
+
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
348
372
|
startPlanCreation(input: StartPlanCreationInput): Promise<PlanCreationProgress>;
|
|
349
373
|
getPlanCreation(operationId: string): Promise<PlanCreationProgress>;
|
|
350
374
|
supplyPlanCreationMaterial(operationId: string, material: EncryptedPlanMaterial): Promise<PlanCreationProgress>;
|
|
@@ -368,6 +392,7 @@ interface ElementsApiPort {
|
|
|
368
392
|
* The custodian steps on the operator surface. The `/shared-plans/merge/...` equivalents are
|
|
369
393
|
* credential routes and refuse an operator token, so a host addresses them by reveal id.
|
|
370
394
|
*/
|
|
395
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
371
396
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
372
397
|
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
373
398
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -405,7 +430,7 @@ interface ExportPlanBridgeInput {
|
|
|
405
430
|
interface PlanRevealProfile {
|
|
406
431
|
governance: 'KEEP' | 'BYPASS';
|
|
407
432
|
masterKeyRelease: 'REQUIRED';
|
|
408
|
-
custodian: '
|
|
433
|
+
custodian: 'FORCE';
|
|
409
434
|
}
|
|
410
435
|
interface PlanBridgeEnvelope {
|
|
411
436
|
transferMode: 'COPY' | 'MOVE';
|
|
@@ -516,8 +541,8 @@ type RevealMode = 'DIRECT' | 'GOVERNED';
|
|
|
516
541
|
/** Reveal stages are additive. Hosts must treat unknown non-terminal values as waiting. */
|
|
517
542
|
type RevealStage = 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_PARTICIPANTS' | 'AUTHORIZED' | 'MATERIAL_AUTHORIZED' | 'MATERIAL_RELEASED' | 'RECONSTRUCTED' | 'ACTIONS_OPEN' | 'CLOSING' | 'CLOSED' | 'DENIED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'EXPIRED' | 'CANCELED' | 'FAILED' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN';
|
|
518
543
|
type RevealCloseReason = 'COMPLETED' | 'CANCELED' | 'DMS_RESET' | 'ERROR';
|
|
519
|
-
type RevealActionType = 'VIEW_FIELD' | 'COPY_FIELD' | 'USE_FIELD' | 'EXPORT_ASSET' | 'AUTOFILL_FIELD' | 'INSERT_FIELD';
|
|
520
|
-
type RevealActionDestination = 'STDIN' | 'ENVIRONMENT' | 'FILE_DESCRIPTOR' | 'LOCAL_SOCKET' | 'TEMPORARY_FILE';
|
|
544
|
+
type RevealActionType = 'VIEW_FIELD' | 'COPY_FIELD' | 'USE_FIELD' | 'EXPORT_ASSET' | 'AUTOFILL_FIELD' | 'INSERT_FIELD' | 'DELIVER_FIELD';
|
|
545
|
+
type RevealActionDestination = 'STDIN' | 'ENVIRONMENT' | 'FILE_DESCRIPTOR' | 'LOCAL_SOCKET' | 'TEMPORARY_FILE' | 'LOCAL_BROWSER';
|
|
521
546
|
type RevealActionOutcome = 'SUCCEEDED' | 'FAILED' | 'CANCELED';
|
|
522
547
|
interface StartRevealInput {
|
|
523
548
|
mode: RevealMode;
|
|
@@ -530,6 +555,7 @@ interface RevealReconstructionInput {
|
|
|
530
555
|
interface RevealSession {
|
|
531
556
|
id: string;
|
|
532
557
|
idempotencyKey: string;
|
|
558
|
+
/** Standalone Application ID; embedded Business currently fills this wire alias with the integration client ID. */
|
|
533
559
|
applicationId: string;
|
|
534
560
|
environment: 'TEST' | 'LIVE';
|
|
535
561
|
planId: string;
|
|
@@ -556,6 +582,7 @@ interface RevealSession {
|
|
|
556
582
|
* without this a host cannot tell whose action it is waiting for. Absent past governance.
|
|
557
583
|
*/
|
|
558
584
|
governanceGate?: 'DMS' | 'AUTHENTICATION' | 'MODERATION';
|
|
585
|
+
deniedBy?: 'AUTHENTICATION' | 'MODERATION';
|
|
559
586
|
/** Deadline of the active authentication or moderation layer. */
|
|
560
587
|
governanceExpiresAt?: string;
|
|
561
588
|
closedReason?: RevealCloseReason;
|
|
@@ -716,10 +743,8 @@ declare class RelayMasterKeySource implements MasterKeySource {
|
|
|
716
743
|
interface DeclaredMasterKeySource {
|
|
717
744
|
resolve(): Promise<string | undefined>;
|
|
718
745
|
}
|
|
719
|
-
|
|
746
|
+
type MasterKeyAcquisitionOptions = {
|
|
720
747
|
api: ElementsApiPort;
|
|
721
|
-
/** The Application this host acts for. A ref naming any other context is foreign. */
|
|
722
|
-
applicationId: string;
|
|
723
748
|
/**
|
|
724
749
|
* What this host can produce on its own: a passphrase-derived key, or key material it already
|
|
725
750
|
* holds. Absent means the host has no custody of its own and must be given the key.
|
|
@@ -732,7 +757,13 @@ interface MasterKeyAcquisitionOptions {
|
|
|
732
757
|
source?: DeclaredMasterKeySource;
|
|
733
758
|
/** Passed through to the relay, for hosts that want a different wait or poll interval. */
|
|
734
759
|
relay?: Omit<RelayMasterKeySourceOptions, 'api'>;
|
|
735
|
-
}
|
|
760
|
+
} & ({
|
|
761
|
+
applicationId: string;
|
|
762
|
+
organizationId?: never;
|
|
763
|
+
} | {
|
|
764
|
+
organizationId: string;
|
|
765
|
+
applicationId?: never;
|
|
766
|
+
});
|
|
736
767
|
/**
|
|
737
768
|
* Decides how this host obtains the key that opens a plan, and does it.
|
|
738
769
|
*
|
|
@@ -859,6 +890,12 @@ interface ConsumedRevealField {
|
|
|
859
890
|
value: unknown;
|
|
860
891
|
}
|
|
861
892
|
type RevealFieldDestination = (fields: readonly ConsumedRevealField[]) => void | Promise<void>;
|
|
893
|
+
type RevealAssetDestination = (asset: {
|
|
894
|
+
id: string;
|
|
895
|
+
fileName?: string;
|
|
896
|
+
mimeType?: string;
|
|
897
|
+
bytes: Uint8Array;
|
|
898
|
+
}) => void | Promise<void>;
|
|
862
899
|
/**
|
|
863
900
|
* Where a reveal has got to, in the order a reveal runs.
|
|
864
901
|
*
|
|
@@ -877,7 +914,7 @@ type RevealPhase =
|
|
|
877
914
|
* one-shot material release. A host that derives its own key never sees this phase — it passes
|
|
878
915
|
* through in a single call — so its presence means a person has to answer on SafeKey Mobile.
|
|
879
916
|
*/
|
|
880
|
-
'WAITING_FOR_MASTER_KEY' | 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_AUTHENTICATION' | 'WAITING_FOR_MODERATION' | 'RELEASING_MATERIAL' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN' | 'RECONSTRUCTING' | 'OPEN' | 'DENIED' | 'EXPIRED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'STOPPED_BY_DMS' | 'ENDED'
|
|
917
|
+
'WAITING_FOR_MASTER_KEY' | 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_AUTHENTICATION' | 'WAITING_FOR_MODERATION' | 'RELEASING_MATERIAL' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN' | 'CUSTODIAN_SHARE_DISTRIBUTED' | 'RECONSTRUCTING' | 'OPEN' | 'DENIED' | 'EXPIRED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'STOPPED_BY_DMS' | 'ENDED'
|
|
881
918
|
/** A stage this build has not been taught to name. Stages are additive, so it is a wait. */
|
|
882
919
|
| 'CONTINUING';
|
|
883
920
|
interface RevealProgress {
|
|
@@ -911,6 +948,7 @@ interface RevealHandle {
|
|
|
911
948
|
field<TValue = unknown>(selector: AssetFieldSelector, options?: RevealFieldOptions): Promise<TValue>;
|
|
912
949
|
/** Authorize, decode and deliver fields without returning their plaintext to the caller. */
|
|
913
950
|
consumeFields(fields: readonly RevealFieldConsumption[], destination: RevealFieldDestination): Promise<void>;
|
|
951
|
+
exportAsset(selector: string, destination: RevealAssetDestination): Promise<void>;
|
|
914
952
|
close(reason?: RevealCloseReason): Promise<void>;
|
|
915
953
|
[Symbol.asyncDispose](): Promise<void>;
|
|
916
954
|
}
|
|
@@ -965,7 +1003,9 @@ interface ElementsClientOptions {
|
|
|
965
1003
|
relay?: MasterKeyAcquisitionOptions['relay'];
|
|
966
1004
|
};
|
|
967
1005
|
/** The Application this client acts for; needed to wrap keys of plans it creates. */
|
|
968
|
-
applicationId
|
|
1006
|
+
applicationId?: string;
|
|
1007
|
+
/** The selected Business organization for this client instance. */
|
|
1008
|
+
organizationId?: string;
|
|
969
1009
|
assetDecoder: PlanAssetContainerDecoder;
|
|
970
1010
|
}
|
|
971
1011
|
declare class ElementsClient {
|
|
@@ -980,15 +1020,18 @@ declare class ElementsClient {
|
|
|
980
1020
|
masterKeys?: MasterKeyResolver;
|
|
981
1021
|
masterKey?: ElementsClientOptions['masterKey'];
|
|
982
1022
|
applicationId?: string;
|
|
1023
|
+
organizationId?: string;
|
|
983
1024
|
assetDecoder?: PlanAssetContainerDecoder;
|
|
984
1025
|
});
|
|
985
1026
|
private readonly api?;
|
|
986
1027
|
private readonly reconstructor?;
|
|
987
1028
|
private readonly masterKeys?;
|
|
988
1029
|
private readonly applicationId?;
|
|
1030
|
+
private readonly organizationId?;
|
|
989
1031
|
readonly assetDecoder?: PlanAssetContainerDecoder;
|
|
990
1032
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
991
1033
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
1034
|
+
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
992
1035
|
startPlanCreation(input: StartPlanCreationInput): Promise<PlanCreationProgress>;
|
|
993
1036
|
getPlanCreation(operationId: string): Promise<PlanCreationProgress>;
|
|
994
1037
|
supplyPlanCreationMaterial(operationId: string, material: EncryptedPlanMaterial): Promise<PlanCreationProgress>;
|
|
@@ -1079,6 +1122,7 @@ declare class ElementsClient {
|
|
|
1079
1122
|
* travelled with the material, and every access after this one goes through SafeKey Mobile.
|
|
1080
1123
|
*/
|
|
1081
1124
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
1125
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
1082
1126
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
1083
1127
|
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
1084
1128
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -1098,9 +1142,21 @@ declare class ElementsClient {
|
|
|
1098
1142
|
collectGovernedPlanMaterial(session: GovernedRevealSession, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
1099
1143
|
reconstructGovernedPlanMaterial(session: GovernedRevealSession, material: CollectedPlanMaterial): Promise<Uint8Array>;
|
|
1100
1144
|
private useCase;
|
|
1145
|
+
private requireApplication;
|
|
1101
1146
|
}
|
|
1102
1147
|
declare function createElementsClient(options: ElementsClientOptions): ElementsClient;
|
|
1103
1148
|
|
|
1149
|
+
interface BusinessOrganization {
|
|
1150
|
+
id: string;
|
|
1151
|
+
name: string;
|
|
1152
|
+
}
|
|
1153
|
+
declare class BusinessOrganizationSelectionError extends Error {
|
|
1154
|
+
readonly code: 'organization_required' | 'organization_selection_required' | 'organization_access_denied';
|
|
1155
|
+
constructor(code: 'organization_required' | 'organization_selection_required' | 'organization_access_denied');
|
|
1156
|
+
}
|
|
1157
|
+
/** A sole eligible organization can be selected automatically; several require a choice. */
|
|
1158
|
+
declare function selectBusinessOrganization(items: readonly BusinessOrganization[], selectedId?: string): string;
|
|
1159
|
+
|
|
1104
1160
|
declare class ElementsApiRequestFailed extends Error {
|
|
1105
1161
|
readonly status: number;
|
|
1106
1162
|
readonly code?: string | undefined;
|
|
@@ -1113,9 +1169,14 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1113
1169
|
private readonly environment;
|
|
1114
1170
|
private readonly getBearerToken;
|
|
1115
1171
|
private readonly transport;
|
|
1116
|
-
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: BearerTokenResolver, transport: HttpTransport
|
|
1172
|
+
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: BearerTokenResolver, transport: HttpTransport, business?: {
|
|
1173
|
+
readonly organizationId?: string;
|
|
1174
|
+
});
|
|
1175
|
+
private readonly business?;
|
|
1176
|
+
listBusinessOrganizations(): Promise<BusinessOrganization[]>;
|
|
1117
1177
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
1118
1178
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
1179
|
+
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
1119
1180
|
startPlanCreation(input: StartPlanCreationInput): Promise<PlanCreationProgress>;
|
|
1120
1181
|
getPlanCreation(operationId: string): Promise<PlanCreationProgress>;
|
|
1121
1182
|
supplyPlanCreationMaterial(operationId: string, material: EncryptedPlanMaterial): Promise<PlanCreationProgress>;
|
|
@@ -1130,7 +1191,7 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1130
1191
|
*/
|
|
1131
1192
|
masterKeyAcquisition(): Promise<MasterKeyAcquisition>;
|
|
1132
1193
|
foreignMasterKeyAcquisition(system: string, contextId: string): Promise<MasterKeyAcquisition>;
|
|
1133
|
-
startMasterKeyRelaySession(clientPublicKey: string): Promise<MasterKeyRelaySessionOpened>;
|
|
1194
|
+
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
1134
1195
|
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
1135
1196
|
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
1136
1197
|
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
@@ -1146,6 +1207,7 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1146
1207
|
getReveal(revealId: string): Promise<RevealSession>;
|
|
1147
1208
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
1148
1209
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
1210
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
1149
1211
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
1150
1212
|
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
1151
1213
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -1164,6 +1226,7 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1164
1226
|
}>;
|
|
1165
1227
|
private request;
|
|
1166
1228
|
private requestWithoutResult;
|
|
1229
|
+
private requireBusinessSelection;
|
|
1167
1230
|
}
|
|
1168
1231
|
|
|
1169
1232
|
/**
|
|
@@ -1174,6 +1237,13 @@ declare class HttpElementsApiPort implements ElementsApiPort {
|
|
|
1174
1237
|
*/
|
|
1175
1238
|
declare function unwrapDekWithMasterKey(wrappedDekBase64: string, masterKeyHex?: string): Promise<string>;
|
|
1176
1239
|
|
|
1240
|
+
declare class PlanMaterialReconstructionFailed extends Error {
|
|
1241
|
+
readonly code: 'plan_key_unwrap_failed' | 'plan_share_decryption_failed' | 'plan_share_reconstruction_failed';
|
|
1242
|
+
readonly reason?: ReconstructionReason | undefined;
|
|
1243
|
+
constructor(code: 'plan_key_unwrap_failed' | 'plan_share_decryption_failed' | 'plan_share_reconstruction_failed', reason?: ReconstructionReason | undefined);
|
|
1244
|
+
}
|
|
1245
|
+
type ReconstructionReason = string;
|
|
1246
|
+
|
|
1177
1247
|
/** Elements adapter for Core's transport-neutral event port. Scheduling remains owned by Core's mature loop. */
|
|
1178
1248
|
declare class PollingSharedPlanEventListener implements SharedPlanEventListener {
|
|
1179
1249
|
private readonly api;
|
|
@@ -1207,15 +1277,12 @@ interface CorePlanSecrets {
|
|
|
1207
1277
|
/** Number of non-custodian share destinations. */
|
|
1208
1278
|
totalShares: number;
|
|
1209
1279
|
threshold: number;
|
|
1210
|
-
/** @deprecated Custodian posture is derived from the plan declaration and this value is ignored. */
|
|
1211
|
-
withCustodian?: boolean;
|
|
1212
1280
|
}
|
|
1213
1281
|
interface PreparedCorePlanMaterial {
|
|
1214
1282
|
data: Uint8Array;
|
|
1215
1283
|
assets: DataAsset[];
|
|
1216
1284
|
totalShares: number;
|
|
1217
1285
|
threshold: number;
|
|
1218
|
-
withCustodian: boolean;
|
|
1219
1286
|
masterKey: string;
|
|
1220
1287
|
}
|
|
1221
1288
|
/** Uses Core's registered SSDP+ generator and production share sealer as one guided-create adapter. */
|
|
@@ -1449,5 +1516,5 @@ declare class OperatorSessionController {
|
|
|
1449
1516
|
logout(): Promise<void>;
|
|
1450
1517
|
}
|
|
1451
1518
|
|
|
1452
|
-
export { CANONICAL_PLAN_ASSET_TYPES, CANONICAL_STRUCTURED_ASSET_FIELDS, CorePlanMaterialBuilder, ElementsApiPortRequired, ElementsApiRequestFailed, ElementsClient, GuidedCreateRecoveryError, GuidedPlanCreator, HostProcessRuntimeEnvironment, HttpElementsApiPort, HttpOperatorAuthTransport, InheritiClientProvider, InvalidPlanDeclaration, InvalidPlanMaterial, LocalProcessReconciliationOwnership, MasterKeyRelayExpired, MasterKeyRelayTimedOut, MasterKeyRequired, MemoryGuidedCreateCheckpointStore, MemoryKeyVault, MemoryStatePort, OAuthProtocolError, OperatorAuthClient, OperatorAuthError, OperatorReauthenticationRequired, OperatorSessionController, PLAN_CREATION_SERVER_STAGES, PlanMaterialReconstructorRequired, PollingSharedPlanEventListener, RelayMasterKeySource, RevealActionsNotOpen, RevealFieldAccessError, RevealHandleClosed, StaticMasterKeyResolver, SystemOAuthClock, WebOAuthCrypto, createElementsClient, createMasterKeyResolver, getAvailableEnvs, masterKeyRefFor, masterKeyRefKey, oauthErrorCode, parseAssetFieldSelector, revealPhaseOf, unwrapDekWithMasterKey, useClient, validatePlanCreationInput, validatePlanCreationMaterial };
|
|
1453
|
-
export type { AssetFieldSelector, AuthorizationTransaction, AuthorizeRevealActionInput, CanonicalPlanAssetType, CollectedPlanMaterial, CompatibleValue, ConsumedRevealField, CorePlanSecrets, CustodianShareResult, DeclaredMasterKeySource, DecodedPlanAsset, DeviceAuthorization, DeviceTransaction, ElementsApiPort, ElementsClientOptions, ElementsEnvironment, EncryptedPlanMaterial, EncryptedPlanShard, ExportPlanBridgeInput, GovernedRevealSession, GovernedRevealState, GovernedShare, GovernedSharesMaterial, GovernedValidatorMaterial, GuidedCreateCheckpoint, GuidedCreateCheckpointStore, GuidedCreateLocalStage, GuidedCreateOptions, InheritiClientProviderProps, IntegrationPlanAssetDeclaration, KeyVault, ListPlansInput, MasterKeyAcquisition, MasterKeyAcquisitionOptions, MasterKeyRef, MasterKeyRelayPort, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState, MasterKeyResolver, NativePlanParticipant, OAuthClock, OAuthCrypto, OAuthHttpTransport, OAuthTokenResponse, OAuthTransaction, OAuthTransactionStore, OidcDiscoveryDocument, OpenRevealOptions, OperatorAuthClientOptions, OperatorAuthConfiguration, OperatorAuthTransport, OperatorSession, OperatorSessionControlPort, OperatorSessionStore, OperatorSessionSummary, OperatorTokenValidator, PlanAssetContainerDecoder, PlanAssetSummary, PlanBridgeEnvelope, PlanCreationOutcome, PlanCreationProgress, PlanCreationServerStage, PlanDetail, PlanGovernanceMode, PlanGovernancePolicy, PlanMaterialBuilder, PlanMaterialReconstructor, PlanPage, PlanParticipantRelationship, PlanRevealProfile, PlanStatus, PlanSummary, RelayMasterKeySourceOptions, ReportRevealActionOutcomeInput, RevealAction, RevealActionDestination, RevealActionOutcome, RevealActionType, RevealCloseReason, RevealFieldConsumption, RevealFieldDestination, RevealFieldOptions, RevealHandle, RevealMode, RevealPhase, RevealProgress, RevealReconstructionInput, RevealSession, RevealStage, StartPlanCreationInput, StartRevealInput, StatePort, StepUpReadContext, ValidatedOperatorToken };
|
|
1519
|
+
export { BusinessOrganizationSelectionError, CANONICAL_PLAN_ASSET_TYPES, CANONICAL_STRUCTURED_ASSET_FIELDS, CorePlanMaterialBuilder, ElementsApiPortRequired, ElementsApiRequestFailed, ElementsClient, GuidedCreateRecoveryError, GuidedPlanCreator, HostProcessRuntimeEnvironment, HttpElementsApiPort, HttpOperatorAuthTransport, InheritiClientProvider, InvalidPlanDeclaration, InvalidPlanMaterial, LocalProcessReconciliationOwnership, MasterKeyRelayExpired, MasterKeyRelayTimedOut, MasterKeyRequired, MemoryGuidedCreateCheckpointStore, MemoryKeyVault, MemoryStatePort, OAuthProtocolError, OperatorAuthClient, OperatorAuthError, OperatorReauthenticationRequired, OperatorSessionController, PLAN_CREATION_SERVER_STAGES, PlanMaterialReconstructionFailed, PlanMaterialReconstructorRequired, PollingSharedPlanEventListener, RelayMasterKeySource, RevealActionsNotOpen, RevealFieldAccessError, RevealHandleClosed, StaticMasterKeyResolver, SystemOAuthClock, WebOAuthCrypto, createElementsClient, createMasterKeyResolver, getAvailableEnvs, masterKeyRefFor, masterKeyRefKey, oauthErrorCode, parseAssetFieldSelector, revealPhaseOf, selectBusinessOrganization, unwrapDekWithMasterKey, useClient, validatePlanCreationInput, validatePlanCreationMaterial };
|
|
1520
|
+
export type { AssetFieldSelector, AuthorizationTransaction, AuthorizeRevealActionInput, BusinessOrganization, CanonicalPlanAssetType, CollectedPlanMaterial, CompatibleValue, ConsumedRevealField, CorePlanSecrets, CustodianShareResult, DeclaredMasterKeySource, DecodedPlanAsset, DeviceAuthorization, DeviceTransaction, ElementsApiPort, ElementsClientOptions, ElementsEnvironment, EncryptedPlanMaterial, EncryptedPlanShard, ExportPlanBridgeInput, GovernedRevealSession, GovernedRevealState, GovernedShare, GovernedSharesMaterial, GovernedValidatorMaterial, GuidedCreateCheckpoint, GuidedCreateCheckpointStore, GuidedCreateLocalStage, GuidedCreateOptions, InheritiClientProviderProps, IntegrationPlanAssetDeclaration, KeyVault, ListPlanLogsInput, ListPlansInput, MasterKeyAcquisition, MasterKeyAcquisitionOptions, MasterKeyRef, MasterKeyRelayContext, MasterKeyRelayPort, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState, MasterKeyResolver, NativePlanParticipant, OAuthClock, OAuthCrypto, OAuthHttpTransport, OAuthTokenResponse, OAuthTransaction, OAuthTransactionStore, OidcDiscoveryDocument, OpenRevealOptions, OperatorAuthClientOptions, OperatorAuthConfiguration, OperatorAuthTransport, OperatorSession, OperatorSessionControlPort, OperatorSessionStore, OperatorSessionSummary, OperatorTokenValidator, PlanAssetContainerDecoder, PlanAssetSummary, PlanBridgeEnvelope, PlanCreationOutcome, PlanCreationProgress, PlanCreationServerStage, PlanDetail, PlanGovernanceMode, PlanGovernancePolicy, PlanLog, PlanLogPage, PlanMaterialBuilder, PlanMaterialReconstructor, PlanPage, PlanParticipantRelationship, PlanRevealProfile, PlanStatus, PlanSummary, RelayMasterKeySourceOptions, ReportRevealActionOutcomeInput, RevealAction, RevealActionDestination, RevealActionOutcome, RevealActionType, RevealCloseReason, RevealFieldConsumption, RevealFieldDestination, RevealFieldOptions, RevealHandle, RevealMode, RevealPhase, RevealProgress, RevealReconstructionInput, RevealSession, RevealStage, StartPlanCreationInput, StartRevealInput, StatePort, StepUpReadContext, ValidatedOperatorToken };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface BusinessOrganization {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class BusinessOrganizationSelectionError extends Error {
|
|
6
|
+
readonly code: 'organization_required' | 'organization_selection_required' | 'organization_access_denied';
|
|
7
|
+
constructor(code: 'organization_required' | 'organization_selection_required' | 'organization_access_denied');
|
|
8
|
+
}
|
|
9
|
+
export declare function decodeBusinessOrganizations(value: unknown): BusinessOrganization[];
|
|
10
|
+
/** A sole eligible organization can be selected automatically; several require a choice. */
|
|
11
|
+
export declare function selectBusinessOrganization(items: readonly BusinessOrganization[], selectedId?: string): string;
|
|
@@ -7,15 +7,12 @@ export interface CorePlanSecrets {
|
|
|
7
7
|
/** Number of non-custodian share destinations. */
|
|
8
8
|
totalShares: number;
|
|
9
9
|
threshold: number;
|
|
10
|
-
/** @deprecated Custodian posture is derived from the plan declaration and this value is ignored. */
|
|
11
|
-
withCustodian?: boolean;
|
|
12
10
|
}
|
|
13
11
|
interface PreparedCorePlanMaterial {
|
|
14
12
|
data: Uint8Array;
|
|
15
13
|
assets: DataAsset[];
|
|
16
14
|
totalShares: number;
|
|
17
15
|
threshold: number;
|
|
18
|
-
withCustodian: boolean;
|
|
19
16
|
masterKey: string;
|
|
20
17
|
}
|
|
21
18
|
/** Uses Core's registered SSDP+ generator and production share sealer as one guided-create adapter. */
|
|
@@ -48,6 +48,10 @@ export interface MasterKeyRelaySessionOpened {
|
|
|
48
48
|
sessionId: string;
|
|
49
49
|
expiresAt: string | Date;
|
|
50
50
|
}
|
|
51
|
+
export interface MasterKeyRelayContext {
|
|
52
|
+
system: string;
|
|
53
|
+
contextId: string;
|
|
54
|
+
}
|
|
51
55
|
export interface MasterKeyRelaySessionState {
|
|
52
56
|
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
53
57
|
sealedMasterKey?: string;
|
|
@@ -61,10 +65,11 @@ export interface ElementsApiPort {
|
|
|
61
65
|
* Asks the device holding the key to release it to this host. Creating the session *is* the
|
|
62
66
|
* SafeKey request; there is no separate "notify" step.
|
|
63
67
|
*/
|
|
64
|
-
startMasterKeyRelaySession(clientPublicKey: string): Promise<MasterKeyRelaySessionOpened>;
|
|
68
|
+
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
65
69
|
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
66
70
|
listPlans(input?: import('./plan-operations').ListPlansInput): Promise<import('./plan-operations').PlanPage>;
|
|
67
71
|
getPlan(planId: string): Promise<import('./plan-operations').PlanDetail>;
|
|
72
|
+
listPlanLogs(planId: string, input?: import('./plan-operations').ListPlanLogsInput): Promise<import('./plan-operations').PlanLogPage>;
|
|
68
73
|
startPlanCreation(input: import('./plan-operations').StartPlanCreationInput): Promise<import('./plan-operations').PlanCreationProgress>;
|
|
69
74
|
getPlanCreation(operationId: string): Promise<import('./plan-operations').PlanCreationProgress>;
|
|
70
75
|
supplyPlanCreationMaterial(operationId: string, material: import('./plan-operations').EncryptedPlanMaterial): Promise<import('./plan-operations').PlanCreationProgress>;
|
|
@@ -88,6 +93,7 @@ export interface ElementsApiPort {
|
|
|
88
93
|
* The custodian steps on the operator surface. The `/shared-plans/merge/...` equivalents are
|
|
89
94
|
* credential routes and refuse an operator token, so a host addresses them by reveal id.
|
|
90
95
|
*/
|
|
96
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
91
97
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
92
98
|
getRevealCustodianAccess(revealId: string): Promise<CustodianShareAccess>;
|
|
93
99
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -125,7 +131,7 @@ export interface ExportPlanBridgeInput {
|
|
|
125
131
|
export interface PlanRevealProfile {
|
|
126
132
|
governance: 'KEEP' | 'BYPASS';
|
|
127
133
|
masterKeyRelease: 'REQUIRED';
|
|
128
|
-
custodian: '
|
|
134
|
+
custodian: 'FORCE';
|
|
129
135
|
}
|
|
130
136
|
export interface PlanBridgeEnvelope {
|
|
131
137
|
transferMode: 'COPY' | 'MOVE';
|
|
@@ -236,8 +242,8 @@ export type RevealMode = 'DIRECT' | 'GOVERNED';
|
|
|
236
242
|
/** Reveal stages are additive. Hosts must treat unknown non-terminal values as waiting. */
|
|
237
243
|
export type RevealStage = 'STARTING' | 'WAITING_FOR_DMS' | 'WAITING_FOR_PARTICIPANTS' | 'AUTHORIZED' | 'MATERIAL_AUTHORIZED' | 'MATERIAL_RELEASED' | 'RECONSTRUCTED' | 'ACTIONS_OPEN' | 'CLOSING' | 'CLOSED' | 'DENIED' | 'PARTICIPANT_REVOKED' | 'RECONCILIATION_REQUIRED' | 'EXPIRED' | 'CANCELED' | 'FAILED' | 'WAITING_FOR_CUSTODIAN_CLAIM' | 'WAITING_FOR_CUSTODIAN';
|
|
238
244
|
export type RevealCloseReason = 'COMPLETED' | 'CANCELED' | 'DMS_RESET' | 'ERROR';
|
|
239
|
-
export type RevealActionType = 'VIEW_FIELD' | 'COPY_FIELD' | 'USE_FIELD' | 'EXPORT_ASSET' | 'AUTOFILL_FIELD' | 'INSERT_FIELD';
|
|
240
|
-
export type RevealActionDestination = 'STDIN' | 'ENVIRONMENT' | 'FILE_DESCRIPTOR' | 'LOCAL_SOCKET' | 'TEMPORARY_FILE';
|
|
245
|
+
export type RevealActionType = 'VIEW_FIELD' | 'COPY_FIELD' | 'USE_FIELD' | 'EXPORT_ASSET' | 'AUTOFILL_FIELD' | 'INSERT_FIELD' | 'DELIVER_FIELD';
|
|
246
|
+
export type RevealActionDestination = 'STDIN' | 'ENVIRONMENT' | 'FILE_DESCRIPTOR' | 'LOCAL_SOCKET' | 'TEMPORARY_FILE' | 'LOCAL_BROWSER';
|
|
241
247
|
export type RevealActionOutcome = 'SUCCEEDED' | 'FAILED' | 'CANCELED';
|
|
242
248
|
export interface StartRevealInput {
|
|
243
249
|
mode: RevealMode;
|
|
@@ -250,6 +256,7 @@ export interface RevealReconstructionInput {
|
|
|
250
256
|
export interface RevealSession {
|
|
251
257
|
id: string;
|
|
252
258
|
idempotencyKey: string;
|
|
259
|
+
/** Standalone Application ID; embedded Business currently fills this wire alias with the integration client ID. */
|
|
253
260
|
applicationId: string;
|
|
254
261
|
environment: 'TEST' | 'LIVE';
|
|
255
262
|
planId: string;
|
|
@@ -276,6 +283,7 @@ export interface RevealSession {
|
|
|
276
283
|
* without this a host cannot tell whose action it is waiting for. Absent past governance.
|
|
277
284
|
*/
|
|
278
285
|
governanceGate?: 'DMS' | 'AUTHENTICATION' | 'MODERATION';
|
|
286
|
+
deniedBy?: 'AUTHENTICATION' | 'MODERATION';
|
|
279
287
|
/** Deadline of the active authentication or moderation layer. */
|
|
280
288
|
governanceExpiresAt?: string;
|
|
281
289
|
closedReason?: RevealCloseReason;
|
|
@@ -6,7 +6,7 @@ import type { AuthorizeRevealActionInput, CollectedPlanMaterial, CustodianShareR
|
|
|
6
6
|
import type { PlanMaterialReconstructor } from './plan-material-reconstructor';
|
|
7
7
|
import type { MasterKeyRef, MasterKeyResolver } from './master-key';
|
|
8
8
|
import type { PlanAssetDeclaration } from '@safetech/inheriti-core-sdk';
|
|
9
|
-
import type { EncryptedPlanMaterial, ListPlansInput, PlanCreationProgress, PlanDetail, PlanPage, StartPlanCreationInput } from './plan-operations';
|
|
9
|
+
import type { EncryptedPlanMaterial, ListPlanLogsInput, ListPlansInput, PlanCreationProgress, PlanDetail, PlanLogPage, PlanPage, StartPlanCreationInput } from './plan-operations';
|
|
10
10
|
import type { GuidedCreateCheckpointStore } from './guided-plan-creator';
|
|
11
11
|
import { GuidedPlanCreator } from './guided-plan-creator';
|
|
12
12
|
import type { OpenRevealOptions, RevealHandle } from './scoped-reveal';
|
|
@@ -48,7 +48,9 @@ export interface ElementsClientOptions {
|
|
|
48
48
|
relay?: MasterKeyAcquisitionOptions['relay'];
|
|
49
49
|
};
|
|
50
50
|
/** The Application this client acts for; needed to wrap keys of plans it creates. */
|
|
51
|
-
applicationId
|
|
51
|
+
applicationId?: string;
|
|
52
|
+
/** The selected Business organization for this client instance. */
|
|
53
|
+
organizationId?: string;
|
|
52
54
|
assetDecoder: PlanAssetContainerDecoder;
|
|
53
55
|
}
|
|
54
56
|
export default class ElementsClient {
|
|
@@ -63,15 +65,18 @@ export default class ElementsClient {
|
|
|
63
65
|
masterKeys?: MasterKeyResolver;
|
|
64
66
|
masterKey?: ElementsClientOptions['masterKey'];
|
|
65
67
|
applicationId?: string;
|
|
68
|
+
organizationId?: string;
|
|
66
69
|
assetDecoder?: PlanAssetContainerDecoder;
|
|
67
70
|
});
|
|
68
71
|
private readonly api?;
|
|
69
72
|
private readonly reconstructor?;
|
|
70
73
|
private readonly masterKeys?;
|
|
71
74
|
private readonly applicationId?;
|
|
75
|
+
private readonly organizationId?;
|
|
72
76
|
readonly assetDecoder?: PlanAssetContainerDecoder;
|
|
73
77
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
74
78
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
79
|
+
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
75
80
|
startPlanCreation(input: StartPlanCreationInput): Promise<PlanCreationProgress>;
|
|
76
81
|
getPlanCreation(operationId: string): Promise<PlanCreationProgress>;
|
|
77
82
|
supplyPlanCreationMaterial(operationId: string, material: EncryptedPlanMaterial): Promise<PlanCreationProgress>;
|
|
@@ -162,6 +167,7 @@ export default class ElementsClient {
|
|
|
162
167
|
* travelled with the material, and every access after this one goes through SafeKey Mobile.
|
|
163
168
|
*/
|
|
164
169
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
170
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
165
171
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
166
172
|
getRevealCustodianAccess(revealId: string): Promise<import("./elements-api-port").CustodianShareAccess>;
|
|
167
173
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -181,6 +187,7 @@ export default class ElementsClient {
|
|
|
181
187
|
collectGovernedPlanMaterial(session: GovernedRevealSession, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
182
188
|
reconstructGovernedPlanMaterial(session: GovernedRevealSession, material: CollectedPlanMaterial): Promise<Uint8Array>;
|
|
183
189
|
private useCase;
|
|
190
|
+
private requireApplication;
|
|
184
191
|
}
|
|
185
192
|
/** Names the one capability a reveal-only client lacks, instead of failing on a missing property. */
|
|
186
193
|
export declare class CoreSdkContainerRequired extends Error {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BearerTokenResolver, HttpTransport } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
-
import type { AuthorizeRevealActionInput, CollectedPlanMaterial, CustodianShareResult, ElementsApiPort, MasterKeyAcquisition, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState, PlanKeyReference, ExportPlanBridgeInput, GovernedRevealSession, GovernedRevealState, GovernedSharesMaterial, GovernedValidatorMaterial, PlanBridgeEnvelope, ReportRevealActionOutcomeInput, RevealAction, RevealCloseReason, RevealReconstructionInput, RevealSession, StartRevealInput, StepUpReadContext } from './elements-api-port';
|
|
3
|
-
import type { EncryptedPlanMaterial, ListPlansInput, PlanCreationProgress, PlanDetail, PlanPage, StartPlanCreationInput } from './plan-operations';
|
|
2
|
+
import type { AuthorizeRevealActionInput, CollectedPlanMaterial, CustodianShareResult, ElementsApiPort, MasterKeyAcquisition, MasterKeyRelayContext, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState, PlanKeyReference, ExportPlanBridgeInput, GovernedRevealSession, GovernedRevealState, GovernedSharesMaterial, GovernedValidatorMaterial, PlanBridgeEnvelope, ReportRevealActionOutcomeInput, RevealAction, RevealCloseReason, RevealReconstructionInput, RevealSession, StartRevealInput, StepUpReadContext } from './elements-api-port';
|
|
3
|
+
import type { EncryptedPlanMaterial, ListPlanLogsInput, ListPlansInput, PlanCreationProgress, PlanDetail, PlanLogPage, PlanPage, StartPlanCreationInput } from './plan-operations';
|
|
4
|
+
import type { BusinessOrganization } from '../business/organizations';
|
|
4
5
|
export declare class ElementsApiRequestFailed extends Error {
|
|
5
6
|
readonly status: number;
|
|
6
7
|
readonly code?: string | undefined;
|
|
@@ -13,9 +14,14 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
13
14
|
private readonly environment;
|
|
14
15
|
private readonly getBearerToken;
|
|
15
16
|
private readonly transport;
|
|
16
|
-
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: BearerTokenResolver, transport: HttpTransport
|
|
17
|
+
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: BearerTokenResolver, transport: HttpTransport, business?: {
|
|
18
|
+
readonly organizationId?: string;
|
|
19
|
+
});
|
|
20
|
+
private readonly business?;
|
|
21
|
+
listBusinessOrganizations(): Promise<BusinessOrganization[]>;
|
|
17
22
|
listPlans(input?: ListPlansInput): Promise<PlanPage>;
|
|
18
23
|
getPlan(planId: string): Promise<PlanDetail>;
|
|
24
|
+
listPlanLogs(planId: string, input?: ListPlanLogsInput): Promise<PlanLogPage>;
|
|
19
25
|
startPlanCreation(input: StartPlanCreationInput): Promise<PlanCreationProgress>;
|
|
20
26
|
getPlanCreation(operationId: string): Promise<PlanCreationProgress>;
|
|
21
27
|
supplyPlanCreationMaterial(operationId: string, material: EncryptedPlanMaterial): Promise<PlanCreationProgress>;
|
|
@@ -30,7 +36,7 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
30
36
|
*/
|
|
31
37
|
masterKeyAcquisition(): Promise<MasterKeyAcquisition>;
|
|
32
38
|
foreignMasterKeyAcquisition(system: string, contextId: string): Promise<MasterKeyAcquisition>;
|
|
33
|
-
startMasterKeyRelaySession(clientPublicKey: string): Promise<MasterKeyRelaySessionOpened>;
|
|
39
|
+
startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
|
|
34
40
|
readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
|
|
35
41
|
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
36
42
|
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
@@ -46,6 +52,7 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
46
52
|
getReveal(revealId: string): Promise<RevealSession>;
|
|
47
53
|
releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
|
|
48
54
|
markRevealSharesCollected(revealId: string): Promise<void>;
|
|
55
|
+
distributeRevealCustodianShare(revealId: string): Promise<void>;
|
|
49
56
|
requestRevealCustodianRelease(revealId: string): Promise<void>;
|
|
50
57
|
getRevealCustodianAccess(revealId: string): Promise<import('./elements-api-port').CustodianShareAccess>;
|
|
51
58
|
getRevealCustodianShare(revealId: string): Promise<CustodianShareResult>;
|
|
@@ -64,4 +71,5 @@ export default class HttpElementsApiPort implements ElementsApiPort {
|
|
|
64
71
|
}>;
|
|
65
72
|
private request;
|
|
66
73
|
private requestWithoutResult;
|
|
74
|
+
private requireBusinessSelection;
|
|
67
75
|
}
|
|
@@ -18,11 +18,12 @@ export { PlanMaterialReconstructorRequired } from './plan-material-reconstructor
|
|
|
18
18
|
export { MasterKeyRequired, StaticMasterKeyResolver, masterKeyRefFor, masterKeyRefKey } from './master-key';
|
|
19
19
|
export type { MasterKeyRef, MasterKeyResolver } from './master-key';
|
|
20
20
|
export { unwrapDekWithMasterKey } from './unwrap-dek';
|
|
21
|
+
export { PlanMaterialReconstructionFailed } from './ssdp-v2-plan-material-reconstructor';
|
|
21
22
|
export { RelayMasterKeySource, MasterKeyRelayExpired, MasterKeyRelayTimedOut } from './relay-master-key-source';
|
|
22
23
|
export { createMasterKeyResolver } from './master-key-acquisition';
|
|
23
24
|
export type { MasterKeySource } from '@safetech/inheriti-core-sdk';
|
|
24
25
|
export type { DeclaredMasterKeySource, MasterKeyAcquisitionOptions } from './master-key-acquisition';
|
|
25
|
-
export type { MasterKeyAcquisition, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState } from './elements-api-port';
|
|
26
|
+
export type { MasterKeyAcquisition, MasterKeyRelayContext, MasterKeyRelaySessionOpened, MasterKeyRelaySessionState } from './elements-api-port';
|
|
26
27
|
export type { MasterKeyRelayPort, RelayMasterKeySourceOptions } from './relay-master-key-source';
|
|
27
28
|
export { HostProcessRuntimeEnvironment, LocalProcessReconciliationOwnership, PollingSharedPlanEventListener } from './polling-shared-plan-event-listener';
|
|
28
29
|
export * from './plan-operations';
|
|
@@ -10,10 +10,8 @@ import type { RelayMasterKeySourceOptions } from './relay-master-key-source';
|
|
|
10
10
|
export interface DeclaredMasterKeySource {
|
|
11
11
|
resolve(): Promise<string | undefined>;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type MasterKeyAcquisitionOptions = {
|
|
14
14
|
api: ElementsApiPort;
|
|
15
|
-
/** The Application this host acts for. A ref naming any other context is foreign. */
|
|
16
|
-
applicationId: string;
|
|
17
15
|
/**
|
|
18
16
|
* What this host can produce on its own: a passphrase-derived key, or key material it already
|
|
19
17
|
* holds. Absent means the host has no custody of its own and must be given the key.
|
|
@@ -26,7 +24,13 @@ export interface MasterKeyAcquisitionOptions {
|
|
|
26
24
|
source?: DeclaredMasterKeySource;
|
|
27
25
|
/** Passed through to the relay, for hosts that want a different wait or poll interval. */
|
|
28
26
|
relay?: Omit<RelayMasterKeySourceOptions, 'api'>;
|
|
29
|
-
}
|
|
27
|
+
} & ({
|
|
28
|
+
applicationId: string;
|
|
29
|
+
organizationId?: never;
|
|
30
|
+
} | {
|
|
31
|
+
organizationId: string;
|
|
32
|
+
applicationId?: never;
|
|
33
|
+
});
|
|
30
34
|
/**
|
|
31
35
|
* Decides how this host obtains the key that opens a plan, and does it.
|
|
32
36
|
*
|
|
@@ -6,5 +6,5 @@ import SsdpV2PlanMaterialReconstructor from './ssdp-v2-plan-material-reconstruct
|
|
|
6
6
|
* Node's, which is the one import a browser host cannot follow.
|
|
7
7
|
*/
|
|
8
8
|
export default class NodePlanMaterialReconstructor extends SsdpV2PlanMaterialReconstructor {
|
|
9
|
-
constructor();
|
|
9
|
+
constructor(workerUrl?: string | URL);
|
|
10
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { PlanCreationProgress, PlanDetail, PlanPage } from './plan-operations';
|
|
1
|
+
import type { PlanCreationProgress, PlanDetail, PlanLogPage, PlanPage } from './plan-operations';
|
|
2
2
|
export declare function decodePlanPage(value: unknown): PlanPage;
|
|
3
|
+
export declare function decodePlanLogPage(value: unknown): PlanLogPage;
|
|
3
4
|
export declare function decodePlanDetail(value: unknown): PlanDetail;
|
|
4
5
|
export declare function decodePlanCreationProgress(value: unknown): PlanCreationProgress;
|
|
@@ -44,6 +44,27 @@ export interface PlanPage {
|
|
|
44
44
|
items: PlanSummary[];
|
|
45
45
|
nextCursor: string | null;
|
|
46
46
|
}
|
|
47
|
+
export interface ListPlanLogsInput {
|
|
48
|
+
limit?: number;
|
|
49
|
+
offset?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface PlanLog {
|
|
52
|
+
id: string;
|
|
53
|
+
planId: string;
|
|
54
|
+
tenantId: string;
|
|
55
|
+
event: string;
|
|
56
|
+
occurredOn: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
title: string;
|
|
59
|
+
details: Array<{
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface PlanLogPage {
|
|
65
|
+
items: PlanLog[];
|
|
66
|
+
total: number;
|
|
67
|
+
}
|
|
47
68
|
export interface ListPlansInput {
|
|
48
69
|
cursor?: string;
|
|
49
70
|
limit?: number;
|
|
@@ -74,7 +95,7 @@ export interface PlanDetail extends PlanSummary {
|
|
|
74
95
|
}>;
|
|
75
96
|
revealPolicy: {
|
|
76
97
|
masterKeyRelease: CompatibleValue<'REQUIRED'>;
|
|
77
|
-
custodian: CompatibleValue<'FORCE'
|
|
98
|
+
custodian: CompatibleValue<'FORCE'>;
|
|
78
99
|
};
|
|
79
100
|
dms?: {
|
|
80
101
|
subjectEmail: string;
|
|
@@ -151,8 +172,6 @@ export interface PlanGovernancePolicy {
|
|
|
151
172
|
countdownHours?: number;
|
|
152
173
|
countdownMinutes?: number;
|
|
153
174
|
};
|
|
154
|
-
masterKeyRelease?: 'REQUIRED';
|
|
155
|
-
custodian?: 'FORCE' | 'BYPASS';
|
|
156
175
|
}
|
|
157
176
|
export declare const PLAN_CREATION_SERVER_STAGES: readonly ["VALIDATED", "PLAN_CREATED", "PARTICIPANTS_PERSISTED", "STORAGE_PREPARED", "AWAITING_ENCRYPTED_MATERIAL", "VALIDATOR_SHARES_DISTRIBUTED", "CONFIGURED", "COMPLETED"];
|
|
158
177
|
export type PlanCreationServerStage = (typeof PLAN_CREATION_SERVER_STAGES)[number];
|