@safetech/inheriti-client-sdk 1.16.0 → 1.17.1

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/test.d.ts CHANGED
@@ -1,184 +1,2 @@
1
- export declare const TestUtils: {
2
- ProtectionPlan: {
3
- PlanDataAssetInputGenerator: {
4
- plainText: (props?: {
5
- id?: string;
6
- name?: string;
7
- secret?: {
8
- text: string;
9
- };
10
- }) => import("@safetech/inheriti-core-sdk").DataAsset;
11
- onlineAccount: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
12
- recoveryCode: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
13
- pinCode: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
14
- apiKey: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
15
- privateKey: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
16
- seedPhrase: (props?: {
17
- id?: string;
18
- name?: string;
19
- typeLength?: number;
20
- secret?: {
21
- words: string[];
22
- };
23
- }) => import("@safetech/inheriti-core-sdk").DataAsset;
24
- paymentDebitCard: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
25
- paymentCreditCard: (props?: any) => import("@safetech/inheriti-core-sdk").DataAsset;
26
- };
27
- };
28
- RandomElementPickerMother: {
29
- new (): {};
30
- from(a: any): any;
31
- };
32
- SharedProtectionPlan: {};
33
- DataAssetInputGenerator: {
34
- new (): {};
35
- plainText({ id: a, name: e, secret: i }?: {
36
- id?: any;
37
- name?: any;
38
- }): {
39
- id: any;
40
- type: string;
41
- meta: {
42
- name: any;
43
- };
44
- secret: any;
45
- };
46
- userAndPassword({ id: a, name: e, notes: i, secret: n }?: {
47
- id?: any;
48
- name?: any;
49
- notes?: any;
50
- }): {
51
- id: any;
52
- type: string;
53
- meta: {
54
- name: any;
55
- notes: any;
56
- };
57
- secret: any;
58
- };
59
- recoveryCode({ id: a, name: e, notes: i, secret: n }?: {
60
- id?: any;
61
- name?: any;
62
- notes?: any;
63
- }): {
64
- id: any;
65
- type: string;
66
- meta: {
67
- name: any;
68
- notes: any;
69
- };
70
- secret: any;
71
- };
72
- pinCode({ id: a, name: e, notes: i, secret: n }?: {
73
- id?: any;
74
- name?: any;
75
- notes?: any;
76
- }): {
77
- id: any;
78
- type: string;
79
- meta: {
80
- name: any;
81
- notes: any;
82
- };
83
- secret: any;
84
- };
85
- apiKey({ id: a, name: e, notes: i, secret: n }?: {
86
- id?: any;
87
- name?: any;
88
- notes?: any;
89
- }): {
90
- id: any;
91
- type: string;
92
- meta: {
93
- name: any;
94
- notes: any;
95
- };
96
- secret: any;
97
- };
98
- privateKey({ id: a, name: e, notes: i, secret: n }?: {
99
- id?: any;
100
- name?: any;
101
- notes?: any;
102
- }): {
103
- id: any;
104
- type: string;
105
- meta: {
106
- name: any;
107
- notes: any;
108
- };
109
- secret: any;
110
- };
111
- seedPhrase({ id: a, name: e, notes: i, typeLength: n, secret: r }?: {
112
- id?: any;
113
- name?: any;
114
- notes?: any;
115
- typeLength?: any;
116
- }): {
117
- id: any;
118
- type: string;
119
- meta: {
120
- name: any;
121
- notes: any;
122
- };
123
- secret: any;
124
- };
125
- paymentDebitCard({ id: a, name: e, notes: i, secret: n }?: {
126
- id?: any;
127
- name?: any;
128
- notes?: any;
129
- }): {
130
- id: any;
131
- type: string;
132
- meta: {
133
- name: any;
134
- notes: any;
135
- };
136
- secret: any;
137
- };
138
- pdf({ id: a, name: e }?: {
139
- id?: any;
140
- name?: any;
141
- }): {
142
- id: any;
143
- type: string;
144
- meta: {
145
- name: any;
146
- mimeType: string;
147
- isMedia: boolean;
148
- };
149
- secret: {
150
- data: string;
151
- mimeType: string;
152
- };
153
- };
154
- video({ id: a, name: e }?: {
155
- id?: any;
156
- name?: any;
157
- }): {
158
- id: any;
159
- type: string;
160
- meta: {
161
- name: any;
162
- mimeType: string;
163
- isMedia: boolean;
164
- };
165
- secret: {
166
- data: string;
167
- mimeType: string;
168
- };
169
- };
170
- paymentCreditCard({ id: a, name: e, notes: i, secret: n }?: {
171
- id?: any;
172
- name?: any;
173
- notes?: any;
174
- }): {
175
- id: any;
176
- type: string;
177
- meta: {
178
- name: any;
179
- notes: any;
180
- };
181
- secret: any;
182
- };
183
- };
184
- };
1
+ export declare const TestUtils: any;
2
+ export { TestKeyVault, TestStatePort } from './src/elements/test-doubles';
package/index.ts CHANGED
@@ -6,3 +6,4 @@ export type { InheritiClientProviderProps } from "./src/auth/inheriti-client-pro
6
6
  export { default as useClient } from "./src/auth/use-client"
7
7
  export { getAvailableEnvs } from "./src/auth/get-available-envs"
8
8
  export {SDKContainer}
9
+ export * from './src/elements';
package/node.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { createNodeSharedConfigurationSdk, 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 { StatePort } from './src/elements/state-port';
6
+ import HttpElementsApiPort from './src/elements/http-elements-api-port';
7
+ import NodePlanMaterialReconstructor from './src/elements/node-plan-material-reconstructor';
8
+
9
+ export interface NodeElementsClientOptions extends NodeSharedConfigurationSdkOptions { environment: 'TEST' | 'LIVE'; keyVault?: KeyVault; state?: StatePort }
10
+
11
+ export function createNodeElementsClient(options: NodeElementsClientOptions): ElementsClient {
12
+ const baseTransport = options.transport ?? globalThis.fetch.bind(globalThis);
13
+ const transport: NonNullable<NodeSharedConfigurationSdkOptions['transport']> = (input, init) => {
14
+ const headers = new Headers(init?.headers);
15
+ headers.set('x-elements-environment', options.environment);
16
+ return baseTransport(input, Object.assign({}, init, { headers }));
17
+ };
18
+ const coreSdk = createNodeSharedConfigurationSdk({ apiUrl: options.apiUrl, getBearerToken: options.getBearerToken, transport, workerUrl: options.workerUrl, reconciliationConcurrency: options.reconciliationConcurrency, eventListeners: options.eventListeners });
19
+ const api = new HttpElementsApiPort(options.apiUrl, options.environment, options.getBearerToken, transport);
20
+ return new ElementsClient(coreSdk, { keyVault: options.keyVault, state: options.state, api, reconstructor: new NodePlanMaterialReconstructor() });
21
+ }
22
+
23
+ export { ElementsClient };
24
+ export { ElementsApiRequestFailed } from './src/elements/http-elements-api-port';
25
+ export type { StepUpReadContext } from './src/elements/elements-api-port';
26
+ export { MemoryKeyVault } from './src/elements/key-vault';
27
+ export type { KeyVault } from './src/elements/key-vault';
28
+ export { MemoryStatePort } from './src/elements/state-port';
29
+ export type { StatePort } from './src/elements/state-port';
30
+ export { decodeAssetContainer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safetech/inheriti-client-sdk",
3
- "version": "1.16.0",
3
+ "version": "1.17.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -13,12 +13,19 @@
13
13
  "./test": {
14
14
  "import": "./dist/test/index.js",
15
15
  "require": "./dist/test/index.js"
16
+ },
17
+ "./node": {
18
+ "import": "./dist/node.js",
19
+ "require": "./dist/node.js"
16
20
  }
17
21
  },
18
22
  "typesVersions": {
19
23
  "*": {
20
24
  "test": [
21
25
  "dist/test/index.d.ts"
26
+ ],
27
+ "node": [
28
+ "dist/node.d.ts"
22
29
  ]
23
30
  }
24
31
  },
@@ -26,7 +33,7 @@
26
33
  "license": "MIT",
27
34
  "dependencies": {
28
35
  "@safetech/safekey-sdk": "^1.0.0",
29
- "@safetech/inheriti-core-sdk": "*"
36
+ "@safetech/inheriti-core-sdk": "4.0.15"
30
37
  },
31
38
  "devDependencies": {
32
39
  "@rollup/plugin-alias": "^5.1.1",
@@ -66,12 +73,14 @@
66
73
  "publish-version": "node scripts/publish-sdk-version.js",
67
74
  "add-patch": "node scripts/bump-version.js patch",
68
75
  "generate-docs": "npx typedoc --json docs/docs.json",
69
- "publish-npm": "node scripts/publish-npm.js"
76
+ "proof:elements-round-trip": "node examples/elements-round-trip.mjs",
77
+ "publish-npm": "node esbuild.config.js && node scripts/publish-npm.js"
70
78
  },
71
79
  "files": [
72
80
  "dist",
73
81
  "README.md",
74
82
  "LICENSE",
75
- "index.ts"
83
+ "index.ts",
84
+ "node.ts"
76
85
  ]
77
86
  }