@meistrari/auth-core 1.11.8 → 1.13.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/dist/index.d.mts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import * as better_auth_client from 'better-auth/client';
|
|
|
6
6
|
import { BetterFetchOption } from 'better-auth/client';
|
|
7
7
|
import * as jose from 'jose';
|
|
8
8
|
import * as _better_auth_sso from '@better-auth/sso';
|
|
9
|
+
export { ApiKey } from '@better-auth/api-key';
|
|
9
10
|
|
|
10
11
|
declare const ac: {
|
|
11
12
|
newRole<K extends "member" | "access" | "organization" | "invitation" | "team" | "ac">(statements: better_auth_plugins.Subset<K, {
|
|
@@ -295,6 +296,49 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
295
296
|
};
|
|
296
297
|
};
|
|
297
298
|
};
|
|
299
|
+
} & {
|
|
300
|
+
customEndpoints: {
|
|
301
|
+
organizations: {
|
|
302
|
+
apiKeys: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
303
|
+
query?: Record<string, any> | undefined;
|
|
304
|
+
fetchOptions?: FetchOptions | undefined;
|
|
305
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
306
|
+
id: string;
|
|
307
|
+
name: string | null;
|
|
308
|
+
start: string | null;
|
|
309
|
+
prefix: string | null;
|
|
310
|
+
referenceId: string;
|
|
311
|
+
configId: string | null;
|
|
312
|
+
refillInterval: number | null;
|
|
313
|
+
refillAmount: number | null;
|
|
314
|
+
lastRefillAt: Date | null;
|
|
315
|
+
enabled: boolean | null;
|
|
316
|
+
rateLimitEnabled: boolean | null;
|
|
317
|
+
rateLimitTimeWindow: number | null;
|
|
318
|
+
rateLimitMax: number | null;
|
|
319
|
+
requestCount: number | null;
|
|
320
|
+
remaining: number | null;
|
|
321
|
+
lastRequest: Date | null;
|
|
322
|
+
expiresAt: Date | null;
|
|
323
|
+
createdAt: Date;
|
|
324
|
+
updatedAt: Date;
|
|
325
|
+
permissions: string | null;
|
|
326
|
+
metadata: ({
|
|
327
|
+
user: {
|
|
328
|
+
id: string;
|
|
329
|
+
email: string;
|
|
330
|
+
};
|
|
331
|
+
workspace: {
|
|
332
|
+
id: string;
|
|
333
|
+
title: string;
|
|
334
|
+
};
|
|
335
|
+
} & Record<string, unknown>) | null;
|
|
336
|
+
}[], {
|
|
337
|
+
code?: string | undefined;
|
|
338
|
+
message?: string | undefined;
|
|
339
|
+
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
298
342
|
} & {
|
|
299
343
|
handshake: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
300
344
|
origin: string;
|
|
@@ -4963,6 +5007,38 @@ declare class ApiKeyService {
|
|
|
4963
5007
|
limit: number | undefined;
|
|
4964
5008
|
offset: number | undefined;
|
|
4965
5009
|
}>;
|
|
5010
|
+
listOrganizationApiKeys(): Promise<{
|
|
5011
|
+
id: string;
|
|
5012
|
+
name: string | null;
|
|
5013
|
+
start: string | null;
|
|
5014
|
+
prefix: string | null;
|
|
5015
|
+
referenceId: string;
|
|
5016
|
+
configId: string | null;
|
|
5017
|
+
refillInterval: number | null;
|
|
5018
|
+
refillAmount: number | null;
|
|
5019
|
+
lastRefillAt: Date | null;
|
|
5020
|
+
enabled: boolean | null;
|
|
5021
|
+
rateLimitEnabled: boolean | null;
|
|
5022
|
+
rateLimitTimeWindow: number | null;
|
|
5023
|
+
rateLimitMax: number | null;
|
|
5024
|
+
requestCount: number | null;
|
|
5025
|
+
remaining: number | null;
|
|
5026
|
+
lastRequest: Date | null;
|
|
5027
|
+
expiresAt: Date | null;
|
|
5028
|
+
createdAt: Date;
|
|
5029
|
+
updatedAt: Date;
|
|
5030
|
+
permissions: string | null;
|
|
5031
|
+
metadata: ({
|
|
5032
|
+
user: {
|
|
5033
|
+
id: string;
|
|
5034
|
+
email: string;
|
|
5035
|
+
};
|
|
5036
|
+
workspace: {
|
|
5037
|
+
id: string;
|
|
5038
|
+
title: string;
|
|
5039
|
+
};
|
|
5040
|
+
} & Record<string, unknown>) | null;
|
|
5041
|
+
}[]>;
|
|
4966
5042
|
updateApiKey(payload: UpdateApiKeyPayload): Promise<{
|
|
4967
5043
|
metadata: Record<string, any> | null;
|
|
4968
5044
|
permissions: {
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as better_auth_client from 'better-auth/client';
|
|
|
6
6
|
import { BetterFetchOption } from 'better-auth/client';
|
|
7
7
|
import * as jose from 'jose';
|
|
8
8
|
import * as _better_auth_sso from '@better-auth/sso';
|
|
9
|
+
export { ApiKey } from '@better-auth/api-key';
|
|
9
10
|
|
|
10
11
|
declare const ac: {
|
|
11
12
|
newRole<K extends "member" | "access" | "organization" | "invitation" | "team" | "ac">(statements: better_auth_plugins.Subset<K, {
|
|
@@ -295,6 +296,49 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
295
296
|
};
|
|
296
297
|
};
|
|
297
298
|
};
|
|
299
|
+
} & {
|
|
300
|
+
customEndpoints: {
|
|
301
|
+
organizations: {
|
|
302
|
+
apiKeys: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
303
|
+
query?: Record<string, any> | undefined;
|
|
304
|
+
fetchOptions?: FetchOptions | undefined;
|
|
305
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
306
|
+
id: string;
|
|
307
|
+
name: string | null;
|
|
308
|
+
start: string | null;
|
|
309
|
+
prefix: string | null;
|
|
310
|
+
referenceId: string;
|
|
311
|
+
configId: string | null;
|
|
312
|
+
refillInterval: number | null;
|
|
313
|
+
refillAmount: number | null;
|
|
314
|
+
lastRefillAt: Date | null;
|
|
315
|
+
enabled: boolean | null;
|
|
316
|
+
rateLimitEnabled: boolean | null;
|
|
317
|
+
rateLimitTimeWindow: number | null;
|
|
318
|
+
rateLimitMax: number | null;
|
|
319
|
+
requestCount: number | null;
|
|
320
|
+
remaining: number | null;
|
|
321
|
+
lastRequest: Date | null;
|
|
322
|
+
expiresAt: Date | null;
|
|
323
|
+
createdAt: Date;
|
|
324
|
+
updatedAt: Date;
|
|
325
|
+
permissions: string | null;
|
|
326
|
+
metadata: ({
|
|
327
|
+
user: {
|
|
328
|
+
id: string;
|
|
329
|
+
email: string;
|
|
330
|
+
};
|
|
331
|
+
workspace: {
|
|
332
|
+
id: string;
|
|
333
|
+
title: string;
|
|
334
|
+
};
|
|
335
|
+
} & Record<string, unknown>) | null;
|
|
336
|
+
}[], {
|
|
337
|
+
code?: string | undefined;
|
|
338
|
+
message?: string | undefined;
|
|
339
|
+
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
298
342
|
} & {
|
|
299
343
|
handshake: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
300
344
|
origin: string;
|
|
@@ -4963,6 +5007,38 @@ declare class ApiKeyService {
|
|
|
4963
5007
|
limit: number | undefined;
|
|
4964
5008
|
offset: number | undefined;
|
|
4965
5009
|
}>;
|
|
5010
|
+
listOrganizationApiKeys(): Promise<{
|
|
5011
|
+
id: string;
|
|
5012
|
+
name: string | null;
|
|
5013
|
+
start: string | null;
|
|
5014
|
+
prefix: string | null;
|
|
5015
|
+
referenceId: string;
|
|
5016
|
+
configId: string | null;
|
|
5017
|
+
refillInterval: number | null;
|
|
5018
|
+
refillAmount: number | null;
|
|
5019
|
+
lastRefillAt: Date | null;
|
|
5020
|
+
enabled: boolean | null;
|
|
5021
|
+
rateLimitEnabled: boolean | null;
|
|
5022
|
+
rateLimitTimeWindow: number | null;
|
|
5023
|
+
rateLimitMax: number | null;
|
|
5024
|
+
requestCount: number | null;
|
|
5025
|
+
remaining: number | null;
|
|
5026
|
+
lastRequest: Date | null;
|
|
5027
|
+
expiresAt: Date | null;
|
|
5028
|
+
createdAt: Date;
|
|
5029
|
+
updatedAt: Date;
|
|
5030
|
+
permissions: string | null;
|
|
5031
|
+
metadata: ({
|
|
5032
|
+
user: {
|
|
5033
|
+
id: string;
|
|
5034
|
+
email: string;
|
|
5035
|
+
};
|
|
5036
|
+
workspace: {
|
|
5037
|
+
id: string;
|
|
5038
|
+
title: string;
|
|
5039
|
+
};
|
|
5040
|
+
} & Record<string, unknown>) | null;
|
|
5041
|
+
}[]>;
|
|
4966
5042
|
updateApiKey(payload: UpdateApiKeyPayload): Promise<{
|
|
4967
5043
|
metadata: Record<string, any> | null;
|
|
4968
5044
|
permissions: {
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
|
7
7
|
import { apiKeyClient } from '@better-auth/api-key/client';
|
|
8
8
|
export { APIError } from 'better-auth';
|
|
9
9
|
|
|
10
|
-
const version = "1.
|
|
10
|
+
const version = "1.13.0";
|
|
11
11
|
|
|
12
12
|
const statements = {
|
|
13
13
|
...defaultStatements,
|
|
@@ -778,6 +778,9 @@ class ApiKeyService {
|
|
|
778
778
|
async listApiKeys() {
|
|
779
779
|
return await this.client.apiKey.list();
|
|
780
780
|
}
|
|
781
|
+
async listOrganizationApiKeys() {
|
|
782
|
+
return await this.client.customEndpoints.organizations.apiKeys();
|
|
783
|
+
}
|
|
781
784
|
async updateApiKey(payload) {
|
|
782
785
|
return await this.client.apiKey.update({
|
|
783
786
|
keyId: payload.id,
|