-
Notifications
You must be signed in to change notification settings - Fork 337
/
Copy pathfactory.ts
72 lines (68 loc) · 2.21 KB
/
factory.ts
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import {
AccountlessApplicationAPI,
ActorTokenAPI,
AllowlistIdentifierAPI,
APIKeysAPI,
BetaFeaturesAPI,
BlocklistIdentifierAPI,
ClientAPI,
DomainAPI,
EmailAddressAPI,
IdPOAuthAccessTokenApi,
InstanceAPI,
InvitationAPI,
JwksAPI,
JwtTemplatesApi,
MachineTokensApi,
OAuthApplicationsApi,
OrganizationAPI,
PhoneNumberAPI,
ProxyCheckAPI,
RedirectUrlAPI,
SamlConnectionAPI,
SessionAPI,
SignInTokenAPI,
SignUpAPI,
TestingTokenAPI,
UserAPI,
WaitlistEntryAPI,
WebhookAPI,
} 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 }),
),
actorTokens: new ActorTokenAPI(request),
allowlistIdentifiers: new AllowlistIdentifierAPI(request),
betaFeatures: new BetaFeaturesAPI(request),
blocklistIdentifiers: new BlocklistIdentifierAPI(request),
clients: new ClientAPI(request),
domains: new DomainAPI(request),
emailAddresses: new EmailAddressAPI(request),
instance: new InstanceAPI(request),
invitations: new InvitationAPI(request),
machineTokens: new MachineTokensApi(request),
idPOAuthAccessToken: new IdPOAuthAccessTokenApi(request),
apiKeys: new APIKeysAPI(request),
jwks: new JwksAPI(request),
jwtTemplates: new JwtTemplatesApi(request),
oauthApplications: new OAuthApplicationsApi(request),
organizations: new OrganizationAPI(request),
phoneNumbers: new PhoneNumberAPI(request),
proxyChecks: new ProxyCheckAPI(request),
redirectUrls: new RedirectUrlAPI(request),
samlConnections: new SamlConnectionAPI(request),
sessions: new SessionAPI(request),
signInTokens: new SignInTokenAPI(request),
signUps: new SignUpAPI(request),
testingTokens: new TestingTokenAPI(request),
users: new UserAPI(request),
waitlistEntries: new WaitlistEntryAPI(request),
webhooks: new WebhookAPI(request),
};
}