@scalekit-sdk/node 2.2.0-beta.1 → 2.2.1
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/README.md +5 -5
- package/{reference.md → REFERENCE.md} +530 -748
- package/lib/auth.d.ts +9 -6
- package/lib/auth.js +4 -20
- package/lib/auth.js.map +1 -1
- package/lib/connect.d.ts +3 -3
- package/lib/connect.js +1 -2
- package/lib/connect.js.map +1 -1
- package/lib/connection.d.ts +2 -2
- package/lib/connection.js +4 -4
- package/lib/connection.js.map +1 -1
- package/lib/core.js +2 -2
- package/lib/core.js.map +1 -1
- package/lib/directory.d.ts +2 -2
- package/lib/directory.js +7 -7
- package/lib/directory.js.map +1 -1
- package/lib/domain.d.ts +6 -5
- package/lib/domain.js +4 -5
- package/lib/domain.js.map +1 -1
- package/lib/errors/base-exception.d.ts +1 -1
- package/lib/errors/base-exception.js +1 -1
- package/lib/errors/base-exception.js.map +1 -1
- package/lib/organization.d.ts +10 -9
- package/lib/organization.js +11 -9
- package/lib/organization.js.map +1 -1
- package/lib/passwordless.d.ts +2 -2
- package/lib/passwordless.js +8 -7
- package/lib/passwordless.js.map +1 -1
- package/lib/permission.d.ts +6 -5
- package/lib/permission.js +10 -11
- package/lib/permission.js.map +1 -1
- package/lib/pkg/grpc/buf/validate/validate_pb.d.ts +7 -0
- package/lib/pkg/grpc/buf/validate/validate_pb.js +25 -0
- package/lib/pkg/grpc/buf/validate/validate_pb.js.map +1 -0
- package/lib/pkg/grpc/google/api/annotations_pb.d.ts +7 -0
- package/lib/pkg/grpc/google/api/annotations_pb.js +25 -0
- package/lib/pkg/grpc/google/api/annotations_pb.js.map +1 -0
- package/lib/pkg/grpc/google/api/field_behavior_pb.d.ts +7 -0
- package/lib/pkg/grpc/google/api/field_behavior_pb.js +25 -0
- package/lib/pkg/grpc/google/api/field_behavior_pb.js.map +1 -0
- package/lib/pkg/grpc/google/api/visibility_pb.d.ts +7 -0
- package/lib/pkg/grpc/google/api/visibility_pb.js +25 -0
- package/lib/pkg/grpc/google/api/visibility_pb.js.map +1 -0
- package/lib/pkg/grpc/protoc-gen-openapiv2/options/annotations_pb.d.ts +7 -0
- package/lib/pkg/grpc/protoc-gen-openapiv2/options/annotations_pb.js +25 -0
- package/lib/pkg/grpc/protoc-gen-openapiv2/options/annotations_pb.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.d.ts +48 -42
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js +27 -263
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +371 -325
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +132 -835
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_pb.d.ts +113 -87
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_pb.js +45 -201
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.d.ts +262 -265
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js +92 -938
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +162 -157
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +42 -313
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +1488 -1459
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +353 -2362
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/directories/directories_pb.d.ts +520 -483
- package/lib/pkg/grpc/scalekit/v1/directories/directories_pb.js +224 -1555
- package/lib/pkg/grpc/scalekit/v1/directories/directories_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.d.ts +219 -191
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js +96 -553
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.d.ts +76 -102
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js +37 -393
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.d.ts +36 -26
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js +20 -69
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.d.ts +447 -400
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +163 -1238
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.d.ts +622 -556
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js +201 -1718
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.d.ts +135 -132
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js +55 -518
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +445 -413
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +142 -1490
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
- package/lib/role.d.ts +8 -7
- package/lib/role.js +14 -14
- package/lib/role.js.map +1 -1
- package/lib/scalekit.d.ts +0 -4
- package/lib/scalekit.js +0 -4
- package/lib/scalekit.js.map +1 -1
- package/lib/session.js +15 -24
- package/lib/session.js.map +1 -1
- package/lib/user.d.ts +6 -5
- package/lib/user.js +17 -20
- package/lib/user.js.map +1 -1
- package/lib/webauthn.js +6 -5
- package/lib/webauthn.js.map +1 -1
- package/package.json +12 -10
- package/.github/dependabot.yml +0 -10
- package/.nvmrc +0 -1
- package/buf.gen.yaml +0 -24
- package/jest.config.js +0 -15
- package/lib/connected-accounts.d.ts +0 -119
- package/lib/connected-accounts.js +0 -241
- package/lib/connected-accounts.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.d.ts +0 -19
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.js +0 -27
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.d.ts +0 -118
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js +0 -126
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_connect.d.ts +0 -37
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_connect.js +0 -45
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.d.ts +0 -82
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js +0 -90
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.d.ts +0 -87
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.js +0 -95
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.d.ts +0 -718
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.js +0 -893
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.d.ts +0 -172
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +0 -180
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/directories/directories_connect.d.ts +0 -154
- package/lib/pkg/grpc/scalekit/v1/directories/directories_connect.js +0 -162
- package/lib/pkg/grpc/scalekit/v1/directories/directories_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.d.ts +0 -73
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.js +0 -81
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.d.ts +0 -171
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +0 -179
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.d.ts +0 -250
- package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.js +0 -258
- package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.d.ts +0 -46
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.js +0 -54
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.d.ts +0 -75
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js +0 -83
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.d.ts +0 -431
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js +0 -627
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js.map +0 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.d.ts +0 -173
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js +0 -181
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js.map +0 -1
- package/lib/tools.d.ts +0 -75
- package/lib/tools.js +0 -127
- package/lib/tools.js.map +0 -1
- package/src/auth.ts +0 -99
- package/src/connect.ts +0 -33
- package/src/connected-accounts.ts +0 -358
- package/src/connection.ts +0 -267
- package/src/constants/user.ts +0 -22
- package/src/core.ts +0 -139
- package/src/directory.ts +0 -431
- package/src/domain.ts +0 -272
- package/src/errors/base-exception.ts +0 -262
- package/src/errors/index.ts +0 -3
- package/src/errors/specific-exceptions.ts +0 -88
- package/src/index.ts +0 -10
- package/src/organization.ts +0 -568
- package/src/passwordless.ts +0 -138
- package/src/permission.ts +0 -310
- package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.ts +0 -26
- package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.ts +0 -342
- package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +0 -125
- package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +0 -1213
- package/src/pkg/grpc/scalekit/v1/auth/passwordless_connect.ts +0 -44
- package/src/pkg/grpc/scalekit/v1/auth/passwordless_pb.ts +0 -336
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +0 -89
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +0 -1263
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +0 -573
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.ts +0 -94
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.ts +0 -1294
- package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +0 -179
- package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +0 -3846
- package/src/pkg/grpc/scalekit/v1/directories/directories_connect.ts +0 -161
- package/src/pkg/grpc/scalekit/v1/directories/directories_pb.ts +0 -2119
- package/src/pkg/grpc/scalekit/v1/domains/domains_connect.ts +0 -80
- package/src/pkg/grpc/scalekit/v1/domains/domains_pb.ts +0 -855
- package/src/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.ts +0 -524
- package/src/pkg/grpc/scalekit/v1/options/options_pb.ts +0 -230
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +0 -178
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +0 -1766
- package/src/pkg/grpc/scalekit/v1/roles/roles_connect.ts +0 -257
- package/src/pkg/grpc/scalekit/v1/roles/roles_pb.ts +0 -2395
- package/src/pkg/grpc/scalekit/v1/sessions/sessions_connect.ts +0 -53
- package/src/pkg/grpc/scalekit/v1/sessions/sessions_pb.ts +0 -749
- package/src/pkg/grpc/scalekit/v1/tools/tools_connect.ts +0 -82
- package/src/pkg/grpc/scalekit/v1/tools/tools_pb.ts +0 -847
- package/src/pkg/grpc/scalekit/v1/users/users_connect.ts +0 -180
- package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +0 -2151
- package/src/role.ts +0 -461
- package/src/scalekit.ts +0 -809
- package/src/session.ts +0 -337
- package/src/tools.ts +0 -166
- package/src/types/auth.ts +0 -73
- package/src/types/organization.ts +0 -12
- package/src/types/scalekit.ts +0 -50
- package/src/types/user.ts +0 -21
- package/src/user.ts +0 -825
- package/src/webauthn.ts +0 -98
- package/tests/README.md +0 -25
- package/tests/connected-accounts.test.ts +0 -472
- package/tests/connection.test.ts +0 -42
- package/tests/directory.test.ts +0 -46
- package/tests/domain.test.ts +0 -293
- package/tests/organization.test.ts +0 -81
- package/tests/passwordless.test.ts +0 -108
- package/tests/permission.test.ts +0 -399
- package/tests/role.test.ts +0 -323
- package/tests/scalekit.test.ts +0 -104
- package/tests/setup.ts +0 -34
- package/tests/tools.test.ts +0 -239
- package/tests/users.test.ts +0 -168
- package/tests/utils/test-data.ts +0 -481
- package/tsconfig.json +0 -19
package/src/domain.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { PromiseClient } from "@connectrpc/connect";
|
|
2
|
-
import GrpcConnect from "./connect";
|
|
3
|
-
import CoreClient from "./core";
|
|
4
|
-
import { DomainService } from "./pkg/grpc/scalekit/v1/domains/domains_connect";
|
|
5
|
-
import {
|
|
6
|
-
CreateDomainResponse,
|
|
7
|
-
GetDomainResponse,
|
|
8
|
-
ListDomainResponse,
|
|
9
|
-
DomainType,
|
|
10
|
-
} from "./pkg/grpc/scalekit/v1/domains/domains_pb";
|
|
11
|
-
import { Empty } from "@bufbuild/protobuf";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Client for managing domains for organizations.
|
|
15
|
-
*
|
|
16
|
-
* Domains enable automatic organization identification during SSO flows based on user email addresses.
|
|
17
|
-
* You can configure domains as ORGANIZATION_DOMAIN (for SSO routing) or ALLOWED_EMAIL_DOMAIN
|
|
18
|
-
* (for restricting which email domains can automatically join an organization).
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* const scalekitClient = new ScalekitClient(envUrl, clientId, clientSecret);
|
|
22
|
-
* const domainClient = scalekitClient.domain;
|
|
23
|
-
*
|
|
24
|
-
* @see {@link https://docs.scalekit.com/apis/#tag/domains | Domain API Documentation}
|
|
25
|
-
*/
|
|
26
|
-
export default class DomainClient {
|
|
27
|
-
private client: PromiseClient<typeof DomainService>;
|
|
28
|
-
constructor(
|
|
29
|
-
private readonly grpcConncet: GrpcConnect,
|
|
30
|
-
private readonly coreClient: CoreClient
|
|
31
|
-
) {
|
|
32
|
-
this.client = this.grpcConncet.createClient(DomainService);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Adds a new domain configuration to an organization for SSO routing or user suggestions.
|
|
37
|
-
*
|
|
38
|
-
* Domains serve two purposes based on their type:
|
|
39
|
-
* - **ORGANIZATION_DOMAIN**: Used to identify the SSO connection for the organization. When users
|
|
40
|
-
* authenticate with email addresses from this domain, they're automatically routed to the
|
|
41
|
-
* organization's SSO provider.
|
|
42
|
-
* - **ALLOWED_EMAIL_DOMAIN**: Enables users to join the organization with automatic suggestions
|
|
43
|
-
* in the organization switcher during signup/login.
|
|
44
|
-
*
|
|
45
|
-
* Note: Public disposable domains (gmail.com, outlook.com, etc.) are automatically blocked for security.
|
|
46
|
-
*
|
|
47
|
-
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
48
|
-
* @param {string} name - The domain name (e.g., "acme.com", "example.org")
|
|
49
|
-
* @param {object} [options] - Optional domain configuration
|
|
50
|
-
* @param {DomainType | string} [options.domainType] - Domain type: 'ALLOWED_EMAIL_DOMAIN' or 'ORGANIZATION_DOMAIN'
|
|
51
|
-
*
|
|
52
|
-
* @returns {Promise<CreateDomainResponse>} The created domain with ID and verification status
|
|
53
|
-
*
|
|
54
|
-
* @throws {Error} If domain type is invalid
|
|
55
|
-
* @throws {Error} If domain is a blocked public domain (gmail.com, etc.)
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* // Add SSO routing domain
|
|
59
|
-
* const response = await scalekitClient.domain.createDomain(
|
|
60
|
-
* 'org_123456',
|
|
61
|
-
* 'acme.com',
|
|
62
|
-
* { domainType: 'ORGANIZATION_DOMAIN' }
|
|
63
|
-
* );
|
|
64
|
-
* console.log('Domain created:', response.domain.id);
|
|
65
|
-
* console.log('Verification required:', response.domain.verificationStatus);
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* // Add allowed email domain for user suggestions
|
|
69
|
-
* await scalekitClient.domain.createDomain(
|
|
70
|
-
* 'org_123456',
|
|
71
|
-
* 'acme.io',
|
|
72
|
-
* { domainType: 'ALLOWED_EMAIL_DOMAIN' }
|
|
73
|
-
* );
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* // Create domain with default type
|
|
77
|
-
* await scalekitClient.domain.createDomain('org_123456', 'company.com');
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* // Configure multiple domains for an organization
|
|
81
|
-
* const domains = ['acme.com', 'acme.io', 'acme.net'];
|
|
82
|
-
* for (const domain of domains) {
|
|
83
|
-
* await scalekitClient.domain.createDomain('org_123456', domain, {
|
|
84
|
-
* domainType: 'ORGANIZATION_DOMAIN'
|
|
85
|
-
* });
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* @see {@link https://docs.scalekit.com/apis/#tag/domains | Create Domain API}
|
|
89
|
-
* @see {@link listDomains} - List all domains for an organization
|
|
90
|
-
* @see {@link deleteDomain} - Remove a domain
|
|
91
|
-
*/
|
|
92
|
-
async createDomain(
|
|
93
|
-
organizationId: string,
|
|
94
|
-
name: string,
|
|
95
|
-
options?: { domainType?: DomainType | string }
|
|
96
|
-
): Promise<CreateDomainResponse> {
|
|
97
|
-
let domainTypeValue: DomainType | undefined;
|
|
98
|
-
if (options?.domainType) {
|
|
99
|
-
if (typeof options.domainType === "string") {
|
|
100
|
-
domainTypeValue =
|
|
101
|
-
DomainType[options.domainType as keyof typeof DomainType];
|
|
102
|
-
if (domainTypeValue === undefined) {
|
|
103
|
-
throw new Error("Invalid domain type");
|
|
104
|
-
}
|
|
105
|
-
} else {
|
|
106
|
-
domainTypeValue = options.domainType;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return this.coreClient.connectExec(this.client.createDomain, {
|
|
111
|
-
identities: {
|
|
112
|
-
case: "organizationId",
|
|
113
|
-
value: organizationId,
|
|
114
|
-
},
|
|
115
|
-
domain: {
|
|
116
|
-
domain: name,
|
|
117
|
-
...(!!domainTypeValue && { domainType: domainTypeValue }),
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Retrieves detailed information about a specific domain configuration.
|
|
124
|
-
*
|
|
125
|
-
* Returns complete domain details including the domain name, type (ORGANIZATION_DOMAIN or
|
|
126
|
-
* ALLOWED_EMAIL_DOMAIN), verification status, and when it was created/updated. Use this to
|
|
127
|
-
* check domain configuration status or verification requirements.
|
|
128
|
-
*
|
|
129
|
-
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
130
|
-
* @param {string} domainId - The domain ID (format: "domain_...")
|
|
131
|
-
*
|
|
132
|
-
* @returns {Promise<GetDomainResponse>} Complete domain configuration and status
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* // Check domain verification status
|
|
136
|
-
* const response = await scalekitClient.domain.getDomain(
|
|
137
|
-
* 'org_123456',
|
|
138
|
-
* 'domain_abc123'
|
|
139
|
-
* );
|
|
140
|
-
* console.log('Domain:', response.domain.domain);
|
|
141
|
-
* console.log('Type:', response.domain.domainType);
|
|
142
|
-
* console.log('Verified:', response.domain.verificationStatus);
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* // Verify domain configuration after creation
|
|
146
|
-
* const created = await scalekitClient.domain.createDomain(
|
|
147
|
-
* 'org_123456',
|
|
148
|
-
* 'acme.com',
|
|
149
|
-
* { domainType: 'ORGANIZATION_DOMAIN' }
|
|
150
|
-
* );
|
|
151
|
-
*
|
|
152
|
-
* // Later, check if domain has been verified
|
|
153
|
-
* const domain = await scalekitClient.domain.getDomain(
|
|
154
|
-
* 'org_123456',
|
|
155
|
-
* created.domain.id
|
|
156
|
-
* );
|
|
157
|
-
* if (domain.domain.verificationStatus === 'VERIFIED') {
|
|
158
|
-
* console.log('Domain is ready for SSO routing');
|
|
159
|
-
* }
|
|
160
|
-
*
|
|
161
|
-
* @see {@link https://docs.scalekit.com/apis/#tag/domains | Get Domain API}
|
|
162
|
-
* @see {@link createDomain} - Add a new domain
|
|
163
|
-
* @see {@link listDomains} - List all domains for an organization
|
|
164
|
-
*/
|
|
165
|
-
async getDomain(
|
|
166
|
-
organizationId: string,
|
|
167
|
-
domainId: string
|
|
168
|
-
): Promise<GetDomainResponse> {
|
|
169
|
-
return this.coreClient.connectExec(this.client.getDomain, {
|
|
170
|
-
id: domainId,
|
|
171
|
-
identities: {
|
|
172
|
-
case: "organizationId",
|
|
173
|
-
value: organizationId,
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
private resolveDomainType(
|
|
179
|
-
domainType?: DomainType | string
|
|
180
|
-
): DomainType | undefined {
|
|
181
|
-
if (domainType == null) return;
|
|
182
|
-
if (typeof domainType !== 'string') return domainType;
|
|
183
|
-
const resolved = DomainType[domainType as keyof typeof DomainType];
|
|
184
|
-
if (resolved === undefined) {
|
|
185
|
-
throw new Error(
|
|
186
|
-
`Invalid domain type: ${domainType}. Expected ALLOWED_EMAIL_DOMAIN or ORGANIZATION_DOMAIN`
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
return resolved;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Retrieves all domain configurations for an organization.
|
|
194
|
-
*
|
|
195
|
-
* Returns a complete list of domains configured for the organization, including both
|
|
196
|
-
* ORGANIZATION_DOMAIN (for SSO routing) and ALLOWED_EMAIL_DOMAIN (for user suggestions).
|
|
197
|
-
* Each domain includes its verification status, type, and configuration details.
|
|
198
|
-
*
|
|
199
|
-
* Use this to audit domain configuration, check which domains are verified, or display
|
|
200
|
-
* domain settings in an admin dashboard.
|
|
201
|
-
*
|
|
202
|
-
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
203
|
-
*
|
|
204
|
-
* @param options Optional parameters for filtering domains
|
|
205
|
-
* @param {DomainType | string} options.domainType Filter domains by type (ALLOWED_EMAIL_DOMAIN or ORGANIZATION_DOMAIN)
|
|
206
|
-
* @returns {Promise<ListDomainResponse>} List of all domains with their configurations
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* // List all domains for an organization
|
|
210
|
-
* const response = await scalekitClient.domain.listDomains('org_123456');
|
|
211
|
-
* console.log(`Found ${response.domains.length} domains`);
|
|
212
|
-
* response.domains.forEach(domain => {
|
|
213
|
-
* console.log(`- ${domain.domain} (${domain.domainType}): ${domain.verificationStatus}`);
|
|
214
|
-
* });
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* // Check which domains are verified for SSO
|
|
218
|
-
* const response = await scalekitClient.domain.listDomains('org_123456');
|
|
219
|
-
* const verifiedSSODomains = response.domains.filter(
|
|
220
|
-
* d => d.domainType === 'ORGANIZATION_DOMAIN' && d.verificationStatus === 'VERIFIED'
|
|
221
|
-
* );
|
|
222
|
-
* console.log('Verified SSO domains:', verifiedSSODomains.map(d => d.domain));
|
|
223
|
-
* @see {@link https://docs.scalekit.com/apis/#tag/domains | List Domains API}
|
|
224
|
-
* @see {@link createDomain} - Add a new domain
|
|
225
|
-
* @see {@link getDomain} - Get details for a specific domain
|
|
226
|
-
* @see {@link deleteDomain} - Remove a domain
|
|
227
|
-
*/
|
|
228
|
-
async listDomains(organizationId: string, options?: { domainType?: DomainType | string }): Promise<ListDomainResponse> {
|
|
229
|
-
const domainTypeValue = this.resolveDomainType(options?.domainType);
|
|
230
|
-
|
|
231
|
-
return this.coreClient.connectExec(
|
|
232
|
-
this.client.listDomains,
|
|
233
|
-
{
|
|
234
|
-
identities: {
|
|
235
|
-
case: 'organizationId',
|
|
236
|
-
value: organizationId
|
|
237
|
-
},
|
|
238
|
-
...(!!domainTypeValue && { domainType: domainTypeValue })
|
|
239
|
-
},
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Deletes a domain from an organization.
|
|
245
|
-
*
|
|
246
|
-
* Removes the domain configuration from the organization. Users with email addresses from
|
|
247
|
-
* this domain will no longer be automatically routed to this organization's SSO connection.
|
|
248
|
-
*
|
|
249
|
-
* @param {string} organizationId - The organization ID
|
|
250
|
-
* @param {string} domainId - The domain ID to delete
|
|
251
|
-
*
|
|
252
|
-
* @returns {Promise<Empty>} Empty response on successful deletion
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* // Remove a domain from an organization
|
|
256
|
-
* await scalekitClient.domain.deleteDomain('org_123456', 'domain_abc123');
|
|
257
|
-
* console.log('Domain deleted successfully');
|
|
258
|
-
*
|
|
259
|
-
* @see {@link https://docs.scalekit.com/apis/#tag/domains | Delete Domain API}
|
|
260
|
-
* @see {@link createDomain} - Add a new domain
|
|
261
|
-
* @see {@link listDomains} - List all domains for an organization
|
|
262
|
-
*/
|
|
263
|
-
async deleteDomain(organizationId: string, domainId: string): Promise<Empty> {
|
|
264
|
-
return this.coreClient.connectExec(this.client.deleteDomain, {
|
|
265
|
-
id: domainId,
|
|
266
|
-
identities: {
|
|
267
|
-
case: "organizationId",
|
|
268
|
-
value: organizationId,
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { ConnectError, Code } from '@connectrpc/connect';
|
|
2
|
-
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { ErrorInfo } from '../pkg/grpc/scalekit/v1/errdetails/errdetails_pb';
|
|
4
|
-
|
|
5
|
-
// gRPC to HTTP status mapping
|
|
6
|
-
const GRPC_TO_HTTP: Record<number, number> = {
|
|
7
|
-
[Code.InvalidArgument]: 400,
|
|
8
|
-
[Code.FailedPrecondition]: 400,
|
|
9
|
-
[Code.OutOfRange]: 400,
|
|
10
|
-
[Code.Unauthenticated]: 401,
|
|
11
|
-
[Code.PermissionDenied]: 403,
|
|
12
|
-
[Code.NotFound]: 404,
|
|
13
|
-
[Code.AlreadyExists]: 409,
|
|
14
|
-
[Code.Aborted]: 409,
|
|
15
|
-
[Code.ResourceExhausted]: 429,
|
|
16
|
-
[Code.Canceled]: 499,
|
|
17
|
-
[Code.DataLoss]: 500,
|
|
18
|
-
[Code.Unknown]: 500,
|
|
19
|
-
[Code.Internal]: 500,
|
|
20
|
-
[Code.Unimplemented]: 501,
|
|
21
|
-
[Code.Unavailable]: 503,
|
|
22
|
-
[Code.DeadlineExceeded]: 504,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// HTTP to gRPC status mapping
|
|
26
|
-
const HTTP_TO_GRPC: Record<number, number> = {
|
|
27
|
-
200: Code.Unknown, // No direct mapping for 200
|
|
28
|
-
400: Code.InvalidArgument,
|
|
29
|
-
401: Code.Unauthenticated,
|
|
30
|
-
403: Code.PermissionDenied,
|
|
31
|
-
404: Code.NotFound,
|
|
32
|
-
409: Code.AlreadyExists,
|
|
33
|
-
429: Code.ResourceExhausted,
|
|
34
|
-
500: Code.Internal,
|
|
35
|
-
501: Code.Unimplemented,
|
|
36
|
-
503: Code.Unavailable,
|
|
37
|
-
504: Code.DeadlineExceeded,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// HTTP status constants
|
|
41
|
-
const HTTP_STATUS = {
|
|
42
|
-
'OK': 200,
|
|
43
|
-
'BAD_REQUEST': 400,
|
|
44
|
-
'UNAUTHORIZED': 401,
|
|
45
|
-
'FORBIDDEN': 403,
|
|
46
|
-
'NOT_FOUND': 404,
|
|
47
|
-
'CONFLICT': 409,
|
|
48
|
-
'TOO_MANY_REQUESTS': 429,
|
|
49
|
-
'INTERNAL_SERVER_ERROR': 500,
|
|
50
|
-
'NOT_IMPLEMENTED': 501,
|
|
51
|
-
'SERVICE_UNAVAILABLE': 503,
|
|
52
|
-
'GATEWAY_TIMEOUT': 504,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Base exception class
|
|
56
|
-
export class ScalekitException extends Error {
|
|
57
|
-
constructor(error: any) {
|
|
58
|
-
super(error?.message || error?.toString() || 'Unknown error');
|
|
59
|
-
this.name = 'ScalekitException';
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Webhook verification error
|
|
64
|
-
export class WebhookVerificationError extends ScalekitException {
|
|
65
|
-
constructor(error: any) {
|
|
66
|
-
super(error);
|
|
67
|
-
this.name = 'WebhookVerificationError';
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Token validation failure exception
|
|
72
|
-
export class ScalekitValidateTokenFailureException extends ScalekitException {
|
|
73
|
-
constructor(error: any) {
|
|
74
|
-
super(error);
|
|
75
|
-
this.name = 'ScalekitValidateTokenFailureException';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Base server exception
|
|
80
|
-
export class ScalekitServerException extends ScalekitException {
|
|
81
|
-
private _grpcStatus: Code;
|
|
82
|
-
private _httpStatus: number;
|
|
83
|
-
private _message: string | null;
|
|
84
|
-
private _errDetails: any;
|
|
85
|
-
private _errorCode: string | null;
|
|
86
|
-
private _unpackedDetails: ErrorInfo[];
|
|
87
|
-
|
|
88
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
89
|
-
super(error);
|
|
90
|
-
|
|
91
|
-
this._unpackedDetails = [];
|
|
92
|
-
|
|
93
|
-
if (this.isAxiosResponse(error)) {
|
|
94
|
-
// Handle HTTP Response errors
|
|
95
|
-
if (error.statusText && typeof error.statusText === 'string') {
|
|
96
|
-
this._httpStatus = HTTP_STATUS[error.statusText.toUpperCase() as keyof typeof HTTP_STATUS] || HTTP_STATUS.INTERNAL_SERVER_ERROR;
|
|
97
|
-
} else {
|
|
98
|
-
this._httpStatus = HTTP_STATUS.INTERNAL_SERVER_ERROR;
|
|
99
|
-
}
|
|
100
|
-
this._grpcStatus = HTTP_TO_GRPC[error.status] || Code.Unknown;
|
|
101
|
-
this._errorCode = error.statusText;
|
|
102
|
-
this._errDetails = error.data;
|
|
103
|
-
this._message = null;
|
|
104
|
-
} else {
|
|
105
|
-
// Handle gRPC ConnectError
|
|
106
|
-
this._grpcStatus = error.code;
|
|
107
|
-
this._httpStatus = GRPC_TO_HTTP[error.code] || 500;
|
|
108
|
-
this._message = error.message;
|
|
109
|
-
this._errDetails = error.findDetails(ErrorInfo);
|
|
110
|
-
this._errorCode = null;
|
|
111
|
-
|
|
112
|
-
// Unpack error details
|
|
113
|
-
for (const detail of this._errDetails) {
|
|
114
|
-
this._unpackedDetails.push(detail);
|
|
115
|
-
if (!this._errorCode) {
|
|
116
|
-
this._errorCode = detail.errorCode;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
this.name = 'ScalekitServerException';
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
private isAxiosResponse(error: any): error is AxiosResponse {
|
|
125
|
-
return error && typeof error.status === 'number' && typeof error.statusText === 'string';
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// String representation
|
|
129
|
-
toString(): string {
|
|
130
|
-
const border = '='.repeat(40);
|
|
131
|
-
|
|
132
|
-
if (this._unpackedDetails.length > 0) {
|
|
133
|
-
let detailsStr = JSON.stringify(this._unpackedDetails, null, 2);
|
|
134
|
-
|
|
135
|
-
// Format the JSON string for better readability
|
|
136
|
-
|
|
137
|
-
if (detailsStr.startsWith("[") && detailsStr.includes("\n")) {
|
|
138
|
-
detailsStr = "[\n" + detailsStr.substring(1);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return `\n${border}\n` +
|
|
142
|
-
`Error Code: ${this._errorCode}\n` +
|
|
143
|
-
`GRPC: (${this.getGrpcStatusName()}: ${this._grpcStatus})\n` +
|
|
144
|
-
`HTTP: (${this.getHttpStatusName()}: ${this._httpStatus})\n` +
|
|
145
|
-
`Error Details:\n` +
|
|
146
|
-
`${this._message}: ${detailsStr}\n${border}\n`;
|
|
147
|
-
} else {
|
|
148
|
-
return `\n${border}\n` +
|
|
149
|
-
`Error Code: ${this._errorCode}\n` +
|
|
150
|
-
`GRPC: (${this.getGrpcStatusName()}: ${this._grpcStatus})\n` +
|
|
151
|
-
`HTTP: (${this.getHttpStatusName()}: ${this._httpStatus})\n` +
|
|
152
|
-
`Error Details: ${this._errDetails}\n${border}\n`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Helper method to get gRPC status name
|
|
157
|
-
private getGrpcStatusName(): string {
|
|
158
|
-
switch (this._grpcStatus) {
|
|
159
|
-
case Code.InvalidArgument: return 'INVALID_ARGUMENT';
|
|
160
|
-
case Code.FailedPrecondition: return 'FAILED_PRECONDITION';
|
|
161
|
-
case Code.OutOfRange: return 'OUT_OF_RANGE';
|
|
162
|
-
case Code.Unauthenticated: return 'UNAUTHENTICATED';
|
|
163
|
-
case Code.PermissionDenied: return 'PERMISSION_DENIED';
|
|
164
|
-
case Code.NotFound: return 'NOT_FOUND';
|
|
165
|
-
case Code.AlreadyExists: return 'ALREADY_EXISTS';
|
|
166
|
-
case Code.Aborted: return 'ABORTED';
|
|
167
|
-
case Code.ResourceExhausted: return 'RESOURCE_EXHAUSTED';
|
|
168
|
-
case Code.Canceled: return 'CANCELED';
|
|
169
|
-
case Code.DataLoss: return 'DATA_LOSS';
|
|
170
|
-
case Code.Unknown: return 'UNKNOWN';
|
|
171
|
-
case Code.Internal: return 'INTERNAL';
|
|
172
|
-
case Code.Unimplemented: return 'UNIMPLEMENTED';
|
|
173
|
-
case Code.Unavailable: return 'UNAVAILABLE';
|
|
174
|
-
case Code.DeadlineExceeded: return 'DEADLINE_EXCEEDED';
|
|
175
|
-
default: return 'UNKNOWN';
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Helper method to get HTTP status name
|
|
180
|
-
private getHttpStatusName(): string {
|
|
181
|
-
switch (this._httpStatus) {
|
|
182
|
-
case 200: return 'OK';
|
|
183
|
-
case 400: return 'BAD_REQUEST';
|
|
184
|
-
case 401: return 'UNAUTHORIZED';
|
|
185
|
-
case 403: return 'FORBIDDEN';
|
|
186
|
-
case 404: return 'NOT_FOUND';
|
|
187
|
-
case 409: return 'CONFLICT';
|
|
188
|
-
case 429: return 'TOO_MANY_REQUESTS';
|
|
189
|
-
case 500: return 'INTERNAL_SERVER_ERROR';
|
|
190
|
-
case 501: return 'NOT_IMPLEMENTED';
|
|
191
|
-
case 503: return 'SERVICE_UNAVAILABLE';
|
|
192
|
-
case 504: return 'GATEWAY_TIMEOUT';
|
|
193
|
-
default: return 'INTERNAL_SERVER_ERROR';
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Getters
|
|
198
|
-
get grpcStatus(): Code {
|
|
199
|
-
return this._grpcStatus;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
get httpStatus(): number {
|
|
203
|
-
return this._httpStatus;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
get errorCode(): string | null {
|
|
207
|
-
return this._errorCode;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
get message(): string {
|
|
211
|
-
return this._message || super.message;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
get errDetails(): any {
|
|
215
|
-
return this._errDetails;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
get unpackedDetails(): ErrorInfo[] {
|
|
219
|
-
return this._unpackedDetails;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
static promote(error: AxiosResponse | ConnectError): ScalekitServerException {
|
|
223
|
-
// Use dynamic import to avoid circular dependency
|
|
224
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
225
|
-
const specific = require('./specific-exceptions');
|
|
226
|
-
const grpcStatus = error instanceof ConnectError
|
|
227
|
-
? error.code
|
|
228
|
-
: HTTP_TO_GRPC[error.status] || Code.Unknown;
|
|
229
|
-
|
|
230
|
-
switch (grpcStatus) {
|
|
231
|
-
case Code.InvalidArgument:
|
|
232
|
-
case Code.FailedPrecondition:
|
|
233
|
-
case Code.OutOfRange:
|
|
234
|
-
return new specific.ScalekitBadRequestException(error);
|
|
235
|
-
case Code.Unauthenticated:
|
|
236
|
-
return new specific.ScalekitUnauthorizedException(error);
|
|
237
|
-
case Code.PermissionDenied:
|
|
238
|
-
return new specific.ScalekitForbiddenException(error);
|
|
239
|
-
case Code.NotFound:
|
|
240
|
-
return new specific.ScalekitNotFoundException(error);
|
|
241
|
-
case Code.AlreadyExists:
|
|
242
|
-
case Code.Aborted:
|
|
243
|
-
return new specific.ScalekitConflictException(error);
|
|
244
|
-
case Code.ResourceExhausted:
|
|
245
|
-
return new specific.ScalekitTooManyRequestsException(error);
|
|
246
|
-
case Code.Canceled:
|
|
247
|
-
return new specific.ScalekitCancelledException(error);
|
|
248
|
-
case Code.DataLoss:
|
|
249
|
-
case Code.Unknown:
|
|
250
|
-
case Code.Internal:
|
|
251
|
-
return new specific.ScalekitInternalServerException(error);
|
|
252
|
-
case Code.Unimplemented:
|
|
253
|
-
return new specific.ScalekitNotImplementedException(error);
|
|
254
|
-
case Code.Unavailable:
|
|
255
|
-
return new specific.ScalekitServiceUnavailableException(error);
|
|
256
|
-
case Code.DeadlineExceeded:
|
|
257
|
-
return new specific.ScalekitGatewayTimeoutException(error);
|
|
258
|
-
default:
|
|
259
|
-
return new specific.ScalekitUnknownException(error);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
package/src/errors/index.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { ConnectError } from '@connectrpc/connect';
|
|
2
|
-
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { ScalekitServerException } from './base-exception';
|
|
4
|
-
|
|
5
|
-
// Specific exception classes
|
|
6
|
-
export class ScalekitBadRequestException extends ScalekitServerException {
|
|
7
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
8
|
-
super(error);
|
|
9
|
-
this.name = 'ScalekitBadRequestException';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class ScalekitUnauthorizedException extends ScalekitServerException {
|
|
14
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
15
|
-
super(error);
|
|
16
|
-
this.name = 'ScalekitUnauthorizedException';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class ScalekitForbiddenException extends ScalekitServerException {
|
|
21
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
22
|
-
super(error);
|
|
23
|
-
this.name = 'ScalekitForbiddenException';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class ScalekitNotFoundException extends ScalekitServerException {
|
|
28
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
29
|
-
super(error);
|
|
30
|
-
this.name = 'ScalekitNotFoundException';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export class ScalekitConflictException extends ScalekitServerException {
|
|
35
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
36
|
-
super(error);
|
|
37
|
-
this.name = 'ScalekitConflictException';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export class ScalekitTooManyRequestsException extends ScalekitServerException {
|
|
42
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
43
|
-
super(error);
|
|
44
|
-
this.name = 'ScalekitTooManyRequestsException';
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class ScalekitInternalServerException extends ScalekitServerException {
|
|
49
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
50
|
-
super(error);
|
|
51
|
-
this.name = 'ScalekitInternalServerException';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class ScalekitNotImplementedException extends ScalekitServerException {
|
|
56
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
57
|
-
super(error);
|
|
58
|
-
this.name = 'ScalekitNotImplementedException';
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export class ScalekitServiceUnavailableException extends ScalekitServerException {
|
|
63
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
64
|
-
super(error);
|
|
65
|
-
this.name = 'ScalekitServiceUnavailableException';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export class ScalekitGatewayTimeoutException extends ScalekitServerException {
|
|
70
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
71
|
-
super(error);
|
|
72
|
-
this.name = 'ScalekitGatewayTimeoutException';
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export class ScalekitCancelledException extends ScalekitServerException {
|
|
77
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
78
|
-
super(error);
|
|
79
|
-
this.name = 'ScalekitCancelledException';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export class ScalekitUnknownException extends ScalekitServerException {
|
|
84
|
-
constructor(error: AxiosResponse | ConnectError) {
|
|
85
|
-
super(error);
|
|
86
|
-
this.name = 'ScalekitUnknownException';
|
|
87
|
-
}
|
|
88
|
-
}
|
package/src/index.ts
DELETED