@dfns/sdk 0.4.3 → 0.5.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.
Files changed (102) hide show
  1. package/dfnsApiClient.d.ts +0 -6
  2. package/dfnsApiClient.js +0 -12
  3. package/dfnsDelegatedApiClient.d.ts +0 -6
  4. package/dfnsDelegatedApiClient.js +0 -12
  5. package/generated/auth/client.d.ts +2 -0
  6. package/generated/auth/client.js +24 -0
  7. package/generated/auth/delegatedClient.d.ts +2 -0
  8. package/generated/auth/delegatedClient.js +24 -0
  9. package/generated/auth/types.d.ts +66 -12
  10. package/generated/permissions/types.d.ts +2 -2
  11. package/generated/policies/types.d.ts +15 -0
  12. package/generated/wallets/types.d.ts +105 -18
  13. package/package.json +1 -1
  14. package/store.d.ts +3 -32
  15. package/codegen/Assets/AssetsClient.d.ts +0 -13
  16. package/codegen/Assets/AssetsClient.js +0 -93
  17. package/codegen/Assets/DelegatedAssetsClient.d.ts +0 -16
  18. package/codegen/Assets/DelegatedAssetsClient.js +0 -124
  19. package/codegen/Assets/index.d.ts +0 -3
  20. package/codegen/Assets/index.js +0 -19
  21. package/codegen/Assets/types.d.ts +0 -37
  22. package/codegen/Assets/types.js +0 -2
  23. package/codegen/Auth/AuthClient.d.ts +0 -50
  24. package/codegen/Auth/AuthClient.js +0 -518
  25. package/codegen/Auth/DelegatedAuthClient.d.ts +0 -78
  26. package/codegen/Auth/DelegatedAuthClient.js +0 -936
  27. package/codegen/Auth/index.d.ts +0 -3
  28. package/codegen/Auth/index.js +0 -19
  29. package/codegen/Auth/types.d.ts +0 -177
  30. package/codegen/Auth/types.js +0 -2
  31. package/codegen/Callbacks/CallbacksClient.d.ts +0 -12
  32. package/codegen/Callbacks/CallbacksClient.js +0 -78
  33. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +0 -15
  34. package/codegen/Callbacks/DelegatedCallbacksClient.js +0 -110
  35. package/codegen/Callbacks/index.d.ts +0 -3
  36. package/codegen/Callbacks/index.js +0 -19
  37. package/codegen/Callbacks/types.d.ts +0 -23
  38. package/codegen/Callbacks/types.js +0 -2
  39. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +0 -21
  40. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +0 -189
  41. package/codegen/PublicKeys/PublicKeysClient.d.ts +0 -16
  42. package/codegen/PublicKeys/PublicKeysClient.js +0 -128
  43. package/codegen/PublicKeys/index.d.ts +0 -3
  44. package/codegen/PublicKeys/index.js +0 -19
  45. package/codegen/PublicKeys/types.d.ts +0 -51
  46. package/codegen/PublicKeys/types.js +0 -2
  47. package/codegen/Wallets/DelegatedWalletsClient.d.ts +0 -32
  48. package/codegen/Wallets/DelegatedWalletsClient.js +0 -325
  49. package/codegen/Wallets/WalletsClient.d.ts +0 -24
  50. package/codegen/Wallets/WalletsClient.js +0 -219
  51. package/codegen/Wallets/index.d.ts +0 -3
  52. package/codegen/Wallets/index.js +0 -19
  53. package/codegen/Wallets/types.d.ts +0 -101
  54. package/codegen/Wallets/types.js +0 -2
  55. package/codegen/datamodel/Assets/errors.d.ts +0 -11
  56. package/codegen/datamodel/Assets/errors.js +0 -17
  57. package/codegen/datamodel/Assets/index.d.ts +0 -3
  58. package/codegen/datamodel/Assets/index.js +0 -19
  59. package/codegen/datamodel/Assets/responses.d.ts +0 -47
  60. package/codegen/datamodel/Assets/responses.js +0 -2
  61. package/codegen/datamodel/Assets/types.d.ts +0 -219
  62. package/codegen/datamodel/Assets/types.js +0 -75
  63. package/codegen/datamodel/Auth/errors.d.ts +0 -0
  64. package/codegen/datamodel/Auth/errors.js +0 -1
  65. package/codegen/datamodel/Auth/index.d.ts +0 -2
  66. package/codegen/datamodel/Auth/index.js +0 -18
  67. package/codegen/datamodel/Auth/responses.d.ts +0 -358
  68. package/codegen/datamodel/Auth/responses.js +0 -2
  69. package/codegen/datamodel/Auth/types.d.ts +0 -933
  70. package/codegen/datamodel/Auth/types.js +0 -149
  71. package/codegen/datamodel/Callbacks/errors.d.ts +0 -0
  72. package/codegen/datamodel/Callbacks/errors.js +0 -1
  73. package/codegen/datamodel/Callbacks/index.d.ts +0 -2
  74. package/codegen/datamodel/Callbacks/index.js +0 -18
  75. package/codegen/datamodel/Callbacks/responses.d.ts +0 -36
  76. package/codegen/datamodel/Callbacks/responses.js +0 -2
  77. package/codegen/datamodel/Callbacks/types.d.ts +0 -43
  78. package/codegen/datamodel/Callbacks/types.js +0 -39
  79. package/codegen/datamodel/Foundations/errors.d.ts +0 -131
  80. package/codegen/datamodel/Foundations/errors.js +0 -182
  81. package/codegen/datamodel/Foundations/index.d.ts +0 -2
  82. package/codegen/datamodel/Foundations/index.js +0 -18
  83. package/codegen/datamodel/Foundations/responses.d.ts +0 -0
  84. package/codegen/datamodel/Foundations/responses.js +0 -1
  85. package/codegen/datamodel/Foundations/types.d.ts +0 -9795
  86. package/codegen/datamodel/Foundations/types.js +0 -57763
  87. package/codegen/datamodel/PublicKeys/errors.d.ts +0 -0
  88. package/codegen/datamodel/PublicKeys/errors.js +0 -1
  89. package/codegen/datamodel/PublicKeys/index.d.ts +0 -2
  90. package/codegen/datamodel/PublicKeys/index.js +0 -18
  91. package/codegen/datamodel/PublicKeys/responses.d.ts +0 -56
  92. package/codegen/datamodel/PublicKeys/responses.js +0 -2
  93. package/codegen/datamodel/PublicKeys/types.d.ts +0 -223
  94. package/codegen/datamodel/PublicKeys/types.js +0 -59
  95. package/codegen/datamodel/Wallets/errors.d.ts +0 -0
  96. package/codegen/datamodel/Wallets/errors.js +0 -1
  97. package/codegen/datamodel/Wallets/index.d.ts +0 -2
  98. package/codegen/datamodel/Wallets/index.js +0 -18
  99. package/codegen/datamodel/Wallets/responses.d.ts +0 -92
  100. package/codegen/datamodel/Wallets/responses.js +0 -2
  101. package/codegen/datamodel/Wallets/types.d.ts +0 -790
  102. package/codegen/datamodel/Wallets/types.js +0 -293
@@ -1,149 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthIdentityKind = exports.UserAuthKind = exports.AccessTokenKind = exports.ServerKind = exports.CredentialFactor = exports.FidoCredentialsTransportKind = exports.ApplicationKind = exports.AuthenticatorAttestationOptions = exports.AuthenticatorRequirementOptions = exports.UserKind = exports.CredentialKind = void 0;
4
- /**
5
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
6
- */
7
- var CredentialKind;
8
- (function (CredentialKind) {
9
- // FIXME: Missing documentation for Fido2
10
- CredentialKind["Fido2"] = "Fido2";
11
- // FIXME: Missing documentation for Key
12
- CredentialKind["Key"] = "Key";
13
- // FIXME: Missing documentation for Password
14
- CredentialKind["Password"] = "Password";
15
- // FIXME: Missing documentation for Totp
16
- CredentialKind["Totp"] = "Totp";
17
- // FIXME: Missing documentation for RecoveryKey
18
- CredentialKind["RecoveryKey"] = "RecoveryKey";
19
- })(CredentialKind || (exports.CredentialKind = CredentialKind = {}));
20
- /**
21
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
22
- */
23
- var UserKind;
24
- (function (UserKind) {
25
- // FIXME: Missing documentation for CustomerEmployee
26
- UserKind["CustomerEmployee"] = "CustomerEmployee";
27
- // FIXME: Missing documentation for DfnsStaff
28
- UserKind["DfnsStaff"] = "DfnsStaff";
29
- // FIXME: Missing documentation for EndUser
30
- UserKind["EndUser"] = "EndUser";
31
- // FIXME: Missing documentation for Pat
32
- UserKind["Pat"] = "Pat";
33
- // FIXME: Missing documentation for Application
34
- UserKind["Application"] = "Application";
35
- // FIXME: Missing documentation for ServiceAccount
36
- UserKind["ServiceAccount"] = "ServiceAccount";
37
- })(UserKind || (exports.UserKind = UserKind = {}));
38
- /**
39
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
40
- */
41
- var AuthenticatorRequirementOptions;
42
- (function (AuthenticatorRequirementOptions) {
43
- // FIXME: Missing documentation for required
44
- AuthenticatorRequirementOptions["required"] = "required";
45
- // FIXME: Missing documentation for preferred
46
- AuthenticatorRequirementOptions["preferred"] = "preferred";
47
- // FIXME: Missing documentation for discouraged
48
- AuthenticatorRequirementOptions["discouraged"] = "discouraged";
49
- })(AuthenticatorRequirementOptions || (exports.AuthenticatorRequirementOptions = AuthenticatorRequirementOptions = {}));
50
- /**
51
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
52
- */
53
- var AuthenticatorAttestationOptions;
54
- (function (AuthenticatorAttestationOptions) {
55
- // FIXME: Missing documentation for none
56
- AuthenticatorAttestationOptions["none"] = "none";
57
- // FIXME: Missing documentation for indirect
58
- AuthenticatorAttestationOptions["indirect"] = "indirect";
59
- // FIXME: Missing documentation for direct
60
- AuthenticatorAttestationOptions["direct"] = "direct";
61
- // FIXME: Missing documentation for enterprise
62
- AuthenticatorAttestationOptions["enterprise"] = "enterprise";
63
- })(AuthenticatorAttestationOptions || (exports.AuthenticatorAttestationOptions = AuthenticatorAttestationOptions = {}));
64
- /**
65
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
66
- */
67
- var ApplicationKind;
68
- (function (ApplicationKind) {
69
- // FIXME: Missing documentation for ServerSideApplication
70
- ApplicationKind["ServerSideApplication"] = "ServerSideApplication";
71
- // FIXME: Missing documentation for ClientSideApplication
72
- ApplicationKind["ClientSideApplication"] = "ClientSideApplication";
73
- })(ApplicationKind || (exports.ApplicationKind = ApplicationKind = {}));
74
- /**
75
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
76
- */
77
- var FidoCredentialsTransportKind;
78
- (function (FidoCredentialsTransportKind) {
79
- // FIXME: Missing documentation for usb
80
- FidoCredentialsTransportKind["usb"] = "usb";
81
- // FIXME: Missing documentation for nfc
82
- FidoCredentialsTransportKind["nfc"] = "nfc";
83
- // FIXME: Missing documentation for ble
84
- FidoCredentialsTransportKind["ble"] = "ble";
85
- // FIXME: Missing documentation for internal
86
- FidoCredentialsTransportKind["internal"] = "internal";
87
- // FIXME: Missing documentation for hybrid
88
- FidoCredentialsTransportKind["hybrid"] = "hybrid";
89
- })(FidoCredentialsTransportKind || (exports.FidoCredentialsTransportKind = FidoCredentialsTransportKind = {}));
90
- /**
91
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
92
- */
93
- var CredentialFactor;
94
- (function (CredentialFactor) {
95
- // FIXME: Missing documentation for first
96
- CredentialFactor["first"] = "first";
97
- // FIXME: Missing documentation for second
98
- CredentialFactor["second"] = "second";
99
- // FIXME: Missing documentation for either
100
- CredentialFactor["either"] = "either";
101
- })(CredentialFactor || (exports.CredentialFactor = CredentialFactor = {}));
102
- /**
103
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
104
- */
105
- var ServerKind;
106
- (function (ServerKind) {
107
- // FIXME: Missing documentation for Api
108
- ServerKind["Api"] = "Api";
109
- // FIXME: Missing documentation for Staff
110
- ServerKind["Staff"] = "Staff";
111
- })(ServerKind || (exports.ServerKind = ServerKind = {}));
112
- /**
113
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
114
- */
115
- var AccessTokenKind;
116
- (function (AccessTokenKind) {
117
- // FIXME: Missing documentation for ServiceAccount
118
- AccessTokenKind["ServiceAccount"] = "ServiceAccount";
119
- // FIXME: Missing documentation for Pat
120
- AccessTokenKind["Pat"] = "Pat";
121
- // FIXME: Missing documentation for Application
122
- AccessTokenKind["Application"] = "Application";
123
- })(AccessTokenKind || (exports.AccessTokenKind = AccessTokenKind = {}));
124
- /**
125
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
126
- */
127
- var UserAuthKind;
128
- (function (UserAuthKind) {
129
- // FIXME: Missing documentation for EndUser
130
- UserAuthKind["EndUser"] = "EndUser";
131
- // FIXME: Missing documentation for CustomerEmployee
132
- UserAuthKind["CustomerEmployee"] = "CustomerEmployee";
133
- // FIXME: Missing documentation for DfnsStaff
134
- UserAuthKind["DfnsStaff"] = "DfnsStaff";
135
- })(UserAuthKind || (exports.UserAuthKind = UserAuthKind = {}));
136
- /**
137
- * @deprecated import equivalent type from '@dfns/sdk/types/auth' instead
138
- */
139
- var AuthIdentityKind;
140
- (function (AuthIdentityKind) {
141
- // FIXME: Missing documentation for DfnsStaffIdentity
142
- AuthIdentityKind["DfnsStaffIdentity"] = "DfnsStaffIdentity";
143
- // FIXME: Missing documentation for OrgEmployeeIdentity
144
- AuthIdentityKind["OrgEmployeeIdentity"] = "OrgEmployeeIdentity";
145
- // FIXME: Missing documentation for OrgApiKeyIdentity
146
- AuthIdentityKind["OrgApiKeyIdentity"] = "OrgApiKeyIdentity";
147
- // FIXME: Missing documentation for DfnsService
148
- AuthIdentityKind["DfnsService"] = "DfnsService";
149
- })(AuthIdentityKind || (exports.AuthIdentityKind = AuthIdentityKind = {}));
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- export * from './responses';
2
- export * from './types';
@@ -1,18 +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("./responses"), exports);
18
- __exportStar(require("./types"), exports);
@@ -1,36 +0,0 @@
1
- import { BadRequestError, EntityNotFoundError, ForbiddenError, UnauthorizedError } from '../Foundations';
2
- import { CallbackEvent, CallbackSubscription } from './types';
3
- export type CreateCallbackSubscriptionSuccess = CallbackSubscription;
4
- export type CreateCallbackSubscriptionError = {
5
- error: BadRequestError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
6
- };
7
- export type CreateCallbackSubscriptionResponse = CreateCallbackSubscriptionSuccess | CreateCallbackSubscriptionError;
8
- export type GetCallbackSubscriptionByIdSuccess = CallbackSubscription;
9
- export type GetCallbackSubscriptionByIdError = {
10
- error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
11
- };
12
- export type GetCallbackSubscriptionByIdResponse = GetCallbackSubscriptionByIdSuccess | GetCallbackSubscriptionByIdError;
13
- export type ListCallbackSubscriptionsSuccess = {
14
- items: CallbackSubscription[];
15
- };
16
- export type ListCallbackSubscriptionsError = {
17
- error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
18
- };
19
- export type ListCallbackSubscriptionsResponse = ListCallbackSubscriptionsSuccess | ListCallbackSubscriptionsError;
20
- export type ArchiveCallbackSubscriptionSuccess = CallbackSubscription;
21
- export type ArchiveCallbackSubscriptionError = {
22
- error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
23
- };
24
- export type ArchiveCallbackSubscriptionResponse = ArchiveCallbackSubscriptionSuccess | ArchiveCallbackSubscriptionError;
25
- export type GetCallbackEventByIdSuccess = CallbackEvent;
26
- export type GetCallbackEventByIdError = {
27
- error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
28
- };
29
- export type GetCallbackEventByIdResponse = GetCallbackEventByIdSuccess | GetCallbackEventByIdError;
30
- export type ListCallbackEventsSuccess = {
31
- items: CallbackEvent[];
32
- };
33
- export type ListCallbackEventsError = {
34
- error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
35
- };
36
- export type ListCallbackEventsResponse = ListCallbackEventsSuccess | ListCallbackEventsError;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,43 +0,0 @@
1
- import { DocumentSnapshot, EntityId, IsoDatetime } from '../Foundations';
2
- export type CallbackEvent = {
3
- id: EntityId;
4
- orgId: EntityId;
5
- externalId?: string;
6
- callbackSubscriptionId: EntityId;
7
- kind: CallbackEventKind;
8
- documentSnapshot: DocumentSnapshot;
9
- dateCreated: IsoDatetime;
10
- status: CallbackEventStatus;
11
- };
12
- export type CallbackSubscription = {
13
- id: EntityId;
14
- orgId: EntityId;
15
- externalId?: string;
16
- eventKind: CallbackEventKind;
17
- url: string;
18
- status: CallbackSubscriptionStatus;
19
- dateCreated: IsoDatetime;
20
- };
21
- export type CreateCallbackSubscriptionInput = {
22
- externalId?: string;
23
- eventKind: CallbackEventKind;
24
- url: string;
25
- };
26
- export declare enum CallbackEventKind {
27
- PaymentInitiated = "PaymentInitiated",
28
- PaymentExecuted = "PaymentExecuted",
29
- PaymentConfirmed = "PaymentConfirmed",
30
- PaymentReceived = "PaymentReceived",
31
- TransactionBroadcasted = "TransactionBroadcasted",
32
- WalletCreated = "WalletCreated",
33
- PolicyActivated = "PolicyActivated"
34
- }
35
- export declare enum CallbackEventStatus {
36
- Sent = "Sent",
37
- Failed = "Failed"
38
- }
39
- export declare enum CallbackSubscriptionStatus {
40
- Enabled = "Enabled",
41
- Disabled = "Disabled",
42
- Archived = "Archived"
43
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CallbackSubscriptionStatus = exports.CallbackEventStatus = exports.CallbackEventKind = void 0;
4
- // FIXME: Missing documentation for CallbackEventKind
5
- var CallbackEventKind;
6
- (function (CallbackEventKind) {
7
- // FIXME: Missing documentation for PaymentInitiated
8
- CallbackEventKind["PaymentInitiated"] = "PaymentInitiated";
9
- // FIXME: Missing documentation for PaymentExecuted
10
- CallbackEventKind["PaymentExecuted"] = "PaymentExecuted";
11
- // FIXME: Missing documentation for PaymentConfirmed
12
- CallbackEventKind["PaymentConfirmed"] = "PaymentConfirmed";
13
- // FIXME: Missing documentation for PaymentReceived
14
- CallbackEventKind["PaymentReceived"] = "PaymentReceived";
15
- // FIXME: Missing documentation for TransactionBroadcasted
16
- CallbackEventKind["TransactionBroadcasted"] = "TransactionBroadcasted";
17
- // FIXME: Missing documentation for WalletCreated
18
- CallbackEventKind["WalletCreated"] = "WalletCreated";
19
- // FIXME: Missing documentation for PolicyActivated
20
- CallbackEventKind["PolicyActivated"] = "PolicyActivated";
21
- })(CallbackEventKind || (exports.CallbackEventKind = CallbackEventKind = {}));
22
- // FIXME: Missing documentation for CallbackEventStatus
23
- var CallbackEventStatus;
24
- (function (CallbackEventStatus) {
25
- // FIXME: Missing documentation for Sent
26
- CallbackEventStatus["Sent"] = "Sent";
27
- // FIXME: Missing documentation for Failed
28
- CallbackEventStatus["Failed"] = "Failed";
29
- })(CallbackEventStatus || (exports.CallbackEventStatus = CallbackEventStatus = {}));
30
- // FIXME: Missing documentation for CallbackSubscriptionStatus
31
- var CallbackSubscriptionStatus;
32
- (function (CallbackSubscriptionStatus) {
33
- // FIXME: Missing documentation for Enabled
34
- CallbackSubscriptionStatus["Enabled"] = "Enabled";
35
- // FIXME: Missing documentation for Disabled
36
- CallbackSubscriptionStatus["Disabled"] = "Disabled";
37
- // FIXME: Missing documentation for Archived
38
- CallbackSubscriptionStatus["Archived"] = "Archived";
39
- })(CallbackSubscriptionStatus || (exports.CallbackSubscriptionStatus = CallbackSubscriptionStatus = {}));
@@ -1,131 +0,0 @@
1
- export declare class DfnsError extends Error {
2
- name: string;
3
- errorName: string;
4
- httpStatus: number;
5
- shouldTriggerInvestigation: boolean;
6
- serviceName: string;
7
- causes?: string[];
8
- isDfnsError: boolean;
9
- constructor(message: string, serviceName: string, causes?: string[], shouldTriggerInvestigation?: boolean);
10
- toErrorObject(): {
11
- name: string;
12
- errorName: string;
13
- serviceName: string;
14
- message: string;
15
- causes: string[] | undefined;
16
- shouldTriggerInvestigation: boolean;
17
- httpStatus: number;
18
- stackTrace: string;
19
- };
20
- toString(): string;
21
- }
22
- export declare class ServiceUnavailableError extends DfnsError {
23
- name: string;
24
- serviceName: string;
25
- message: string;
26
- causes?: string[];
27
- shouldTriggerInvestigaton: boolean;
28
- isDfnsError: boolean;
29
- httpStatus: number;
30
- errorName: string;
31
- }
32
- export declare class NotImplementedError extends DfnsError {
33
- name: string;
34
- serviceName: string;
35
- message: string;
36
- causes?: string[];
37
- shouldTriggerInvestigaton: boolean;
38
- isDfnsError: boolean;
39
- httpStatus: number;
40
- errorName: string;
41
- }
42
- export declare class InternalServerError extends DfnsError {
43
- name: string;
44
- serviceName: string;
45
- message: string;
46
- causes?: string[];
47
- shouldTriggerInvestigaton: boolean;
48
- isDfnsError: boolean;
49
- httpStatus: number;
50
- errorName: string;
51
- }
52
- export declare class UnprocessableContentError extends DfnsError {
53
- name: string;
54
- serviceName: string;
55
- message: string;
56
- causes?: string[];
57
- shouldTriggerInvestigaton: boolean;
58
- isDfnsError: boolean;
59
- httpStatus: number;
60
- errorName: string;
61
- }
62
- export declare class EntityExpiredError extends DfnsError {
63
- name: string;
64
- serviceName: string;
65
- message: string;
66
- causes?: string[];
67
- shouldTriggerInvestigaton: boolean;
68
- isDfnsError: boolean;
69
- httpStatus: number;
70
- errorName: string;
71
- }
72
- export declare class DuplicateError extends DfnsError {
73
- name: string;
74
- serviceName: string;
75
- message: string;
76
- causes?: string[];
77
- shouldTriggerInvestigaton: boolean;
78
- isDfnsError: boolean;
79
- httpStatus: number;
80
- errorName: string;
81
- }
82
- export declare class EntityNotFoundError extends DfnsError {
83
- name: string;
84
- serviceName: string;
85
- message: string;
86
- causes?: string[];
87
- shouldTriggerInvestigaton: boolean;
88
- isDfnsError: boolean;
89
- httpStatus: number;
90
- errorName: string;
91
- }
92
- export declare class ForbiddenError extends DfnsError {
93
- name: string;
94
- serviceName: string;
95
- message: string;
96
- causes?: string[];
97
- shouldTriggerInvestigaton: boolean;
98
- isDfnsError: boolean;
99
- httpStatus: number;
100
- errorName: string;
101
- }
102
- export declare class PaymentRequiredError extends DfnsError {
103
- name: string;
104
- serviceName: string;
105
- message: string;
106
- causes?: string[];
107
- shouldTriggerInvestigaton: boolean;
108
- isDfnsError: boolean;
109
- httpStatus: number;
110
- errorName: string;
111
- }
112
- export declare class UnauthorizedError extends DfnsError {
113
- name: string;
114
- serviceName: string;
115
- message: string;
116
- causes?: string[];
117
- shouldTriggerInvestigaton: boolean;
118
- isDfnsError: boolean;
119
- httpStatus: number;
120
- errorName: string;
121
- }
122
- export declare class BadRequestError extends DfnsError {
123
- name: string;
124
- serviceName: string;
125
- message: string;
126
- causes?: string[];
127
- shouldTriggerInvestigaton: boolean;
128
- isDfnsError: boolean;
129
- httpStatus: number;
130
- errorName: string;
131
- }
@@ -1,182 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BadRequestError = exports.UnauthorizedError = exports.PaymentRequiredError = exports.ForbiddenError = exports.EntityNotFoundError = exports.DuplicateError = exports.EntityExpiredError = exports.UnprocessableContentError = exports.InternalServerError = exports.NotImplementedError = exports.ServiceUnavailableError = exports.DfnsError = void 0;
4
- class DfnsError extends Error {
5
- constructor(message, serviceName, causes = [], shouldTriggerInvestigation = true) {
6
- super(message);
7
- this.name = 'DfnsError';
8
- this.errorName = '';
9
- this.httpStatus = 500;
10
- this.shouldTriggerInvestigation = false;
11
- this.serviceName = 'SERVICE_NOT_DEFINED';
12
- this.causes = [];
13
- this.isDfnsError = true;
14
- this.serviceName = serviceName || process.env.SERVICE_NAME;
15
- this.shouldTriggerInvestigation = shouldTriggerInvestigation;
16
- this.causes = causes;
17
- if (typeof serviceName !== 'string') {
18
- this.serviceName = 'SERVICE_NOT_DEFINED';
19
- this.shouldTriggerInvestigation = true;
20
- }
21
- }
22
- toErrorObject() {
23
- const stackTrace = this.stack || '';
24
- return {
25
- name: this.name,
26
- errorName: this.errorName,
27
- serviceName: this.serviceName,
28
- message: this.message,
29
- causes: this.causes,
30
- shouldTriggerInvestigation: this.shouldTriggerInvestigation,
31
- httpStatus: this.httpStatus,
32
- stackTrace,
33
- };
34
- }
35
- toString() {
36
- return JSON.stringify(this.toErrorObject());
37
- }
38
- }
39
- exports.DfnsError = DfnsError;
40
- class ServiceUnavailableError extends DfnsError {
41
- constructor() {
42
- super(...arguments);
43
- this.name = 'ServiceUnavailableError';
44
- // FIXME: Missing documentation for isDfnsError
45
- this.isDfnsError = true;
46
- // FIXME: Missing documentation for httpStatus
47
- this.httpStatus = 503;
48
- // FIXME: Missing documentation for errorName
49
- this.errorName = 'Service Unavailable';
50
- }
51
- }
52
- exports.ServiceUnavailableError = ServiceUnavailableError;
53
- class NotImplementedError extends DfnsError {
54
- constructor() {
55
- super(...arguments);
56
- this.name = 'NotImplementedError';
57
- // FIXME: Missing documentation for isDfnsError
58
- this.isDfnsError = true;
59
- // FIXME: Missing documentation for httpStatus
60
- this.httpStatus = 501;
61
- // FIXME: Missing documentation for errorName
62
- this.errorName = 'Not Implemented';
63
- }
64
- }
65
- exports.NotImplementedError = NotImplementedError;
66
- class InternalServerError extends DfnsError {
67
- constructor() {
68
- super(...arguments);
69
- this.name = 'InternalServerError';
70
- // FIXME: Missing documentation for isDfnsError
71
- this.isDfnsError = true;
72
- // FIXME: Missing documentation for httpStatus
73
- this.httpStatus = 500;
74
- // FIXME: Missing documentation for errorName
75
- this.errorName = 'Internal Server Error';
76
- }
77
- }
78
- exports.InternalServerError = InternalServerError;
79
- class UnprocessableContentError extends DfnsError {
80
- constructor() {
81
- super(...arguments);
82
- this.name = 'UnprocessableContentError';
83
- // FIXME: Missing documentation for isDfnsError
84
- this.isDfnsError = true;
85
- // FIXME: Missing documentation for httpStatus
86
- this.httpStatus = 422;
87
- // FIXME: Missing documentation for errorName
88
- this.errorName = 'Unprocessable Content';
89
- }
90
- }
91
- exports.UnprocessableContentError = UnprocessableContentError;
92
- class EntityExpiredError extends DfnsError {
93
- constructor() {
94
- super(...arguments);
95
- this.name = 'EntityExpiredError';
96
- // FIXME: Missing documentation for isDfnsError
97
- this.isDfnsError = true;
98
- // FIXME: Missing documentation for httpStatus
99
- this.httpStatus = 410;
100
- // FIXME: Missing documentation for errorName
101
- this.errorName = 'Resource Expired';
102
- }
103
- }
104
- exports.EntityExpiredError = EntityExpiredError;
105
- class DuplicateError extends DfnsError {
106
- constructor() {
107
- super(...arguments);
108
- this.name = 'DuplicateError';
109
- // FIXME: Missing documentation for isDfnsError
110
- this.isDfnsError = true;
111
- // FIXME: Missing documentation for httpStatus
112
- this.httpStatus = 409;
113
- // FIXME: Missing documentation for errorName
114
- this.errorName = 'Duplicate';
115
- }
116
- }
117
- exports.DuplicateError = DuplicateError;
118
- class EntityNotFoundError extends DfnsError {
119
- constructor() {
120
- super(...arguments);
121
- this.name = 'EntityNotFoundError';
122
- // FIXME: Missing documentation for isDfnsError
123
- this.isDfnsError = true;
124
- // FIXME: Missing documentation for httpStatus
125
- this.httpStatus = 404;
126
- // FIXME: Missing documentation for errorName
127
- this.errorName = 'Not Found';
128
- }
129
- }
130
- exports.EntityNotFoundError = EntityNotFoundError;
131
- class ForbiddenError extends DfnsError {
132
- constructor() {
133
- super(...arguments);
134
- this.name = 'ForbiddenError';
135
- // FIXME: Missing documentation for isDfnsError
136
- this.isDfnsError = true;
137
- // FIXME: Missing documentation for httpStatus
138
- this.httpStatus = 403;
139
- // FIXME: Missing documentation for errorName
140
- this.errorName = 'Access To Resource Not Allowed';
141
- }
142
- }
143
- exports.ForbiddenError = ForbiddenError;
144
- class PaymentRequiredError extends DfnsError {
145
- constructor() {
146
- super(...arguments);
147
- this.name = 'PaymentRequiredError';
148
- // FIXME: Missing documentation for isDfnsError
149
- this.isDfnsError = true;
150
- // FIXME: Missing documentation for httpStatus
151
- this.httpStatus = 402;
152
- // FIXME: Missing documentation for errorName
153
- this.errorName = 'Payment Required';
154
- }
155
- }
156
- exports.PaymentRequiredError = PaymentRequiredError;
157
- class UnauthorizedError extends DfnsError {
158
- constructor() {
159
- super(...arguments);
160
- this.name = 'UnauthorizedError';
161
- // FIXME: Missing documentation for isDfnsError
162
- this.isDfnsError = true;
163
- // FIXME: Missing documentation for httpStatus
164
- this.httpStatus = 401;
165
- // FIXME: Missing documentation for errorName
166
- this.errorName = 'Unauthorized';
167
- }
168
- }
169
- exports.UnauthorizedError = UnauthorizedError;
170
- class BadRequestError extends DfnsError {
171
- constructor() {
172
- super(...arguments);
173
- this.name = 'BadRequestError';
174
- // FIXME: Missing documentation for isDfnsError
175
- this.isDfnsError = true;
176
- // FIXME: Missing documentation for httpStatus
177
- this.httpStatus = 400;
178
- // FIXME: Missing documentation for errorName
179
- this.errorName = 'Bad Request';
180
- }
181
- }
182
- exports.BadRequestError = BadRequestError;
@@ -1,2 +0,0 @@
1
- export * from './errors';
2
- export * from './types';
@@ -1,18 +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("./errors"), exports);
18
- __exportStar(require("./types"), exports);
File without changes
@@ -1 +0,0 @@
1
- "use strict";