@dfns/sdk 0.5.10-alpha.2 → 0.6.0-rc.0

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.
@@ -5,10 +5,10 @@ export type ActivateApplicationResponse = {
5
5
  appId: string;
6
6
  kind: "ServerSideApplication" | "ClientSideApplication";
7
7
  orgId: string;
8
- expectedRpId: string;
8
+ expectedRpId?: string | undefined;
9
9
  name: string;
10
10
  isActive: boolean;
11
- expectedOrigin: string;
11
+ expectedOrigin?: string | undefined;
12
12
  permissionAssignments: {
13
13
  permissionName: string;
14
14
  permissionId: string;
@@ -140,10 +140,10 @@ export type ArchiveApplicationResponse = {
140
140
  appId: string;
141
141
  kind: "ServerSideApplication" | "ClientSideApplication";
142
142
  orgId: string;
143
- expectedRpId: string;
143
+ expectedRpId?: string | undefined;
144
144
  name: string;
145
145
  isActive: boolean;
146
- expectedOrigin: string;
146
+ expectedOrigin?: string | undefined;
147
147
  permissionAssignments: {
148
148
  permissionName: string;
149
149
  permissionId: string;
@@ -261,15 +261,15 @@ export type ArchiveUserResponse = {
261
261
  export type ArchiveUserRequest = ArchiveUserParams;
262
262
  export type CreateApplicationBody = {
263
263
  name: string;
264
- relyingPartyId: string;
265
- origin: string;
264
+ relyingPartyId?: string | undefined;
265
+ origin?: string | undefined;
266
266
  permissionId?: string | undefined;
267
267
  externalId?: string | undefined;
268
268
  kind: "ClientSideApplication";
269
269
  } | {
270
270
  name: string;
271
- relyingPartyId: string;
272
- origin: string;
271
+ relyingPartyId?: string | undefined;
272
+ origin?: string | undefined;
273
273
  permissionId?: string | undefined;
274
274
  externalId?: string | undefined;
275
275
  kind: "ServerSideApplication";
@@ -280,10 +280,10 @@ export type CreateApplicationResponse = {
280
280
  appId: string;
281
281
  kind: "ServerSideApplication" | "ClientSideApplication";
282
282
  orgId: string;
283
- expectedRpId: string;
283
+ expectedRpId?: string | undefined;
284
284
  name: string;
285
285
  isActive: boolean;
286
- expectedOrigin: string;
286
+ expectedOrigin?: string | undefined;
287
287
  permissionAssignments: {
288
288
  permissionName: string;
289
289
  permissionId: string;
@@ -391,10 +391,10 @@ export type CreateCredentialChallengeResponse = {
391
391
  name: string;
392
392
  };
393
393
  challengeIdentifier: string;
394
- rp: {
394
+ rp?: {
395
395
  id: string;
396
396
  name: string;
397
- };
397
+ } | undefined;
398
398
  /** @deprecated use challengeIdentifier instead */
399
399
  temporaryAuthenticationToken: string;
400
400
  } | {
@@ -405,10 +405,10 @@ export type CreateCredentialChallengeResponse = {
405
405
  name: string;
406
406
  };
407
407
  challengeIdentifier: string;
408
- rp: {
408
+ rp?: {
409
409
  id: string;
410
410
  name: string;
411
- };
411
+ } | undefined;
412
412
  otpUrl: string;
413
413
  /** @deprecated use challengeIdentifier instead */
414
414
  temporaryAuthenticationToken: string;
@@ -421,10 +421,11 @@ export type CreateCredentialChallengeResponse = {
421
421
  };
422
422
  challengeIdentifier: string;
423
423
  challenge: string;
424
- rp: {
424
+ rp?: {
425
425
  id: string;
426
426
  name: string;
427
- };
427
+ } | undefined;
428
+ allowedRelyingParties: string[];
428
429
  authenticatorSelection: {
429
430
  authenticatorAttachment?: ("platform" | "cross-platform") | undefined;
430
431
  residentKey: "required" | "preferred" | "discouraged";
@@ -452,10 +453,10 @@ export type CreateCredentialChallengeResponse = {
452
453
  };
453
454
  challengeIdentifier: string;
454
455
  challenge: string;
455
- rp: {
456
+ rp?: {
456
457
  id: string;
457
458
  name: string;
458
- };
459
+ } | undefined;
459
460
  attestation: "none" | "indirect" | "direct" | "enterprise";
460
461
  pubKeyCredParams: {
461
462
  type: "public-key";
@@ -472,10 +473,10 @@ export type CreateCredentialChallengeResponse = {
472
473
  };
473
474
  challengeIdentifier: string;
474
475
  challenge: string;
475
- rp: {
476
+ rp?: {
476
477
  id: string;
477
478
  name: string;
478
- };
479
+ } | undefined;
479
480
  attestation: "none" | "indirect" | "direct" | "enterprise";
480
481
  pubKeyCredParams: {
481
482
  type: "public-key";
@@ -492,10 +493,10 @@ export type CreateCredentialChallengeResponse = {
492
493
  };
493
494
  challengeIdentifier: string;
494
495
  challenge: string;
495
- rp: {
496
+ rp?: {
496
497
  id: string;
497
498
  name: string;
498
- };
499
+ } | undefined;
499
500
  attestation: "none" | "indirect" | "direct" | "enterprise";
500
501
  pubKeyCredParams: {
501
502
  type: "public-key";
@@ -519,10 +520,10 @@ export type CreateCredentialChallengeWithCodeResponse = {
519
520
  name: string;
520
521
  };
521
522
  challengeIdentifier: string;
522
- rp: {
523
+ rp?: {
523
524
  id: string;
524
525
  name: string;
525
- };
526
+ } | undefined;
526
527
  /** @deprecated use challengeIdentifier instead */
527
528
  temporaryAuthenticationToken: string;
528
529
  } | {
@@ -533,10 +534,10 @@ export type CreateCredentialChallengeWithCodeResponse = {
533
534
  name: string;
534
535
  };
535
536
  challengeIdentifier: string;
536
- rp: {
537
+ rp?: {
537
538
  id: string;
538
539
  name: string;
539
- };
540
+ } | undefined;
540
541
  otpUrl: string;
541
542
  /** @deprecated use challengeIdentifier instead */
542
543
  temporaryAuthenticationToken: string;
@@ -549,10 +550,11 @@ export type CreateCredentialChallengeWithCodeResponse = {
549
550
  };
550
551
  challengeIdentifier: string;
551
552
  challenge: string;
552
- rp: {
553
+ rp?: {
553
554
  id: string;
554
555
  name: string;
555
- };
556
+ } | undefined;
557
+ allowedRelyingParties: string[];
556
558
  authenticatorSelection: {
557
559
  authenticatorAttachment?: ("platform" | "cross-platform") | undefined;
558
560
  residentKey: "required" | "preferred" | "discouraged";
@@ -580,10 +582,10 @@ export type CreateCredentialChallengeWithCodeResponse = {
580
582
  };
581
583
  challengeIdentifier: string;
582
584
  challenge: string;
583
- rp: {
585
+ rp?: {
584
586
  id: string;
585
587
  name: string;
586
- };
588
+ } | undefined;
587
589
  attestation: "none" | "indirect" | "direct" | "enterprise";
588
590
  pubKeyCredParams: {
589
591
  type: "public-key";
@@ -600,10 +602,10 @@ export type CreateCredentialChallengeWithCodeResponse = {
600
602
  };
601
603
  challengeIdentifier: string;
602
604
  challenge: string;
603
- rp: {
605
+ rp?: {
604
606
  id: string;
605
607
  name: string;
606
- };
608
+ } | undefined;
607
609
  attestation: "none" | "indirect" | "direct" | "enterprise";
608
610
  pubKeyCredParams: {
609
611
  type: "public-key";
@@ -620,10 +622,10 @@ export type CreateCredentialChallengeWithCodeResponse = {
620
622
  };
621
623
  challengeIdentifier: string;
622
624
  challenge: string;
623
- rp: {
625
+ rp?: {
624
626
  id: string;
625
627
  name: string;
626
- };
628
+ } | undefined;
627
629
  attestation: "none" | "indirect" | "direct" | "enterprise";
628
630
  pubKeyCredParams: {
629
631
  type: "public-key";
@@ -725,10 +727,11 @@ export type CreateDelegatedRecoveryChallengeResponse = {
725
727
  };
726
728
  temporaryAuthenticationToken: string;
727
729
  challenge: string;
728
- rp: {
730
+ rp?: {
729
731
  id: string;
730
732
  name: string;
731
- };
733
+ } | undefined;
734
+ allowedRelyingParties: string[];
732
735
  supportedCredentialKinds: {
733
736
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
734
737
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -771,10 +774,11 @@ export type CreateDelegatedRegistrationChallengeResponse = {
771
774
  };
772
775
  temporaryAuthenticationToken: string;
773
776
  challenge: string;
774
- rp: {
777
+ rp?: {
775
778
  id: string;
776
779
  name: string;
777
- };
780
+ } | undefined;
781
+ allowedRelyingParties: string[];
778
782
  supportedCredentialKinds: {
779
783
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
780
784
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -808,10 +812,11 @@ export type CreateLoginChallengeBody = {
808
812
  export type CreateLoginChallengeResponse = {
809
813
  challenge: string;
810
814
  challengeIdentifier: string;
811
- rp: {
815
+ rp?: {
812
816
  id: string;
813
817
  name: string;
814
- };
818
+ } | undefined;
819
+ allowedRelyingParties: string[];
815
820
  supportedCredentialKinds: {
816
821
  kind: "Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey";
817
822
  factor: "first" | "second" | "either";
@@ -885,10 +890,11 @@ export type CreateRecoveryChallengeResponse = {
885
890
  };
886
891
  temporaryAuthenticationToken: string;
887
892
  challenge: string;
888
- rp: {
893
+ rp?: {
889
894
  id: string;
890
895
  name: string;
891
- };
896
+ } | undefined;
897
+ allowedRelyingParties: string[];
892
898
  supportedCredentialKinds: {
893
899
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
894
900
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -931,10 +937,11 @@ export type CreateRegistrationChallengeResponse = {
931
937
  };
932
938
  temporaryAuthenticationToken: string;
933
939
  challenge: string;
934
- rp: {
940
+ rp?: {
935
941
  id: string;
936
942
  name: string;
937
- };
943
+ } | undefined;
944
+ allowedRelyingParties: string[];
938
945
  supportedCredentialKinds: {
939
946
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
940
947
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -1021,10 +1028,11 @@ export type CreateSocialRegistrationChallengeResponse = {
1021
1028
  };
1022
1029
  temporaryAuthenticationToken: string;
1023
1030
  challenge: string;
1024
- rp: {
1031
+ rp?: {
1025
1032
  id: string;
1026
1033
  name: string;
1027
- };
1034
+ } | undefined;
1035
+ allowedRelyingParties: string[];
1028
1036
  supportedCredentialKinds: {
1029
1037
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
1030
1038
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -1086,10 +1094,11 @@ export type CreateUserActionChallengeBody = {
1086
1094
  export type CreateUserActionChallengeResponse = {
1087
1095
  challenge: string;
1088
1096
  challengeIdentifier: string;
1089
- rp: {
1097
+ rp?: {
1090
1098
  id: string;
1091
1099
  name: string;
1092
- };
1100
+ } | undefined;
1101
+ allowedRelyingParties: string[];
1093
1102
  supportedCredentialKinds: {
1094
1103
  kind: "Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey";
1095
1104
  factor: "first" | "second" | "either";
@@ -1195,10 +1204,10 @@ export type DeactivateApplicationResponse = {
1195
1204
  appId: string;
1196
1205
  kind: "ServerSideApplication" | "ClientSideApplication";
1197
1206
  orgId: string;
1198
- expectedRpId: string;
1207
+ expectedRpId?: string | undefined;
1199
1208
  name: string;
1200
1209
  isActive: boolean;
1201
- expectedOrigin: string;
1210
+ expectedOrigin?: string | undefined;
1202
1211
  permissionAssignments: {
1203
1212
  permissionName: string;
1204
1213
  permissionId: string;
@@ -1339,10 +1348,10 @@ export type GetApplicationResponse = {
1339
1348
  appId: string;
1340
1349
  kind: "ServerSideApplication" | "ClientSideApplication";
1341
1350
  orgId: string;
1342
- expectedRpId: string;
1351
+ expectedRpId?: string | undefined;
1343
1352
  name: string;
1344
1353
  isActive: boolean;
1345
- expectedOrigin: string;
1354
+ expectedOrigin?: string | undefined;
1346
1355
  permissionAssignments: {
1347
1356
  permissionName: string;
1348
1357
  permissionId: string;
@@ -1463,10 +1472,10 @@ export type ListApplicationsResponse = {
1463
1472
  appId: string;
1464
1473
  kind: "ServerSideApplication" | "ClientSideApplication";
1465
1474
  orgId: string;
1466
- expectedRpId: string;
1475
+ expectedRpId?: string | undefined;
1467
1476
  name: string;
1468
1477
  isActive: boolean;
1469
- expectedOrigin: string;
1478
+ expectedOrigin?: string | undefined;
1470
1479
  permissionAssignments: {
1471
1480
  permissionName: string;
1472
1481
  permissionId: string;
@@ -1785,10 +1794,11 @@ export type RecreateDelegatedRegistrationChallengeResponse = {
1785
1794
  };
1786
1795
  temporaryAuthenticationToken: string;
1787
1796
  challenge: string;
1788
- rp: {
1797
+ rp?: {
1789
1798
  id: string;
1790
1799
  name: string;
1791
- };
1800
+ } | undefined;
1801
+ allowedRelyingParties: string[];
1792
1802
  supportedCredentialKinds: {
1793
1803
  firstFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
1794
1804
  secondFactor: ("Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey")[];
@@ -2073,10 +2083,10 @@ export type UpdateApplicationResponse = {
2073
2083
  appId: string;
2074
2084
  kind: "ServerSideApplication" | "ClientSideApplication";
2075
2085
  orgId: string;
2076
- expectedRpId: string;
2086
+ expectedRpId?: string | undefined;
2077
2087
  name: string;
2078
2088
  isActive: boolean;
2079
- expectedOrigin: string;
2089
+ expectedOrigin?: string | undefined;
2080
2090
  permissionAssignments: {
2081
2091
  permissionName: string;
2082
2092
  permissionId: string;
@@ -36,7 +36,7 @@ export type CreateAssignmentRequest = CreateAssignmentParams & {
36
36
  };
37
37
  export type CreatePermissionBody = {
38
38
  name: string;
39
- operations: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[];
39
+ operations: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[];
40
40
  };
41
41
  export type CreatePermissionResponse = {
42
42
  id: string;
@@ -178,7 +178,7 @@ export type ListPermissionsRequest = {
178
178
  };
179
179
  export type UpdatePermissionBody = {
180
180
  name?: string | undefined;
181
- operations?: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined;
181
+ operations?: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined;
182
182
  };
183
183
  export type UpdatePermissionParams = {
184
184
  permissionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfns/sdk",
3
- "version": "0.5.10-alpha.2",
3
+ "version": "0.6.0-rc.0",
4
4
  "dependencies": {
5
5
  "buffer": "6.0.3",
6
6
  "cross-fetch": "3.1.6",
package/signer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type CredentialFactor = 'first' | 'second' | 'either';
2
- export type CredentialKind = 'Key' | 'Fido2' | 'Password' | 'Totp' | 'RecoveryKey';
2
+ export type CredentialKind = 'Key' | 'PasswordProtectedKey' | 'Fido2' | 'Password' | 'Totp' | 'RecoveryKey';
3
3
  export type CredentialTransport = 'usb' | 'nfc' | 'ble' | 'internal';
4
4
  export type UserVerificationRequirement = 'required' | 'preferred' | 'discouraged';
5
5
  export type AllowCredential = {
@@ -13,10 +13,11 @@ export type SupportedCredential = {
13
13
  };
14
14
  export type UserActionChallenge = {
15
15
  supportedCredentialKinds: SupportedCredential[];
16
- rp: {
16
+ rp?: {
17
17
  id: string;
18
18
  name: string;
19
19
  };
20
+ allowedRelyingParties: string[];
20
21
  challenge: string;
21
22
  challengeIdentifier: string;
22
23
  externalAuthenticationUrl: string;
package/utils/fetch.js CHANGED
@@ -5,6 +5,7 @@ const cross_fetch_1 = require("cross-fetch");
5
5
  const nonce_1 = require("./nonce");
6
6
  const dfnsError_1 = require("../dfnsError");
7
7
  const DEFAULT_DFNS_BASE_URL = 'https://api.dfns.io';
8
+ const package_json_1 = require("../package.json");
8
9
  const fullUrl = (fetch) => {
9
10
  return async (resource, options) => {
10
11
  const baseUrl = options.apiOptions.baseUrl || DEFAULT_DFNS_BASE_URL;
@@ -73,6 +74,7 @@ const dfnsAuth = (fetch) => {
73
74
  options.headers = {
74
75
  'x-dfns-appid': appId,
75
76
  'x-dfns-nonce': (0, nonce_1.generateNonce)(),
77
+ 'x-dfns-sdk-version': package_json_1.version,
76
78
  ...dfnsAppSecret,
77
79
  ...authorization,
78
80
  ...(options.headers ?? {}),
@@ -1,8 +0,0 @@
1
- import { DfnsApiClientOptions } from '../../types/generic';
2
- import * as T from './types';
3
- export declare class StakingClient {
4
- private apiOptions;
5
- constructor(apiOptions: DfnsApiClientOptions);
6
- createStake(request: T.CreateStakeRequest): Promise<T.CreateStakeResponse>;
7
- listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>;
8
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StakingClient = void 0;
4
- const fetch_1 = require("../../utils/fetch");
5
- const userActionFetch_1 = require("../../utils/userActionFetch");
6
- const url_1 = require("../../utils/url");
7
- class StakingClient {
8
- constructor(apiOptions) {
9
- this.apiOptions = apiOptions;
10
- }
11
- async createStake(request) {
12
- const path = (0, url_1.buildPathAndQuery)('/staking/stakes', {
13
- path: request ?? {},
14
- query: {},
15
- });
16
- const response = await (0, userActionFetch_1.userActionFetch)(path, {
17
- method: 'POST',
18
- body: request.body,
19
- apiOptions: this.apiOptions,
20
- });
21
- return response.json();
22
- }
23
- async listStakes(request) {
24
- const path = (0, url_1.buildPathAndQuery)('/staking/stakes', {
25
- path: request ?? {},
26
- query: request?.query ?? {},
27
- });
28
- const response = await (0, fetch_1.simpleFetch)(path, {
29
- method: 'GET',
30
- apiOptions: this.apiOptions,
31
- });
32
- return response.json();
33
- }
34
- }
35
- exports.StakingClient = StakingClient;
@@ -1,10 +0,0 @@
1
- import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
2
- import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
3
- import * as T from './types';
4
- export declare class DelegatedStakingClient {
5
- private apiOptions;
6
- constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
- createStakeInit(request: T.CreateStakeRequest): Promise<UserActionChallengeResponse>;
8
- createStakeComplete(request: T.CreateStakeRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateStakeResponse>;
9
- listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>;
10
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DelegatedStakingClient = void 0;
4
- const baseAuthApi_1 = require("../../baseAuthApi");
5
- const fetch_1 = require("../../utils/fetch");
6
- const url_1 = require("../../utils/url");
7
- class DelegatedStakingClient {
8
- constructor(apiOptions) {
9
- this.apiOptions = apiOptions;
10
- }
11
- async createStakeInit(request) {
12
- const path = (0, url_1.buildPathAndQuery)('/staking/stakes', {
13
- path: request ?? {},
14
- query: {},
15
- });
16
- const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
- userActionHttpMethod: 'POST',
18
- userActionHttpPath: path,
19
- userActionPayload: JSON.stringify(request.body),
20
- userActionServerKind: 'Api',
21
- }, this.apiOptions);
22
- return challenge;
23
- }
24
- async createStakeComplete(request, signedChallenge) {
25
- const path = (0, url_1.buildPathAndQuery)('/staking/stakes', {
26
- path: request ?? {},
27
- query: {},
28
- });
29
- const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
30
- const response = await (0, fetch_1.simpleFetch)(path, {
31
- method: 'POST',
32
- body: request.body,
33
- headers: { 'x-dfns-useraction': userAction },
34
- apiOptions: this.apiOptions,
35
- });
36
- return response.json();
37
- }
38
- async listStakes(request) {
39
- const path = (0, url_1.buildPathAndQuery)('/staking/stakes', {
40
- path: request ?? {},
41
- query: request?.query ?? {},
42
- });
43
- const response = await (0, fetch_1.simpleFetch)(path, {
44
- method: 'GET',
45
- apiOptions: this.apiOptions,
46
- });
47
- return response.json();
48
- }
49
- }
50
- exports.DelegatedStakingClient = DelegatedStakingClient;
@@ -1,3 +0,0 @@
1
- export * from './types';
2
- export * from './client';
3
- export * from './delegatedClient';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- __exportStar(require("./client"), exports);
19
- __exportStar(require("./delegatedClient"), exports);
@@ -1,99 +0,0 @@
1
- export type CreateStakeBody = {
2
- kind: "Native";
3
- amount: string;
4
- priority?: ("Slow" | "Standard" | "Fast") | undefined;
5
- createDestinationAccount?: boolean | undefined;
6
- externalId?: string | undefined;
7
- walletId: string;
8
- provider: "Figment";
9
- protocol: "Babylon";
10
- duration: number;
11
- };
12
- export type CreateStakeResponse = {
13
- stake: {
14
- id: string;
15
- provider: "Figment";
16
- providerStakeId: string;
17
- walletId: string;
18
- protocol: "Babylon";
19
- status: "Active";
20
- requester: {
21
- userId: string;
22
- tokenId?: string | undefined;
23
- appId?: string | undefined;
24
- };
25
- requestBody: {
26
- kind: "Native";
27
- amount: string;
28
- priority?: ("Slow" | "Standard" | "Fast") | undefined;
29
- createDestinationAccount?: boolean | undefined;
30
- externalId?: string | undefined;
31
- walletId: string;
32
- provider: "Figment";
33
- protocol: "Babylon";
34
- duration: number;
35
- };
36
- dateCreated: string;
37
- };
38
- stakeTransaction: {
39
- id: string;
40
- stakeId: string;
41
- transactionId?: string | undefined;
42
- kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "Withdraw";
43
- requester: {
44
- userId: string;
45
- tokenId?: string | undefined;
46
- appId?: string | undefined;
47
- };
48
- requestBody: {
49
- kind: "Native";
50
- amount: string;
51
- priority?: ("Slow" | "Standard" | "Fast") | undefined;
52
- createDestinationAccount?: boolean | undefined;
53
- externalId?: string | undefined;
54
- walletId: string;
55
- provider: "Figment";
56
- protocol: "Babylon";
57
- duration: number;
58
- };
59
- dateCreated: string;
60
- };
61
- };
62
- export type CreateStakeRequest = {
63
- body: CreateStakeBody;
64
- };
65
- export type ListStakesQuery = {
66
- limit?: number | undefined;
67
- paginationToken?: string | undefined;
68
- };
69
- export type ListStakesResponse = {
70
- items: {
71
- id: string;
72
- provider: "Figment";
73
- providerStakeId: string;
74
- walletId: string;
75
- protocol: "Babylon";
76
- status: "Active";
77
- requester: {
78
- userId: string;
79
- tokenId?: string | undefined;
80
- appId?: string | undefined;
81
- };
82
- requestBody: {
83
- kind: "Native";
84
- amount: string;
85
- priority?: ("Slow" | "Standard" | "Fast") | undefined;
86
- createDestinationAccount?: boolean | undefined;
87
- externalId?: string | undefined;
88
- walletId: string;
89
- provider: "Figment";
90
- protocol: "Babylon";
91
- duration: number;
92
- };
93
- dateCreated: string;
94
- }[];
95
- nextPageToken?: string | undefined;
96
- };
97
- export type ListStakesRequest = {
98
- query?: ListStakesQuery;
99
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });