@safetech/inheriti-client-sdk 1.17.11 → 1.17.13

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.
Files changed (28) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/inheriti-client-sdk.umd.js +30 -30
  5. package/dist/node.d.ts +25 -1
  6. package/dist/node.js +1 -1
  7. package/dist/sdk-types.d.ts +52 -8
  8. package/dist/src/business/plan-edit/core-edit-transport.d.ts +10 -0
  9. package/dist/src/business/plan-edit/http-plan-edit-port.d.ts +106 -0
  10. package/dist/src/business/plan-edit/plan-edit-asset-access.d.ts +28 -0
  11. package/dist/src/business/plan-edit/plan-edit-reconfiguration.d.ts +26 -0
  12. package/dist/src/business/plan-edit/quick-plan-editor.d.ts +82 -0
  13. package/dist/src/business/quick-plan/build-material.d.ts +6 -0
  14. package/dist/src/business/quick-plan/contract.d.ts +57 -0
  15. package/dist/src/business/quick-plan/http-quick-plan-port.d.ts +40 -0
  16. package/dist/src/business/quick-plan/messages.d.ts +9 -0
  17. package/dist/src/business/quick-plan/prepare-asset.d.ts +10 -0
  18. package/dist/src/business/quick-plan/quick-plan-creator.d.ts +17 -0
  19. package/dist/src/business/quick-plan/request-fingerprint.d.ts +2 -0
  20. package/dist/src/elements/elements-api-port.d.ts +5 -1
  21. package/dist/src/elements/elements-client.d.ts +19 -3
  22. package/dist/src/elements/http-elements-api-port.d.ts +5 -1
  23. package/dist/src/elements/index.d.ts +1 -1
  24. package/dist/src/elements/master-key.d.ts +4 -1
  25. package/dist/src/elements/plan-operations.d.ts +3 -0
  26. package/dist/src/elements/relay-master-key-source.d.ts +9 -1
  27. package/dist/src/elements/scoped-reveal.d.ts +6 -0
  28. package/package.json +2 -2
@@ -108,6 +108,12 @@ export default class ElementsClient {
108
108
  configurePlan<TInput extends object, TResult>(input: TInput): Promise<TResult>;
109
109
  /** Resolves the Application's required master key without exposing it as an operation argument. */
110
110
  applicationMasterKey(): Promise<string>;
111
+ /** Resolves the selected Business organization's key without requiring a plan. */
112
+ organizationMasterKey(signal?: AbortSignal, onRelaySession?: (session: {
113
+ sessionId: string;
114
+ expiresAt: string | Date;
115
+ }) => void | Promise<void>): Promise<string>;
116
+ private resolveKey;
111
117
  /**
112
118
  * Resolves the key that opens a plan before anything is collected.
113
119
  *
@@ -116,7 +122,10 @@ export default class ElementsClient {
116
122
  * nothing. Resolving first also keeps a single SafeKey interaction — the relay — ahead
117
123
  * of the custodian's, instead of interleaving two device round trips.
118
124
  */
119
- prepareReveal(planId: string): Promise<{
125
+ prepareReveal(planId: string, signal?: AbortSignal, onRelaySession?: (session: {
126
+ sessionId: string;
127
+ expiresAt: string | Date;
128
+ }) => void | Promise<void>): Promise<{
120
129
  masterKeyWrapped: boolean;
121
130
  masterKeyHex?: string;
122
131
  }>;
@@ -151,10 +160,16 @@ export default class ElementsClient {
151
160
  system: string;
152
161
  contextId: string;
153
162
  };
154
- }): Promise<string | undefined>;
163
+ }, signal?: AbortSignal, onRelaySession?: (session: {
164
+ sessionId: string;
165
+ expiresAt: string | Date;
166
+ }) => void | Promise<void>): Promise<string | undefined>;
155
167
  initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
156
168
  getGovernedReveal(processId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealState>;
157
169
  startReveal(planId: string, input: StartRevealInput): Promise<RevealSession>;
170
+ getActivePlanReveal(planId: string): Promise<(RevealSession & {
171
+ recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
172
+ }) | null>;
158
173
  getReveal(revealId: string): Promise<RevealSession>;
159
174
  openReveal(planId: string, options?: OpenRevealOptions): Promise<RevealHandle>;
160
175
  withReveal<TResult>(planId: string, options: OpenRevealOptions, work: (reveal: RevealHandle) => Promise<TResult>): Promise<TResult>;
@@ -176,9 +191,10 @@ export default class ElementsClient {
176
191
  collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
177
192
  reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
178
193
  closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
179
- abortPlanAccess(planId: string): Promise<{
194
+ abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
180
195
  aborted: boolean;
181
196
  }>;
197
+ cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
182
198
  authorizeRevealAction(revealId: string, input: AuthorizeRevealActionInput): Promise<RevealAction>;
183
199
  reportRevealActionOutcome(revealId: string, actionId: string, input: ReportRevealActionOutcomeInput): Promise<RevealAction>;
184
200
  getCustodianShare(processId: string, stepUp?: StepUpReadContext): Promise<CustodianShareResult>;
@@ -54,6 +54,7 @@ export default class HttpElementsApiPort implements ElementsApiPort {
54
54
  foreignMasterKeyAcquisition(system: string, contextId: string): Promise<MasterKeyAcquisition>;
55
55
  startMasterKeyRelaySession(clientPublicKey: string, context?: MasterKeyRelayContext): Promise<MasterKeyRelaySessionOpened>;
56
56
  readMasterKeyRelaySession(sessionId: string): Promise<MasterKeyRelaySessionState>;
57
+ cancelMasterKeyRelaySession(sessionId: string): Promise<void>;
57
58
  planKeyReference(planId: string): Promise<PlanKeyReference>;
58
59
  collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
59
60
  initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
@@ -65,6 +66,9 @@ export default class HttpElementsApiPort implements ElementsApiPort {
65
66
  markGovernedDataRevealed(processId: string): Promise<void>;
66
67
  closeGovernedReveal(processId: string): Promise<void>;
67
68
  startReveal(planId: string, input: StartRevealInput): Promise<RevealSession>;
69
+ getActivePlanReveal(planId: string): Promise<(RevealSession & {
70
+ recovery: 'RESUMABLE' | 'RESTART_REQUIRED';
71
+ }) | null>;
68
72
  getReveal(revealId: string): Promise<RevealSession>;
69
73
  releaseRevealMaterial(revealId: string, materialVersion: string): Promise<unknown>;
70
74
  markRevealSharesCollected(revealId: string): Promise<void>;
@@ -77,7 +81,7 @@ export default class HttpElementsApiPort implements ElementsApiPort {
77
81
  collectRevealCustodianShare(revealId: string, shareId: string): Promise<void>;
78
82
  reportRevealReconstruction(revealId: string, input: RevealReconstructionInput): Promise<RevealSession>;
79
83
  closeReveal(revealId: string, reason: RevealCloseReason): Promise<RevealSession>;
80
- abortPlanAccess(planId: string): Promise<{
84
+ abortPlanAccess(planId: string, expectedRevealId?: string): Promise<{
81
85
  aborted: boolean;
82
86
  }>;
83
87
  authorizeRevealAction(revealId: string, input: AuthorizeRevealActionInput): Promise<RevealAction>;
@@ -19,7 +19,7 @@ export { MasterKeyRequired, StaticMasterKeyResolver, masterKeyRefFor, masterKeyR
19
19
  export type { MasterKeyRef, MasterKeyResolver } from './master-key';
20
20
  export { unwrapDekWithMasterKey } from './unwrap-dek';
21
21
  export { PlanMaterialReconstructionFailed } from './ssdp-v2-plan-material-reconstructor';
22
- export { RelayMasterKeySource, MasterKeyRelayExpired, MasterKeyRelayTimedOut } from './relay-master-key-source';
22
+ export { RelayMasterKeySource, MasterKeyRelayExpired, MasterKeyRelayTimedOut, MasterKeyRelayCancellationFailed } from './relay-master-key-source';
23
23
  export { createMasterKeyResolver } from './master-key-acquisition';
24
24
  export type { MasterKeySource } from '@safetech/inheriti-core-sdk';
25
25
  export type { DeclaredMasterKeySource, MasterKeyAcquisitionOptions } from './master-key-acquisition';
@@ -21,7 +21,10 @@ export declare function masterKeyRefKey(ref: MasterKeyRef): string;
21
21
  * KMS, and relay a third.
22
22
  */
23
23
  export interface MasterKeyResolver {
24
- resolve(ref: MasterKeyRef): Promise<string | undefined>;
24
+ resolve(ref: MasterKeyRef, signal?: AbortSignal, onRelaySession?: (session: {
25
+ sessionId: string;
26
+ expiresAt: string | Date;
27
+ }) => void | Promise<void>): Promise<string | undefined>;
25
28
  }
26
29
  /**
27
30
  * Derives which key opens a plan.
@@ -201,6 +201,9 @@ export interface EncryptedPlanMaterial {
201
201
  notes?: string;
202
202
  code?: string;
203
203
  matchOrigins?: readonly string[];
204
+ isMedia?: boolean;
205
+ mimeType?: string;
206
+ fileName?: string;
204
207
  };
205
208
  fieldNames?: readonly string[];
206
209
  isBinary?: boolean;
@@ -8,6 +8,7 @@ export interface MasterKeyRelayPort {
8
8
  status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
9
9
  sealedMasterKey?: string;
10
10
  }>;
11
+ cancelRelaySession?(sessionId: string): Promise<void>;
11
12
  }
12
13
  export declare class MasterKeyRelayTimedOut extends Error {
13
14
  readonly sessionId: string;
@@ -17,6 +18,10 @@ export declare class MasterKeyRelayExpired extends Error {
17
18
  readonly sessionId: string;
18
19
  constructor(sessionId: string);
19
20
  }
21
+ export declare class MasterKeyRelayCancellationFailed extends Error {
22
+ readonly code = "master_key_relay_cancellation_failed";
23
+ constructor(cause: unknown);
24
+ }
20
25
  export interface RelayMasterKeySourceOptions {
21
26
  api: MasterKeyRelayPort;
22
27
  /** How long to wait for the device before giving up. Defaults to the session lifetime. */
@@ -34,5 +39,8 @@ export interface RelayMasterKeySourceOptions {
34
39
  export declare class RelayMasterKeySource implements MasterKeySource {
35
40
  private readonly options;
36
41
  constructor(options: RelayMasterKeySourceOptions);
37
- resolve(): Promise<string>;
42
+ resolve(signal?: AbortSignal, onRelaySession?: (session: {
43
+ sessionId: string;
44
+ expiresAt: string | Date;
45
+ }) => void | Promise<void>): Promise<string>;
38
46
  }
@@ -78,9 +78,15 @@ export interface OpenRevealOptions {
78
78
  }, signal?: AbortSignal): Promise<ProCustodianShare & {
79
79
  deviceId: string;
80
80
  }>;
81
+ clearPin?(): void;
81
82
  };
82
83
  /** Every step of the reveal, named. Prefer this to `onSession`, which reports server stages only. */
83
84
  onProgress?: (progress: RevealProgress) => void;
85
+ /** Relay session metadata for cancellation after a host restarts; contains no key material. */
86
+ onRelaySession?: (session: {
87
+ sessionId: string;
88
+ expiresAt: string | Date;
89
+ }) => void | Promise<void>;
84
90
  onSession?: (session: RevealSession) => void;
85
91
  }
86
92
  /** The governance layers the server does report, read from the gate it names. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safetech/inheriti-client-sdk",
3
- "version": "1.17.11",
3
+ "version": "1.17.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "license": "MIT",
43
43
  "dependencies": {
44
44
  "@safetech/safekey-sdk": "^1.0.0",
45
- "@safetech/inheriti-core-sdk": "4.0.29"
45
+ "@safetech/inheriti-core-sdk": "4.0.33"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@rollup/plugin-alias": "^5.1.1",