@safetech/inheriti-client-sdk 1.17.12 → 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.
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/inheriti-client-sdk.umd.js +21 -21
- package/dist/node.d.ts +25 -1
- package/dist/node.js +1 -1
- package/dist/sdk-types.d.ts +15 -1
- package/dist/src/business/plan-edit/core-edit-transport.d.ts +10 -0
- package/dist/src/business/plan-edit/http-plan-edit-port.d.ts +106 -0
- package/dist/src/business/plan-edit/plan-edit-asset-access.d.ts +28 -0
- package/dist/src/business/plan-edit/plan-edit-reconfiguration.d.ts +26 -0
- package/dist/src/business/plan-edit/quick-plan-editor.d.ts +82 -0
- package/dist/src/business/quick-plan/build-material.d.ts +6 -0
- package/dist/src/business/quick-plan/contract.d.ts +57 -0
- package/dist/src/business/quick-plan/http-quick-plan-port.d.ts +40 -0
- package/dist/src/business/quick-plan/messages.d.ts +9 -0
- package/dist/src/business/quick-plan/prepare-asset.d.ts +10 -0
- package/dist/src/business/quick-plan/quick-plan-creator.d.ts +17 -0
- package/dist/src/business/quick-plan/request-fingerprint.d.ts +2 -0
- package/dist/src/elements/elements-client.d.ts +6 -0
- package/dist/src/elements/index.d.ts +1 -1
- package/dist/src/elements/plan-operations.d.ts +3 -0
- package/dist/src/elements/relay-master-key-source.d.ts +4 -0
- package/dist/src/elements/scoped-reveal.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export interface EditSession {
|
|
2
|
+
id: string;
|
|
3
|
+
planId: string;
|
|
4
|
+
stage: string;
|
|
5
|
+
mode: 'DIRECT' | 'GOVERNED';
|
|
6
|
+
expiresAt: string;
|
|
7
|
+
materialVersion?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PlanEditCandidate {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
status: 'PROTECTED';
|
|
13
|
+
createdAt: string;
|
|
14
|
+
assetSummary: {
|
|
15
|
+
count: number;
|
|
16
|
+
types: string[];
|
|
17
|
+
names: string[];
|
|
18
|
+
};
|
|
19
|
+
governance: {
|
|
20
|
+
mode: 'DIRECT' | 'GOVERNED';
|
|
21
|
+
minimumApprovals: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface PlanEditCandidatePage {
|
|
25
|
+
items: PlanEditCandidate[];
|
|
26
|
+
nextCursor: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface PlanEditContext {
|
|
29
|
+
idempotencyKey: string;
|
|
30
|
+
mode: 'DIRECT' | 'GOVERNED';
|
|
31
|
+
totalShares: number;
|
|
32
|
+
masterKeyEncrypted: boolean;
|
|
33
|
+
masterKeyAcquisition: {
|
|
34
|
+
system: string;
|
|
35
|
+
contextId: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface ReconfigureMaterial {
|
|
39
|
+
mergeProcessId: string;
|
|
40
|
+
protectionProtocol?: 'SSDP_PLUS_V1' | 'SSDP_PLUS_V2';
|
|
41
|
+
validatorShares: readonly {
|
|
42
|
+
id: string;
|
|
43
|
+
data?: string;
|
|
44
|
+
replacedShareId?: string;
|
|
45
|
+
}[];
|
|
46
|
+
dataShards: readonly {
|
|
47
|
+
id: string;
|
|
48
|
+
data?: string;
|
|
49
|
+
replacedShareId?: string;
|
|
50
|
+
}[];
|
|
51
|
+
backupShards: readonly {
|
|
52
|
+
id: string;
|
|
53
|
+
data?: string;
|
|
54
|
+
replacedShareId?: string;
|
|
55
|
+
}[];
|
|
56
|
+
encryptedKey?: string;
|
|
57
|
+
assetsMetadata?: unknown;
|
|
58
|
+
custodianPair?: {
|
|
59
|
+
keyShard: {
|
|
60
|
+
id: string;
|
|
61
|
+
data: string;
|
|
62
|
+
};
|
|
63
|
+
dataShard: {
|
|
64
|
+
id: string;
|
|
65
|
+
data: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare class HttpPlanEditPort {
|
|
70
|
+
private readonly apiUrl;
|
|
71
|
+
private readonly environment;
|
|
72
|
+
private readonly getBearerToken;
|
|
73
|
+
private readonly transport;
|
|
74
|
+
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: () => Promise<string | null>, transport?: typeof fetch);
|
|
75
|
+
start(organizationId: string, planId: string, mode: 'DIRECT' | 'GOVERNED', idempotencyKey: string): Promise<EditSession>;
|
|
76
|
+
listEligibleCandidates(organizationId: string, cursor?: string, namePrefix?: string): Promise<PlanEditCandidatePage>;
|
|
77
|
+
context(organizationId: string, planId: string): Promise<PlanEditContext>;
|
|
78
|
+
startRelaySession(organizationId: string, context: PlanEditContext['masterKeyAcquisition'], clientPublicKey: string): Promise<{
|
|
79
|
+
sessionId: string;
|
|
80
|
+
expiresAt: string | Date;
|
|
81
|
+
}>;
|
|
82
|
+
readRelaySession(organizationId: string, sessionId: string): Promise<{
|
|
83
|
+
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
84
|
+
sealedMasterKey?: string;
|
|
85
|
+
}>;
|
|
86
|
+
status(organizationId: string, editId: string): Promise<EditSession>;
|
|
87
|
+
preflight(organizationId: string, planId: string, material: ReconfigureMaterial): Promise<void>;
|
|
88
|
+
commit(organizationId: string, planId: string, material: ReconfigureMaterial): Promise<{
|
|
89
|
+
totalShares: number;
|
|
90
|
+
}>;
|
|
91
|
+
abort(organizationId: string, editId: string): Promise<void>;
|
|
92
|
+
commitStatus(organizationId: string, editId: string): Promise<{
|
|
93
|
+
planId: string;
|
|
94
|
+
status: string;
|
|
95
|
+
editStatus: string;
|
|
96
|
+
shares: Array<{
|
|
97
|
+
id: string;
|
|
98
|
+
storageLayerId: string;
|
|
99
|
+
}>;
|
|
100
|
+
assetsMetadataHash: string;
|
|
101
|
+
}>;
|
|
102
|
+
private request;
|
|
103
|
+
private isCandidatePage;
|
|
104
|
+
private isEditContext;
|
|
105
|
+
private reconfigureBody;
|
|
106
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SDKContainer, DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { HttpPlanEditPort } from './http-plan-edit-port';
|
|
3
|
+
import type { EditRecoveryStore, PlanEditAssetReference, QuickPlanEditPhase } from './quick-plan-editor';
|
|
4
|
+
type Plan = {
|
|
5
|
+
withCustodian: boolean;
|
|
6
|
+
masterKeyEncrypted: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class PlanEditAssetAccess {
|
|
9
|
+
private readonly port;
|
|
10
|
+
private readonly coreSdk;
|
|
11
|
+
private readonly recoveryStore;
|
|
12
|
+
private revealedAssets?;
|
|
13
|
+
private revealGeneration;
|
|
14
|
+
constructor(port: HttpPlanEditPort, coreSdk: SDKContainer, recoveryStore: EditRecoveryStore);
|
|
15
|
+
clearRevealedAssets(planId: string): void;
|
|
16
|
+
private configurationRepository;
|
|
17
|
+
loadAssets(input: PlanEditAssetReference, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<{
|
|
18
|
+
plan: Plan;
|
|
19
|
+
masterKey?: string;
|
|
20
|
+
assets: DataAsset[];
|
|
21
|
+
}>;
|
|
22
|
+
private assertEditSession;
|
|
23
|
+
private resolveMasterKey;
|
|
24
|
+
private revealAssets;
|
|
25
|
+
private assertShare;
|
|
26
|
+
private assertNotAborted;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SDKContainer, DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { HttpPlanEditPort } from './http-plan-edit-port';
|
|
3
|
+
import type { AddPlanAssetInput, EditRecoveryStore, QuickPlanEditPhase } from './quick-plan-editor';
|
|
4
|
+
export type EditReference = Pick<AddPlanAssetInput, 'organizationId' | 'planId' | 'editId'>;
|
|
5
|
+
export declare class PlanEditReconfiguration {
|
|
6
|
+
private readonly port;
|
|
7
|
+
private readonly coreSdk;
|
|
8
|
+
private readonly recoveryStore;
|
|
9
|
+
private readonly clearRevealedAssets;
|
|
10
|
+
constructor(port: HttpPlanEditPort, coreSdk: SDKContainer, recoveryStore: EditRecoveryStore, clearRevealedAssets: (planId: string) => void);
|
|
11
|
+
saveAssets(input: AddPlanAssetInput, assets: DataAsset[], withCustodian: boolean, masterKey: string | undefined, assetId: string, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<{
|
|
12
|
+
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
13
|
+
assetId: string;
|
|
14
|
+
}>;
|
|
15
|
+
recover(input: EditReference): Promise<{
|
|
16
|
+
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
17
|
+
}>;
|
|
18
|
+
discard(input: EditReference): Promise<void>;
|
|
19
|
+
discardLocal(planId: string): Promise<void>;
|
|
20
|
+
private configurationRepository;
|
|
21
|
+
private clearCheckpoint;
|
|
22
|
+
private prepareConfiguration;
|
|
23
|
+
private transportShares;
|
|
24
|
+
private commit;
|
|
25
|
+
private isCommitted;
|
|
26
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { SDKContainer, DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { EditSession } from './http-plan-edit-port';
|
|
3
|
+
import { HttpPlanEditPort } from './http-plan-edit-port';
|
|
4
|
+
import type { ReconfigureMaterial } from './http-plan-edit-port';
|
|
5
|
+
import type { EditReference } from './plan-edit-reconfiguration';
|
|
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 AddPlanAssetInput {
|
|
8
|
+
organizationId: string;
|
|
9
|
+
planId: string;
|
|
10
|
+
editId: string;
|
|
11
|
+
asset: Omit<DataAsset, 'id'>;
|
|
12
|
+
totalShares: number;
|
|
13
|
+
masterKey?: string;
|
|
14
|
+
acquireMasterKey?: () => Promise<string>;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
selectCustodianDevice?: () => 'SK_MOBILE' | 'SK_PRO' | Promise<'SK_MOBILE' | 'SK_PRO'>;
|
|
17
|
+
proDevice?: {
|
|
18
|
+
write(share: {
|
|
19
|
+
id: string;
|
|
20
|
+
planId: string;
|
|
21
|
+
shares: string[];
|
|
22
|
+
}, signal?: AbortSignal): Promise<{
|
|
23
|
+
deviceId: string;
|
|
24
|
+
}>;
|
|
25
|
+
read(request: {
|
|
26
|
+
shareId: string;
|
|
27
|
+
planId: string;
|
|
28
|
+
}, signal?: AbortSignal): Promise<{
|
|
29
|
+
id: string;
|
|
30
|
+
planId: string;
|
|
31
|
+
shares: string[];
|
|
32
|
+
deviceId: string;
|
|
33
|
+
}>;
|
|
34
|
+
clearPin?(): void;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface ReplacePlanAssetInput extends AddPlanAssetInput {
|
|
38
|
+
assetId: string;
|
|
39
|
+
}
|
|
40
|
+
export type PlanEditAssetReference = Pick<AddPlanAssetInput, 'organizationId' | 'planId' | 'editId' | 'masterKey' | 'acquireMasterKey' | 'signal' | 'selectCustodianDevice' | 'proDevice'>;
|
|
41
|
+
export type PlanEditAssetSummary = Pick<DataAsset, 'id' | 'type'> & {
|
|
42
|
+
name: string;
|
|
43
|
+
isMedia: boolean;
|
|
44
|
+
};
|
|
45
|
+
export interface EditRecoveryRecord {
|
|
46
|
+
organizationId: string;
|
|
47
|
+
planId: string;
|
|
48
|
+
editId: string;
|
|
49
|
+
assetId: string;
|
|
50
|
+
material: ReconfigureMaterial;
|
|
51
|
+
}
|
|
52
|
+
export interface EditRecoveryStore {
|
|
53
|
+
save(record: EditRecoveryRecord): Promise<boolean>;
|
|
54
|
+
load(planId: string): Promise<EditRecoveryRecord | null>;
|
|
55
|
+
remove(planId: string): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class QuickPlanEditor {
|
|
58
|
+
private readonly port;
|
|
59
|
+
private readonly coreSdk;
|
|
60
|
+
private readonly assetAccess;
|
|
61
|
+
private readonly reconfiguration;
|
|
62
|
+
constructor(port: HttpPlanEditPort, coreSdk: SDKContainer, recoveryStore: EditRecoveryStore);
|
|
63
|
+
clearRevealedAssets(planId: string): void;
|
|
64
|
+
start(organizationId: string, planId: string, mode: 'DIRECT' | 'GOVERNED', idempotencyKey: string): Promise<EditSession>;
|
|
65
|
+
listAssets(input: PlanEditAssetReference, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<PlanEditAssetSummary[]>;
|
|
66
|
+
getAsset(input: PlanEditAssetReference, assetId: string, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<DataAsset>;
|
|
67
|
+
replaceAsset(input: ReplacePlanAssetInput, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<{
|
|
68
|
+
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
69
|
+
assetId: string;
|
|
70
|
+
}>;
|
|
71
|
+
addAsset(input: AddPlanAssetInput, onProgress?: (phase: QuickPlanEditPhase) => void): Promise<{
|
|
72
|
+
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
73
|
+
assetId: string;
|
|
74
|
+
}>;
|
|
75
|
+
private isMedia;
|
|
76
|
+
private hasMediaData;
|
|
77
|
+
recover(input: EditReference): Promise<{
|
|
78
|
+
status: 'UPDATED' | 'RECOVERY_REQUIRED';
|
|
79
|
+
}>;
|
|
80
|
+
discard(input: EditReference): Promise<void>;
|
|
81
|
+
discardLocal(planId: string): Promise<void>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SDKContainer } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { EncryptedPlanMaterial } from '../../elements/plan-operations';
|
|
3
|
+
import type { QuickPlanInput, QuickPlanCreateContext, QuickPlanStatus, QuickPlanPort } from './contract';
|
|
4
|
+
import type { prepareAsset } from './prepare-asset';
|
|
5
|
+
import type { QuickPlanCreatePhase } from './quick-plan-creator';
|
|
6
|
+
export declare function buildMaterial(input: QuickPlanInput, prepared: ReturnType<typeof prepareAsset>, context: QuickPlanCreateContext, status: QuickPlanStatus, port: QuickPlanPort, coreSdk: SDKContainer, onProgress?: (phase: QuickPlanCreatePhase) => void): Promise<EncryptedPlanMaterial>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { MasterKeySource } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
3
|
+
import type { EncryptedPlanMaterial } from '../../elements/plan-operations';
|
|
4
|
+
export interface QuickPlanInput {
|
|
5
|
+
organizationId: string;
|
|
6
|
+
planId: string;
|
|
7
|
+
title: string;
|
|
8
|
+
asset: Omit<DataAsset, 'id'>;
|
|
9
|
+
audience?: {
|
|
10
|
+
teamId: string;
|
|
11
|
+
};
|
|
12
|
+
masterKeySource?: MasterKeySource;
|
|
13
|
+
totalShares: number;
|
|
14
|
+
}
|
|
15
|
+
export interface QuickPlanStatus {
|
|
16
|
+
status: string;
|
|
17
|
+
mergeThreshold: number;
|
|
18
|
+
withCustodian: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface QuickPlanCreateContext {
|
|
21
|
+
planId: string;
|
|
22
|
+
memberId: string;
|
|
23
|
+
storage: {
|
|
24
|
+
activeDataStorageLayerCount: number;
|
|
25
|
+
};
|
|
26
|
+
masterKeyAcquisition: {
|
|
27
|
+
system: string;
|
|
28
|
+
contextId: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface QuickPlanPort {
|
|
32
|
+
createContext(organizationId: string): Promise<QuickPlanCreateContext>;
|
|
33
|
+
teams(organizationId: string): Promise<{
|
|
34
|
+
teams: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}>;
|
|
38
|
+
}>;
|
|
39
|
+
status(organizationId: string, planId: string): Promise<QuickPlanStatus>;
|
|
40
|
+
create(organizationId: string, planId: string, title: string, audience?: {
|
|
41
|
+
teamId: string;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
distribute(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
44
|
+
preflight(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
45
|
+
configure(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
46
|
+
startRelaySession(organizationId: string, context: {
|
|
47
|
+
system: string;
|
|
48
|
+
contextId: string;
|
|
49
|
+
}, clientPublicKey: string): Promise<{
|
|
50
|
+
sessionId: string;
|
|
51
|
+
expiresAt: string | Date;
|
|
52
|
+
}>;
|
|
53
|
+
readRelaySession(organizationId: string, sessionId: string): Promise<{
|
|
54
|
+
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
55
|
+
sealedMasterKey?: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { EncryptedPlanMaterial } from '../../elements/plan-operations';
|
|
2
|
+
import type { QuickPlanCreateContext, QuickPlanStatus, QuickPlanPort } from './contract';
|
|
3
|
+
export declare class PlanRequestFailed extends Error {
|
|
4
|
+
readonly status: number;
|
|
5
|
+
readonly code?: string | undefined;
|
|
6
|
+
constructor(status: number, code?: string | undefined);
|
|
7
|
+
}
|
|
8
|
+
export declare class HttpQuickPlanPort implements QuickPlanPort {
|
|
9
|
+
private readonly apiUrl;
|
|
10
|
+
private readonly environment;
|
|
11
|
+
private readonly getBearerToken;
|
|
12
|
+
private readonly transport;
|
|
13
|
+
constructor(apiUrl: string, environment: 'TEST' | 'LIVE', getBearerToken: () => Promise<string | null>, transport?: typeof fetch);
|
|
14
|
+
createContext(organizationId: string): Promise<QuickPlanCreateContext>;
|
|
15
|
+
teams(organizationId: string): Promise<{
|
|
16
|
+
teams: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
status(organizationId: string, planId: string): Promise<QuickPlanStatus>;
|
|
22
|
+
create(organizationId: string, planId: string, title: string, audience?: {
|
|
23
|
+
teamId: string;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
distribute(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
26
|
+
preflight(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
27
|
+
configure(organizationId: string, planId: string, material: EncryptedPlanMaterial): Promise<void>;
|
|
28
|
+
startRelaySession(organizationId: string, context: {
|
|
29
|
+
system: string;
|
|
30
|
+
contextId: string;
|
|
31
|
+
}, clientPublicKey: string): Promise<{
|
|
32
|
+
sessionId: string;
|
|
33
|
+
expiresAt: string | Date;
|
|
34
|
+
}>;
|
|
35
|
+
readRelaySession(organizationId: string, sessionId: string): Promise<{
|
|
36
|
+
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
37
|
+
sealedMasterKey?: string;
|
|
38
|
+
}>;
|
|
39
|
+
private request;
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const QUICK_PLAN_MESSAGES: {
|
|
2
|
+
readonly invalidDeclaration: "plan_declaration_invalid";
|
|
3
|
+
readonly invalidShares: "plan_share_count_invalid";
|
|
4
|
+
readonly storageChanged: "plan_storage_context_changed";
|
|
5
|
+
readonly invalidMasterKeyContext: "invalid_master_key_context";
|
|
6
|
+
readonly reauthenticationRequired: "operator_reauthentication_required";
|
|
7
|
+
readonly relayFailed: "master_key_relay_failed";
|
|
8
|
+
readonly reconciliationRequired: "reconciliation_required";
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataAsset } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { StartPlanCreationInput } from '../../elements/plan-operations';
|
|
3
|
+
export declare function prepareAsset(input: {
|
|
4
|
+
planId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
asset: Omit<DataAsset, 'id'>;
|
|
7
|
+
}): {
|
|
8
|
+
asset: DataAsset;
|
|
9
|
+
plan: StartPlanCreationInput;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SDKContainer } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { QuickPlanInput, QuickPlanPort } from './contract';
|
|
3
|
+
export type QuickPlanCreatePhase = 'creating_plan' | 'encrypting' | 'generating_shares' | 'preflighting' | 'distributing' | 'configuring' | 'verifying';
|
|
4
|
+
export declare class QuickPlanCreator {
|
|
5
|
+
private readonly port;
|
|
6
|
+
private readonly coreSdk;
|
|
7
|
+
private readonly material;
|
|
8
|
+
private readonly flights;
|
|
9
|
+
constructor(port: QuickPlanPort, coreSdk: SDKContainer);
|
|
10
|
+
createQuickPlan(input: QuickPlanInput, onProgress?: (phase: QuickPlanCreatePhase) => void): Promise<{
|
|
11
|
+
planId: string;
|
|
12
|
+
status: 'READY' | 'PENDING';
|
|
13
|
+
}>;
|
|
14
|
+
private performCreate;
|
|
15
|
+
abandon(planId: string): void;
|
|
16
|
+
private statusOrMissing;
|
|
17
|
+
}
|
|
@@ -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
|
*
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -18,6 +18,10 @@ export declare class MasterKeyRelayExpired extends Error {
|
|
|
18
18
|
readonly sessionId: string;
|
|
19
19
|
constructor(sessionId: string);
|
|
20
20
|
}
|
|
21
|
+
export declare class MasterKeyRelayCancellationFailed extends Error {
|
|
22
|
+
readonly code = "master_key_relay_cancellation_failed";
|
|
23
|
+
constructor(cause: unknown);
|
|
24
|
+
}
|
|
21
25
|
export interface RelayMasterKeySourceOptions {
|
|
22
26
|
api: MasterKeyRelayPort;
|
|
23
27
|
/** How long to wait for the device before giving up. Defaults to the session lifetime. */
|
|
@@ -78,6 +78,7 @@ 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;
|
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.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.
|
|
45
|
+
"@safetech/inheriti-core-sdk": "4.0.33"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@rollup/plugin-alias": "^5.1.1",
|