@yourself_id/siwys-react-native 0.10.1-SAPP-221-mdipUpdate.69

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.cjs ADDED
@@ -0,0 +1,371 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ GatekeeperReactNative: () => GatekeeperReactNative,
34
+ GatekeeperTypes: () => GatekeeperTypes,
35
+ KeymasterReactNative: () => KeymasterReactNative,
36
+ KeymasterTypes: () => KeymasterTypes
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+
40
+ // src/keymaster-react-native.ts
41
+ var GatekeeperClient = require("@mdip/gatekeeper/client").default;
42
+ var KeymasterMDIP = require("@mdip/keymaster").default;
43
+ var KeymasterReactNative = class _KeymasterReactNative {
44
+ static instance = null;
45
+ config;
46
+ keymasterService;
47
+ constructor(config) {
48
+ this.validateConfig(config);
49
+ this.config = config;
50
+ }
51
+ static initialize(config) {
52
+ if (!_KeymasterReactNative.instance) {
53
+ _KeymasterReactNative.instance = new _KeymasterReactNative(config);
54
+ } else {
55
+ console.warn(
56
+ "KeymasterReactNative already initialized, ignoring re-initialization."
57
+ );
58
+ }
59
+ }
60
+ ensureInitialized() {
61
+ if (!_KeymasterReactNative.instance) {
62
+ throw new Error(
63
+ "KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first."
64
+ );
65
+ }
66
+ }
67
+ // Delegated STATIC methods
68
+ static async start() {
69
+ _KeymasterReactNative.getInstance().ensureInitialized();
70
+ return _KeymasterReactNative.getInstance().startInternal();
71
+ }
72
+ static async createChallenge(...args) {
73
+ _KeymasterReactNative.getInstance().ensureInitialized();
74
+ return _KeymasterReactNative.getInstance().createChallengeInternal(...args);
75
+ }
76
+ static async bindCredential(...args) {
77
+ _KeymasterReactNative.getInstance().ensureInitialized();
78
+ return _KeymasterReactNative.getInstance().bindCredentialInternal(...args);
79
+ }
80
+ static async backupWallet(...args) {
81
+ _KeymasterReactNative.getInstance().ensureInitialized();
82
+ return _KeymasterReactNative.getInstance().backupWalletInternal(...args);
83
+ }
84
+ static async createResponse(...args) {
85
+ _KeymasterReactNative.getInstance().ensureInitialized();
86
+ return _KeymasterReactNative.getInstance().createResponseInternal(...args);
87
+ }
88
+ static async issueCredential(...args) {
89
+ _KeymasterReactNative.getInstance().ensureInitialized();
90
+ return _KeymasterReactNative.getInstance().issueCredentialInternal(...args);
91
+ }
92
+ static async publishCredential(...args) {
93
+ _KeymasterReactNative.getInstance().ensureInitialized();
94
+ return _KeymasterReactNative.getInstance().publishCredentialInternal(
95
+ ...args
96
+ );
97
+ }
98
+ static async acceptCredential(...args) {
99
+ _KeymasterReactNative.getInstance().ensureInitialized();
100
+ return _KeymasterReactNative.getInstance().acceptCredentialInternal(...args);
101
+ }
102
+ static async showMnemonic(...args) {
103
+ _KeymasterReactNative.getInstance().ensureInitialized();
104
+ return _KeymasterReactNative.getInstance().showMnemonicInternal(...args);
105
+ }
106
+ static async verifyResponse(...args) {
107
+ _KeymasterReactNative.getInstance().ensureInitialized();
108
+ return _KeymasterReactNative.getInstance().verifyResponseInternal(...args);
109
+ }
110
+ static async decryptMessage(...args) {
111
+ _KeymasterReactNative.getInstance().ensureInitialized();
112
+ return _KeymasterReactNative.getInstance().decryptMessageInternal(...args);
113
+ }
114
+ static async decryptMnemonic(...args) {
115
+ _KeymasterReactNative.getInstance().ensureInitialized();
116
+ return _KeymasterReactNative.getInstance().decryptMnemonicInternal(...args);
117
+ }
118
+ static async getCredential(...args) {
119
+ _KeymasterReactNative.getInstance().ensureInitialized();
120
+ return _KeymasterReactNative.getInstance().getCredentialInternal(...args);
121
+ }
122
+ static async removeCredential(...args) {
123
+ _KeymasterReactNative.getInstance().ensureInitialized();
124
+ return _KeymasterReactNative.getInstance().removeCredentialInternal(...args);
125
+ }
126
+ static async updateCredential(...args) {
127
+ _KeymasterReactNative.getInstance().ensureInitialized();
128
+ return _KeymasterReactNative.getInstance().updateCredentialInternal(...args);
129
+ }
130
+ static async createId(...args) {
131
+ _KeymasterReactNative.getInstance().ensureInitialized();
132
+ return _KeymasterReactNative.getInstance().createIdInternal(...args);
133
+ }
134
+ static async removeId(...args) {
135
+ _KeymasterReactNative.getInstance().ensureInitialized();
136
+ return _KeymasterReactNative.getInstance().removeIdInternal(...args);
137
+ }
138
+ static async resolveDID(...args) {
139
+ _KeymasterReactNative.getInstance().ensureInitialized();
140
+ return _KeymasterReactNative.getInstance().resolveDIDInternal(...args);
141
+ }
142
+ static async setCurrentId(...args) {
143
+ _KeymasterReactNative.getInstance().ensureInitialized();
144
+ return _KeymasterReactNative.getInstance().setCurrentIdInternal(...args);
145
+ }
146
+ static async createSchema(...args) {
147
+ _KeymasterReactNative.getInstance().ensureInitialized();
148
+ return _KeymasterReactNative.getInstance().createSchemaInternal(...args);
149
+ }
150
+ static async newWallet(...args) {
151
+ _KeymasterReactNative.getInstance().ensureInitialized();
152
+ return _KeymasterReactNative.getInstance().newWalletInternal(...args);
153
+ }
154
+ static async recoverWallet(...args) {
155
+ _KeymasterReactNative.getInstance().ensureInitialized();
156
+ return _KeymasterReactNative.getInstance().recoverWalletInternal(...args);
157
+ }
158
+ static getInstance() {
159
+ if (!_KeymasterReactNative.instance) {
160
+ throw new Error(
161
+ "KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first."
162
+ );
163
+ }
164
+ return _KeymasterReactNative.instance;
165
+ }
166
+ // -------- Internal instance methods (originals renamed with Internal) -------
167
+ async startInternal() {
168
+ if (this.config.gatekeeperConfig) {
169
+ return await this.startIntegratedKeymaster();
170
+ } else {
171
+ throw "Missing Gatekeeper config";
172
+ }
173
+ }
174
+ async startIntegratedKeymaster() {
175
+ try {
176
+ if (this.config.walletDb) {
177
+ const gatekeeper = await GatekeeperClient.create({
178
+ url: this.config.gatekeeperConfig?.url,
179
+ waitUntilReady: this.config.gatekeeperConfig?.waitUntilReady,
180
+ intervalSeconds: this.config.gatekeeperConfig?.intervalSeconds,
181
+ chatty: this.config.gatekeeperConfig?.chatty
182
+ });
183
+ this.keymasterService = new KeymasterMDIP({
184
+ gatekeeper,
185
+ wallet: this.config.walletDb,
186
+ cipher: this.config.cipher
187
+ });
188
+ } else {
189
+ return false;
190
+ }
191
+ } catch (e) {
192
+ console.error("Error starting KeymasterReactNative service:", e);
193
+ return false;
194
+ }
195
+ return true;
196
+ }
197
+ async createChallengeInternal(spec, options) {
198
+ const challenge = await this.keymasterService.createChallenge(
199
+ spec,
200
+ options
201
+ );
202
+ return {
203
+ challenge,
204
+ challengeUrl: `${spec.callback}?challenge=${challenge}`
205
+ };
206
+ }
207
+ async bindCredentialInternal(schemaId, subjectId, options = {}) {
208
+ return this.keymasterService.bindCredential(schemaId, subjectId, options);
209
+ }
210
+ async createResponseInternal(challengeDID, options) {
211
+ return this.keymasterService.createResponse(challengeDID, options);
212
+ }
213
+ async backupWalletInternal(registry) {
214
+ return this.keymasterService.backupWallet(registry);
215
+ }
216
+ async issueCredentialInternal(credential, options = {}) {
217
+ return this.keymasterService.issueCredential(credential, options);
218
+ }
219
+ async publishCredentialInternal(did, options = {}) {
220
+ return this.keymasterService.publishCredential(did, options);
221
+ }
222
+ async acceptCredentialInternal(did) {
223
+ return this.keymasterService.acceptCredential(did);
224
+ }
225
+ async showMnemonicInternal() {
226
+ return this.keymasterService.decryptMnemonic();
227
+ }
228
+ async verifyResponseInternal(did, options) {
229
+ return this.keymasterService.verifyResponse(did, options);
230
+ }
231
+ async decryptMessageInternal(...args) {
232
+ return this.keymasterService.decryptMessage(...args);
233
+ }
234
+ async decryptMnemonicInternal(...args) {
235
+ return this.keymasterService.decryptMnemonic(...args);
236
+ }
237
+ async getCredentialInternal(...args) {
238
+ return this.keymasterService.getCredential(...args);
239
+ }
240
+ async removeCredentialInternal(...args) {
241
+ return this.keymasterService.removeCredential(...args);
242
+ }
243
+ async updateCredentialInternal(...args) {
244
+ return this.keymasterService.updateCredential(...args);
245
+ }
246
+ async createIdInternal(...args) {
247
+ return this.keymasterService.createId(...args);
248
+ }
249
+ async removeIdInternal(...args) {
250
+ return this.keymasterService.removeId(...args);
251
+ }
252
+ async resolveDIDInternal(...args) {
253
+ return this.keymasterService.resolveDID(...args);
254
+ }
255
+ async setCurrentIdInternal(...args) {
256
+ return this.keymasterService.setCurrentId(...args);
257
+ }
258
+ async createSchemaInternal(...args) {
259
+ return this.keymasterService.createSchema(...args);
260
+ }
261
+ async newWalletInternal(...args) {
262
+ return this.keymasterService.newWallet(...args);
263
+ }
264
+ async recoverWalletInternal(...args) {
265
+ return this.keymasterService.recoverWallet(...args);
266
+ }
267
+ validateConfig(config) {
268
+ if (!config.gatekeeperConfig) {
269
+ throw new Error("Missing Gatekeeper config");
270
+ }
271
+ if (config.gatekeeperConfig) {
272
+ if (!config.walletDb?.loadWallet) {
273
+ throw new Error("Missing load wallet callback");
274
+ }
275
+ if (!config.walletDb?.saveWallet) {
276
+ throw new Error("Missing save wallet callback");
277
+ }
278
+ }
279
+ }
280
+ };
281
+
282
+ // src/gatekeeper-react-native.ts
283
+ var GatekeeperClient2 = require("@mdip/gatekeeper/client").default;
284
+ var GatekeeperReactNative = class _GatekeeperReactNative {
285
+ static instance = null;
286
+ config;
287
+ gatekeeperClient;
288
+ constructor(config) {
289
+ this.validateConfig(config);
290
+ this.config = config;
291
+ }
292
+ static initialize(config) {
293
+ if (!_GatekeeperReactNative.instance) {
294
+ _GatekeeperReactNative.instance = new _GatekeeperReactNative(config);
295
+ } else {
296
+ console.warn(
297
+ "GatekeeperReactNative already initialized, ignoring re-initialization."
298
+ );
299
+ }
300
+ }
301
+ ensureInitialized() {
302
+ if (!_GatekeeperReactNative.instance) {
303
+ throw new Error(
304
+ "GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first."
305
+ );
306
+ }
307
+ }
308
+ // Delegated STATIC methods
309
+ static async start() {
310
+ _GatekeeperReactNative.getInstance().ensureInitialized();
311
+ return _GatekeeperReactNative.getInstance().startInternal();
312
+ }
313
+ static async getDIDs(...args) {
314
+ _GatekeeperReactNative.getInstance().ensureInitialized();
315
+ return _GatekeeperReactNative.getInstance().getDIDsInternal(...args);
316
+ }
317
+ static getInstance() {
318
+ if (!_GatekeeperReactNative.instance) {
319
+ throw new Error(
320
+ "GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first."
321
+ );
322
+ }
323
+ return _GatekeeperReactNative.instance;
324
+ }
325
+ // -------- Internal instance methods (originals renamed with Internal) -------
326
+ async startInternal() {
327
+ if (this.config) {
328
+ return await this.startIntegratedGatekeeper();
329
+ } else {
330
+ throw "Missing Gatekeeper config";
331
+ }
332
+ }
333
+ async startIntegratedGatekeeper() {
334
+ try {
335
+ this.gatekeeperClient = await GatekeeperClient2.create({
336
+ url: this.config?.url,
337
+ waitUntilReady: this.config?.waitUntilReady,
338
+ intervalSeconds: this.config?.intervalSeconds,
339
+ chatty: this.config?.chatty
340
+ });
341
+ } catch (e) {
342
+ console.error("Error starting GatekeeperReactNative service:", e);
343
+ return false;
344
+ }
345
+ return true;
346
+ }
347
+ async getDIDsInternal({
348
+ dids,
349
+ resolve
350
+ }) {
351
+ const response = await this.gatekeeperClient.getDIDs({ dids, resolve });
352
+ return response.data;
353
+ }
354
+ validateConfig(config) {
355
+ if (!config) {
356
+ throw new Error("Missing Gatekeeper config");
357
+ }
358
+ }
359
+ };
360
+
361
+ // src/index.ts
362
+ var KeymasterTypes = __toESM(require("@mdip/keymaster/types"), 1);
363
+ var GatekeeperTypes = __toESM(require("@mdip/gatekeeper/types"), 1);
364
+ // Annotate the CommonJS export names for ESM import in node:
365
+ 0 && (module.exports = {
366
+ GatekeeperReactNative,
367
+ GatekeeperTypes,
368
+ KeymasterReactNative,
369
+ KeymasterTypes
370
+ });
371
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/keymaster-react-native.ts","../src/gatekeeper-react-native.ts"],"sourcesContent":["export {\n KeymasterReactNative,\n KeymasterConfig as KeymasterReactNativeConfig,\n} from \"./keymaster-react-native.js\";\nexport { GatekeeperReactNative } from \"./gatekeeper-react-native.js\";\n\nexport {\n SdkConfig,\n WalletConfig,\n CreateChallengeResponse,\n CreateChallengeSpec,\n} from \"./types/index.js\";\n\nimport * as KeymasterTypes from \"@mdip/keymaster/types\";\nimport * as GatekeeperTypes from \"@mdip/gatekeeper/types\";\n\nexport { KeymasterTypes, GatekeeperTypes };\n","const GatekeeperClient = require(\"@mdip/gatekeeper/client\").default;\nconst KeymasterMDIP = require(\"@mdip/keymaster\").default;\nimport { default as KeymasterLib } from \"@mdip/keymaster\";\nimport { Cipher } from \"@mdip/cipher/types\";\nimport {\n CreateChallengeResponse,\n CreateChallengeSpec,\n SdkConfig,\n} from \"./types/index.js\";\nimport {\n ChallengeResponse,\n CreateAssetOptions,\n CreateResponseOptions,\n IssueCredentialsOptions,\n VerifiableCredential,\n WalletBase,\n} from \"@mdip/keymaster/types\";\n\nexport interface KeymasterConfig {\n gatekeeperConfig?: SdkConfig;\n walletDb?: WalletBase;\n cipher?: Cipher;\n}\n\nexport class KeymasterReactNative {\n private static instance: KeymasterReactNative | null = null;\n\n private config: KeymasterConfig;\n private keymasterService!: KeymasterLib;\n\n private constructor(config: KeymasterConfig) {\n this.validateConfig(config);\n this.config = config;\n }\n\n public static initialize(config: KeymasterConfig) {\n if (!KeymasterReactNative.instance) {\n KeymasterReactNative.instance = new KeymasterReactNative(config);\n } else {\n console.warn(\n \"KeymasterReactNative already initialized, ignoring re-initialization.\"\n );\n }\n }\n\n private ensureInitialized() {\n if (!KeymasterReactNative.instance) {\n throw new Error(\n \"KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first.\"\n );\n }\n }\n\n // Delegated STATIC methods\n\n public static async start() {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().startInternal();\n }\n\n public static async createChallenge(\n ...args: Parameters<KeymasterReactNative[\"createChallengeInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createChallengeInternal(...args);\n }\n\n public static async bindCredential(\n ...args: Parameters<KeymasterReactNative[\"bindCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().bindCredentialInternal(...args);\n }\n\n public static async backupWallet(\n ...args: Parameters<KeymasterReactNative[\"backupWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().backupWalletInternal(...args);\n }\n\n public static async createResponse(\n ...args: Parameters<KeymasterReactNative[\"createResponseInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createResponseInternal(...args);\n }\n\n public static async issueCredential(\n ...args: Parameters<KeymasterReactNative[\"issueCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().issueCredentialInternal(...args);\n }\n\n public static async publishCredential(\n ...args: Parameters<KeymasterReactNative[\"publishCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().publishCredentialInternal(\n ...args\n );\n }\n\n public static async acceptCredential(\n ...args: Parameters<KeymasterReactNative[\"acceptCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().acceptCredentialInternal(...args);\n }\n\n public static async showMnemonic(\n ...args: Parameters<KeymasterReactNative[\"showMnemonicInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().showMnemonicInternal(...args);\n }\n\n public static async verifyResponse(\n ...args: Parameters<KeymasterReactNative[\"verifyResponseInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().verifyResponseInternal(...args);\n }\n\n public static async decryptMessage(\n ...args: Parameters<KeymasterReactNative[\"decryptMessageInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().decryptMessageInternal(...args);\n }\n\n public static async decryptMnemonic(\n ...args: Parameters<KeymasterReactNative[\"decryptMnemonicInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().decryptMnemonicInternal(...args);\n }\n\n public static async getCredential(\n ...args: Parameters<KeymasterReactNative[\"getCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().getCredentialInternal(...args);\n }\n\n public static async removeCredential(\n ...args: Parameters<KeymasterReactNative[\"removeCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().removeCredentialInternal(...args);\n }\n\n public static async updateCredential(\n ...args: Parameters<KeymasterReactNative[\"updateCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().updateCredentialInternal(...args);\n }\n\n public static async createId(\n ...args: Parameters<KeymasterReactNative[\"createIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createIdInternal(...args);\n }\n\n public static async removeId(\n ...args: Parameters<KeymasterReactNative[\"removeIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().removeIdInternal(...args);\n }\n\n public static async resolveDID(\n ...args: Parameters<KeymasterReactNative[\"resolveDIDInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().resolveDIDInternal(...args);\n }\n\n public static async setCurrentId(\n ...args: Parameters<KeymasterReactNative[\"setCurrentIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().setCurrentIdInternal(...args);\n }\n\n public static async createSchema(\n ...args: Parameters<KeymasterReactNative[\"createSchemaInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createSchemaInternal(...args);\n }\n\n public static async newWallet(\n ...args: Parameters<KeymasterReactNative[\"newWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().newWalletInternal(...args);\n }\n\n public static async recoverWallet(\n ...args: Parameters<KeymasterReactNative[\"recoverWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().recoverWalletInternal(...args);\n }\n\n private static getInstance(): KeymasterReactNative {\n if (!KeymasterReactNative.instance) {\n throw new Error(\n \"KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first.\"\n );\n }\n return KeymasterReactNative.instance;\n }\n\n // -------- Internal instance methods (originals renamed with Internal) -------\n\n private async startInternal(): Promise<boolean> {\n if (this.config.gatekeeperConfig) {\n return await this.startIntegratedKeymaster();\n } else {\n throw \"Missing Gatekeeper config\";\n }\n }\n\n private async startIntegratedKeymaster(): Promise<boolean> {\n try {\n if (this.config.walletDb) {\n const gatekeeper = await GatekeeperClient.create({\n url: this.config.gatekeeperConfig?.url,\n waitUntilReady: this.config.gatekeeperConfig?.waitUntilReady,\n intervalSeconds: this.config.gatekeeperConfig?.intervalSeconds,\n chatty: this.config.gatekeeperConfig?.chatty,\n });\n this.keymasterService = new KeymasterMDIP({\n gatekeeper,\n wallet: this.config.walletDb,\n cipher: this.config.cipher,\n });\n } else {\n return false;\n }\n } catch (e) {\n console.error(\"Error starting KeymasterReactNative service:\", e);\n return false;\n }\n\n return true;\n }\n\n private async createChallengeInternal(\n spec: CreateChallengeSpec,\n options?: CreateAssetOptions\n ): Promise<CreateChallengeResponse> {\n const challenge: string = await this.keymasterService.createChallenge(\n spec,\n options\n );\n return {\n challenge: challenge,\n challengeUrl: `${spec.callback}?challenge=${challenge}`,\n };\n }\n\n private async bindCredentialInternal(\n schemaId: string,\n subjectId: string,\n options: {\n validFrom?: string;\n validUntil?: string;\n credential?: Record<string, unknown>;\n } = {}\n ): Promise<VerifiableCredential> {\n return this.keymasterService.bindCredential(schemaId, subjectId, options);\n }\n\n private async createResponseInternal(\n challengeDID: string,\n options?: CreateResponseOptions\n ): Promise<string> {\n return this.keymasterService.createResponse(challengeDID, options);\n }\n\n private async backupWalletInternal(registry?: string): Promise<string> {\n return this.keymasterService.backupWallet(registry);\n }\n\n private async issueCredentialInternal(\n credential: Partial<VerifiableCredential>,\n options: IssueCredentialsOptions = {}\n ): Promise<string> {\n return this.keymasterService.issueCredential(credential, options);\n }\n\n private async publishCredentialInternal(\n did: string,\n options: { reveal?: boolean } = {}\n ): Promise<VerifiableCredential> {\n return this.keymasterService.publishCredential(did, options);\n }\n\n private async acceptCredentialInternal(did: string): Promise<boolean> {\n return this.keymasterService.acceptCredential(did);\n }\n\n private async showMnemonicInternal(): Promise<string> {\n return this.keymasterService.decryptMnemonic();\n }\n\n private async verifyResponseInternal(\n did: string,\n options?: { retries?: number; delay?: number }\n ): Promise<ChallengeResponse> {\n return this.keymasterService.verifyResponse(did, options);\n }\n\n private async decryptMessageInternal(\n ...args: Parameters<KeymasterLib[\"decryptMessage\"]>\n ) {\n return this.keymasterService.decryptMessage(...args);\n }\n\n private async decryptMnemonicInternal(\n ...args: Parameters<KeymasterLib[\"decryptMnemonic\"]>\n ) {\n return this.keymasterService.decryptMnemonic(...args);\n }\n\n private async getCredentialInternal(\n ...args: Parameters<KeymasterLib[\"getCredential\"]>\n ) {\n return this.keymasterService.getCredential(...args);\n }\n\n private async removeCredentialInternal(\n ...args: Parameters<KeymasterLib[\"removeCredential\"]>\n ) {\n return this.keymasterService.removeCredential(...args);\n }\n\n private async updateCredentialInternal(\n ...args: Parameters<KeymasterLib[\"updateCredential\"]>\n ) {\n return this.keymasterService.updateCredential(...args);\n }\n\n private async createIdInternal(\n ...args: Parameters<KeymasterLib[\"createId\"]>\n ) {\n return this.keymasterService.createId(...args);\n }\n\n private async removeIdInternal(\n ...args: Parameters<KeymasterLib[\"removeId\"]>\n ) {\n return this.keymasterService.removeId(...args);\n }\n\n private async resolveDIDInternal(\n ...args: Parameters<KeymasterLib[\"resolveDID\"]>\n ) {\n return this.keymasterService.resolveDID(...args);\n }\n\n private async setCurrentIdInternal(\n ...args: Parameters<KeymasterLib[\"setCurrentId\"]>\n ) {\n return this.keymasterService.setCurrentId(...args);\n }\n\n private async createSchemaInternal(\n ...args: Parameters<KeymasterLib[\"createSchema\"]>\n ) {\n return this.keymasterService.createSchema(...args);\n }\n\n private async newWalletInternal(\n ...args: Parameters<KeymasterLib[\"newWallet\"]>\n ) {\n return this.keymasterService.newWallet(...args);\n }\n\n private async recoverWalletInternal(\n ...args: Parameters<KeymasterLib[\"recoverWallet\"]>\n ) {\n return this.keymasterService.recoverWallet(...args);\n }\n\n private validateConfig(config: KeymasterConfig): void {\n if (!config.gatekeeperConfig) {\n throw new Error(\"Missing Gatekeeper config\");\n }\n\n if (config.gatekeeperConfig) {\n if (!config.walletDb?.loadWallet) {\n throw new Error(\"Missing load wallet callback\");\n }\n if (!config.walletDb?.saveWallet) {\n throw new Error(\"Missing save wallet callback\");\n }\n }\n }\n}\n","import { SdkConfig } from \"./types/index.js\";\nconst GatekeeperClient = require(\"@mdip/gatekeeper/client\").default;\nimport { GetDIDOptions, MdipDocument } from \"@mdip/gatekeeper/types\";\n\nexport class GatekeeperReactNative {\n private static instance: GatekeeperReactNative | null = null;\n\n private config: SdkConfig;\n private gatekeeperClient!: typeof GatekeeperClient;\n\n private constructor(config: SdkConfig) {\n this.validateConfig(config);\n this.config = config;\n }\n\n public static initialize(config: SdkConfig) {\n if (!GatekeeperReactNative.instance) {\n GatekeeperReactNative.instance = new GatekeeperReactNative(config);\n } else {\n console.warn(\n \"GatekeeperReactNative already initialized, ignoring re-initialization.\"\n );\n }\n }\n\n private ensureInitialized() {\n if (!GatekeeperReactNative.instance) {\n throw new Error(\n \"GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first.\"\n );\n }\n }\n\n // Delegated STATIC methods\n\n public static async start() {\n GatekeeperReactNative.getInstance().ensureInitialized();\n return GatekeeperReactNative.getInstance().startInternal();\n }\n\n public static async getDIDs(\n ...args: Parameters<GatekeeperReactNative[\"getDIDsInternal\"]>\n ) {\n GatekeeperReactNative.getInstance().ensureInitialized();\n return GatekeeperReactNative.getInstance().getDIDsInternal(...args);\n }\n\n private static getInstance(): GatekeeperReactNative {\n if (!GatekeeperReactNative.instance) {\n throw new Error(\n \"GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first.\"\n );\n }\n return GatekeeperReactNative.instance;\n }\n\n // -------- Internal instance methods (originals renamed with Internal) -------\n\n private async startInternal(): Promise<boolean> {\n if (this.config) {\n return await this.startIntegratedGatekeeper();\n } else {\n throw \"Missing Gatekeeper config\";\n }\n }\n\n private async startIntegratedGatekeeper(): Promise<boolean> {\n try {\n this.gatekeeperClient = await GatekeeperClient.create({\n url: this.config?.url,\n waitUntilReady: this.config?.waitUntilReady,\n intervalSeconds: this.config?.intervalSeconds,\n chatty: this.config?.chatty,\n });\n } catch (e) {\n console.error(\"Error starting GatekeeperReactNative service:\", e);\n return false;\n }\n return true;\n }\n\n private async getDIDsInternal({\n dids,\n resolve,\n }: GetDIDOptions): Promise<string[] | MdipDocument[]> {\n const response = await this.gatekeeperClient.getDIDs({ dids, resolve });\n return response.data;\n }\n\n private validateConfig(config: SdkConfig): void {\n if (!config) {\n throw new Error(\"Missing Gatekeeper config\");\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAM,mBAAmB,QAAQ,yBAAyB,EAAE;AAC5D,IAAM,gBAAgB,QAAQ,iBAAiB,EAAE;AAuB1C,IAAM,uBAAN,MAAM,sBAAqB;AAAA,EAChC,OAAe,WAAwC;AAAA,EAE/C;AAAA,EACA;AAAA,EAEA,YAAY,QAAyB;AAC3C,SAAK,eAAe,MAAM;AAC1B,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAc,WAAW,QAAyB;AAChD,QAAI,CAAC,sBAAqB,UAAU;AAClC,4BAAqB,WAAW,IAAI,sBAAqB,MAAM;AAAA,IACjE,OAAO;AACL,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,oBAAoB;AAC1B,QAAI,CAAC,sBAAqB,UAAU;AAClC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAIA,aAAoB,QAAQ;AAC1B,0BAAqB,YAAY,EAAE,kBAAkB;AACrD,WAAO,sBAAqB,YAAY,EAAE,cAAc;AAAA,EAC1D;AAAA,EA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;AAAA,EAClB;AAAA,EAEQ,eAAe,QAAyB;AAC9C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AAAA,EACF;AACF;;;AFjFA,qBAAgC;AAChC,sBAAiC;","names":["GatekeeperClient"]}
@@ -0,0 +1,109 @@
1
+ import * as _mdip_keymaster_types from '@mdip/keymaster/types';
2
+ import { WalletBase, VerifiableCredential, ChallengeResponse } from '@mdip/keymaster/types';
3
+ export { _mdip_keymaster_types as KeymasterTypes };
4
+ import * as _mdip_gatekeeper_types from '@mdip/gatekeeper/types';
5
+ import { MdipDocument } from '@mdip/gatekeeper/types';
6
+ export { _mdip_gatekeeper_types as GatekeeperTypes };
7
+ import { Cipher } from '@mdip/cipher/types';
8
+
9
+ interface CreateChallengeSpec {
10
+ callback: string;
11
+ credentials?: {
12
+ schema: string;
13
+ issuers: string[];
14
+ }[];
15
+ }
16
+ interface CreateChallengeResponse {
17
+ challenge: string;
18
+ challengeUrl: string;
19
+ }
20
+ interface SdkConfig {
21
+ url: string;
22
+ waitUntilReady?: boolean;
23
+ intervalSeconds?: number;
24
+ chatty?: boolean;
25
+ }
26
+ interface WalletConfig {
27
+ id: string;
28
+ mnemonic?: string;
29
+ registry?: string;
30
+ }
31
+
32
+ interface KeymasterConfig {
33
+ gatekeeperConfig?: SdkConfig;
34
+ walletDb?: WalletBase;
35
+ cipher?: Cipher;
36
+ }
37
+ declare class KeymasterReactNative {
38
+ private static instance;
39
+ private config;
40
+ private keymasterService;
41
+ private constructor();
42
+ static initialize(config: KeymasterConfig): void;
43
+ private ensureInitialized;
44
+ static start(): Promise<boolean>;
45
+ static createChallenge(...args: Parameters<KeymasterReactNative["createChallengeInternal"]>): Promise<CreateChallengeResponse>;
46
+ static bindCredential(...args: Parameters<KeymasterReactNative["bindCredentialInternal"]>): Promise<VerifiableCredential>;
47
+ static backupWallet(...args: Parameters<KeymasterReactNative["backupWalletInternal"]>): Promise<string>;
48
+ static createResponse(...args: Parameters<KeymasterReactNative["createResponseInternal"]>): Promise<string>;
49
+ static issueCredential(...args: Parameters<KeymasterReactNative["issueCredentialInternal"]>): Promise<string>;
50
+ static publishCredential(...args: Parameters<KeymasterReactNative["publishCredentialInternal"]>): Promise<VerifiableCredential>;
51
+ static acceptCredential(...args: Parameters<KeymasterReactNative["acceptCredentialInternal"]>): Promise<boolean>;
52
+ static showMnemonic(...args: Parameters<KeymasterReactNative["showMnemonicInternal"]>): Promise<string>;
53
+ static verifyResponse(...args: Parameters<KeymasterReactNative["verifyResponseInternal"]>): Promise<ChallengeResponse>;
54
+ static decryptMessage(...args: Parameters<KeymasterReactNative["decryptMessageInternal"]>): Promise<string>;
55
+ static decryptMnemonic(...args: Parameters<KeymasterReactNative["decryptMnemonicInternal"]>): Promise<string>;
56
+ static getCredential(...args: Parameters<KeymasterReactNative["getCredentialInternal"]>): Promise<VerifiableCredential | null>;
57
+ static removeCredential(...args: Parameters<KeymasterReactNative["removeCredentialInternal"]>): Promise<boolean>;
58
+ static updateCredential(...args: Parameters<KeymasterReactNative["updateCredentialInternal"]>): Promise<boolean>;
59
+ static createId(...args: Parameters<KeymasterReactNative["createIdInternal"]>): Promise<string>;
60
+ static removeId(...args: Parameters<KeymasterReactNative["removeIdInternal"]>): Promise<boolean>;
61
+ static resolveDID(...args: Parameters<KeymasterReactNative["resolveDIDInternal"]>): Promise<_mdip_gatekeeper_types.MdipDocument>;
62
+ static setCurrentId(...args: Parameters<KeymasterReactNative["setCurrentIdInternal"]>): Promise<boolean>;
63
+ static createSchema(...args: Parameters<KeymasterReactNative["createSchemaInternal"]>): Promise<string>;
64
+ static newWallet(...args: Parameters<KeymasterReactNative["newWalletInternal"]>): Promise<_mdip_keymaster_types.WalletFile>;
65
+ static recoverWallet(...args: Parameters<KeymasterReactNative["recoverWalletInternal"]>): Promise<_mdip_keymaster_types.WalletFile>;
66
+ private static getInstance;
67
+ private startInternal;
68
+ private startIntegratedKeymaster;
69
+ private createChallengeInternal;
70
+ private bindCredentialInternal;
71
+ private createResponseInternal;
72
+ private backupWalletInternal;
73
+ private issueCredentialInternal;
74
+ private publishCredentialInternal;
75
+ private acceptCredentialInternal;
76
+ private showMnemonicInternal;
77
+ private verifyResponseInternal;
78
+ private decryptMessageInternal;
79
+ private decryptMnemonicInternal;
80
+ private getCredentialInternal;
81
+ private removeCredentialInternal;
82
+ private updateCredentialInternal;
83
+ private createIdInternal;
84
+ private removeIdInternal;
85
+ private resolveDIDInternal;
86
+ private setCurrentIdInternal;
87
+ private createSchemaInternal;
88
+ private newWalletInternal;
89
+ private recoverWalletInternal;
90
+ private validateConfig;
91
+ }
92
+
93
+ declare class GatekeeperReactNative {
94
+ private static instance;
95
+ private config;
96
+ private gatekeeperClient;
97
+ private constructor();
98
+ static initialize(config: SdkConfig): void;
99
+ private ensureInitialized;
100
+ static start(): Promise<boolean>;
101
+ static getDIDs(...args: Parameters<GatekeeperReactNative["getDIDsInternal"]>): Promise<string[] | MdipDocument[]>;
102
+ private static getInstance;
103
+ private startInternal;
104
+ private startIntegratedGatekeeper;
105
+ private getDIDsInternal;
106
+ private validateConfig;
107
+ }
108
+
109
+ export { type CreateChallengeResponse, type CreateChallengeSpec, GatekeeperReactNative, KeymasterReactNative, type KeymasterConfig as KeymasterReactNativeConfig, type SdkConfig, type WalletConfig };
@@ -0,0 +1,109 @@
1
+ import * as _mdip_keymaster_types from '@mdip/keymaster/types';
2
+ import { WalletBase, VerifiableCredential, ChallengeResponse } from '@mdip/keymaster/types';
3
+ export { _mdip_keymaster_types as KeymasterTypes };
4
+ import * as _mdip_gatekeeper_types from '@mdip/gatekeeper/types';
5
+ import { MdipDocument } from '@mdip/gatekeeper/types';
6
+ export { _mdip_gatekeeper_types as GatekeeperTypes };
7
+ import { Cipher } from '@mdip/cipher/types';
8
+
9
+ interface CreateChallengeSpec {
10
+ callback: string;
11
+ credentials?: {
12
+ schema: string;
13
+ issuers: string[];
14
+ }[];
15
+ }
16
+ interface CreateChallengeResponse {
17
+ challenge: string;
18
+ challengeUrl: string;
19
+ }
20
+ interface SdkConfig {
21
+ url: string;
22
+ waitUntilReady?: boolean;
23
+ intervalSeconds?: number;
24
+ chatty?: boolean;
25
+ }
26
+ interface WalletConfig {
27
+ id: string;
28
+ mnemonic?: string;
29
+ registry?: string;
30
+ }
31
+
32
+ interface KeymasterConfig {
33
+ gatekeeperConfig?: SdkConfig;
34
+ walletDb?: WalletBase;
35
+ cipher?: Cipher;
36
+ }
37
+ declare class KeymasterReactNative {
38
+ private static instance;
39
+ private config;
40
+ private keymasterService;
41
+ private constructor();
42
+ static initialize(config: KeymasterConfig): void;
43
+ private ensureInitialized;
44
+ static start(): Promise<boolean>;
45
+ static createChallenge(...args: Parameters<KeymasterReactNative["createChallengeInternal"]>): Promise<CreateChallengeResponse>;
46
+ static bindCredential(...args: Parameters<KeymasterReactNative["bindCredentialInternal"]>): Promise<VerifiableCredential>;
47
+ static backupWallet(...args: Parameters<KeymasterReactNative["backupWalletInternal"]>): Promise<string>;
48
+ static createResponse(...args: Parameters<KeymasterReactNative["createResponseInternal"]>): Promise<string>;
49
+ static issueCredential(...args: Parameters<KeymasterReactNative["issueCredentialInternal"]>): Promise<string>;
50
+ static publishCredential(...args: Parameters<KeymasterReactNative["publishCredentialInternal"]>): Promise<VerifiableCredential>;
51
+ static acceptCredential(...args: Parameters<KeymasterReactNative["acceptCredentialInternal"]>): Promise<boolean>;
52
+ static showMnemonic(...args: Parameters<KeymasterReactNative["showMnemonicInternal"]>): Promise<string>;
53
+ static verifyResponse(...args: Parameters<KeymasterReactNative["verifyResponseInternal"]>): Promise<ChallengeResponse>;
54
+ static decryptMessage(...args: Parameters<KeymasterReactNative["decryptMessageInternal"]>): Promise<string>;
55
+ static decryptMnemonic(...args: Parameters<KeymasterReactNative["decryptMnemonicInternal"]>): Promise<string>;
56
+ static getCredential(...args: Parameters<KeymasterReactNative["getCredentialInternal"]>): Promise<VerifiableCredential | null>;
57
+ static removeCredential(...args: Parameters<KeymasterReactNative["removeCredentialInternal"]>): Promise<boolean>;
58
+ static updateCredential(...args: Parameters<KeymasterReactNative["updateCredentialInternal"]>): Promise<boolean>;
59
+ static createId(...args: Parameters<KeymasterReactNative["createIdInternal"]>): Promise<string>;
60
+ static removeId(...args: Parameters<KeymasterReactNative["removeIdInternal"]>): Promise<boolean>;
61
+ static resolveDID(...args: Parameters<KeymasterReactNative["resolveDIDInternal"]>): Promise<_mdip_gatekeeper_types.MdipDocument>;
62
+ static setCurrentId(...args: Parameters<KeymasterReactNative["setCurrentIdInternal"]>): Promise<boolean>;
63
+ static createSchema(...args: Parameters<KeymasterReactNative["createSchemaInternal"]>): Promise<string>;
64
+ static newWallet(...args: Parameters<KeymasterReactNative["newWalletInternal"]>): Promise<_mdip_keymaster_types.WalletFile>;
65
+ static recoverWallet(...args: Parameters<KeymasterReactNative["recoverWalletInternal"]>): Promise<_mdip_keymaster_types.WalletFile>;
66
+ private static getInstance;
67
+ private startInternal;
68
+ private startIntegratedKeymaster;
69
+ private createChallengeInternal;
70
+ private bindCredentialInternal;
71
+ private createResponseInternal;
72
+ private backupWalletInternal;
73
+ private issueCredentialInternal;
74
+ private publishCredentialInternal;
75
+ private acceptCredentialInternal;
76
+ private showMnemonicInternal;
77
+ private verifyResponseInternal;
78
+ private decryptMessageInternal;
79
+ private decryptMnemonicInternal;
80
+ private getCredentialInternal;
81
+ private removeCredentialInternal;
82
+ private updateCredentialInternal;
83
+ private createIdInternal;
84
+ private removeIdInternal;
85
+ private resolveDIDInternal;
86
+ private setCurrentIdInternal;
87
+ private createSchemaInternal;
88
+ private newWalletInternal;
89
+ private recoverWalletInternal;
90
+ private validateConfig;
91
+ }
92
+
93
+ declare class GatekeeperReactNative {
94
+ private static instance;
95
+ private config;
96
+ private gatekeeperClient;
97
+ private constructor();
98
+ static initialize(config: SdkConfig): void;
99
+ private ensureInitialized;
100
+ static start(): Promise<boolean>;
101
+ static getDIDs(...args: Parameters<GatekeeperReactNative["getDIDsInternal"]>): Promise<string[] | MdipDocument[]>;
102
+ private static getInstance;
103
+ private startInternal;
104
+ private startIntegratedGatekeeper;
105
+ private getDIDsInternal;
106
+ private validateConfig;
107
+ }
108
+
109
+ export { type CreateChallengeResponse, type CreateChallengeSpec, GatekeeperReactNative, KeymasterReactNative, type KeymasterConfig as KeymasterReactNativeConfig, type SdkConfig, type WalletConfig };
package/dist/index.js ADDED
@@ -0,0 +1,338 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/keymaster-react-native.ts
9
+ var GatekeeperClient = __require("@mdip/gatekeeper/client").default;
10
+ var KeymasterMDIP = __require("@mdip/keymaster").default;
11
+ var KeymasterReactNative = class _KeymasterReactNative {
12
+ static instance = null;
13
+ config;
14
+ keymasterService;
15
+ constructor(config) {
16
+ this.validateConfig(config);
17
+ this.config = config;
18
+ }
19
+ static initialize(config) {
20
+ if (!_KeymasterReactNative.instance) {
21
+ _KeymasterReactNative.instance = new _KeymasterReactNative(config);
22
+ } else {
23
+ console.warn(
24
+ "KeymasterReactNative already initialized, ignoring re-initialization."
25
+ );
26
+ }
27
+ }
28
+ ensureInitialized() {
29
+ if (!_KeymasterReactNative.instance) {
30
+ throw new Error(
31
+ "KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first."
32
+ );
33
+ }
34
+ }
35
+ // Delegated STATIC methods
36
+ static async start() {
37
+ _KeymasterReactNative.getInstance().ensureInitialized();
38
+ return _KeymasterReactNative.getInstance().startInternal();
39
+ }
40
+ static async createChallenge(...args) {
41
+ _KeymasterReactNative.getInstance().ensureInitialized();
42
+ return _KeymasterReactNative.getInstance().createChallengeInternal(...args);
43
+ }
44
+ static async bindCredential(...args) {
45
+ _KeymasterReactNative.getInstance().ensureInitialized();
46
+ return _KeymasterReactNative.getInstance().bindCredentialInternal(...args);
47
+ }
48
+ static async backupWallet(...args) {
49
+ _KeymasterReactNative.getInstance().ensureInitialized();
50
+ return _KeymasterReactNative.getInstance().backupWalletInternal(...args);
51
+ }
52
+ static async createResponse(...args) {
53
+ _KeymasterReactNative.getInstance().ensureInitialized();
54
+ return _KeymasterReactNative.getInstance().createResponseInternal(...args);
55
+ }
56
+ static async issueCredential(...args) {
57
+ _KeymasterReactNative.getInstance().ensureInitialized();
58
+ return _KeymasterReactNative.getInstance().issueCredentialInternal(...args);
59
+ }
60
+ static async publishCredential(...args) {
61
+ _KeymasterReactNative.getInstance().ensureInitialized();
62
+ return _KeymasterReactNative.getInstance().publishCredentialInternal(
63
+ ...args
64
+ );
65
+ }
66
+ static async acceptCredential(...args) {
67
+ _KeymasterReactNative.getInstance().ensureInitialized();
68
+ return _KeymasterReactNative.getInstance().acceptCredentialInternal(...args);
69
+ }
70
+ static async showMnemonic(...args) {
71
+ _KeymasterReactNative.getInstance().ensureInitialized();
72
+ return _KeymasterReactNative.getInstance().showMnemonicInternal(...args);
73
+ }
74
+ static async verifyResponse(...args) {
75
+ _KeymasterReactNative.getInstance().ensureInitialized();
76
+ return _KeymasterReactNative.getInstance().verifyResponseInternal(...args);
77
+ }
78
+ static async decryptMessage(...args) {
79
+ _KeymasterReactNative.getInstance().ensureInitialized();
80
+ return _KeymasterReactNative.getInstance().decryptMessageInternal(...args);
81
+ }
82
+ static async decryptMnemonic(...args) {
83
+ _KeymasterReactNative.getInstance().ensureInitialized();
84
+ return _KeymasterReactNative.getInstance().decryptMnemonicInternal(...args);
85
+ }
86
+ static async getCredential(...args) {
87
+ _KeymasterReactNative.getInstance().ensureInitialized();
88
+ return _KeymasterReactNative.getInstance().getCredentialInternal(...args);
89
+ }
90
+ static async removeCredential(...args) {
91
+ _KeymasterReactNative.getInstance().ensureInitialized();
92
+ return _KeymasterReactNative.getInstance().removeCredentialInternal(...args);
93
+ }
94
+ static async updateCredential(...args) {
95
+ _KeymasterReactNative.getInstance().ensureInitialized();
96
+ return _KeymasterReactNative.getInstance().updateCredentialInternal(...args);
97
+ }
98
+ static async createId(...args) {
99
+ _KeymasterReactNative.getInstance().ensureInitialized();
100
+ return _KeymasterReactNative.getInstance().createIdInternal(...args);
101
+ }
102
+ static async removeId(...args) {
103
+ _KeymasterReactNative.getInstance().ensureInitialized();
104
+ return _KeymasterReactNative.getInstance().removeIdInternal(...args);
105
+ }
106
+ static async resolveDID(...args) {
107
+ _KeymasterReactNative.getInstance().ensureInitialized();
108
+ return _KeymasterReactNative.getInstance().resolveDIDInternal(...args);
109
+ }
110
+ static async setCurrentId(...args) {
111
+ _KeymasterReactNative.getInstance().ensureInitialized();
112
+ return _KeymasterReactNative.getInstance().setCurrentIdInternal(...args);
113
+ }
114
+ static async createSchema(...args) {
115
+ _KeymasterReactNative.getInstance().ensureInitialized();
116
+ return _KeymasterReactNative.getInstance().createSchemaInternal(...args);
117
+ }
118
+ static async newWallet(...args) {
119
+ _KeymasterReactNative.getInstance().ensureInitialized();
120
+ return _KeymasterReactNative.getInstance().newWalletInternal(...args);
121
+ }
122
+ static async recoverWallet(...args) {
123
+ _KeymasterReactNative.getInstance().ensureInitialized();
124
+ return _KeymasterReactNative.getInstance().recoverWalletInternal(...args);
125
+ }
126
+ static getInstance() {
127
+ if (!_KeymasterReactNative.instance) {
128
+ throw new Error(
129
+ "KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first."
130
+ );
131
+ }
132
+ return _KeymasterReactNative.instance;
133
+ }
134
+ // -------- Internal instance methods (originals renamed with Internal) -------
135
+ async startInternal() {
136
+ if (this.config.gatekeeperConfig) {
137
+ return await this.startIntegratedKeymaster();
138
+ } else {
139
+ throw "Missing Gatekeeper config";
140
+ }
141
+ }
142
+ async startIntegratedKeymaster() {
143
+ try {
144
+ if (this.config.walletDb) {
145
+ const gatekeeper = await GatekeeperClient.create({
146
+ url: this.config.gatekeeperConfig?.url,
147
+ waitUntilReady: this.config.gatekeeperConfig?.waitUntilReady,
148
+ intervalSeconds: this.config.gatekeeperConfig?.intervalSeconds,
149
+ chatty: this.config.gatekeeperConfig?.chatty
150
+ });
151
+ this.keymasterService = new KeymasterMDIP({
152
+ gatekeeper,
153
+ wallet: this.config.walletDb,
154
+ cipher: this.config.cipher
155
+ });
156
+ } else {
157
+ return false;
158
+ }
159
+ } catch (e) {
160
+ console.error("Error starting KeymasterReactNative service:", e);
161
+ return false;
162
+ }
163
+ return true;
164
+ }
165
+ async createChallengeInternal(spec, options) {
166
+ const challenge = await this.keymasterService.createChallenge(
167
+ spec,
168
+ options
169
+ );
170
+ return {
171
+ challenge,
172
+ challengeUrl: `${spec.callback}?challenge=${challenge}`
173
+ };
174
+ }
175
+ async bindCredentialInternal(schemaId, subjectId, options = {}) {
176
+ return this.keymasterService.bindCredential(schemaId, subjectId, options);
177
+ }
178
+ async createResponseInternal(challengeDID, options) {
179
+ return this.keymasterService.createResponse(challengeDID, options);
180
+ }
181
+ async backupWalletInternal(registry) {
182
+ return this.keymasterService.backupWallet(registry);
183
+ }
184
+ async issueCredentialInternal(credential, options = {}) {
185
+ return this.keymasterService.issueCredential(credential, options);
186
+ }
187
+ async publishCredentialInternal(did, options = {}) {
188
+ return this.keymasterService.publishCredential(did, options);
189
+ }
190
+ async acceptCredentialInternal(did) {
191
+ return this.keymasterService.acceptCredential(did);
192
+ }
193
+ async showMnemonicInternal() {
194
+ return this.keymasterService.decryptMnemonic();
195
+ }
196
+ async verifyResponseInternal(did, options) {
197
+ return this.keymasterService.verifyResponse(did, options);
198
+ }
199
+ async decryptMessageInternal(...args) {
200
+ return this.keymasterService.decryptMessage(...args);
201
+ }
202
+ async decryptMnemonicInternal(...args) {
203
+ return this.keymasterService.decryptMnemonic(...args);
204
+ }
205
+ async getCredentialInternal(...args) {
206
+ return this.keymasterService.getCredential(...args);
207
+ }
208
+ async removeCredentialInternal(...args) {
209
+ return this.keymasterService.removeCredential(...args);
210
+ }
211
+ async updateCredentialInternal(...args) {
212
+ return this.keymasterService.updateCredential(...args);
213
+ }
214
+ async createIdInternal(...args) {
215
+ return this.keymasterService.createId(...args);
216
+ }
217
+ async removeIdInternal(...args) {
218
+ return this.keymasterService.removeId(...args);
219
+ }
220
+ async resolveDIDInternal(...args) {
221
+ return this.keymasterService.resolveDID(...args);
222
+ }
223
+ async setCurrentIdInternal(...args) {
224
+ return this.keymasterService.setCurrentId(...args);
225
+ }
226
+ async createSchemaInternal(...args) {
227
+ return this.keymasterService.createSchema(...args);
228
+ }
229
+ async newWalletInternal(...args) {
230
+ return this.keymasterService.newWallet(...args);
231
+ }
232
+ async recoverWalletInternal(...args) {
233
+ return this.keymasterService.recoverWallet(...args);
234
+ }
235
+ validateConfig(config) {
236
+ if (!config.gatekeeperConfig) {
237
+ throw new Error("Missing Gatekeeper config");
238
+ }
239
+ if (config.gatekeeperConfig) {
240
+ if (!config.walletDb?.loadWallet) {
241
+ throw new Error("Missing load wallet callback");
242
+ }
243
+ if (!config.walletDb?.saveWallet) {
244
+ throw new Error("Missing save wallet callback");
245
+ }
246
+ }
247
+ }
248
+ };
249
+
250
+ // src/gatekeeper-react-native.ts
251
+ var GatekeeperClient2 = __require("@mdip/gatekeeper/client").default;
252
+ var GatekeeperReactNative = class _GatekeeperReactNative {
253
+ static instance = null;
254
+ config;
255
+ gatekeeperClient;
256
+ constructor(config) {
257
+ this.validateConfig(config);
258
+ this.config = config;
259
+ }
260
+ static initialize(config) {
261
+ if (!_GatekeeperReactNative.instance) {
262
+ _GatekeeperReactNative.instance = new _GatekeeperReactNative(config);
263
+ } else {
264
+ console.warn(
265
+ "GatekeeperReactNative already initialized, ignoring re-initialization."
266
+ );
267
+ }
268
+ }
269
+ ensureInitialized() {
270
+ if (!_GatekeeperReactNative.instance) {
271
+ throw new Error(
272
+ "GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first."
273
+ );
274
+ }
275
+ }
276
+ // Delegated STATIC methods
277
+ static async start() {
278
+ _GatekeeperReactNative.getInstance().ensureInitialized();
279
+ return _GatekeeperReactNative.getInstance().startInternal();
280
+ }
281
+ static async getDIDs(...args) {
282
+ _GatekeeperReactNative.getInstance().ensureInitialized();
283
+ return _GatekeeperReactNative.getInstance().getDIDsInternal(...args);
284
+ }
285
+ static getInstance() {
286
+ if (!_GatekeeperReactNative.instance) {
287
+ throw new Error(
288
+ "GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first."
289
+ );
290
+ }
291
+ return _GatekeeperReactNative.instance;
292
+ }
293
+ // -------- Internal instance methods (originals renamed with Internal) -------
294
+ async startInternal() {
295
+ if (this.config) {
296
+ return await this.startIntegratedGatekeeper();
297
+ } else {
298
+ throw "Missing Gatekeeper config";
299
+ }
300
+ }
301
+ async startIntegratedGatekeeper() {
302
+ try {
303
+ this.gatekeeperClient = await GatekeeperClient2.create({
304
+ url: this.config?.url,
305
+ waitUntilReady: this.config?.waitUntilReady,
306
+ intervalSeconds: this.config?.intervalSeconds,
307
+ chatty: this.config?.chatty
308
+ });
309
+ } catch (e) {
310
+ console.error("Error starting GatekeeperReactNative service:", e);
311
+ return false;
312
+ }
313
+ return true;
314
+ }
315
+ async getDIDsInternal({
316
+ dids,
317
+ resolve
318
+ }) {
319
+ const response = await this.gatekeeperClient.getDIDs({ dids, resolve });
320
+ return response.data;
321
+ }
322
+ validateConfig(config) {
323
+ if (!config) {
324
+ throw new Error("Missing Gatekeeper config");
325
+ }
326
+ }
327
+ };
328
+
329
+ // src/index.ts
330
+ import * as KeymasterTypes from "@mdip/keymaster/types";
331
+ import * as GatekeeperTypes from "@mdip/gatekeeper/types";
332
+ export {
333
+ GatekeeperReactNative,
334
+ GatekeeperTypes,
335
+ KeymasterReactNative,
336
+ KeymasterTypes
337
+ };
338
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/keymaster-react-native.ts","../src/gatekeeper-react-native.ts","../src/index.ts"],"sourcesContent":["const GatekeeperClient = require(\"@mdip/gatekeeper/client\").default;\nconst KeymasterMDIP = require(\"@mdip/keymaster\").default;\nimport { default as KeymasterLib } from \"@mdip/keymaster\";\nimport { Cipher } from \"@mdip/cipher/types\";\nimport {\n CreateChallengeResponse,\n CreateChallengeSpec,\n SdkConfig,\n} from \"./types/index.js\";\nimport {\n ChallengeResponse,\n CreateAssetOptions,\n CreateResponseOptions,\n IssueCredentialsOptions,\n VerifiableCredential,\n WalletBase,\n} from \"@mdip/keymaster/types\";\n\nexport interface KeymasterConfig {\n gatekeeperConfig?: SdkConfig;\n walletDb?: WalletBase;\n cipher?: Cipher;\n}\n\nexport class KeymasterReactNative {\n private static instance: KeymasterReactNative | null = null;\n\n private config: KeymasterConfig;\n private keymasterService!: KeymasterLib;\n\n private constructor(config: KeymasterConfig) {\n this.validateConfig(config);\n this.config = config;\n }\n\n public static initialize(config: KeymasterConfig) {\n if (!KeymasterReactNative.instance) {\n KeymasterReactNative.instance = new KeymasterReactNative(config);\n } else {\n console.warn(\n \"KeymasterReactNative already initialized, ignoring re-initialization.\"\n );\n }\n }\n\n private ensureInitialized() {\n if (!KeymasterReactNative.instance) {\n throw new Error(\n \"KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first.\"\n );\n }\n }\n\n // Delegated STATIC methods\n\n public static async start() {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().startInternal();\n }\n\n public static async createChallenge(\n ...args: Parameters<KeymasterReactNative[\"createChallengeInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createChallengeInternal(...args);\n }\n\n public static async bindCredential(\n ...args: Parameters<KeymasterReactNative[\"bindCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().bindCredentialInternal(...args);\n }\n\n public static async backupWallet(\n ...args: Parameters<KeymasterReactNative[\"backupWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().backupWalletInternal(...args);\n }\n\n public static async createResponse(\n ...args: Parameters<KeymasterReactNative[\"createResponseInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createResponseInternal(...args);\n }\n\n public static async issueCredential(\n ...args: Parameters<KeymasterReactNative[\"issueCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().issueCredentialInternal(...args);\n }\n\n public static async publishCredential(\n ...args: Parameters<KeymasterReactNative[\"publishCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().publishCredentialInternal(\n ...args\n );\n }\n\n public static async acceptCredential(\n ...args: Parameters<KeymasterReactNative[\"acceptCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().acceptCredentialInternal(...args);\n }\n\n public static async showMnemonic(\n ...args: Parameters<KeymasterReactNative[\"showMnemonicInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().showMnemonicInternal(...args);\n }\n\n public static async verifyResponse(\n ...args: Parameters<KeymasterReactNative[\"verifyResponseInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().verifyResponseInternal(...args);\n }\n\n public static async decryptMessage(\n ...args: Parameters<KeymasterReactNative[\"decryptMessageInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().decryptMessageInternal(...args);\n }\n\n public static async decryptMnemonic(\n ...args: Parameters<KeymasterReactNative[\"decryptMnemonicInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().decryptMnemonicInternal(...args);\n }\n\n public static async getCredential(\n ...args: Parameters<KeymasterReactNative[\"getCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().getCredentialInternal(...args);\n }\n\n public static async removeCredential(\n ...args: Parameters<KeymasterReactNative[\"removeCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().removeCredentialInternal(...args);\n }\n\n public static async updateCredential(\n ...args: Parameters<KeymasterReactNative[\"updateCredentialInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().updateCredentialInternal(...args);\n }\n\n public static async createId(\n ...args: Parameters<KeymasterReactNative[\"createIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createIdInternal(...args);\n }\n\n public static async removeId(\n ...args: Parameters<KeymasterReactNative[\"removeIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().removeIdInternal(...args);\n }\n\n public static async resolveDID(\n ...args: Parameters<KeymasterReactNative[\"resolveDIDInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().resolveDIDInternal(...args);\n }\n\n public static async setCurrentId(\n ...args: Parameters<KeymasterReactNative[\"setCurrentIdInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().setCurrentIdInternal(...args);\n }\n\n public static async createSchema(\n ...args: Parameters<KeymasterReactNative[\"createSchemaInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().createSchemaInternal(...args);\n }\n\n public static async newWallet(\n ...args: Parameters<KeymasterReactNative[\"newWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().newWalletInternal(...args);\n }\n\n public static async recoverWallet(\n ...args: Parameters<KeymasterReactNative[\"recoverWalletInternal\"]>\n ) {\n KeymasterReactNative.getInstance().ensureInitialized();\n return KeymasterReactNative.getInstance().recoverWalletInternal(...args);\n }\n\n private static getInstance(): KeymasterReactNative {\n if (!KeymasterReactNative.instance) {\n throw new Error(\n \"KeymasterReactNative not initialized. Call KeymasterReactNative.initialize() first.\"\n );\n }\n return KeymasterReactNative.instance;\n }\n\n // -------- Internal instance methods (originals renamed with Internal) -------\n\n private async startInternal(): Promise<boolean> {\n if (this.config.gatekeeperConfig) {\n return await this.startIntegratedKeymaster();\n } else {\n throw \"Missing Gatekeeper config\";\n }\n }\n\n private async startIntegratedKeymaster(): Promise<boolean> {\n try {\n if (this.config.walletDb) {\n const gatekeeper = await GatekeeperClient.create({\n url: this.config.gatekeeperConfig?.url,\n waitUntilReady: this.config.gatekeeperConfig?.waitUntilReady,\n intervalSeconds: this.config.gatekeeperConfig?.intervalSeconds,\n chatty: this.config.gatekeeperConfig?.chatty,\n });\n this.keymasterService = new KeymasterMDIP({\n gatekeeper,\n wallet: this.config.walletDb,\n cipher: this.config.cipher,\n });\n } else {\n return false;\n }\n } catch (e) {\n console.error(\"Error starting KeymasterReactNative service:\", e);\n return false;\n }\n\n return true;\n }\n\n private async createChallengeInternal(\n spec: CreateChallengeSpec,\n options?: CreateAssetOptions\n ): Promise<CreateChallengeResponse> {\n const challenge: string = await this.keymasterService.createChallenge(\n spec,\n options\n );\n return {\n challenge: challenge,\n challengeUrl: `${spec.callback}?challenge=${challenge}`,\n };\n }\n\n private async bindCredentialInternal(\n schemaId: string,\n subjectId: string,\n options: {\n validFrom?: string;\n validUntil?: string;\n credential?: Record<string, unknown>;\n } = {}\n ): Promise<VerifiableCredential> {\n return this.keymasterService.bindCredential(schemaId, subjectId, options);\n }\n\n private async createResponseInternal(\n challengeDID: string,\n options?: CreateResponseOptions\n ): Promise<string> {\n return this.keymasterService.createResponse(challengeDID, options);\n }\n\n private async backupWalletInternal(registry?: string): Promise<string> {\n return this.keymasterService.backupWallet(registry);\n }\n\n private async issueCredentialInternal(\n credential: Partial<VerifiableCredential>,\n options: IssueCredentialsOptions = {}\n ): Promise<string> {\n return this.keymasterService.issueCredential(credential, options);\n }\n\n private async publishCredentialInternal(\n did: string,\n options: { reveal?: boolean } = {}\n ): Promise<VerifiableCredential> {\n return this.keymasterService.publishCredential(did, options);\n }\n\n private async acceptCredentialInternal(did: string): Promise<boolean> {\n return this.keymasterService.acceptCredential(did);\n }\n\n private async showMnemonicInternal(): Promise<string> {\n return this.keymasterService.decryptMnemonic();\n }\n\n private async verifyResponseInternal(\n did: string,\n options?: { retries?: number; delay?: number }\n ): Promise<ChallengeResponse> {\n return this.keymasterService.verifyResponse(did, options);\n }\n\n private async decryptMessageInternal(\n ...args: Parameters<KeymasterLib[\"decryptMessage\"]>\n ) {\n return this.keymasterService.decryptMessage(...args);\n }\n\n private async decryptMnemonicInternal(\n ...args: Parameters<KeymasterLib[\"decryptMnemonic\"]>\n ) {\n return this.keymasterService.decryptMnemonic(...args);\n }\n\n private async getCredentialInternal(\n ...args: Parameters<KeymasterLib[\"getCredential\"]>\n ) {\n return this.keymasterService.getCredential(...args);\n }\n\n private async removeCredentialInternal(\n ...args: Parameters<KeymasterLib[\"removeCredential\"]>\n ) {\n return this.keymasterService.removeCredential(...args);\n }\n\n private async updateCredentialInternal(\n ...args: Parameters<KeymasterLib[\"updateCredential\"]>\n ) {\n return this.keymasterService.updateCredential(...args);\n }\n\n private async createIdInternal(\n ...args: Parameters<KeymasterLib[\"createId\"]>\n ) {\n return this.keymasterService.createId(...args);\n }\n\n private async removeIdInternal(\n ...args: Parameters<KeymasterLib[\"removeId\"]>\n ) {\n return this.keymasterService.removeId(...args);\n }\n\n private async resolveDIDInternal(\n ...args: Parameters<KeymasterLib[\"resolveDID\"]>\n ) {\n return this.keymasterService.resolveDID(...args);\n }\n\n private async setCurrentIdInternal(\n ...args: Parameters<KeymasterLib[\"setCurrentId\"]>\n ) {\n return this.keymasterService.setCurrentId(...args);\n }\n\n private async createSchemaInternal(\n ...args: Parameters<KeymasterLib[\"createSchema\"]>\n ) {\n return this.keymasterService.createSchema(...args);\n }\n\n private async newWalletInternal(\n ...args: Parameters<KeymasterLib[\"newWallet\"]>\n ) {\n return this.keymasterService.newWallet(...args);\n }\n\n private async recoverWalletInternal(\n ...args: Parameters<KeymasterLib[\"recoverWallet\"]>\n ) {\n return this.keymasterService.recoverWallet(...args);\n }\n\n private validateConfig(config: KeymasterConfig): void {\n if (!config.gatekeeperConfig) {\n throw new Error(\"Missing Gatekeeper config\");\n }\n\n if (config.gatekeeperConfig) {\n if (!config.walletDb?.loadWallet) {\n throw new Error(\"Missing load wallet callback\");\n }\n if (!config.walletDb?.saveWallet) {\n throw new Error(\"Missing save wallet callback\");\n }\n }\n }\n}\n","import { SdkConfig } from \"./types/index.js\";\nconst GatekeeperClient = require(\"@mdip/gatekeeper/client\").default;\nimport { GetDIDOptions, MdipDocument } from \"@mdip/gatekeeper/types\";\n\nexport class GatekeeperReactNative {\n private static instance: GatekeeperReactNative | null = null;\n\n private config: SdkConfig;\n private gatekeeperClient!: typeof GatekeeperClient;\n\n private constructor(config: SdkConfig) {\n this.validateConfig(config);\n this.config = config;\n }\n\n public static initialize(config: SdkConfig) {\n if (!GatekeeperReactNative.instance) {\n GatekeeperReactNative.instance = new GatekeeperReactNative(config);\n } else {\n console.warn(\n \"GatekeeperReactNative already initialized, ignoring re-initialization.\"\n );\n }\n }\n\n private ensureInitialized() {\n if (!GatekeeperReactNative.instance) {\n throw new Error(\n \"GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first.\"\n );\n }\n }\n\n // Delegated STATIC methods\n\n public static async start() {\n GatekeeperReactNative.getInstance().ensureInitialized();\n return GatekeeperReactNative.getInstance().startInternal();\n }\n\n public static async getDIDs(\n ...args: Parameters<GatekeeperReactNative[\"getDIDsInternal\"]>\n ) {\n GatekeeperReactNative.getInstance().ensureInitialized();\n return GatekeeperReactNative.getInstance().getDIDsInternal(...args);\n }\n\n private static getInstance(): GatekeeperReactNative {\n if (!GatekeeperReactNative.instance) {\n throw new Error(\n \"GatekeeperReactNative not initialized. Call GatekeeperReactNative.initialize() first.\"\n );\n }\n return GatekeeperReactNative.instance;\n }\n\n // -------- Internal instance methods (originals renamed with Internal) -------\n\n private async startInternal(): Promise<boolean> {\n if (this.config) {\n return await this.startIntegratedGatekeeper();\n } else {\n throw \"Missing Gatekeeper config\";\n }\n }\n\n private async startIntegratedGatekeeper(): Promise<boolean> {\n try {\n this.gatekeeperClient = await GatekeeperClient.create({\n url: this.config?.url,\n waitUntilReady: this.config?.waitUntilReady,\n intervalSeconds: this.config?.intervalSeconds,\n chatty: this.config?.chatty,\n });\n } catch (e) {\n console.error(\"Error starting GatekeeperReactNative service:\", e);\n return false;\n }\n return true;\n }\n\n private async getDIDsInternal({\n dids,\n resolve,\n }: GetDIDOptions): Promise<string[] | MdipDocument[]> {\n const response = await this.gatekeeperClient.getDIDs({ dids, resolve });\n return response.data;\n }\n\n private validateConfig(config: SdkConfig): void {\n if (!config) {\n throw new Error(\"Missing Gatekeeper config\");\n }\n }\n}\n","export {\n KeymasterReactNative,\n KeymasterConfig as KeymasterReactNativeConfig,\n} from \"./keymaster-react-native.js\";\nexport { GatekeeperReactNative } from \"./gatekeeper-react-native.js\";\n\nexport {\n SdkConfig,\n WalletConfig,\n CreateChallengeResponse,\n CreateChallengeSpec,\n} from \"./types/index.js\";\n\nimport * as KeymasterTypes from \"@mdip/keymaster/types\";\nimport * as GatekeeperTypes from \"@mdip/gatekeeper/types\";\n\nexport { KeymasterTypes, GatekeeperTypes };\n"],"mappings":";;;;;;;;AAAA,IAAM,mBAAmB,UAAQ,yBAAyB,EAAE;AAC5D,IAAM,gBAAgB,UAAQ,iBAAiB,EAAE;AAuB1C,IAAM,uBAAN,MAAM,sBAAqB;AAAA,EAChC,OAAe,WAAwC;AAAA,EAE/C;AAAA,EACA;AAAA,EAEA,YAAY,QAAyB;AAC3C,SAAK,eAAe,MAAM;AAC1B,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAc,WAAW,QAAyB;AAChD,QAAI,CAAC,sBAAqB,UAAU;AAClC,4BA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QAAQ;AAAA,QAC7B,iBAAiB,KAAK,QAAQ;AAAA,QAC9B,QAAQ,KAAK,QAAQ;AAAA,MACvB,CAAC;AAAA,IACH,SAAS,GAAG;AACV,cAAQ,MAAM,iDAAiD,CAAC;AAChE,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAc,gBAAgB;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,GAAsD;AACpD,UAAM,WAAW,MAAM,KAAK,iBAAiB,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACtE,WAAO,SAAS;AAAA,EAClB;AAAA,EAEQ,eAAe,QAAyB;AAC9C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AAAA,EACF;AACF;;;ACjFA,YAAY,oBAAoB;AAChC,YAAY,qBAAqB;","names":["GatekeeperClient"]}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@yourself_id/siwys-react-native",
3
+ "version": "0.10.1-SAPP-221-mdipUpdate.69+2e36978",
4
+ "description": "A React Native component library",
5
+ "repository": "https://github.com/selfidhq/siwys-js",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public",
21
+ "registry": "https://registry.npmjs.org/"
22
+ },
23
+ "scripts": {
24
+ "build": "tsup",
25
+ "test": "echo 'no tests yet'"
26
+ },
27
+ "dependencies": {
28
+ "@mdip/cipher": "1.1.0",
29
+ "@mdip/gatekeeper": "1.1.0",
30
+ "@mdip/keymaster": "1.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@babel/preset-env": "^7.25.8",
34
+ "@babel/preset-react": "^7.25.7",
35
+ "@babel/preset-typescript": "^7.25.7",
36
+ "@types/jest": "^29.5.13",
37
+ "@types/react": "^18.3.11",
38
+ "@types/react-dom": "^18.3.1",
39
+ "babel-jest": "^29.7.0",
40
+ "jest": "^29.7.0",
41
+ "tsup": "^8.3.0",
42
+ "typescript": "4.9.4"
43
+ },
44
+ "gitHead": "2e3697880cd16ca8297c0031e5b11d910f199f59"
45
+ }