-
Notifications
You must be signed in to change notification settings - Fork 442
Expand file tree
/
Copy pathfactory.ts
More file actions
46 lines (42 loc) · 1.38 KB
/
factory.ts
File metadata and controls
46 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import {
AccountlessApplicationAPI,
AllowlistIdentifierAPI,
ClientAPI,
DomainAPI,
EmailAddressAPI,
InvitationAPI,
MachineTokensAPI,
OrganizationAPI,
PhoneNumberAPI,
RedirectUrlAPI,
SamlConnectionAPI,
SessionAPI,
SignInTokenAPI,
TestingTokenAPI,
UserAPI,
} from './endpoints';
import { buildRequest } from './request';
export type CreateBackendApiOptions = Parameters<typeof buildRequest>[0];
export type ApiClient = ReturnType<typeof createBackendApiClient>;
export function createBackendApiClient(options: CreateBackendApiOptions) {
const request = buildRequest(options);
return {
__experimental_accountlessApplications: new AccountlessApplicationAPI(
buildRequest({ ...options, requireSecretKey: false }),
),
machineTokens: new MachineTokensAPI(request),
allowlistIdentifiers: new AllowlistIdentifierAPI(request),
clients: new ClientAPI(request),
emailAddresses: new EmailAddressAPI(request),
invitations: new InvitationAPI(request),
organizations: new OrganizationAPI(request),
phoneNumbers: new PhoneNumberAPI(request),
redirectUrls: new RedirectUrlAPI(request),
sessions: new SessionAPI(request),
signInTokens: new SignInTokenAPI(request),
users: new UserAPI(request),
domains: new DomainAPI(request),
samlConnections: new SamlConnectionAPI(request),
testingTokens: new TestingTokenAPI(request),
};
}