@safetech/inheriti-client-sdk 1.17.0 → 1.17.2
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/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/inheriti-client-sdk.umd.js +186 -108
- package/dist/node.d.ts +31 -0
- package/dist/node.js +1 -0
- package/dist/sdk-types.d.ts +411 -3
- package/dist/src/elements/elements-api-port.d.ts +172 -0
- package/dist/src/elements/elements-client.d.ts +93 -0
- package/dist/src/elements/http-elements-api-port.d.ts +32 -0
- package/dist/src/elements/index.d.ts +17 -0
- package/dist/src/elements/key-vault.d.ts +19 -0
- package/dist/src/elements/master-key.d.ts +58 -0
- package/dist/src/elements/node-plan-material-reconstructor.d.ts +7 -0
- package/dist/src/elements/plan-material-reconstructor.d.ts +11 -0
- package/dist/src/elements/relay-master-key-source.d.ts +38 -0
- package/dist/src/elements/state-port.d.ts +11 -0
- package/dist/src/elements/test-doubles.d.ts +6 -0
- package/dist/src/elements/unwrap-dek.d.ts +7 -0
- package/dist/test/index.js +1 -1
- package/dist/test.d.ts +2 -184
- package/index.ts +1 -0
- package/node.ts +46 -0
- package/package.json +12 -3
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { decodeAssetContainer } from '@safetech/inheriti-core-sdk/node';
|
|
2
|
+
import type { NodeSharedConfigurationSdkOptions } from '@safetech/inheriti-core-sdk/node';
|
|
3
|
+
import ElementsClient from './src/elements/elements-client';
|
|
4
|
+
import type { KeyVault } from './src/elements/key-vault';
|
|
5
|
+
import type { MasterKeyResolver } from './src/elements/master-key';
|
|
6
|
+
import type { StatePort } from './src/elements/state-port';
|
|
7
|
+
export interface NodeElementsClientOptions extends NodeSharedConfigurationSdkOptions {
|
|
8
|
+
environment: 'TEST' | 'LIVE';
|
|
9
|
+
keyVault?: KeyVault;
|
|
10
|
+
state?: StatePort;
|
|
11
|
+
/** Resolves master keys per plan reference; required to open non-custodial plans. */
|
|
12
|
+
masterKeys?: MasterKeyResolver;
|
|
13
|
+
/** The Application this client acts for; needed to wrap keys of plans it creates. */
|
|
14
|
+
applicationId?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function createNodeElementsClient(options: NodeElementsClientOptions): ElementsClient;
|
|
17
|
+
export { ElementsClient };
|
|
18
|
+
export { ElementsApiRequestFailed } from './src/elements/http-elements-api-port';
|
|
19
|
+
export type { StepUpReadContext } from './src/elements/elements-api-port';
|
|
20
|
+
export { MemoryKeyVault } from './src/elements/key-vault';
|
|
21
|
+
export type { KeyVault } from './src/elements/key-vault';
|
|
22
|
+
export { MemoryStatePort } from './src/elements/state-port';
|
|
23
|
+
export type { StatePort } from './src/elements/state-port';
|
|
24
|
+
export { MasterKeyRequired, StaticMasterKeyResolver, masterKeyRefFor, masterKeyRefKey } from './src/elements/master-key';
|
|
25
|
+
export type { MasterKeyRef, MasterKeyResolver } from './src/elements/master-key';
|
|
26
|
+
export { unwrapDekWithMasterKey } from './src/elements/unwrap-dek';
|
|
27
|
+
export { RelayMasterKeySource, MasterKeyRelayExpired, MasterKeyRelayTimedOut } from './src/elements/relay-master-key-source';
|
|
28
|
+
export type { MasterKeyRelayPort } from './src/elements/relay-master-key-source';
|
|
29
|
+
export { PassphraseMasterKeySource, RawMasterKeySource, deriveMasterKey, generateHexSeed, computePassphraseVerifier } from '@safetech/inheriti-core-sdk/node';
|
|
30
|
+
export type { MasterKeySource } from '@safetech/inheriti-core-sdk/node';
|
|
31
|
+
export { decodeAssetContainer };
|
package/dist/node.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createNodeSharedConfigurationSdk as b,decodeAssetContainer as te}from"@safetech/inheriti-core-sdk/node";function c(r){return`${r.system}:${r.contextId}`}function K(r){return r.sourceReference?{system:r.sourceReference.system,contextId:r.sourceReference.contextId}:r.tenantId?{system:"INHERITI_ELEMENTS",contextId:r.tenantId}:void 0}var u=class extends Error{constructor(t){super(`master_key_required:${c(t)}`);this.ref=t;this.name="MasterKeyRequired"}},I=class{sources=new Map;constructor(e=[]){for(let t of e)this.register(t.ref,t.source)}register(e,t){return this.sources.set(c(e),t),this}async resolve(e){return this.sources.get(c(e))?.resolve()}};var y=class{keys=new Map;async store(e,t){this.keys.set(c(e),t.slice())}async load(e){return this.keys.get(c(e))?.slice()}async remove(e){this.keys.delete(c(e))}};var h=class{values=new Map;async set(e,t){this.values.set(e,t)}async get(e){return this.values.get(e)}async remove(e){this.values.delete(e)}};var p=class extends Error{constructor(){super("elements_api_port_required"),this.name="ElementsApiPortRequired"}};var R=class extends Error{constructor(){super("plan_material_reconstructor_required"),this.name="PlanMaterialReconstructorRequired"}};var g=class{constructor(e,t={}){this.coreSdk=e;this.keyVault=t.keyVault??new y,this.state=t.state??new h,this.api=t.api,this.reconstructor=t.reconstructor,this.masterKeys=t.masterKeys,this.applicationId=t.applicationId}keyVault;state;api;reconstructor;masterKeys;applicationId;createPlan(e){return this.useCase("CreateSharedProtectionPlanUseCase",e)}async configurePlan(e){let t=e.masterKey??await this.applicationMasterKey(),a=t?Object.assign({},e,{masterKey:t}):e;return this.useCase("ConfigureSharedProtectionPlanUseCase",a)}async applicationMasterKey(){if(!this.applicationId)return;let e={system:"INHERITI_ELEMENTS",contextId:this.applicationId},t=await this.keyVault.load(e);if(t)return E(t);let a=await this.masterKeys?.resolve(e);return a&&await this.keyVault.store(e,x(a)),a}async prepareReveal(e){if(!this.api)throw new p;let t=await this.api.planKeyReference(e);return t.masterKeyWrapped?{masterKeyWrapped:!0,masterKeyHex:await this.resolveMasterKey(t)}:{masterKeyWrapped:!1}}async revealPlan(e,t){await this.prepareReveal(e);let a=await this.collectPlanMaterial(e,t);return this.reconstructPlanMaterial(a)}collectPlanMaterial(e,t){if(!this.api)throw new p;return t?this.api.collectPlanMaterial(e,t):this.api.collectPlanMaterial(e)}async reconstructPlanMaterial(e){if(!this.reconstructor)throw new R;return this.reconstructor.reconstruct(e,await this.resolveMasterKey(e))}async resolveMasterKey(e){if(!e.masterKeyWrapped)return;let t=K(e);if(!t)throw new u({system:"INHERITI_ELEMENTS",contextId:e.planId});let a=await this.keyVault.load(t);if(a)return E(a);let s=await this.masterKeys?.resolve(t);if(!s)throw new u(t);return await this.keyVault.store(t,x(s)),s}initializeGovernedReveal(e,t){if(!this.api)throw new p;return t?this.api.initializeGovernedReveal(e,t):this.api.initializeGovernedReveal(e)}getGovernedReveal(e,t){if(!this.api)throw new p;return t?this.api.getGovernedReveal(e,t):this.api.getGovernedReveal(e)}exportPlanBridge(e,t){if(!this.api)throw new p;return this.api.exportPlanBridge(e,t)}importPlanBridge(e){if(!this.api)throw new p;return this.api.importPlanBridge(e)}async collectGovernedPlanMaterial(e,t){if(!this.api)throw new p;await this.resolveMasterKey({planId:e.planId,masterKeyWrapped:e.masterKeyWrapped,tenantId:e.tenantId,sourceReference:e.sourceReference});let a=t?await this.api.collectGovernedValidatorShares(e.processId,t):await this.api.collectGovernedValidatorShares(e.processId),s=t?await this.api.collectGovernedShares(e.processId,t):await this.api.collectGovernedShares(e.processId);await this.api.markGovernedSharesCollected(e.processId);let n=a.validatorShares.map(d=>Object.assign({},d,{shareType:"VALIDATOR_SHARD"})),o=s.dataShards.map(d=>Object.assign({},d,{shareType:"DATA_SHARD"})),i=s.backupShards.map(d=>Object.assign({},d,{shareType:"BACKUP_SHARD"})),l=s.keyShards.map(d=>Object.assign({},d,{shareType:"CUSTODIAN_KEY_SHARD"}));return{planId:e.planId,mergeThreshold:e.mergeThreshold,planKey:s.dek||a.dek,shares:n.concat(o,i,l),verifiedStorageLayerTypes:[],masterKeyWrapped:e.masterKeyWrapped,tenantId:e.tenantId,sourceReference:e.sourceReference}}async reconstructGovernedPlanMaterial(e,t){let a=await this.reconstructPlanMaterial(t);if(!this.api)throw new p;return await this.api.markGovernedSharesReconstructed(e.processId),await this.api.markGovernedDataRevealed(e.processId),await this.api.closeGovernedReveal(e.processId),a}useCase(e,t){return this.coreSdk.getService(e).execute(t)}};function x(r){let e=r.match(/.{2}/g);if(!e||e.length*2!==r.length)throw new Error("invalid_master_key_material");return new Uint8Array(e.map(t=>parseInt(t,16)))}function E(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var m=class extends Error{constructor(t,a,s){super(a??`elements_api_request_failed_${t}`);this.status=t;this.code=a;this.detail=s;this.name="ElementsApiRequestFailed"}get stepUpRequestId(){return this.code==="step_up_approval_required"?this.detail:void 0}},f=class{constructor(e,t,a,s){this.apiUrl=e;this.environment=t;this.getBearerToken=a;this.transport=s}planKeyReference(e){return this.request(`shared-plans/${encodeURIComponent(e)}/material/key-reference`,"GET")}async collectPlanMaterial(e,t){return this.request(`shared-plans/${encodeURIComponent(e)}/material/collect`,"POST",void 0,t)}initializeGovernedReveal(e,t){return this.request(`shared-plans/${encodeURIComponent(e)}/governed-reveal`,"POST",void 0,t)}getGovernedReveal(e,t){return this.request(`shared-plans/governed-reveal/${encodeURIComponent(e)}`,"GET",void 0,t)}collectGovernedValidatorShares(e,t){return this.request(`shared-plans/governed-reveal/${encodeURIComponent(e)}/validator-shares`,"POST",void 0,t)}collectGovernedShares(e,t){return this.request(`shared-plans/governed-reveal/${encodeURIComponent(e)}/shares`,"POST",void 0,t)}markGovernedSharesCollected(e){return this.requestWithoutResult(`shared-plans/governed-reveal/${encodeURIComponent(e)}/shares-collected`)}markGovernedSharesReconstructed(e){return this.requestWithoutResult(`shared-plans/governed-reveal/${encodeURIComponent(e)}/shares-reconstructed`)}markGovernedDataRevealed(e){return this.requestWithoutResult(`shared-plans/governed-reveal/${encodeURIComponent(e)}/data-revealed`)}closeGovernedReveal(e){return this.requestWithoutResult(`shared-plans/governed-reveal/${encodeURIComponent(e)}/close`)}exportPlanBridge(e,t){return this.request(`shared-plans/${encodeURIComponent(e)}/bridge/export`,"POST",t)}importPlanBridge(e){return this.request("shared-plans/bridge/import","POST",{envelope:e})}async request(e,t,a,s){let n=await this.getBearerToken(),o=new Headers({"x-elements-environment":this.environment});n&&o.set("authorization",`Bearer ${n}`),s?.requestId&&o.set("x-elements-step-up-request",s.requestId),a&&o.set("content-type","application/json");let i=this.apiUrl.endsWith("/")?this.apiUrl:`${this.apiUrl}/`,l=await this.transport(new URL(e,i),{method:t,headers:o,body:a?JSON.stringify(a):void 0}),d=await l.json();if(!l.ok)throw new m(l.status,d.name??d.message,d.description);if(!d.ok||!d.result)throw new m(l.status);return d.result}async requestWithoutResult(e){let t=await this.getBearerToken(),a=new Headers({"x-elements-environment":this.environment});t&&a.set("authorization",`Bearer ${t}`);let s=this.apiUrl.endsWith("/")?this.apiUrl:`${this.apiUrl}/`,n=await this.transport(new URL(e,s),{method:"POST",headers:a});if(!n.ok)throw new m(n.status);if(!(await n.json()).ok)throw new m(n.status)}};import{createConfiguredSsdpV2Processor as U}from"@safetech/inheriti-core-sdk/node";async function M(r,e){if(!e)throw new Error("master_key_required");let t=T(e),a=await crypto.subtle.importKey("raw",t,{name:"AES-GCM"},!1,["decrypt"]),s=k(r),n=s.slice(0,12),o=s.slice(12),i=await crypto.subtle.decrypt({name:"AES-GCM",iv:n},a,o);return C(new Uint8Array(i))}function T(r){let e=r.match(/.{2}/g);if(!e||e.length*2!==r.length)throw new Error("invalid_master_key_material");return new Uint8Array(e.map(t=>parseInt(t,16)))}function k(r){let e=atob(r),t=new Uint8Array(e.length);for(let a=0;a<e.length;a+=1)t[a]=e.charCodeAt(a);return t}function C(r){let e="";for(let t of r)e+=String.fromCharCode(t);return btoa(e)}var v=class{async reconstruct(e,t){let a=e.masterKeyWrapped?await M(e.planKey,t):e.planKey,s=await crypto.subtle.importKey("raw",this.decodeBase64(a),{name:"AES-GCM"},!1,["decrypt"]),n=[],o=[];for(let i of e.shares){let l=await this.decryptShare(i.data,s);i.shareType==="VALIDATOR_SHARD"?o.push(l):n.push(l)}return U().reconstruct(n,{planId:e.planId,threshold:e.mergeThreshold,keyShares:o}).result}async decryptShare(e,t){let a=e.indexOf(":");if(a<1)throw new Error("invalid_encrypted_plan_share");let s=this.decodeBase64(e.slice(0,a)),n=this.decodeBase64(e.slice(a+1)),o=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},t,n);return new TextDecoder().decode(o)}decodeBase64(e){let t=atob(e),a=new ArrayBuffer(t.length),s=new Uint8Array(a);for(let n=0;n<t.length;n+=1)s[n]=t.charCodeAt(n);return a}};import{decryptRSAOAEP as A,generateRSAOAEPKeyPair as G}from"@safetech/inheriti-core-sdk";var P=class extends Error{constructor(t){super("master_key_relay_timed_out");this.sessionId=t;this.name="MasterKeyRelayTimedOut"}},S=class extends Error{constructor(t){super("master_key_relay_expired");this.sessionId=t;this.name="MasterKeyRelayExpired"}},w=class{constructor(e){this.options=e}async resolve(){let{publicKeyBase64:e,privateKey:t}=await G(),a=await this.options.api.startRelaySession(e),s=this.options.pollIntervalMs??2e3,n=Date.now()+(this.options.timeoutMs??600*1e3),o=this.options.sleep??(i=>new Promise(l=>setTimeout(l,i)));for(;Date.now()<n;){let i=await this.options.api.readRelaySession(a.sessionId);if(i.status==="DELIVERED"&&i.sealedMasterKey){let l=(await A(i.sealedMasterKey,t)).trim().toLowerCase();if(!/^[0-9a-f]{64}$/.test(l))throw new Error("invalid_master_key_material");return l}if(i.status==="EXPIRED")throw new S(a.sessionId);await o(s)}throw new P(a.sessionId)}};import{PassphraseMasterKeySource as ye,RawMasterKeySource as he,deriveMasterKey as ge,generateHexSeed as fe,computePassphraseVerifier as ve}from"@safetech/inheriti-core-sdk/node";function ne(r){let e=r.transport??globalThis.fetch.bind(globalThis),t=(n,o)=>{let i=new Headers(o?.headers);return i.set("x-elements-environment",r.environment),e(n,Object.assign({},o,{headers:i}))},a=b({apiUrl:r.apiUrl,getBearerToken:r.getBearerToken,transport:t,workerUrl:r.workerUrl,reconciliationConcurrency:r.reconciliationConcurrency,eventListeners:r.eventListeners}),s=new f(r.apiUrl,r.environment,r.getBearerToken,t);return new g(a,{keyVault:r.keyVault,state:r.state,api:s,reconstructor:new v,masterKeys:r.masterKeys,applicationId:r.applicationId})}export{m as ElementsApiRequestFailed,g as ElementsClient,S as MasterKeyRelayExpired,P as MasterKeyRelayTimedOut,u as MasterKeyRequired,y as MemoryKeyVault,h as MemoryStatePort,ye as PassphraseMasterKeySource,he as RawMasterKeySource,w as RelayMasterKeySource,I as StaticMasterKeyResolver,ve as computePassphraseVerifier,ne as createNodeElementsClient,te as decodeAssetContainer,ge as deriveMasterKey,fe as generateHexSeed,K as masterKeyRefFor,c as masterKeyRefKey,M as unwrapDekWithMasterKey};
|
package/dist/sdk-types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { SDKContainer } from '@safetech/inheriti-core-sdk/vanilla';
|
|
1
2
|
export { SDKContainer } from '@safetech/inheriti-core-sdk/vanilla';
|
|
2
|
-
import { ValidEnv, AuthClientProps } from '@safetech/inheriti-core-sdk';
|
|
3
|
+
import { ValidEnv, AuthClientProps, MasterKeySource } from '@safetech/inheriti-core-sdk';
|
|
3
4
|
export * from '@safetech/inheriti-core-sdk';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
@@ -55,5 +56,412 @@ declare function getAvailableEnvs(): {
|
|
|
55
56
|
demoKeyApiUrl: string;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Identifies which master key opens a plan.
|
|
61
|
+
*
|
|
62
|
+
* A plan's key is a property of the plan, not of the Application holding it: a bridged
|
|
63
|
+
* plan is never re-wrapped, so it stays sealed under the key of the context it came
|
|
64
|
+
* from. One host may therefore need several keys at once — its own Application key and
|
|
65
|
+
* a foreign organization key for each bridged plan.
|
|
66
|
+
*/
|
|
67
|
+
interface MasterKeyRef {
|
|
68
|
+
system: 'INHERITI_BUSINESS' | 'INHERITI_ELEMENTS';
|
|
69
|
+
contextId: string;
|
|
70
|
+
}
|
|
71
|
+
/** Stable string form of a ref, used as the `KeyVault` key. */
|
|
72
|
+
declare function masterKeyRefKey(ref: MasterKeyRef): string;
|
|
73
|
+
/**
|
|
74
|
+
* Resolves the master key for a given plan's key reference.
|
|
75
|
+
*
|
|
76
|
+
* Custody says how a key came into existence; a resolver says how *this* host obtains
|
|
77
|
+
* it. The two are independent, so a resolver may derive one key, read another from a
|
|
78
|
+
* KMS, and relay a third.
|
|
79
|
+
*/
|
|
80
|
+
interface MasterKeyResolver {
|
|
81
|
+
resolve(ref: MasterKeyRef): Promise<string | undefined>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Derives which key opens a plan.
|
|
85
|
+
*
|
|
86
|
+
* A bridged plan names its source context; a locally created one is opened by the key
|
|
87
|
+
* of the Application holding it.
|
|
88
|
+
*/
|
|
89
|
+
declare function masterKeyRefFor(material: {
|
|
90
|
+
tenantId?: string;
|
|
91
|
+
sourceReference?: {
|
|
92
|
+
system: string;
|
|
93
|
+
contextId: string;
|
|
94
|
+
};
|
|
95
|
+
}): MasterKeyRef | undefined;
|
|
96
|
+
/** Thrown when a plan is master key wrapped and no key resolves for its reference. */
|
|
97
|
+
declare class MasterKeyRequired extends Error {
|
|
98
|
+
readonly ref: MasterKeyRef;
|
|
99
|
+
constructor(ref: MasterKeyRef);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Resolves keys from a static map of references to sources.
|
|
103
|
+
*
|
|
104
|
+
* Sources come from the Core SDK, so a passphrase-derived key and one supplied from a
|
|
105
|
+
* KMS are the same to everything downstream.
|
|
106
|
+
*/
|
|
107
|
+
declare class StaticMasterKeyResolver implements MasterKeyResolver {
|
|
108
|
+
private readonly sources;
|
|
109
|
+
constructor(entries?: Array<{
|
|
110
|
+
ref: MasterKeyRef;
|
|
111
|
+
source: MasterKeySource;
|
|
112
|
+
}>);
|
|
113
|
+
register(ref: MasterKeyRef, source: MasterKeySource): this;
|
|
114
|
+
resolve(ref: MasterKeyRef): Promise<string | undefined>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Where the host keeps master keys between operations.
|
|
119
|
+
*
|
|
120
|
+
* Keyed by master key reference rather than by Application: a host may hold its own
|
|
121
|
+
* Application key alongside a foreign organization key for each bridged plan, and those
|
|
122
|
+
* are different keys that must not collide.
|
|
123
|
+
*/
|
|
124
|
+
interface KeyVault {
|
|
125
|
+
store(ref: MasterKeyRef, key: Uint8Array): Promise<void>;
|
|
126
|
+
load(ref: MasterKeyRef): Promise<Uint8Array | undefined>;
|
|
127
|
+
remove(ref: MasterKeyRef): Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
declare class MemoryKeyVault implements KeyVault {
|
|
130
|
+
private readonly keys;
|
|
131
|
+
store(ref: MasterKeyRef, key: Uint8Array): Promise<void>;
|
|
132
|
+
load(ref: MasterKeyRef): Promise<Uint8Array | undefined>;
|
|
133
|
+
remove(ref: MasterKeyRef): Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface StatePort {
|
|
137
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
138
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
139
|
+
remove(key: string): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
declare class MemoryStatePort implements StatePort {
|
|
142
|
+
private readonly values;
|
|
143
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
144
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
145
|
+
remove(key: string): Promise<void>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface CollectedPlanMaterial {
|
|
149
|
+
planId: string;
|
|
150
|
+
mergeThreshold: number;
|
|
151
|
+
planKey: string;
|
|
152
|
+
shares: Array<{
|
|
153
|
+
id: string;
|
|
154
|
+
storageLayerId: string;
|
|
155
|
+
shareType: string;
|
|
156
|
+
data: string;
|
|
157
|
+
}>;
|
|
158
|
+
verifiedStorageLayerTypes: string[];
|
|
159
|
+
/** True when `planKey` is still sealed under a master key and must be unwrapped. */
|
|
160
|
+
masterKeyWrapped?: boolean;
|
|
161
|
+
/** The tenant holding the plan. With no source reference, this names the key. */
|
|
162
|
+
tenantId?: string;
|
|
163
|
+
/** Present when the plan came from another system, whose key still opens it. */
|
|
164
|
+
sourceReference?: {
|
|
165
|
+
system: string;
|
|
166
|
+
planId: string;
|
|
167
|
+
contextId: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/** Metadata naming the key that opens a plan, without collecting anything. */
|
|
171
|
+
interface PlanKeyReference {
|
|
172
|
+
planId: string;
|
|
173
|
+
masterKeyWrapped: boolean;
|
|
174
|
+
tenantId: string;
|
|
175
|
+
sourceReference?: {
|
|
176
|
+
system: string;
|
|
177
|
+
planId: string;
|
|
178
|
+
contextId: string;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
interface ElementsApiPort {
|
|
182
|
+
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
183
|
+
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
184
|
+
initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
|
|
185
|
+
getGovernedReveal(processId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealState>;
|
|
186
|
+
collectGovernedValidatorShares(processId: string, stepUp?: StepUpReadContext): Promise<GovernedValidatorMaterial>;
|
|
187
|
+
collectGovernedShares(processId: string, stepUp?: StepUpReadContext): Promise<GovernedSharesMaterial>;
|
|
188
|
+
markGovernedSharesCollected(processId: string): Promise<void>;
|
|
189
|
+
markGovernedSharesReconstructed(processId: string): Promise<void>;
|
|
190
|
+
markGovernedDataRevealed(processId: string): Promise<void>;
|
|
191
|
+
closeGovernedReveal(processId: string): Promise<void>;
|
|
192
|
+
exportPlanBridge(planId: string, input: ExportPlanBridgeInput): Promise<PlanBridgeEnvelope>;
|
|
193
|
+
importPlanBridge(envelope: PlanBridgeEnvelope): Promise<{
|
|
194
|
+
planId: string;
|
|
195
|
+
}>;
|
|
196
|
+
}
|
|
197
|
+
interface StepUpReadContext {
|
|
198
|
+
requestId?: string;
|
|
199
|
+
}
|
|
200
|
+
interface ExportPlanBridgeInput {
|
|
201
|
+
targetPlanId: string;
|
|
202
|
+
targetContextId: string;
|
|
203
|
+
requestedRevealProfile?: PlanRevealProfile;
|
|
204
|
+
allowPostureLoosening?: boolean;
|
|
205
|
+
transferMode?: 'COPY' | 'MOVE';
|
|
206
|
+
}
|
|
207
|
+
interface PlanRevealProfile {
|
|
208
|
+
governance: 'KEEP' | 'BYPASS';
|
|
209
|
+
masterKeyRelease: 'REQUIRED' | 'BYPASS';
|
|
210
|
+
custodian: 'BYPASS' | 'FORCE';
|
|
211
|
+
}
|
|
212
|
+
interface PlanBridgeEnvelope {
|
|
213
|
+
transferMode: 'COPY' | 'MOVE';
|
|
214
|
+
sourceReference: {
|
|
215
|
+
system: 'INHERITI_BUSINESS' | 'INHERITI_ELEMENTS';
|
|
216
|
+
planId: string;
|
|
217
|
+
contextId: string;
|
|
218
|
+
version?: number;
|
|
219
|
+
};
|
|
220
|
+
definition: {
|
|
221
|
+
id: string;
|
|
222
|
+
details: {
|
|
223
|
+
name: string;
|
|
224
|
+
description?: string;
|
|
225
|
+
};
|
|
226
|
+
type: string;
|
|
227
|
+
privacyMode: string;
|
|
228
|
+
mergeThreshold: number;
|
|
229
|
+
minimumApprovals: number;
|
|
230
|
+
authenticationMethods?: Array<{
|
|
231
|
+
id: string;
|
|
232
|
+
countdown?: {
|
|
233
|
+
days: number;
|
|
234
|
+
hours: number;
|
|
235
|
+
minutes: number;
|
|
236
|
+
};
|
|
237
|
+
}>;
|
|
238
|
+
moderators?: Array<{
|
|
239
|
+
id: string;
|
|
240
|
+
countdown?: {
|
|
241
|
+
days: number;
|
|
242
|
+
hours: number;
|
|
243
|
+
minutes: number;
|
|
244
|
+
};
|
|
245
|
+
}>;
|
|
246
|
+
authenticationMode?: 'EXCLUSIVE' | 'ALL_REQUIRED';
|
|
247
|
+
approvalMode?: 'THRESHOLD' | 'UNANIMOUS';
|
|
248
|
+
accessPolicy?: unknown;
|
|
249
|
+
assetsMetadata?: Record<string, unknown>;
|
|
250
|
+
triggers?: Array<{
|
|
251
|
+
id: string;
|
|
252
|
+
countdown: {
|
|
253
|
+
days: number;
|
|
254
|
+
hours: number;
|
|
255
|
+
minutes: number;
|
|
256
|
+
seconds: number;
|
|
257
|
+
};
|
|
258
|
+
settings?: {
|
|
259
|
+
email?: string;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
revealProfile: PlanRevealProfile;
|
|
264
|
+
protectedPlanKey: string;
|
|
265
|
+
shares: Array<{
|
|
266
|
+
id: string;
|
|
267
|
+
type?: string;
|
|
268
|
+
sourceStorageType: string;
|
|
269
|
+
targetStorageType: string;
|
|
270
|
+
wrappedData: string;
|
|
271
|
+
}>;
|
|
272
|
+
subjects: Array<{
|
|
273
|
+
id: string;
|
|
274
|
+
userId?: string;
|
|
275
|
+
email: string;
|
|
276
|
+
firstName: string;
|
|
277
|
+
lastName: string;
|
|
278
|
+
}>;
|
|
279
|
+
}
|
|
280
|
+
interface GovernedRevealSession {
|
|
281
|
+
processId: string;
|
|
282
|
+
planId: string;
|
|
283
|
+
mergeThreshold: number;
|
|
284
|
+
status?: string;
|
|
285
|
+
/** Same key signalling the direct collection route returns, for the governed path. */
|
|
286
|
+
masterKeyWrapped?: boolean;
|
|
287
|
+
tenantId?: string;
|
|
288
|
+
sourceReference?: {
|
|
289
|
+
system: string;
|
|
290
|
+
planId: string;
|
|
291
|
+
contextId: string;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
interface GovernedRevealState {
|
|
295
|
+
id: string;
|
|
296
|
+
planId: string;
|
|
297
|
+
status: string;
|
|
298
|
+
approvalProcess?: {
|
|
299
|
+
status?: string;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
interface GovernedShare {
|
|
303
|
+
id: string;
|
|
304
|
+
storageLayerId: string;
|
|
305
|
+
data: string;
|
|
306
|
+
}
|
|
307
|
+
interface GovernedValidatorMaterial {
|
|
308
|
+
validatorShares: GovernedShare[];
|
|
309
|
+
dek: string;
|
|
310
|
+
}
|
|
311
|
+
interface GovernedSharesMaterial {
|
|
312
|
+
dataShards: GovernedShare[];
|
|
313
|
+
backupShards: GovernedShare[];
|
|
314
|
+
keyShards: GovernedShare[];
|
|
315
|
+
dek: string;
|
|
316
|
+
}
|
|
317
|
+
declare class ElementsApiPortRequired extends Error {
|
|
318
|
+
constructor();
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface PlanMaterialReconstructor {
|
|
322
|
+
/**
|
|
323
|
+
* `masterKeyHex` is required when the material reports `masterKeyWrapped`: the plan
|
|
324
|
+
* key comes back sealed and the platform cannot open it.
|
|
325
|
+
*/
|
|
326
|
+
reconstruct(material: CollectedPlanMaterial, masterKeyHex?: string): Promise<Uint8Array>;
|
|
327
|
+
}
|
|
328
|
+
declare class PlanMaterialReconstructorRequired extends Error {
|
|
329
|
+
constructor();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface ElementsClientOptions {
|
|
333
|
+
coreSdk: SDKContainer;
|
|
334
|
+
keyVault?: KeyVault;
|
|
335
|
+
state?: StatePort;
|
|
336
|
+
api?: ElementsApiPort;
|
|
337
|
+
reconstructor?: PlanMaterialReconstructor;
|
|
338
|
+
/**
|
|
339
|
+
* Resolves master keys per plan. A host may need several: its own Application key
|
|
340
|
+
* and a foreign organization key for each bridged plan it opens.
|
|
341
|
+
*/
|
|
342
|
+
masterKeys?: MasterKeyResolver;
|
|
343
|
+
/** The Application this client acts for; needed to wrap keys of plans it creates. */
|
|
344
|
+
applicationId?: string;
|
|
345
|
+
}
|
|
346
|
+
declare class ElementsClient {
|
|
347
|
+
private readonly coreSdk;
|
|
348
|
+
readonly keyVault: KeyVault;
|
|
349
|
+
readonly state: StatePort;
|
|
350
|
+
constructor(coreSdk: SDKContainer, options?: {
|
|
351
|
+
keyVault?: KeyVault;
|
|
352
|
+
state?: StatePort;
|
|
353
|
+
api?: ElementsApiPort;
|
|
354
|
+
reconstructor?: PlanMaterialReconstructor;
|
|
355
|
+
masterKeys?: MasterKeyResolver;
|
|
356
|
+
applicationId?: string;
|
|
357
|
+
});
|
|
358
|
+
private readonly api?;
|
|
359
|
+
private readonly reconstructor?;
|
|
360
|
+
private readonly masterKeys?;
|
|
361
|
+
private readonly applicationId?;
|
|
362
|
+
createPlan<TInput, TResult>(input: TInput): Promise<TResult>;
|
|
363
|
+
/**
|
|
364
|
+
* Configures a plan, sealing its key under the Application's master key when one
|
|
365
|
+
* exists. Supplying the key here is what makes the plan non-custodial: without it
|
|
366
|
+
* the platform unwraps the DEK and can read the plan.
|
|
367
|
+
*/
|
|
368
|
+
configurePlan<TInput extends {
|
|
369
|
+
masterKey?: string;
|
|
370
|
+
}, TResult>(input: TInput): Promise<TResult>;
|
|
371
|
+
/** The Application's own master key, when this client was given one to resolve. */
|
|
372
|
+
applicationMasterKey(): Promise<string | undefined>;
|
|
373
|
+
/**
|
|
374
|
+
* Resolves the key that opens a plan before anything is collected.
|
|
375
|
+
*
|
|
376
|
+
* Ordering matters: collecting releases the custodian share and advances the reveal,
|
|
377
|
+
* so discovering afterwards that the key is unavailable spends a one-shot release for
|
|
378
|
+
* nothing. Resolving first also keeps a single SafeKey interaction — the relay — ahead
|
|
379
|
+
* of the custodian's, instead of interleaving two device round trips.
|
|
380
|
+
*/
|
|
381
|
+
prepareReveal(planId: string): Promise<{
|
|
382
|
+
masterKeyWrapped: boolean;
|
|
383
|
+
masterKeyHex?: string;
|
|
384
|
+
}>;
|
|
385
|
+
/**
|
|
386
|
+
* The whole direct reveal in the order it must happen: hold the key, then collect,
|
|
387
|
+
* then reconstruct.
|
|
388
|
+
*/
|
|
389
|
+
revealPlan(planId: string, stepUp?: StepUpReadContext): Promise<Uint8Array>;
|
|
390
|
+
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
391
|
+
reconstructPlanMaterial(material: CollectedPlanMaterial): Promise<Uint8Array>;
|
|
392
|
+
/**
|
|
393
|
+
* Resolves the key that opens this plan, caching it in the vault.
|
|
394
|
+
*
|
|
395
|
+
* Fails with the reference named rather than letting an unwrap collapse into an
|
|
396
|
+
* opaque decrypt error: "you are missing the key for Business organization X" is the
|
|
397
|
+
* diagnostic that matters.
|
|
398
|
+
*/
|
|
399
|
+
resolveMasterKey(material: {
|
|
400
|
+
planId: string;
|
|
401
|
+
masterKeyWrapped?: boolean;
|
|
402
|
+
tenantId?: string;
|
|
403
|
+
sourceReference?: {
|
|
404
|
+
system: string;
|
|
405
|
+
contextId: string;
|
|
406
|
+
};
|
|
407
|
+
}): Promise<string | undefined>;
|
|
408
|
+
initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
|
|
409
|
+
getGovernedReveal(processId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealState>;
|
|
410
|
+
exportPlanBridge(planId: string, input: ExportPlanBridgeInput): Promise<PlanBridgeEnvelope>;
|
|
411
|
+
importPlanBridge(envelope: PlanBridgeEnvelope): Promise<{
|
|
412
|
+
planId: string;
|
|
413
|
+
}>;
|
|
414
|
+
collectGovernedPlanMaterial(session: GovernedRevealSession, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
415
|
+
reconstructGovernedPlanMaterial(session: GovernedRevealSession, material: CollectedPlanMaterial): Promise<Uint8Array>;
|
|
416
|
+
private useCase;
|
|
417
|
+
}
|
|
418
|
+
declare function createElementsClient(options: ElementsClientOptions): ElementsClient;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Opens a plan key that was sealed under a master key.
|
|
422
|
+
*
|
|
423
|
+
* The wrap is AES-GCM with a 12-byte prefixed IV, matching the Core SDK's
|
|
424
|
+
* `wrapKeyWithMasterKeyThenRsa`; the platform only ever removed the outer RSA layer.
|
|
425
|
+
*/
|
|
426
|
+
declare function unwrapDekWithMasterKey(wrappedDekBase64: string, masterKeyHex?: string): Promise<string>;
|
|
427
|
+
|
|
428
|
+
interface MasterKeyRelayPort {
|
|
429
|
+
startRelaySession(clientPublicKey: string): Promise<{
|
|
430
|
+
sessionId: string;
|
|
431
|
+
expiresAt: string | Date;
|
|
432
|
+
}>;
|
|
433
|
+
readRelaySession(sessionId: string): Promise<{
|
|
434
|
+
status: 'PENDING' | 'DELIVERED' | 'EXPIRED';
|
|
435
|
+
sealedMasterKey?: string;
|
|
436
|
+
}>;
|
|
437
|
+
}
|
|
438
|
+
declare class MasterKeyRelayTimedOut extends Error {
|
|
439
|
+
readonly sessionId: string;
|
|
440
|
+
constructor(sessionId: string);
|
|
441
|
+
}
|
|
442
|
+
declare class MasterKeyRelayExpired extends Error {
|
|
443
|
+
readonly sessionId: string;
|
|
444
|
+
constructor(sessionId: string);
|
|
445
|
+
}
|
|
446
|
+
interface RelayMasterKeySourceOptions {
|
|
447
|
+
api: MasterKeyRelayPort;
|
|
448
|
+
/** How long to wait for the device before giving up. Defaults to the session lifetime. */
|
|
449
|
+
timeoutMs?: number;
|
|
450
|
+
pollIntervalMs?: number;
|
|
451
|
+
sleep?: (ms: number) => Promise<void>;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Obtains the master key from the device holding it.
|
|
455
|
+
*
|
|
456
|
+
* Elements has no websocket layer, so the host polls. The key is sealed to an ephemeral
|
|
457
|
+
* public key generated here and never leaves this process in the clear: the private half
|
|
458
|
+
* is not persisted, so a relayed key cannot be replayed from stored state.
|
|
459
|
+
*/
|
|
460
|
+
declare class RelayMasterKeySource implements MasterKeySource {
|
|
461
|
+
private readonly options;
|
|
462
|
+
constructor(options: RelayMasterKeySourceOptions);
|
|
463
|
+
resolve(): Promise<string>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export { ElementsApiPortRequired, ElementsClient, InheritiClientProvider, MasterKeyRelayExpired, MasterKeyRelayTimedOut, MasterKeyRequired, MemoryKeyVault, MemoryStatePort, PlanMaterialReconstructorRequired, RelayMasterKeySource, StaticMasterKeyResolver, createElementsClient, getAvailableEnvs, masterKeyRefFor, masterKeyRefKey, unwrapDekWithMasterKey, useClient };
|
|
467
|
+
export type { CollectedPlanMaterial, ElementsApiPort, ElementsClientOptions, ExportPlanBridgeInput, GovernedRevealSession, GovernedRevealState, GovernedShare, GovernedSharesMaterial, GovernedValidatorMaterial, InheritiClientProviderProps, KeyVault, MasterKeyRef, MasterKeyRelayPort, MasterKeyResolver, PlanBridgeEnvelope, PlanMaterialReconstructor, PlanRevealProfile, RelayMasterKeySourceOptions, StatePort, StepUpReadContext };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export interface CollectedPlanMaterial {
|
|
2
|
+
planId: string;
|
|
3
|
+
mergeThreshold: number;
|
|
4
|
+
planKey: string;
|
|
5
|
+
shares: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
storageLayerId: string;
|
|
8
|
+
shareType: string;
|
|
9
|
+
data: string;
|
|
10
|
+
}>;
|
|
11
|
+
verifiedStorageLayerTypes: string[];
|
|
12
|
+
/** True when `planKey` is still sealed under a master key and must be unwrapped. */
|
|
13
|
+
masterKeyWrapped?: boolean;
|
|
14
|
+
/** The tenant holding the plan. With no source reference, this names the key. */
|
|
15
|
+
tenantId?: string;
|
|
16
|
+
/** Present when the plan came from another system, whose key still opens it. */
|
|
17
|
+
sourceReference?: {
|
|
18
|
+
system: string;
|
|
19
|
+
planId: string;
|
|
20
|
+
contextId: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Metadata naming the key that opens a plan, without collecting anything. */
|
|
24
|
+
export interface PlanKeyReference {
|
|
25
|
+
planId: string;
|
|
26
|
+
masterKeyWrapped: boolean;
|
|
27
|
+
tenantId: string;
|
|
28
|
+
sourceReference?: {
|
|
29
|
+
system: string;
|
|
30
|
+
planId: string;
|
|
31
|
+
contextId: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ElementsApiPort {
|
|
35
|
+
planKeyReference(planId: string): Promise<PlanKeyReference>;
|
|
36
|
+
collectPlanMaterial(planId: string, stepUp?: StepUpReadContext): Promise<CollectedPlanMaterial>;
|
|
37
|
+
initializeGovernedReveal(planId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealSession>;
|
|
38
|
+
getGovernedReveal(processId: string, stepUp?: StepUpReadContext): Promise<GovernedRevealState>;
|
|
39
|
+
collectGovernedValidatorShares(processId: string, stepUp?: StepUpReadContext): Promise<GovernedValidatorMaterial>;
|
|
40
|
+
collectGovernedShares(processId: string, stepUp?: StepUpReadContext): Promise<GovernedSharesMaterial>;
|
|
41
|
+
markGovernedSharesCollected(processId: string): Promise<void>;
|
|
42
|
+
markGovernedSharesReconstructed(processId: string): Promise<void>;
|
|
43
|
+
markGovernedDataRevealed(processId: string): Promise<void>;
|
|
44
|
+
closeGovernedReveal(processId: string): Promise<void>;
|
|
45
|
+
exportPlanBridge(planId: string, input: ExportPlanBridgeInput): Promise<PlanBridgeEnvelope>;
|
|
46
|
+
importPlanBridge(envelope: PlanBridgeEnvelope): Promise<{
|
|
47
|
+
planId: string;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
export interface StepUpReadContext {
|
|
51
|
+
requestId?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ExportPlanBridgeInput {
|
|
54
|
+
targetPlanId: string;
|
|
55
|
+
targetContextId: string;
|
|
56
|
+
requestedRevealProfile?: PlanRevealProfile;
|
|
57
|
+
allowPostureLoosening?: boolean;
|
|
58
|
+
transferMode?: 'COPY' | 'MOVE';
|
|
59
|
+
}
|
|
60
|
+
export interface PlanRevealProfile {
|
|
61
|
+
governance: 'KEEP' | 'BYPASS';
|
|
62
|
+
masterKeyRelease: 'REQUIRED' | 'BYPASS';
|
|
63
|
+
custodian: 'BYPASS' | 'FORCE';
|
|
64
|
+
}
|
|
65
|
+
export interface PlanBridgeEnvelope {
|
|
66
|
+
transferMode: 'COPY' | 'MOVE';
|
|
67
|
+
sourceReference: {
|
|
68
|
+
system: 'INHERITI_BUSINESS' | 'INHERITI_ELEMENTS';
|
|
69
|
+
planId: string;
|
|
70
|
+
contextId: string;
|
|
71
|
+
version?: number;
|
|
72
|
+
};
|
|
73
|
+
definition: {
|
|
74
|
+
id: string;
|
|
75
|
+
details: {
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
};
|
|
79
|
+
type: string;
|
|
80
|
+
privacyMode: string;
|
|
81
|
+
mergeThreshold: number;
|
|
82
|
+
minimumApprovals: number;
|
|
83
|
+
authenticationMethods?: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
countdown?: {
|
|
86
|
+
days: number;
|
|
87
|
+
hours: number;
|
|
88
|
+
minutes: number;
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
91
|
+
moderators?: Array<{
|
|
92
|
+
id: string;
|
|
93
|
+
countdown?: {
|
|
94
|
+
days: number;
|
|
95
|
+
hours: number;
|
|
96
|
+
minutes: number;
|
|
97
|
+
};
|
|
98
|
+
}>;
|
|
99
|
+
authenticationMode?: 'EXCLUSIVE' | 'ALL_REQUIRED';
|
|
100
|
+
approvalMode?: 'THRESHOLD' | 'UNANIMOUS';
|
|
101
|
+
accessPolicy?: unknown;
|
|
102
|
+
assetsMetadata?: Record<string, unknown>;
|
|
103
|
+
triggers?: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
countdown: {
|
|
106
|
+
days: number;
|
|
107
|
+
hours: number;
|
|
108
|
+
minutes: number;
|
|
109
|
+
seconds: number;
|
|
110
|
+
};
|
|
111
|
+
settings?: {
|
|
112
|
+
email?: string;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
revealProfile: PlanRevealProfile;
|
|
117
|
+
protectedPlanKey: string;
|
|
118
|
+
shares: Array<{
|
|
119
|
+
id: string;
|
|
120
|
+
type?: string;
|
|
121
|
+
sourceStorageType: string;
|
|
122
|
+
targetStorageType: string;
|
|
123
|
+
wrappedData: string;
|
|
124
|
+
}>;
|
|
125
|
+
subjects: Array<{
|
|
126
|
+
id: string;
|
|
127
|
+
userId?: string;
|
|
128
|
+
email: string;
|
|
129
|
+
firstName: string;
|
|
130
|
+
lastName: string;
|
|
131
|
+
}>;
|
|
132
|
+
}
|
|
133
|
+
export interface GovernedRevealSession {
|
|
134
|
+
processId: string;
|
|
135
|
+
planId: string;
|
|
136
|
+
mergeThreshold: number;
|
|
137
|
+
status?: string;
|
|
138
|
+
/** Same key signalling the direct collection route returns, for the governed path. */
|
|
139
|
+
masterKeyWrapped?: boolean;
|
|
140
|
+
tenantId?: string;
|
|
141
|
+
sourceReference?: {
|
|
142
|
+
system: string;
|
|
143
|
+
planId: string;
|
|
144
|
+
contextId: string;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export interface GovernedRevealState {
|
|
148
|
+
id: string;
|
|
149
|
+
planId: string;
|
|
150
|
+
status: string;
|
|
151
|
+
approvalProcess?: {
|
|
152
|
+
status?: string;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export interface GovernedShare {
|
|
156
|
+
id: string;
|
|
157
|
+
storageLayerId: string;
|
|
158
|
+
data: string;
|
|
159
|
+
}
|
|
160
|
+
export interface GovernedValidatorMaterial {
|
|
161
|
+
validatorShares: GovernedShare[];
|
|
162
|
+
dek: string;
|
|
163
|
+
}
|
|
164
|
+
export interface GovernedSharesMaterial {
|
|
165
|
+
dataShards: GovernedShare[];
|
|
166
|
+
backupShards: GovernedShare[];
|
|
167
|
+
keyShards: GovernedShare[];
|
|
168
|
+
dek: string;
|
|
169
|
+
}
|
|
170
|
+
export declare class ElementsApiPortRequired extends Error {
|
|
171
|
+
constructor();
|
|
172
|
+
}
|