@meistrari/auth-core 1.17.1 → 1.19.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.
- package/README.md +19 -2
- package/dist/index.d.mts +49 -21
- package/dist/index.d.ts +49 -21
- package/dist/index.mjs +39 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @meistrari/auth-core
|
|
2
2
|
|
|
3
3
|
A TypeScript/JavaScript SDK for interacting with the Auth API service.
|
|
4
4
|
|
|
@@ -14,11 +14,18 @@ A TypeScript/JavaScript SDK for interacting with the Auth API service.
|
|
|
14
14
|
- Team management
|
|
15
15
|
- Member invitations
|
|
16
16
|
- **JWT Token Validation**
|
|
17
|
+
- **Application Authentication**
|
|
18
|
+
- OAuth PKCE application flows
|
|
19
|
+
- OAuth Device Authorization Grant endpoints
|
|
20
|
+
- Application token refresh, logout, and organization switching
|
|
21
|
+
- **API Keys**
|
|
22
|
+
- User-scoped API key CRUD
|
|
23
|
+
- Active-organization API key listing
|
|
17
24
|
|
|
18
25
|
## Installation
|
|
19
26
|
|
|
20
27
|
```bash
|
|
21
|
-
|
|
28
|
+
bun add @meistrari/auth-core
|
|
22
29
|
```
|
|
23
30
|
|
|
24
31
|
## Quick Start
|
|
@@ -38,6 +45,16 @@ await authClient.session.signInWithEmailAndPassword({
|
|
|
38
45
|
// List user's organizations
|
|
39
46
|
const organizations = await authClient.organization.listOrganizations()
|
|
40
47
|
console.log('Organizations:', organizations)
|
|
48
|
+
|
|
49
|
+
// Application auth helpers
|
|
50
|
+
const { code } = await authClient.application.startAuthorizationFlow(
|
|
51
|
+
'application-id',
|
|
52
|
+
'https://your-app.com/auth/callback',
|
|
53
|
+
'pkce-code-challenge',
|
|
54
|
+
'organization-id',
|
|
55
|
+
)
|
|
56
|
+
const tokens = await authClient.application.completeAuthorizationFlow(code, 'pkce-code-verifier')
|
|
57
|
+
console.log('Application user:', tokens.user.email)
|
|
41
58
|
```
|
|
42
59
|
|
|
43
60
|
## API Reference
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as better_auth_plugins from 'better-auth/plugins';
|
|
|
2
2
|
import * as better_auth from 'better-auth';
|
|
3
3
|
import { JWTPayload as JWTPayload$1 } from 'better-auth';
|
|
4
4
|
export { APIError } from 'better-auth';
|
|
5
|
-
import { z } from 'zod';
|
|
5
|
+
import z$1, { z } from 'zod';
|
|
6
6
|
import * as better_auth_client from 'better-auth/client';
|
|
7
7
|
import { BetterFetchOption } from 'better-auth/client';
|
|
8
8
|
import * as jose from 'jose';
|
|
@@ -261,21 +261,24 @@ declare const JWTPayload: z.ZodObject<{
|
|
|
261
261
|
}, z.core.$strip>;
|
|
262
262
|
type JWTPayload = JWTPayload$1 & z.infer<typeof JWTPayload>;
|
|
263
263
|
|
|
264
|
+
declare const ApiKeyMetadata: z$1.ZodObject<{
|
|
265
|
+
user: z$1.ZodObject<{
|
|
266
|
+
id: z$1.ZodString;
|
|
267
|
+
email: z$1.ZodString;
|
|
268
|
+
}, z$1.core.$strip>;
|
|
269
|
+
workspace: z$1.ZodObject<{
|
|
270
|
+
id: z$1.ZodString;
|
|
271
|
+
title: z$1.ZodString;
|
|
272
|
+
}, z$1.core.$strip>;
|
|
273
|
+
application: z$1.ZodNullable<z$1.ZodOptional<z$1.ZodObject<{
|
|
274
|
+
id: z$1.ZodString;
|
|
275
|
+
name: z$1.ZodString;
|
|
276
|
+
}, z$1.core.$strip>>>;
|
|
277
|
+
}, z$1.core.$strip>;
|
|
264
278
|
/**
|
|
265
279
|
* Metadata attached to an API key, identifying the owning user and workspace.
|
|
266
280
|
*/
|
|
267
|
-
type ApiKeyMetadata =
|
|
268
|
-
/** The user who owns this API key. */
|
|
269
|
-
user: {
|
|
270
|
-
id: string;
|
|
271
|
-
email: string;
|
|
272
|
-
};
|
|
273
|
-
/** The workspace this API key belongs to. */
|
|
274
|
-
workspace: {
|
|
275
|
-
id: string;
|
|
276
|
-
title: string;
|
|
277
|
-
};
|
|
278
|
-
} & Record<string, unknown>;
|
|
281
|
+
type ApiKeyMetadata = z$1.infer<typeof ApiKeyMetadata> & Record<string, unknown>;
|
|
279
282
|
/**
|
|
280
283
|
* A full API key including the secret key value.
|
|
281
284
|
*
|
|
@@ -3378,13 +3381,18 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
3378
3381
|
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3379
3382
|
} & {
|
|
3380
3383
|
applications: {
|
|
3381
|
-
|
|
3382
|
-
data:
|
|
3383
|
-
organizations: FullOrganization[];
|
|
3384
|
-
application?: Application | undefined;
|
|
3385
|
-
};
|
|
3384
|
+
getApplicationAuthContext: (applicationId: string) => Promise<{
|
|
3385
|
+
data: ApplicationAuthContextResponse;
|
|
3386
3386
|
error: null;
|
|
3387
3387
|
} | {
|
|
3388
|
+
data: null;
|
|
3389
|
+
error: {
|
|
3390
|
+
message?: string | undefined;
|
|
3391
|
+
status: number;
|
|
3392
|
+
statusText: string;
|
|
3393
|
+
};
|
|
3394
|
+
}>;
|
|
3395
|
+
listCandidateOrganizations: (applicationId: string) => Promise<{
|
|
3388
3396
|
data: {
|
|
3389
3397
|
organizations: FullOrganization[];
|
|
3390
3398
|
application?: Application | undefined;
|
|
@@ -3394,6 +3402,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
3394
3402
|
status: number;
|
|
3395
3403
|
statusText: string;
|
|
3396
3404
|
};
|
|
3405
|
+
} | {
|
|
3406
|
+
data: {
|
|
3407
|
+
organizations: FullOrganization[];
|
|
3408
|
+
application?: Application | undefined;
|
|
3409
|
+
};
|
|
3410
|
+
error: null;
|
|
3397
3411
|
}>;
|
|
3398
3412
|
inviteUserToApplication: (options: InviteUserToApplicationOptions) => Promise<{
|
|
3399
3413
|
data: null;
|
|
@@ -4551,6 +4565,13 @@ type ListCandidateOrganizationsResponse = {
|
|
|
4551
4565
|
/** Organizations where the user is a member and the application is entitled. */
|
|
4552
4566
|
organizations: FullOrganization[];
|
|
4553
4567
|
};
|
|
4568
|
+
/**
|
|
4569
|
+
* Public application context used to preserve continuity during auth redirects.
|
|
4570
|
+
*/
|
|
4571
|
+
type ApplicationAuthContextResponse = {
|
|
4572
|
+
/** Minimal application identity shown in the hosted auth flow. */
|
|
4573
|
+
application: Pick<Application, 'id' | 'name'>;
|
|
4574
|
+
};
|
|
4554
4575
|
/**
|
|
4555
4576
|
* Response returned when starting an authorization flow.
|
|
4556
4577
|
*/
|
|
@@ -4778,6 +4799,13 @@ declare class ApplicationService {
|
|
|
4778
4799
|
* @param client - The API client for making application requests
|
|
4779
4800
|
*/
|
|
4780
4801
|
constructor(client: APIClient);
|
|
4802
|
+
/**
|
|
4803
|
+
* Gets public display context for an application auth redirect.
|
|
4804
|
+
*
|
|
4805
|
+
* @param applicationId - The application ID to get public auth context for
|
|
4806
|
+
* @returns The minimal application identity safe to show before login
|
|
4807
|
+
*/
|
|
4808
|
+
getApplicationAuthContext(applicationId: string): Promise<ApplicationAuthContextResponse>;
|
|
4781
4809
|
/**
|
|
4782
4810
|
* Lists candidate organizations for a specific application.
|
|
4783
4811
|
*
|
|
@@ -4876,7 +4904,7 @@ declare class ApplicationService {
|
|
|
4876
4904
|
* @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
|
|
4877
4905
|
* @throws {ApplicationError} For other API errors
|
|
4878
4906
|
*/
|
|
4879
|
-
refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null
|
|
4907
|
+
refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null>;
|
|
4880
4908
|
/**
|
|
4881
4909
|
* Gets the current user and organization for a specific application.
|
|
4882
4910
|
*
|
|
@@ -5628,5 +5656,5 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
5628
5656
|
*/
|
|
5629
5657
|
declare function extractTokenPayload(token: string): JWTPayload;
|
|
5630
5658
|
|
|
5631
|
-
export { ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, createAPIClient, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|
|
5632
|
-
export type { APIClient, ApiKey,
|
|
5659
|
+
export { ApiKeyMetadata, ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, createAPIClient, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|
|
5660
|
+
export type { APIClient, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationInvitationResponse, BaseOrganization, CompleteAuthorizationFlowResponse, CreateApiKeyPayload, CreateApplicationInvitationResponse, CreateTeamPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, FullOrganization, Invitation, InviteUserToApplicationOptions, InviteUserToOrganizationOptions, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, Session, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as better_auth_plugins from 'better-auth/plugins';
|
|
|
2
2
|
import * as better_auth from 'better-auth';
|
|
3
3
|
import { JWTPayload as JWTPayload$1 } from 'better-auth';
|
|
4
4
|
export { APIError } from 'better-auth';
|
|
5
|
-
import { z } from 'zod';
|
|
5
|
+
import z$1, { z } from 'zod';
|
|
6
6
|
import * as better_auth_client from 'better-auth/client';
|
|
7
7
|
import { BetterFetchOption } from 'better-auth/client';
|
|
8
8
|
import * as jose from 'jose';
|
|
@@ -261,21 +261,24 @@ declare const JWTPayload: z.ZodObject<{
|
|
|
261
261
|
}, z.core.$strip>;
|
|
262
262
|
type JWTPayload = JWTPayload$1 & z.infer<typeof JWTPayload>;
|
|
263
263
|
|
|
264
|
+
declare const ApiKeyMetadata: z$1.ZodObject<{
|
|
265
|
+
user: z$1.ZodObject<{
|
|
266
|
+
id: z$1.ZodString;
|
|
267
|
+
email: z$1.ZodString;
|
|
268
|
+
}, z$1.core.$strip>;
|
|
269
|
+
workspace: z$1.ZodObject<{
|
|
270
|
+
id: z$1.ZodString;
|
|
271
|
+
title: z$1.ZodString;
|
|
272
|
+
}, z$1.core.$strip>;
|
|
273
|
+
application: z$1.ZodNullable<z$1.ZodOptional<z$1.ZodObject<{
|
|
274
|
+
id: z$1.ZodString;
|
|
275
|
+
name: z$1.ZodString;
|
|
276
|
+
}, z$1.core.$strip>>>;
|
|
277
|
+
}, z$1.core.$strip>;
|
|
264
278
|
/**
|
|
265
279
|
* Metadata attached to an API key, identifying the owning user and workspace.
|
|
266
280
|
*/
|
|
267
|
-
type ApiKeyMetadata =
|
|
268
|
-
/** The user who owns this API key. */
|
|
269
|
-
user: {
|
|
270
|
-
id: string;
|
|
271
|
-
email: string;
|
|
272
|
-
};
|
|
273
|
-
/** The workspace this API key belongs to. */
|
|
274
|
-
workspace: {
|
|
275
|
-
id: string;
|
|
276
|
-
title: string;
|
|
277
|
-
};
|
|
278
|
-
} & Record<string, unknown>;
|
|
281
|
+
type ApiKeyMetadata = z$1.infer<typeof ApiKeyMetadata> & Record<string, unknown>;
|
|
279
282
|
/**
|
|
280
283
|
* A full API key including the secret key value.
|
|
281
284
|
*
|
|
@@ -3378,13 +3381,18 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
3378
3381
|
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3379
3382
|
} & {
|
|
3380
3383
|
applications: {
|
|
3381
|
-
|
|
3382
|
-
data:
|
|
3383
|
-
organizations: FullOrganization[];
|
|
3384
|
-
application?: Application | undefined;
|
|
3385
|
-
};
|
|
3384
|
+
getApplicationAuthContext: (applicationId: string) => Promise<{
|
|
3385
|
+
data: ApplicationAuthContextResponse;
|
|
3386
3386
|
error: null;
|
|
3387
3387
|
} | {
|
|
3388
|
+
data: null;
|
|
3389
|
+
error: {
|
|
3390
|
+
message?: string | undefined;
|
|
3391
|
+
status: number;
|
|
3392
|
+
statusText: string;
|
|
3393
|
+
};
|
|
3394
|
+
}>;
|
|
3395
|
+
listCandidateOrganizations: (applicationId: string) => Promise<{
|
|
3388
3396
|
data: {
|
|
3389
3397
|
organizations: FullOrganization[];
|
|
3390
3398
|
application?: Application | undefined;
|
|
@@ -3394,6 +3402,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
3394
3402
|
status: number;
|
|
3395
3403
|
statusText: string;
|
|
3396
3404
|
};
|
|
3405
|
+
} | {
|
|
3406
|
+
data: {
|
|
3407
|
+
organizations: FullOrganization[];
|
|
3408
|
+
application?: Application | undefined;
|
|
3409
|
+
};
|
|
3410
|
+
error: null;
|
|
3397
3411
|
}>;
|
|
3398
3412
|
inviteUserToApplication: (options: InviteUserToApplicationOptions) => Promise<{
|
|
3399
3413
|
data: null;
|
|
@@ -4551,6 +4565,13 @@ type ListCandidateOrganizationsResponse = {
|
|
|
4551
4565
|
/** Organizations where the user is a member and the application is entitled. */
|
|
4552
4566
|
organizations: FullOrganization[];
|
|
4553
4567
|
};
|
|
4568
|
+
/**
|
|
4569
|
+
* Public application context used to preserve continuity during auth redirects.
|
|
4570
|
+
*/
|
|
4571
|
+
type ApplicationAuthContextResponse = {
|
|
4572
|
+
/** Minimal application identity shown in the hosted auth flow. */
|
|
4573
|
+
application: Pick<Application, 'id' | 'name'>;
|
|
4574
|
+
};
|
|
4554
4575
|
/**
|
|
4555
4576
|
* Response returned when starting an authorization flow.
|
|
4556
4577
|
*/
|
|
@@ -4778,6 +4799,13 @@ declare class ApplicationService {
|
|
|
4778
4799
|
* @param client - The API client for making application requests
|
|
4779
4800
|
*/
|
|
4780
4801
|
constructor(client: APIClient);
|
|
4802
|
+
/**
|
|
4803
|
+
* Gets public display context for an application auth redirect.
|
|
4804
|
+
*
|
|
4805
|
+
* @param applicationId - The application ID to get public auth context for
|
|
4806
|
+
* @returns The minimal application identity safe to show before login
|
|
4807
|
+
*/
|
|
4808
|
+
getApplicationAuthContext(applicationId: string): Promise<ApplicationAuthContextResponse>;
|
|
4781
4809
|
/**
|
|
4782
4810
|
* Lists candidate organizations for a specific application.
|
|
4783
4811
|
*
|
|
@@ -4876,7 +4904,7 @@ declare class ApplicationService {
|
|
|
4876
4904
|
* @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
|
|
4877
4905
|
* @throws {ApplicationError} For other API errors
|
|
4878
4906
|
*/
|
|
4879
|
-
refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null
|
|
4907
|
+
refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null>;
|
|
4880
4908
|
/**
|
|
4881
4909
|
* Gets the current user and organization for a specific application.
|
|
4882
4910
|
*
|
|
@@ -5628,5 +5656,5 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
5628
5656
|
*/
|
|
5629
5657
|
declare function extractTokenPayload(token: string): JWTPayload;
|
|
5630
5658
|
|
|
5631
|
-
export { ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, createAPIClient, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|
|
5632
|
-
export type { APIClient, ApiKey,
|
|
5659
|
+
export { ApiKeyMetadata, ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, createAPIClient, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|
|
5660
|
+
export type { APIClient, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationInvitationResponse, BaseOrganization, CompleteAuthorizationFlowResponse, CreateApiKeyPayload, CreateApplicationInvitationResponse, CreateTeamPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, FullOrganization, Invitation, InviteUserToApplicationOptions, InviteUserToOrganizationOptions, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, Session, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,10 @@ import { createAuthClient } from 'better-auth/client';
|
|
|
5
5
|
import { organizationClient, inferOrgAdditionalFields, twoFactorClient, jwtClient, adminClient, inferAdditionalFields } from 'better-auth/client/plugins';
|
|
6
6
|
import { createAccessControl } from 'better-auth/plugins/access';
|
|
7
7
|
import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
8
|
-
import { z } from 'zod';
|
|
8
|
+
import z$1, { z } from 'zod';
|
|
9
9
|
export { APIError } from 'better-auth';
|
|
10
10
|
|
|
11
|
-
const version = "1.
|
|
11
|
+
const version = "1.19.0";
|
|
12
12
|
|
|
13
13
|
const statements = {
|
|
14
14
|
...defaultStatements,
|
|
@@ -92,6 +92,13 @@ function applicationsPluginClient() {
|
|
|
92
92
|
getActions: ($fetch) => {
|
|
93
93
|
return {
|
|
94
94
|
applications: {
|
|
95
|
+
getApplicationAuthContext: async (applicationId) => {
|
|
96
|
+
return await $fetch("/applications/context", {
|
|
97
|
+
query: {
|
|
98
|
+
applicationId
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
},
|
|
95
102
|
listCandidateOrganizations: async (applicationId) => {
|
|
96
103
|
const response = await $fetch("/applications/candidate-organizations", {
|
|
97
104
|
query: {
|
|
@@ -382,6 +389,19 @@ class ApplicationService {
|
|
|
382
389
|
constructor(client) {
|
|
383
390
|
this.client = client;
|
|
384
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Gets public display context for an application auth redirect.
|
|
394
|
+
*
|
|
395
|
+
* @param applicationId - The application ID to get public auth context for
|
|
396
|
+
* @returns The minimal application identity safe to show before login
|
|
397
|
+
*/
|
|
398
|
+
async getApplicationAuthContext(applicationId) {
|
|
399
|
+
const response = await this.client.applications.getApplicationAuthContext(applicationId);
|
|
400
|
+
if (!response.data) {
|
|
401
|
+
throw new Error("No data returned from the API", { cause: response.error });
|
|
402
|
+
}
|
|
403
|
+
return response.data;
|
|
404
|
+
}
|
|
385
405
|
/**
|
|
386
406
|
* Lists candidate organizations for a specific application.
|
|
387
407
|
*
|
|
@@ -553,7 +573,7 @@ class ApplicationService {
|
|
|
553
573
|
} catch (error) {
|
|
554
574
|
if (error instanceof ApplicationError)
|
|
555
575
|
throw error;
|
|
556
|
-
handleRefreshError(error);
|
|
576
|
+
return handleRefreshError(error);
|
|
557
577
|
}
|
|
558
578
|
}
|
|
559
579
|
/**
|
|
@@ -1093,6 +1113,21 @@ class ApiKeyService {
|
|
|
1093
1113
|
}
|
|
1094
1114
|
}
|
|
1095
1115
|
|
|
1116
|
+
const ApiKeyMetadata = z$1.object({
|
|
1117
|
+
user: z$1.object({
|
|
1118
|
+
id: z$1.string(),
|
|
1119
|
+
email: z$1.string()
|
|
1120
|
+
}),
|
|
1121
|
+
workspace: z$1.object({
|
|
1122
|
+
id: z$1.string(),
|
|
1123
|
+
title: z$1.string()
|
|
1124
|
+
}),
|
|
1125
|
+
application: z$1.object({
|
|
1126
|
+
id: z$1.string(),
|
|
1127
|
+
name: z$1.string()
|
|
1128
|
+
}).optional().nullable()
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1096
1131
|
class AuthClient {
|
|
1097
1132
|
client;
|
|
1098
1133
|
/**
|
|
@@ -1159,4 +1194,4 @@ function extractTokenPayload(token) {
|
|
|
1159
1194
|
return payload;
|
|
1160
1195
|
}
|
|
1161
1196
|
|
|
1162
|
-
export { ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|
|
1197
|
+
export { ApiKeyMetadata, ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
|