@keyringnetwork/keyring-connect-sdk 1.0.8 → 1.0.9

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.
@@ -34,27 +34,33 @@
34
34
  "disclosable_fields": [
35
35
  {
36
36
  "label": "first name",
37
- "path": "data.fillInfo.firstName"
37
+ "path": "data.fillInfo.firstName",
38
+ "key": "first_name"
38
39
  },
39
40
  {
40
41
  "label": "last name",
41
- "path": "data.fillInfo.lastName"
42
+ "path": "data.fillInfo.lastName",
43
+ "key": "last_name"
42
44
  },
43
45
  {
44
46
  "label": "dob",
45
- "path": "data.fillInfo.dob"
47
+ "path": "data.fillInfo.dob",
48
+ "key": "dob"
46
49
  },
47
50
  {
48
51
  "label": "kyc level",
49
- "path": "data.passKycLevel"
52
+ "path": "data.passKycLevel",
53
+ "key": "kyc_level"
50
54
  },
51
55
  {
52
56
  "label": "country of primary address",
53
- "path": "data.fillInfo.residenceCountry"
57
+ "path": "data.fillInfo.residenceCountry",
58
+ "key": "country_of_primary_address"
54
59
  },
55
60
  {
56
61
  "label": "account type",
57
- "path": "data.type"
62
+ "path": "data.type",
63
+ "key": "account_type"
58
64
  }
59
65
  ],
60
66
  "headers": [
@@ -99,23 +105,28 @@
99
105
  "disclosable_fields": [
100
106
  {
101
107
  "label": "kyb status",
102
- "path": "data.kycStatus"
108
+ "path": "data.kycStatus",
109
+ "key": "kyb_status"
103
110
  },
104
111
  {
105
112
  "label": "company name",
106
- "path": "data.fillInfo.companyName"
113
+ "path": "data.fillInfo.companyName",
114
+ "key": "company_name"
107
115
  },
108
116
  {
109
117
  "label": "country of primary address",
110
- "path": "data.fillInfo.residenceCountry"
118
+ "path": "data.fillInfo.residenceCountry",
119
+ "key": "country_of_primary_address"
111
120
  },
112
121
  {
113
122
  "label": "kyb message detail",
114
- "path": "data.frontDisplayLevelMsg"
123
+ "path": "data.frontDisplayLevelMsg",
124
+ "key": "kyb_message_detail"
115
125
  },
116
126
  {
117
127
  "label": "account type",
118
- "path": "data.type"
128
+ "path": "data.type",
129
+ "key": "account_type"
119
130
  }
120
131
  ],
121
132
  "headers": [
@@ -185,23 +196,28 @@
185
196
  "disclosable_fields": [
186
197
  {
187
198
  "label": "user kyc",
188
- "path": "result.access.user_kyc"
199
+ "path": "result.access.user_kyc",
200
+ "key": "user_kyc"
189
201
  },
190
202
  {
191
203
  "label": "first name",
192
- "path": "result.first_name"
204
+ "path": "result.first_name",
205
+ "key": "first_name"
193
206
  },
194
207
  {
195
208
  "label": "country",
196
- "path": "result.country"
209
+ "path": "result.country",
210
+ "key": "country"
197
211
  },
198
212
  {
199
213
  "label": "tier bucket",
200
- "path": "result.tier_bucket"
214
+ "path": "result.tier_bucket",
215
+ "key": "tier_bucket"
201
216
  },
202
217
  {
203
218
  "label": "tier verified",
204
- "path": "result.tier_verified"
219
+ "path": "result.tier_verified",
220
+ "key": "tier_verified"
205
221
  }
206
222
  ],
207
223
  "headers": [
@@ -250,23 +266,28 @@
250
266
  "disclosable_fields": [
251
267
  {
252
268
  "label": "user kyc",
253
- "path": "result.access.user_kyc"
269
+ "path": "result.access.user_kyc",
270
+ "key": "user_kyc"
254
271
  },
255
272
  {
256
273
  "label": "first name",
257
- "path": "result.first_name"
274
+ "path": "result.first_name",
275
+ "key": "first_name"
258
276
  },
259
277
  {
260
278
  "label": "country",
261
- "path": "result.country"
279
+ "path": "result.country",
280
+ "key": "country"
262
281
  },
263
282
  {
264
283
  "label": "tier bucket",
265
- "path": "result.tier_bucket"
284
+ "path": "result.tier_bucket",
285
+ "key": "tier_bucket"
266
286
  },
267
287
  {
268
288
  "label": "tier verified",
269
- "path": "result.tier_verified"
289
+ "path": "result.tier_verified",
290
+ "key": "tier_verified"
270
291
  }
271
292
  ],
272
293
  "headers": [
@@ -331,15 +352,18 @@
331
352
  "disclosable_fields": [
332
353
  {
333
354
  "label": "country",
334
- "path": "data.userDetails.country"
355
+ "path": "data.userDetails.country",
356
+ "key": "country"
335
357
  },
336
358
  {
337
359
  "label": "kyc level",
338
- "path": "data.userKycStatus.kycLevel"
360
+ "path": "data.userKycStatus.kycLevel",
361
+ "key": "kyc_level"
339
362
  },
340
363
  {
341
364
  "label": "kyc type",
342
- "path": "data.userKycStatus.kycType"
365
+ "path": "data.userKycStatus.kycType",
366
+ "key": "kyc_type"
343
367
  }
344
368
  ],
345
369
  "headers": [
@@ -387,15 +411,18 @@
387
411
  "disclosable_fields": [
388
412
  {
389
413
  "label": "country of primary address",
390
- "path": "data.userDetails.country"
414
+ "path": "data.userDetails.country",
415
+ "key": "country_of_primary_address"
391
416
  },
392
417
  {
393
418
  "label": "kyc level",
394
- "path": "data.userKycStatus.kycLevel"
419
+ "path": "data.userKycStatus.kycLevel",
420
+ "key": "kyc_level"
395
421
  },
396
422
  {
397
423
  "label": "kyc type",
398
- "path": "data.userKycStatus.kycType"
424
+ "path": "data.userKycStatus.kycType",
425
+ "key": "kyc_type"
399
426
  }
400
427
  ],
401
428
  "headers": [
@@ -440,11 +467,13 @@
440
467
  "disclosable_fields": [
441
468
  {
442
469
  "label": "full name",
443
- "path": "customer.name"
470
+ "path": "customer.name",
471
+ "key": "full_name"
444
472
  },
445
473
  {
446
474
  "label": "mailing address",
447
- "path": "customer.addresses.mailing"
475
+ "path": "customer.addresses.mailing",
476
+ "key": "mailing_address"
448
477
  }
449
478
  ],
450
479
  "headers": [
@@ -505,11 +534,13 @@
505
534
  "disclosable_fields": [
506
535
  {
507
536
  "label": "next requirement",
508
- "path": "data.viewer.userProperties.nextRequirement"
537
+ "path": "data.viewer.userProperties.nextRequirement",
538
+ "key": "next_requirement"
509
539
  },
510
540
  {
511
541
  "label": "country",
512
- "path": "data.viewer.userProperties.country.code"
542
+ "path": "data.viewer.userProperties.country.code",
543
+ "key": "country"
513
544
  }
514
545
  ],
515
546
  "headers": [
@@ -577,19 +608,23 @@
577
608
  "disclosable_fields": [
578
609
  {
579
610
  "label": "country address",
580
- "path": "user.address.country"
611
+ "path": "user.address.country",
612
+ "key": "country_address"
581
613
  },
582
614
  {
583
615
  "label": "user status",
584
- "path": "user.state"
616
+ "path": "user.state",
617
+ "key": "user_status"
585
618
  },
586
619
  {
587
620
  "label": "kyc verification",
588
- "path": "user.kyc"
621
+ "path": "user.kyc",
622
+ "key": "kyc_verification"
589
623
  },
590
624
  {
591
625
  "label": "under review",
592
- "path": "user.underReview"
626
+ "path": "user.underReview",
627
+ "key": "under_review"
593
628
  }
594
629
  ],
595
630
  "headers": [
package/dist/main.js CHANGED
@@ -115,7 +115,10 @@ class KeyringConnect {
115
115
  }
116
116
  }
117
117
  static validateDatasource(config) {
118
- var _a;
118
+ var _a, _b;
119
+ if (!((_a = config.proof_config) === null || _a === void 0 ? void 0 : _a.datasource)) {
120
+ return config;
121
+ }
119
122
  const datasource = datasources_json_1.default.find((datasource) => { var _a, _b; return datasource.id === ((_b = (_a = config.proof_config) === null || _a === void 0 ? void 0 : _a.datasource) === null || _b === void 0 ? void 0 : _b.id); });
120
123
  const knownDatasources = datasources_json_1.default
121
124
  .map((datasource) => datasource.name)
@@ -124,7 +127,7 @@ class KeyringConnect {
124
127
  throw new Error(`Unsupported datasource. Connect to either of the supported datasources: ${knownDatasources}`);
125
128
  }
126
129
  return Object.assign(Object.assign({}, config), { proof_config: {
127
- entity_type: (_a = config.proof_config) === null || _a === void 0 ? void 0 : _a.entity_type,
130
+ entity_type: (_b = config.proof_config) === null || _b === void 0 ? void 0 : _b.entity_type,
128
131
  datasource,
129
132
  } });
130
133
  }
@@ -146,8 +149,7 @@ class KeyringConnect {
146
149
  },
147
150
  krn_config: config.krn_config
148
151
  ? {
149
- onboarding_api_url: config.krn_config.onboarding_api_url,
150
- datastore_api_url: config.krn_config.datastore_api_url,
152
+ keyring_api_url: config.krn_config.keyring_api_url,
151
153
  analytics_api_url: config.krn_config.analytics_api_url,
152
154
  isolate_proving: config.krn_config.isolate_proving,
153
155
  notaryUrl: config.krn_config.notaryUrl,
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare enum EVENT_ACTIONS {
6
6
  export type PartialDataSource = Pick<DataSource, "id"> & Partial<DataSource>;
7
7
  export type ValidatedConfig = ExtensionSDKConfig & {
8
8
  proof_config: {
9
- datasource: DataSource;
9
+ datasource?: DataSource;
10
10
  };
11
11
  };
12
12
  export type ExtensionSDKConfig = {
@@ -31,7 +31,7 @@ export type ExtensionSDKConfig = {
31
31
  * @note should be used with caution as strict validation is applied to the proof config.
32
32
  */
33
33
  proof_config?: {
34
- datasource: PartialDataSource;
34
+ datasource?: PartialDataSource;
35
35
  entity_type?: string;
36
36
  };
37
37
  /**
@@ -39,8 +39,7 @@ export type ExtensionSDKConfig = {
39
39
  * @note this is meant to be used for internal testing and development purposes.
40
40
  */
41
41
  krn_config?: {
42
- onboarding_api_url?: string;
43
- datastore_api_url?: string;
42
+ keyring_api_url?: string;
44
43
  analytics_api_url?: string;
45
44
  auth0_id_token?: string;
46
45
  entity_id?: string;
@@ -59,12 +58,11 @@ export type ExtensionLaunchConfig = {
59
58
  client_entity_id?: string;
60
59
  };
61
60
  proof_config?: {
62
- datasource: DataSource;
61
+ datasource?: DataSource;
63
62
  entity_type?: string;
64
63
  };
65
64
  krn_config?: {
66
- onboarding_api_url?: string;
67
- datastore_api_url?: string;
65
+ keyring_api_url?: string;
68
66
  analytics_api_url?: string;
69
67
  isolate_proving?: boolean;
70
68
  notaryUrl?: string;
@@ -73,9 +71,9 @@ export type ExtensionLaunchConfig = {
73
71
  };
74
72
  auth_user?: any;
75
73
  };
76
- export type ExtensionStatus = 'idle' | 'mounted' | 'proving' | 'prove_success' | 'error';
77
- export type AttestationStatus = 'onboarding_required' | 'onboarding_pending' | 'attestation_ready' | 'non_compliant';
78
- export type CredentialStatus = 'expired' | 'valid' | 'none';
74
+ export type ExtensionStatus = "idle" | "mounted" | "proving" | "prove_success" | "error";
75
+ export type AttestationStatus = "onboarding_required" | "onboarding_pending" | "attestation_ready" | "non_compliant";
76
+ export type CredentialStatus = "expired" | "valid" | "none";
79
77
  export type User = {
80
78
  /**
81
79
  * Off-chain attestation status.
@@ -109,7 +107,7 @@ export interface DataSource {
109
107
  id: string;
110
108
  name: string;
111
109
  label: string;
112
- user_actions?: string[];
110
+ user_actions: string[];
113
111
  link: string;
114
112
  login_url: string;
115
113
  target_url: string | null;
@@ -127,9 +125,9 @@ export interface TlsnEndpoint {
127
125
  method: string;
128
126
  headers: string[];
129
127
  disclosable_fields: DisclosableField[];
130
- required_cookies?: string[] | null;
131
- data_bounds?: DataBounds | null;
132
- body?: string | null;
128
+ required_cookies: string[] | null;
129
+ data_bounds: DataBounds | null;
130
+ body: string | null;
133
131
  }
134
132
  export interface Claim {
135
133
  id: string;
@@ -144,4 +142,5 @@ export interface DataBounds {
144
142
  export interface DisclosableField {
145
143
  label: string;
146
144
  path: string;
145
+ key: string;
147
146
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@keyringnetwork/keyring-connect-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "An SDK for interacting with Keyring Connect browser extension",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "rm -rf dist && pnpm get:datasources && tsc",
9
9
  "dev": "pnpm get:datasources && tsc --watch",
10
- "publish:sdk": "pnpm build && npm publish",
10
+ "build_and_publish": "pnpm build && npm publish",
11
11
  "get:datasources": "node ../../scripts/parseDatasource.js -o src/constants/datasources.json"
12
12
  },
13
13
  "files": [