@dfns/sdk 0.2.3-rc.1 → 0.2.3
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/baseAuthApi.d.ts +113 -0
- package/baseAuthApi.js +97 -0
- package/codegen/Assets/AssetsClient.d.ts +13 -0
- package/codegen/Assets/AssetsClient.js +93 -0
- package/codegen/Assets/DelegatedAssetsClient.d.ts +16 -0
- package/codegen/Assets/DelegatedAssetsClient.js +124 -0
- package/codegen/Assets/index.d.ts +3 -0
- package/codegen/Assets/index.js +19 -0
- package/codegen/Assets/types.d.ts +37 -0
- package/codegen/Assets/types.js +2 -0
- package/codegen/Auth/AuthClient.d.ts +50 -0
- package/codegen/Auth/AuthClient.js +518 -0
- package/codegen/Auth/DelegatedAuthClient.d.ts +78 -0
- package/codegen/Auth/DelegatedAuthClient.js +936 -0
- package/codegen/Auth/index.d.ts +3 -0
- package/codegen/Auth/index.js +19 -0
- package/codegen/Auth/types.d.ts +177 -0
- package/codegen/Auth/types.js +2 -0
- package/codegen/Blockchains/BlockchainsClient.d.ts +7 -0
- package/codegen/Blockchains/BlockchainsClient.js +23 -0
- package/codegen/Blockchains/DelegatedBlockchainsClient.d.ts +7 -0
- package/codegen/Blockchains/DelegatedBlockchainsClient.js +23 -0
- package/codegen/Blockchains/index.d.ts +3 -0
- package/codegen/Blockchains/index.js +19 -0
- package/codegen/Blockchains/types.d.ts +6 -0
- package/codegen/Blockchains/types.js +2 -0
- package/codegen/Callbacks/CallbacksClient.d.ts +12 -0
- package/codegen/Callbacks/CallbacksClient.js +78 -0
- package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +15 -0
- package/codegen/Callbacks/DelegatedCallbacksClient.js +110 -0
- package/codegen/Callbacks/index.d.ts +3 -0
- package/codegen/Callbacks/index.js +19 -0
- package/codegen/Callbacks/{types.ts → types.d.ts} +18 -26
- package/codegen/Callbacks/types.js +2 -0
- package/codegen/Permissions/DelegatedPermissionsClient.d.ts +27 -0
- package/codegen/Permissions/DelegatedPermissionsClient.js +284 -0
- package/codegen/Permissions/PermissionsClient.d.ts +18 -0
- package/codegen/Permissions/PermissionsClient.js +156 -0
- package/codegen/Permissions/index.d.ts +3 -0
- package/codegen/Permissions/index.js +19 -0
- package/codegen/Permissions/types.d.ts +62 -0
- package/codegen/Permissions/types.js +2 -0
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +11 -0
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +61 -0
- package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +9 -0
- package/codegen/PolicyExecution/PolicyExecutionClient.js +45 -0
- package/codegen/PolicyExecution/index.d.ts +3 -0
- package/codegen/PolicyExecution/index.js +19 -0
- package/codegen/PolicyExecution/types.d.ts +18 -0
- package/codegen/PolicyExecution/types.js +2 -0
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +25 -0
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +240 -0
- package/codegen/PolicyManagement/PolicyManagementClient.d.ts +18 -0
- package/codegen/PolicyManagement/PolicyManagementClient.js +146 -0
- package/codegen/PolicyManagement/index.d.ts +3 -0
- package/codegen/PolicyManagement/index.js +19 -0
- package/codegen/PolicyManagement/{types.ts → types.d.ts} +40 -56
- package/codegen/PolicyManagement/types.js +2 -0
- package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +21 -0
- package/codegen/PublicKeys/DelegatedPublicKeysClient.js +189 -0
- package/codegen/PublicKeys/PublicKeysClient.d.ts +16 -0
- package/codegen/PublicKeys/PublicKeysClient.js +128 -0
- package/codegen/PublicKeys/index.d.ts +3 -0
- package/codegen/PublicKeys/index.js +19 -0
- package/codegen/PublicKeys/types.d.ts +51 -0
- package/codegen/PublicKeys/types.js +2 -0
- package/codegen/Signers/DelegatedSignersClient.d.ts +7 -0
- package/codegen/Signers/DelegatedSignersClient.js +22 -0
- package/codegen/Signers/SignersClient.d.ts +7 -0
- package/codegen/Signers/SignersClient.js +22 -0
- package/codegen/Signers/index.d.ts +3 -0
- package/codegen/Signers/index.js +19 -0
- package/codegen/Signers/types.d.ts +2 -0
- package/codegen/Signers/types.js +2 -0
- package/codegen/Wallets/DelegatedWalletsClient.d.ts +32 -0
- package/codegen/Wallets/DelegatedWalletsClient.js +325 -0
- package/codegen/Wallets/WalletsClient.d.ts +24 -0
- package/codegen/Wallets/WalletsClient.js +219 -0
- package/codegen/Wallets/index.d.ts +3 -0
- package/codegen/Wallets/index.js +19 -0
- package/codegen/Wallets/types.d.ts +101 -0
- package/codegen/Wallets/types.js +2 -0
- package/codegen/datamodel/ApiKeys/errors.d.ts +6 -0
- package/codegen/datamodel/ApiKeys/errors.js +15 -0
- package/codegen/datamodel/ApiKeys/index.d.ts +3 -0
- package/codegen/datamodel/ApiKeys/index.js +19 -0
- package/codegen/datamodel/ApiKeys/responses.d.ts +25 -0
- package/codegen/datamodel/ApiKeys/responses.js +2 -0
- package/codegen/datamodel/ApiKeys/types.d.ts +32 -0
- package/codegen/datamodel/ApiKeys/types.js +11 -0
- package/codegen/datamodel/Assets/errors.d.ts +11 -0
- package/codegen/datamodel/Assets/errors.js +17 -0
- package/codegen/datamodel/Assets/index.d.ts +3 -0
- package/codegen/datamodel/Assets/index.js +19 -0
- package/codegen/datamodel/Assets/responses.d.ts +47 -0
- package/codegen/datamodel/Assets/responses.js +2 -0
- package/codegen/datamodel/Assets/types.d.ts +225 -0
- package/codegen/datamodel/Assets/types.js +75 -0
- package/codegen/datamodel/Auth/errors.js +1 -0
- package/codegen/datamodel/Auth/index.d.ts +2 -0
- package/codegen/datamodel/Auth/index.js +18 -0
- package/codegen/datamodel/Auth/responses.d.ts +358 -0
- package/codegen/datamodel/Auth/responses.js +2 -0
- package/codegen/datamodel/Auth/types.d.ts +615 -0
- package/codegen/datamodel/Auth/types.js +127 -0
- package/codegen/datamodel/BlockchainIndexing/errors.js +1 -0
- package/codegen/datamodel/BlockchainIndexing/index.d.ts +1 -0
- package/codegen/datamodel/BlockchainIndexing/index.js +17 -0
- package/codegen/datamodel/BlockchainIndexing/{responses.ts → responses.d.ts} +5 -10
- package/codegen/datamodel/BlockchainIndexing/responses.js +2 -0
- package/codegen/datamodel/BlockchainIndexing/types.js +1 -0
- package/codegen/datamodel/Blockchains/errors.js +1 -0
- package/codegen/datamodel/Blockchains/index.d.ts +2 -0
- package/codegen/datamodel/Blockchains/index.js +18 -0
- package/codegen/datamodel/Blockchains/responses.d.ts +12 -0
- package/codegen/datamodel/Blockchains/responses.js +2 -0
- package/codegen/datamodel/Blockchains/types.d.ts +270 -0
- package/codegen/datamodel/Blockchains/types.js +53 -0
- package/codegen/datamodel/Callbacks/errors.js +1 -0
- package/codegen/datamodel/Callbacks/index.d.ts +2 -0
- package/codegen/datamodel/Callbacks/index.js +18 -0
- package/codegen/datamodel/Callbacks/responses.d.ts +36 -0
- package/codegen/datamodel/Callbacks/responses.js +2 -0
- package/codegen/datamodel/Callbacks/types.d.ts +43 -0
- package/codegen/datamodel/Callbacks/types.js +39 -0
- package/codegen/datamodel/Foundations/errors.d.ts +131 -0
- package/codegen/datamodel/Foundations/errors.js +182 -0
- package/codegen/datamodel/Foundations/index.d.ts +2 -0
- package/codegen/datamodel/Foundations/index.js +18 -0
- package/codegen/datamodel/Foundations/responses.js +1 -0
- package/codegen/datamodel/Foundations/types.d.ts +9759 -0
- package/codegen/datamodel/Foundations/types.js +57755 -0
- package/codegen/datamodel/Orgs/errors.js +1 -0
- package/codegen/datamodel/Orgs/index.d.ts +2 -0
- package/codegen/datamodel/Orgs/index.js +18 -0
- package/codegen/datamodel/Orgs/responses.d.ts +45 -0
- package/codegen/datamodel/Orgs/responses.js +2 -0
- package/codegen/datamodel/Orgs/types.d.ts +240 -0
- package/codegen/datamodel/Orgs/types.js +39 -0
- package/codegen/datamodel/Permissions/errors.js +1 -0
- package/codegen/datamodel/Permissions/index.d.ts +2 -0
- package/codegen/datamodel/Permissions/index.js +18 -0
- package/codegen/datamodel/Permissions/responses.d.ts +75 -0
- package/codegen/datamodel/Permissions/responses.js +2 -0
- package/codegen/datamodel/Permissions/types.d.ts +93 -0
- package/codegen/datamodel/Permissions/types.js +43 -0
- package/codegen/datamodel/PolicyExecution/errors.d.ts +11 -0
- package/codegen/datamodel/PolicyExecution/errors.js +17 -0
- package/codegen/datamodel/PolicyExecution/index.d.ts +3 -0
- package/codegen/datamodel/PolicyExecution/index.js +19 -0
- package/codegen/datamodel/PolicyExecution/responses.d.ts +19 -0
- package/codegen/datamodel/PolicyExecution/responses.js +2 -0
- package/codegen/datamodel/PolicyExecution/types.d.ts +60 -0
- package/codegen/datamodel/PolicyExecution/types.js +17 -0
- package/codegen/datamodel/PolicyManagement/errors.js +1 -0
- package/codegen/datamodel/PolicyManagement/index.d.ts +2 -0
- package/codegen/datamodel/PolicyManagement/index.js +18 -0
- package/codegen/datamodel/PolicyManagement/responses.d.ts +83 -0
- package/codegen/datamodel/PolicyManagement/responses.js +2 -0
- package/codegen/datamodel/PolicyManagement/types.d.ts +391 -0
- package/codegen/datamodel/PolicyManagement/types.js +95 -0
- package/codegen/datamodel/PublicKeys/errors.js +1 -0
- package/codegen/datamodel/PublicKeys/index.d.ts +2 -0
- package/codegen/datamodel/PublicKeys/index.js +18 -0
- package/codegen/datamodel/PublicKeys/responses.d.ts +56 -0
- package/codegen/datamodel/PublicKeys/responses.js +2 -0
- package/codegen/datamodel/PublicKeys/types.d.ts +223 -0
- package/codegen/datamodel/PublicKeys/types.js +59 -0
- package/codegen/datamodel/Signers/errors.js +1 -0
- package/codegen/datamodel/Signers/index.d.ts +2 -0
- package/codegen/datamodel/Signers/index.js +18 -0
- package/codegen/datamodel/Signers/responses.d.ts +27 -0
- package/codegen/datamodel/Signers/responses.js +2 -0
- package/codegen/datamodel/Signers/types.d.ts +21 -0
- package/codegen/datamodel/Signers/types.js +2 -0
- package/codegen/datamodel/Wallets/errors.js +1 -0
- package/codegen/datamodel/Wallets/index.d.ts +2 -0
- package/codegen/datamodel/Wallets/index.js +18 -0
- package/codegen/datamodel/Wallets/responses.d.ts +92 -0
- package/codegen/datamodel/Wallets/responses.js +2 -0
- package/codegen/datamodel/Wallets/types.d.ts +677 -0
- package/codegen/datamodel/Wallets/types.js +251 -0
- package/dfnsApiClient.d.ts +39 -0
- package/dfnsApiClient.js +63 -0
- package/dfnsAuthenticator.d.ts +17 -0
- package/dfnsAuthenticator.js +29 -0
- package/dfnsDelegatedApiClient.d.ts +38 -0
- package/dfnsDelegatedApiClient.js +63 -0
- package/dfnsError.d.ts +5 -0
- package/dfnsError.js +11 -0
- package/generated/policies/client.d.ts +13 -0
- package/generated/policies/client.js +92 -0
- package/generated/policies/delegatedClient.d.ts +18 -0
- package/generated/policies/delegatedClient.js +153 -0
- package/generated/policies/index.d.ts +3 -0
- package/generated/policies/index.js +19 -0
- package/generated/policies/{types.ts → types.d.ts} +17 -29
- package/generated/policies/types.js +2 -0
- package/generated/signers/client.d.ts +7 -0
- package/generated/signers/client.js +22 -0
- package/generated/signers/delegatedClient.d.ts +7 -0
- package/generated/signers/delegatedClient.js +22 -0
- package/generated/signers/index.d.ts +3 -0
- package/generated/signers/index.js +19 -0
- package/generated/signers/{types.ts → types.d.ts} +0 -1
- package/generated/signers/types.js +2 -0
- package/generated/wallets/client.d.ts +25 -0
- package/generated/wallets/client.js +228 -0
- package/generated/wallets/delegatedClient.d.ts +34 -0
- package/generated/wallets/delegatedClient.js +349 -0
- package/generated/wallets/index.d.ts +3 -0
- package/generated/wallets/index.js +19 -0
- package/generated/wallets/{types.ts → types.d.ts} +45 -86
- package/generated/wallets/types.js +2 -0
- package/generated/webhooks/client.d.ts +14 -0
- package/generated/webhooks/client.js +103 -0
- package/generated/webhooks/delegatedClient.d.ts +19 -0
- package/generated/webhooks/delegatedClient.js +164 -0
- package/generated/webhooks/index.d.ts +3 -0
- package/generated/webhooks/index.js +19 -0
- package/generated/webhooks/{types.ts → types.d.ts} +16 -34
- package/generated/webhooks/types.js +2 -0
- package/index.d.ts +7 -0
- package/index.js +23 -0
- package/package.json +8 -1
- package/signer.d.ts +52 -0
- package/signer.js +2 -0
- package/store.d.ts +79 -0
- package/store.js +2 -0
- package/types/policies.d.ts +1 -0
- package/types/policies.js +17 -0
- package/types/signers.d.ts +1 -0
- package/types/signers.js +17 -0
- package/types/wallets.d.ts +1 -0
- package/types/wallets.js +17 -0
- package/types/webhooks.d.ts +1 -0
- package/types/webhooks.js +17 -0
- package/utils/base64.d.ts +3 -0
- package/utils/base64.js +20 -0
- package/utils/fetch.d.ts +12 -0
- package/utils/fetch.js +94 -0
- package/utils/index.d.ts +4 -0
- package/utils/index.js +20 -0
- package/utils/nonce.d.ts +1 -0
- package/utils/nonce.js +12 -0
- package/utils/url.d.ts +4 -0
- package/utils/url.js +16 -0
- package/baseAuthApi.ts +0 -236
- package/codegen/Assets/AssetsClient.ts +0 -137
- package/codegen/Assets/DelegatedAssetsClient.ts +0 -201
- package/codegen/Assets/index.ts +0 -3
- package/codegen/Assets/types.ts +0 -45
- package/codegen/Auth/AuthClient.ts +0 -729
- package/codegen/Auth/DelegatedAuthClient.ts +0 -1508
- package/codegen/Auth/index.ts +0 -3
- package/codegen/Auth/types.ts +0 -262
- package/codegen/Blockchains/BlockchainsClient.ts +0 -25
- package/codegen/Blockchains/DelegatedBlockchainsClient.ts +0 -25
- package/codegen/Blockchains/index.ts +0 -3
- package/codegen/Blockchains/types.ts +0 -8
- package/codegen/Callbacks/CallbacksClient.ts +0 -107
- package/codegen/Callbacks/DelegatedCallbacksClient.ts +0 -172
- package/codegen/Callbacks/index.ts +0 -3
- package/codegen/Permissions/DelegatedPermissionsClient.ts +0 -468
- package/codegen/Permissions/PermissionsClient.ts +0 -223
- package/codegen/Permissions/index.ts +0 -3
- package/codegen/Permissions/types.ts +0 -82
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.ts +0 -99
- package/codegen/PolicyExecution/PolicyExecutionClient.ts +0 -63
- package/codegen/PolicyExecution/index.ts +0 -3
- package/codegen/PolicyExecution/types.ts +0 -24
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.ts +0 -384
- package/codegen/PolicyManagement/PolicyManagementClient.ts +0 -205
- package/codegen/PolicyManagement/index.ts +0 -3
- package/codegen/PublicKeys/DelegatedPublicKeysClient.ts +0 -299
- package/codegen/PublicKeys/PublicKeysClient.ts +0 -179
- package/codegen/PublicKeys/index.ts +0 -3
- package/codegen/PublicKeys/types.ts +0 -68
- package/codegen/Signers/DelegatedSignersClient.ts +0 -22
- package/codegen/Signers/SignersClient.ts +0 -22
- package/codegen/Signers/index.ts +0 -3
- package/codegen/Signers/types.ts +0 -3
- package/codegen/Wallets/DelegatedWalletsClient.ts +0 -511
- package/codegen/Wallets/WalletsClient.ts +0 -310
- package/codegen/Wallets/index.ts +0 -3
- package/codegen/Wallets/types.ts +0 -137
- package/codegen/datamodel/ApiKeys/errors.ts +0 -9
- package/codegen/datamodel/ApiKeys/index.ts +0 -3
- package/codegen/datamodel/ApiKeys/responses.ts +0 -68
- package/codegen/datamodel/ApiKeys/types.ts +0 -81
- package/codegen/datamodel/Assets/errors.ts +0 -24
- package/codegen/datamodel/Assets/index.ts +0 -3
- package/codegen/datamodel/Assets/responses.ts +0 -146
- package/codegen/datamodel/Assets/types.ts +0 -417
- package/codegen/datamodel/Auth/index.ts +0 -2
- package/codegen/datamodel/Auth/responses.ts +0 -1110
- package/codegen/datamodel/Auth/types.ts +0 -1404
- package/codegen/datamodel/BlockchainIndexing/index.ts +0 -1
- package/codegen/datamodel/Blockchains/index.ts +0 -2
- package/codegen/datamodel/Blockchains/responses.ts +0 -41
- package/codegen/datamodel/Blockchains/types.ts +0 -695
- package/codegen/datamodel/Callbacks/index.ts +0 -2
- package/codegen/datamodel/Callbacks/responses.ts +0 -110
- package/codegen/datamodel/Callbacks/types.ts +0 -100
- package/codegen/datamodel/Foundations/errors.ts +0 -299
- package/codegen/datamodel/Foundations/index.ts +0 -2
- package/codegen/datamodel/Foundations/types.ts +0 -57921
- package/codegen/datamodel/Orgs/index.ts +0 -2
- package/codegen/datamodel/Orgs/responses.ts +0 -104
- package/codegen/datamodel/Orgs/types.ts +0 -322
- package/codegen/datamodel/Permissions/index.ts +0 -2
- package/codegen/datamodel/Permissions/responses.ts +0 -258
- package/codegen/datamodel/Permissions/types.ts +0 -221
- package/codegen/datamodel/PolicyExecution/errors.ts +0 -24
- package/codegen/datamodel/PolicyExecution/index.ts +0 -3
- package/codegen/datamodel/PolicyExecution/responses.ts +0 -59
- package/codegen/datamodel/PolicyExecution/types.ts +0 -122
- package/codegen/datamodel/PolicyManagement/index.ts +0 -2
- package/codegen/datamodel/PolicyManagement/responses.ts +0 -255
- package/codegen/datamodel/PolicyManagement/types.ts +0 -711
- package/codegen/datamodel/PublicKeys/index.ts +0 -2
- package/codegen/datamodel/PublicKeys/responses.ts +0 -190
- package/codegen/datamodel/PublicKeys/types.ts +0 -558
- package/codegen/datamodel/Signers/index.ts +0 -2
- package/codegen/datamodel/Signers/responses.ts +0 -64
- package/codegen/datamodel/Signers/types.ts +0 -31
- package/codegen/datamodel/Wallets/errors.ts +0 -0
- package/codegen/datamodel/Wallets/index.ts +0 -2
- package/codegen/datamodel/Wallets/responses.ts +0 -318
- package/codegen/datamodel/Wallets/types.ts +0 -1268
- package/dfnsApiClient.ts +0 -76
- package/dfnsAuthenticator.ts +0 -59
- package/dfnsDelegatedApiClient.ts +0 -75
- package/dfnsError.ts +0 -5
- package/generated/permissions/client.ts +0 -125
- package/generated/permissions/delegatedClient.ts +0 -266
- package/generated/permissions/index.ts +0 -3
- package/generated/permissions/types.ts +0 -202
- package/generated/policies/client.ts +0 -110
- package/generated/policies/delegatedClient.ts +0 -223
- package/generated/policies/index.ts +0 -3
- package/generated/signers/client.ts +0 -22
- package/generated/signers/delegatedClient.ts +0 -23
- package/generated/signers/index.ts +0 -3
- package/generated/wallets/client.ts +0 -282
- package/generated/wallets/delegatedClient.ts +0 -507
- package/generated/wallets/index.ts +0 -3
- package/generated/webhooks/client.ts +0 -124
- package/generated/webhooks/delegatedClient.ts +0 -237
- package/generated/webhooks/index.ts +0 -3
- package/index.ts +0 -7
- package/project.json +0 -14
- package/signer.ts +0 -60
- package/store.ts +0 -99
- package/tsconfig.json +0 -7
- package/typedoc.json +0 -21
- package/types/policies.ts +0 -1
- package/types/signers.ts +0 -1
- package/types/wallets.ts +0 -1
- package/types/webhooks.ts +0 -1
- package/utils/base64.ts +0 -19
- package/utils/fetch.ts +0 -130
- package/utils/index.ts +0 -4
- package/utils/nonce.ts +0 -12
- package/utils/url.ts +0 -19
- /package/{README.md → codegen/datamodel/Auth/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Auth/errors.ts → BlockchainIndexing/errors.d.ts} +0 -0
- /package/codegen/datamodel/BlockchainIndexing/{errors.ts → types.d.ts} +0 -0
- /package/codegen/datamodel/{BlockchainIndexing/types.ts → Blockchains/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Blockchains/errors.ts → Callbacks/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Callbacks/errors.ts → Foundations/responses.d.ts} +0 -0
- /package/codegen/datamodel/{Foundations/responses.ts → Orgs/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Orgs/errors.ts → Permissions/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Permissions/errors.ts → PolicyManagement/errors.d.ts} +0 -0
- /package/codegen/datamodel/{PolicyManagement/errors.ts → PublicKeys/errors.d.ts} +0 -0
- /package/codegen/datamodel/{PublicKeys/errors.ts → Signers/errors.d.ts} +0 -0
- /package/codegen/datamodel/{Signers/errors.ts → Wallets/errors.d.ts} +0 -0
package/baseAuthApi.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { FirstFactorAttestation, RecoveryFactorAttestation, SecondFactorAttestation, UserRegistrationChallenge } from './store';
|
|
2
|
+
import { AllowCredential, CredentialKind, FirstFactorAssertion, RecoveryKeyAssertion, SecondFactorAssertion } from './signer';
|
|
3
|
+
import { HttpMethod } from './utils/fetch';
|
|
4
|
+
export type DfnsBaseApiOptions = {
|
|
5
|
+
appId: string;
|
|
6
|
+
appSecret?: string;
|
|
7
|
+
authToken?: string;
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
};
|
|
10
|
+
export type CreateUserActionChallengeRequest = {
|
|
11
|
+
userActionPayload: string;
|
|
12
|
+
userActionHttpMethod: HttpMethod;
|
|
13
|
+
userActionHttpPath: string;
|
|
14
|
+
userActionServerKind: 'Api';
|
|
15
|
+
};
|
|
16
|
+
export type CredentialFactor = 'first' | 'second' | 'either';
|
|
17
|
+
export type UserActionChallengeResponse = {
|
|
18
|
+
supportedCredentialKinds: {
|
|
19
|
+
kind: CredentialKind;
|
|
20
|
+
factor: CredentialFactor;
|
|
21
|
+
requiresSecondFactor: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
challenge: string;
|
|
24
|
+
challengeIdentifier: string;
|
|
25
|
+
externalAuthenticationUrl: string;
|
|
26
|
+
allowCredentials: {
|
|
27
|
+
key: AllowCredential[];
|
|
28
|
+
webauthn: AllowCredential[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type SignUserActionChallengeRequest = {
|
|
32
|
+
challengeIdentifier: string;
|
|
33
|
+
firstFactor: FirstFactorAssertion;
|
|
34
|
+
secondFactor?: SecondFactorAssertion;
|
|
35
|
+
};
|
|
36
|
+
export type UserActionResponse = {
|
|
37
|
+
userAction: string;
|
|
38
|
+
};
|
|
39
|
+
export type CreateUserLoginChallengeRequest = {
|
|
40
|
+
username: string;
|
|
41
|
+
orgId: string;
|
|
42
|
+
};
|
|
43
|
+
export type UserLoginChallengeResponse = UserActionChallengeResponse;
|
|
44
|
+
export type CreateUserLoginRequest = SignUserActionChallengeRequest;
|
|
45
|
+
export type UserLoginResponse = {
|
|
46
|
+
token: string;
|
|
47
|
+
};
|
|
48
|
+
export type CreateUserRegistrationChallengeRequest = {
|
|
49
|
+
orgId: string;
|
|
50
|
+
username: string;
|
|
51
|
+
registrationCode: string;
|
|
52
|
+
};
|
|
53
|
+
export type UserRegistrationChallengeResponse = UserRegistrationChallenge;
|
|
54
|
+
export type CreateUserRegistrationRequest = {
|
|
55
|
+
firstFactorCredential: FirstFactorAttestation;
|
|
56
|
+
secondFactorCredential?: SecondFactorAttestation;
|
|
57
|
+
recoveryCredential?: RecoveryFactorAttestation;
|
|
58
|
+
};
|
|
59
|
+
export type UserRegistrationResponse = {
|
|
60
|
+
credential: {
|
|
61
|
+
uuid: string;
|
|
62
|
+
kind: CredentialKind;
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
user: {
|
|
66
|
+
id: string;
|
|
67
|
+
username: string;
|
|
68
|
+
orgId: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type CreateUserRecoveryRequest = {
|
|
72
|
+
recovery: RecoveryKeyAssertion;
|
|
73
|
+
newCredentials: {
|
|
74
|
+
firstFactorCredential: FirstFactorAttestation;
|
|
75
|
+
secondFactorCredential?: SecondFactorAttestation;
|
|
76
|
+
recoveryCredential?: RecoveryFactorAttestation;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export type UserRecoveryResponse = UserRegistrationResponse;
|
|
80
|
+
export declare class BaseAuthApi {
|
|
81
|
+
/**
|
|
82
|
+
* Creates a user action challenge
|
|
83
|
+
*/
|
|
84
|
+
static createUserActionChallenge(request: CreateUserActionChallengeRequest, options: DfnsBaseApiOptions): Promise<UserActionChallengeResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* Sign a user action challenge
|
|
87
|
+
*/
|
|
88
|
+
static signUserActionChallenge(request: SignUserActionChallengeRequest, options: DfnsBaseApiOptions): Promise<UserActionResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Initiates user login, by creating a challenge that will need to be signed by the user Credentials.
|
|
91
|
+
*/
|
|
92
|
+
static createUserLoginChallenge(request: CreateUserLoginChallengeRequest, options: DfnsBaseApiOptions): Promise<UserLoginChallengeResponse>;
|
|
93
|
+
/**
|
|
94
|
+
* Completes user login by sending the signed login challenge.
|
|
95
|
+
*/
|
|
96
|
+
static createUserLogin(request: CreateUserLoginRequest, options: DfnsBaseApiOptions): Promise<UserLoginResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Completes user logout by sending the user auth token.
|
|
99
|
+
*/
|
|
100
|
+
static userLogout(options: DfnsBaseApiOptions): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Initiates Registration by creating a challenge that will need to be signed by a new set of Credentials.
|
|
103
|
+
*/
|
|
104
|
+
static createUserRegistrationChallenge(request: CreateUserRegistrationChallengeRequest, options: DfnsBaseApiOptions): Promise<UserRegistrationChallengeResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Completes Registration by sending the signed registration challenge, containing the new Credential identity created.
|
|
107
|
+
*/
|
|
108
|
+
static createUserRegistration(request: CreateUserRegistrationRequest, options: DfnsBaseApiOptions): Promise<UserRegistrationResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Completes Recovery by sending the signed recovery challenge, containing the new Credential identity created.
|
|
111
|
+
*/
|
|
112
|
+
createUserRecovery(request: CreateUserRecoveryRequest, options: DfnsBaseApiOptions): Promise<UserRecoveryResponse>;
|
|
113
|
+
}
|
package/baseAuthApi.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseAuthApi = void 0;
|
|
4
|
+
const fetch_1 = require("./utils/fetch");
|
|
5
|
+
class BaseAuthApi {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a user action challenge
|
|
8
|
+
*/
|
|
9
|
+
static async createUserActionChallenge(request, options) {
|
|
10
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/action/init', {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
body: request,
|
|
13
|
+
apiOptions: options,
|
|
14
|
+
});
|
|
15
|
+
return response.json();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sign a user action challenge
|
|
19
|
+
*/
|
|
20
|
+
static async signUserActionChallenge(request, options) {
|
|
21
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/action', {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
body: request,
|
|
24
|
+
apiOptions: options,
|
|
25
|
+
});
|
|
26
|
+
return response.json();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Initiates user login, by creating a challenge that will need to be signed by the user Credentials.
|
|
30
|
+
*/
|
|
31
|
+
static async createUserLoginChallenge(request, options) {
|
|
32
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/login/init', {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
body: request,
|
|
35
|
+
apiOptions: options,
|
|
36
|
+
});
|
|
37
|
+
return response.json();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Completes user login by sending the signed login challenge.
|
|
41
|
+
*/
|
|
42
|
+
static async createUserLogin(request, options) {
|
|
43
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/login', {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
body: request,
|
|
46
|
+
apiOptions: options,
|
|
47
|
+
});
|
|
48
|
+
return response.json();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Completes user logout by sending the user auth token.
|
|
52
|
+
*/
|
|
53
|
+
static async userLogout(options) {
|
|
54
|
+
if (!options.authToken) {
|
|
55
|
+
throw new Error('authToken is required');
|
|
56
|
+
}
|
|
57
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/logout', {
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
apiOptions: options,
|
|
60
|
+
});
|
|
61
|
+
return response.json();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Initiates Registration by creating a challenge that will need to be signed by a new set of Credentials.
|
|
65
|
+
*/
|
|
66
|
+
static async createUserRegistrationChallenge(request, options) {
|
|
67
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/registration/init', {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
body: request,
|
|
70
|
+
apiOptions: options,
|
|
71
|
+
});
|
|
72
|
+
return response.json();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Completes Registration by sending the signed registration challenge, containing the new Credential identity created.
|
|
76
|
+
*/
|
|
77
|
+
static async createUserRegistration(request, options) {
|
|
78
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/registration', {
|
|
79
|
+
method: 'POST',
|
|
80
|
+
body: request,
|
|
81
|
+
apiOptions: options,
|
|
82
|
+
});
|
|
83
|
+
return response.json();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Completes Recovery by sending the signed recovery challenge, containing the new Credential identity created.
|
|
87
|
+
*/
|
|
88
|
+
async createUserRecovery(request, options) {
|
|
89
|
+
const response = await (0, fetch_1.simpleFetch)('/auth/recover/user', {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
body: request,
|
|
92
|
+
apiOptions: options,
|
|
93
|
+
});
|
|
94
|
+
return response.json();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.BaseAuthApi = BaseAuthApi;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DfnsApiClientOptions } from '../../dfnsApiClient';
|
|
2
|
+
import * as T from './types';
|
|
3
|
+
export declare class AssetsClient {
|
|
4
|
+
private apiOptions;
|
|
5
|
+
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
initiatePayment(request: T.InitiatePaymentRequest): Promise<T.InitiatePaymentResponse>;
|
|
7
|
+
getPaymentById(request: T.GetPaymentByIdRequest): Promise<T.GetPaymentByIdResponse>;
|
|
8
|
+
listPayments(request: T.ListPaymentsRequest): Promise<T.ListPaymentsResponse>;
|
|
9
|
+
createAssetAccount(request: T.CreateAssetAccountRequest): Promise<T.CreateAssetAccountResponse>;
|
|
10
|
+
getAssetAccountById(request: T.GetAssetAccountByIdRequest): Promise<T.GetAssetAccountByIdResponse>;
|
|
11
|
+
listAssetAccounts(request: T.ListAssetAccountsRequest): Promise<T.ListAssetAccountsResponse>;
|
|
12
|
+
getAssetAccountBalanceById(request: T.GetAssetAccountBalanceByIdRequest): Promise<T.GetAssetAccountBalanceByIdResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetsClient = void 0;
|
|
4
|
+
const fetch_1 = require("../../utils/fetch");
|
|
5
|
+
const url_1 = require("../../utils/url");
|
|
6
|
+
class AssetsClient {
|
|
7
|
+
constructor(apiOptions) {
|
|
8
|
+
this.apiOptions = apiOptions;
|
|
9
|
+
}
|
|
10
|
+
async initiatePayment(request) {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
|
|
12
|
+
path: { assetAccountId: request.assetAccountId },
|
|
13
|
+
query: {},
|
|
14
|
+
});
|
|
15
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: request.body,
|
|
18
|
+
apiOptions: this.apiOptions,
|
|
19
|
+
});
|
|
20
|
+
return response.json();
|
|
21
|
+
}
|
|
22
|
+
async getPaymentById(request) {
|
|
23
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments/:paymentId', {
|
|
24
|
+
path: {
|
|
25
|
+
assetAccountId: request.assetAccountId,
|
|
26
|
+
paymentId: request.paymentId,
|
|
27
|
+
},
|
|
28
|
+
query: {},
|
|
29
|
+
});
|
|
30
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
apiOptions: this.apiOptions,
|
|
33
|
+
});
|
|
34
|
+
return response.json();
|
|
35
|
+
}
|
|
36
|
+
async listPayments(request) {
|
|
37
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
|
|
38
|
+
path: { assetAccountId: request.assetAccountId },
|
|
39
|
+
query: {},
|
|
40
|
+
});
|
|
41
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
42
|
+
method: 'GET',
|
|
43
|
+
apiOptions: this.apiOptions,
|
|
44
|
+
});
|
|
45
|
+
return response.json();
|
|
46
|
+
}
|
|
47
|
+
async createAssetAccount(request) {
|
|
48
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
|
|
49
|
+
path: {},
|
|
50
|
+
query: {},
|
|
51
|
+
});
|
|
52
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body: request.body,
|
|
55
|
+
apiOptions: this.apiOptions,
|
|
56
|
+
});
|
|
57
|
+
return response.json();
|
|
58
|
+
}
|
|
59
|
+
async getAssetAccountById(request) {
|
|
60
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId', {
|
|
61
|
+
path: { assetAccountId: request.assetAccountId },
|
|
62
|
+
query: {},
|
|
63
|
+
});
|
|
64
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
65
|
+
method: 'GET',
|
|
66
|
+
apiOptions: this.apiOptions,
|
|
67
|
+
});
|
|
68
|
+
return response.json();
|
|
69
|
+
}
|
|
70
|
+
async listAssetAccounts(request) {
|
|
71
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
|
|
72
|
+
path: {},
|
|
73
|
+
query: request.query ?? {},
|
|
74
|
+
});
|
|
75
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
76
|
+
method: 'GET',
|
|
77
|
+
apiOptions: this.apiOptions,
|
|
78
|
+
});
|
|
79
|
+
return response.json();
|
|
80
|
+
}
|
|
81
|
+
async getAssetAccountBalanceById(request) {
|
|
82
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/balance', {
|
|
83
|
+
path: { assetAccountId: request.assetAccountId },
|
|
84
|
+
query: {},
|
|
85
|
+
});
|
|
86
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
87
|
+
method: 'GET',
|
|
88
|
+
apiOptions: this.apiOptions,
|
|
89
|
+
});
|
|
90
|
+
return response.json();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.AssetsClient = AssetsClient;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
+
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
+
import * as T from './types';
|
|
4
|
+
export declare class DelegatedAssetsClient {
|
|
5
|
+
private apiOptions;
|
|
6
|
+
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
initiatePaymentInit(request: T.InitiatePaymentRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
+
initiatePaymentComplete(request: T.InitiatePaymentRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.InitiatePaymentResponse>;
|
|
9
|
+
getPaymentById(request: T.GetPaymentByIdRequest): Promise<T.GetPaymentByIdResponse>;
|
|
10
|
+
listPayments(request: T.ListPaymentsRequest): Promise<T.ListPaymentsResponse>;
|
|
11
|
+
createAssetAccountInit(request: T.CreateAssetAccountRequest): Promise<UserActionChallengeResponse>;
|
|
12
|
+
createAssetAccountComplete(request: T.CreateAssetAccountRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateAssetAccountResponse>;
|
|
13
|
+
getAssetAccountById(request: T.GetAssetAccountByIdRequest): Promise<T.GetAssetAccountByIdResponse>;
|
|
14
|
+
listAssetAccounts(request: T.ListAssetAccountsRequest): Promise<T.ListAssetAccountsResponse>;
|
|
15
|
+
getAssetAccountBalanceById(request: T.GetAssetAccountBalanceByIdRequest): Promise<T.GetAssetAccountBalanceByIdResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DelegatedAssetsClient = void 0;
|
|
4
|
+
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
+
const fetch_1 = require("../../utils/fetch");
|
|
6
|
+
const url_1 = require("../../utils/url");
|
|
7
|
+
class DelegatedAssetsClient {
|
|
8
|
+
constructor(apiOptions) {
|
|
9
|
+
this.apiOptions = apiOptions;
|
|
10
|
+
}
|
|
11
|
+
async initiatePaymentInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
|
|
13
|
+
path: { assetAccountId: request.assetAccountId },
|
|
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 initiatePaymentComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
|
|
26
|
+
path: { assetAccountId: request.assetAccountId },
|
|
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 getPaymentById(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments/:paymentId', {
|
|
40
|
+
path: {
|
|
41
|
+
assetAccountId: request.assetAccountId,
|
|
42
|
+
paymentId: request.paymentId,
|
|
43
|
+
},
|
|
44
|
+
query: {},
|
|
45
|
+
});
|
|
46
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
47
|
+
method: 'GET',
|
|
48
|
+
apiOptions: this.apiOptions,
|
|
49
|
+
});
|
|
50
|
+
return response.json();
|
|
51
|
+
}
|
|
52
|
+
async listPayments(request) {
|
|
53
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
|
|
54
|
+
path: { assetAccountId: request.assetAccountId },
|
|
55
|
+
query: {},
|
|
56
|
+
});
|
|
57
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
58
|
+
method: 'GET',
|
|
59
|
+
apiOptions: this.apiOptions,
|
|
60
|
+
});
|
|
61
|
+
return response.json();
|
|
62
|
+
}
|
|
63
|
+
async createAssetAccountInit(request) {
|
|
64
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
|
|
65
|
+
path: {},
|
|
66
|
+
query: {},
|
|
67
|
+
});
|
|
68
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
69
|
+
userActionHttpMethod: 'POST',
|
|
70
|
+
userActionHttpPath: path,
|
|
71
|
+
userActionPayload: JSON.stringify(request.body),
|
|
72
|
+
userActionServerKind: 'Api',
|
|
73
|
+
}, this.apiOptions);
|
|
74
|
+
return challenge;
|
|
75
|
+
}
|
|
76
|
+
async createAssetAccountComplete(request, signedChallenge) {
|
|
77
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
|
|
78
|
+
path: {},
|
|
79
|
+
query: {},
|
|
80
|
+
});
|
|
81
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
82
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
body: request.body,
|
|
85
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
86
|
+
apiOptions: this.apiOptions,
|
|
87
|
+
});
|
|
88
|
+
return response.json();
|
|
89
|
+
}
|
|
90
|
+
async getAssetAccountById(request) {
|
|
91
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId', {
|
|
92
|
+
path: { assetAccountId: request.assetAccountId },
|
|
93
|
+
query: {},
|
|
94
|
+
});
|
|
95
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
96
|
+
method: 'GET',
|
|
97
|
+
apiOptions: this.apiOptions,
|
|
98
|
+
});
|
|
99
|
+
return response.json();
|
|
100
|
+
}
|
|
101
|
+
async listAssetAccounts(request) {
|
|
102
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
|
|
103
|
+
path: {},
|
|
104
|
+
query: request.query ?? {},
|
|
105
|
+
});
|
|
106
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
apiOptions: this.apiOptions,
|
|
109
|
+
});
|
|
110
|
+
return response.json();
|
|
111
|
+
}
|
|
112
|
+
async getAssetAccountBalanceById(request) {
|
|
113
|
+
const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/balance', {
|
|
114
|
+
path: { assetAccountId: request.assetAccountId },
|
|
115
|
+
query: {},
|
|
116
|
+
});
|
|
117
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
118
|
+
method: 'GET',
|
|
119
|
+
apiOptions: this.apiOptions,
|
|
120
|
+
});
|
|
121
|
+
return response.json();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.DelegatedAssetsClient = DelegatedAssetsClient;
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./AssetsClient"), exports);
|
|
18
|
+
__exportStar(require("./DelegatedAssetsClient"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Assets from '../datamodel/Assets';
|
|
2
|
+
export type InitiatePaymentRequest = {
|
|
3
|
+
assetAccountId: string;
|
|
4
|
+
body: Assets.CreatePaymentInput;
|
|
5
|
+
};
|
|
6
|
+
export type InitiatePaymentResponse = Assets.Payment;
|
|
7
|
+
export type GetPaymentByIdRequest = {
|
|
8
|
+
assetAccountId: string;
|
|
9
|
+
paymentId: string;
|
|
10
|
+
};
|
|
11
|
+
export type GetPaymentByIdResponse = Assets.Payment;
|
|
12
|
+
export type ListPaymentsRequest = {
|
|
13
|
+
assetAccountId: string;
|
|
14
|
+
};
|
|
15
|
+
export type ListPaymentsResponse = {
|
|
16
|
+
items: Assets.Payment[];
|
|
17
|
+
};
|
|
18
|
+
export type CreateAssetAccountRequest = {
|
|
19
|
+
body: Assets.CreateAssetAccountInput;
|
|
20
|
+
};
|
|
21
|
+
export type CreateAssetAccountResponse = Assets.AssetAccount;
|
|
22
|
+
export type GetAssetAccountByIdRequest = {
|
|
23
|
+
assetAccountId: string;
|
|
24
|
+
};
|
|
25
|
+
export type GetAssetAccountByIdResponse = Assets.AssetAccount;
|
|
26
|
+
export type ListAssetAccountsRequest = {
|
|
27
|
+
query?: {
|
|
28
|
+
status?: Assets.AssetAccountStatus;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type ListAssetAccountsResponse = {
|
|
32
|
+
items: Assets.AssetAccount[];
|
|
33
|
+
};
|
|
34
|
+
export type GetAssetAccountBalanceByIdRequest = {
|
|
35
|
+
assetAccountId: string;
|
|
36
|
+
};
|
|
37
|
+
export type GetAssetAccountBalanceByIdResponse = Assets.AssetAccountBalance;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DfnsApiClientOptions } from '../../dfnsApiClient';
|
|
2
|
+
import * as T from './types';
|
|
3
|
+
export declare class AuthClient {
|
|
4
|
+
private apiOptions;
|
|
5
|
+
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
createDelegatedUserRegistration(request: T.CreateDelegatedUserRegistrationRequest): Promise<T.CreateDelegatedUserRegistrationResponse>;
|
|
7
|
+
createUserRegistration(request: T.CreateUserRegistrationRequest): Promise<T.CreateUserRegistrationResponse>;
|
|
8
|
+
createDelegatedUserLogin(request: T.CreateDelegatedUserLoginRequest): Promise<T.CreateDelegatedUserLoginResponse>;
|
|
9
|
+
createUserActionSignatureChallenge(request: T.CreateUserActionSignatureChallengeRequest): Promise<T.CreateUserActionSignatureChallengeResponse>;
|
|
10
|
+
createUserActionSignature(request: T.CreateUserActionSignatureRequest): Promise<T.CreateUserActionSignatureResponse>;
|
|
11
|
+
createUserCredentialChallenge(request: T.CreateUserCredentialChallengeRequest): Promise<T.CreateUserCredentialChallengeResponse>;
|
|
12
|
+
createUserCredential(request: T.CreateUserCredentialRequest): Promise<T.CreateUserCredentialResponse>;
|
|
13
|
+
activateCredential(request: T.ActivateCredentialRequest): Promise<T.ActivateCredentialResponse>;
|
|
14
|
+
deactivateCredential(request: T.DeactivateCredentialRequest): Promise<T.DeactivateCredentialResponse>;
|
|
15
|
+
listUserCredentials(): Promise<T.ListUserCredentialsResponse>;
|
|
16
|
+
createUserActionSignatureFromCode(request: T.CreateUserActionSignatureFromCodeRequest): Promise<T.CreateUserActionSignatureFromCodeResponse>;
|
|
17
|
+
createCodeUserActionSignatureChallenge(request: T.CreateCodeUserActionSignatureChallengeRequest): Promise<T.CreateCodeUserActionSignatureChallengeResponse>;
|
|
18
|
+
createCodeUserActionSignature(request: T.CreateCodeUserActionSignatureRequest): Promise<T.CreateCodeUserActionSignatureResponse>;
|
|
19
|
+
listPersonalAccessTokens(): Promise<T.ListPersonalAccessTokensResponse>;
|
|
20
|
+
createPersonalAccessToken(request: T.CreatePersonalAccessTokenRequest): Promise<T.CreatePersonalAccessTokenResponse>;
|
|
21
|
+
getPersonalAccessTokens(request: T.GetPersonalAccessTokensRequest): Promise<T.GetPersonalAccessTokensResponse>;
|
|
22
|
+
updatePersonalAccessToken(request: T.UpdatePersonalAccessTokenRequest): Promise<T.UpdatePersonalAccessTokenResponse>;
|
|
23
|
+
archivePersonalAccessToken(request: T.ArchivePersonalAccessTokenRequest): Promise<T.ArchivePersonalAccessTokenResponse>;
|
|
24
|
+
activatePersonalAccessToken(request: T.ActivatePersonalAccessTokenRequest): Promise<T.ActivatePersonalAccessTokenResponse>;
|
|
25
|
+
deactivatePersonalAccessToken(request: T.DeactivatePersonalAccessTokenRequest): Promise<T.DeactivatePersonalAccessTokenResponse>;
|
|
26
|
+
listServiceAccounts(): Promise<T.ListServiceAccountsResponse>;
|
|
27
|
+
createServiceAccount(request: T.CreateServiceAccountRequest): Promise<T.CreateServiceAccountResponse>;
|
|
28
|
+
getServiceAccount(request: T.GetServiceAccountRequest): Promise<T.GetServiceAccountResponse>;
|
|
29
|
+
updateServiceAccount(request: T.UpdateServiceAccountRequest): Promise<T.UpdateServiceAccountResponse>;
|
|
30
|
+
archiveServiceAccount(request: T.ArchiveServiceAccountRequest): Promise<T.ArchiveServiceAccountResponse>;
|
|
31
|
+
activateServiceAccount(request: T.ActivateServiceAccountRequest): Promise<T.ActivateServiceAccountResponse>;
|
|
32
|
+
deactivateServiceAccount(request: T.DeactivateServiceAccountRequest): Promise<T.DeactivateServiceAccountResponse>;
|
|
33
|
+
listUsers(): Promise<T.ListUsersResponse>;
|
|
34
|
+
createUser(request: T.CreateUserRequest): Promise<T.CreateUserResponse>;
|
|
35
|
+
getUser(request: T.GetUserRequest): Promise<T.GetUserResponse>;
|
|
36
|
+
updateUser(request: T.UpdateUserRequest): Promise<T.UpdateUserResponse>;
|
|
37
|
+
archiveUser(request: T.ArchiveUserRequest): Promise<T.ArchiveUserResponse>;
|
|
38
|
+
activateUser(request: T.ActivateUserRequest): Promise<T.ActivateUserResponse>;
|
|
39
|
+
deactivateUser(request: T.DeactivateUserRequest): Promise<T.DeactivateUserResponse>;
|
|
40
|
+
listApplications(): Promise<T.ListApplicationsResponse>;
|
|
41
|
+
createApplication(request: T.CreateApplicationRequest): Promise<T.CreateApplicationResponse>;
|
|
42
|
+
getApplication(request: T.GetApplicationRequest): Promise<T.GetApplicationResponse>;
|
|
43
|
+
updateApplication(request: T.UpdateApplicationRequest): Promise<T.UpdateApplicationResponse>;
|
|
44
|
+
archiveApplication(request: T.ArchiveApplicationRequest): Promise<T.ArchiveApplicationResponse>;
|
|
45
|
+
activateApplication(request: T.ActivateApplicationRequest): Promise<T.ActivateApplicationResponse>;
|
|
46
|
+
deactivateApplication(request: T.DeactivateApplicationRequest): Promise<T.DeactivateApplicationResponse>;
|
|
47
|
+
createUserRecovery(request: T.CreateUserRecoveryRequest): Promise<T.CreateUserRecoveryResponse>;
|
|
48
|
+
restartDelegatedUserRegistration(request: T.RestartDelegatedUserRegistrationRequest): Promise<T.RestartDelegatedUserRegistrationResponse>;
|
|
49
|
+
createDelegatedUserRecovery(request: T.CreateDelegatedUserRecoveryRequest): Promise<T.CreateDelegatedUserRecoveryResponse>;
|
|
50
|
+
}
|