@better-auth/api-key 1.5.6 → 1.5.7-beta.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/dist/client.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-CCe5L05Y.mjs";
2
- import { i as API_KEY_ERROR_CODES, n as apiKey } from "./index-CLXIQyX5.mjs";
1
+ import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-BR70O3Q3.mjs";
2
+ import { i as API_KEY_ERROR_CODES, n as apiKey } from "./index-WXH3i1Uh.mjs";
3
3
  import * as better_auth0 from "better-auth";
4
4
 
5
5
  //#region src/client.d.ts
package/dist/client.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { t as API_KEY_ERROR_CODES } from "./error-codes-vwTWW2ez.mjs";
2
-
1
+ import { t as API_KEY_ERROR_CODES } from "./error-codes-C8MQDPqn.mjs";
3
2
  //#region src/client.ts
4
3
  const apiKeyClient = () => {
5
4
  return {
@@ -13,7 +12,7 @@ const apiKeyClient = () => {
13
12
  $ERROR_CODES: API_KEY_ERROR_CODES
14
13
  };
15
14
  };
16
-
17
15
  //#endregion
18
16
  export { API_KEY_ERROR_CODES, apiKeyClient };
17
+
19
18
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"@better-auth/core\";\nimport type { apiKey } from \".\";\nimport { API_KEY_ERROR_CODES } from \"./error-codes\";\n\nexport * from \"./error-codes\";\n\nexport const apiKeyClient = () => {\n\treturn {\n\t\tid: \"api-key\",\n\t\t$InferServerPlugin: {} as ReturnType<typeof apiKey>,\n\t\tpathMethods: {\n\t\t\t\"/api-key/create\": \"POST\",\n\t\t\t\"/api-key/delete\": \"POST\",\n\t\t\t\"/api-key/delete-all-expired-api-keys\": \"POST\",\n\t\t},\n\t\t$ERROR_CODES: API_KEY_ERROR_CODES,\n\t} satisfies BetterAuthClientPlugin;\n};\n\nexport type ApiKeyClientPlugin = ReturnType<typeof apiKeyClient>;\n\nexport type * from \"./types\";\n"],"mappings":";;;AAMA,MAAa,qBAAqB;AACjC,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EACtB,aAAa;GACZ,mBAAmB;GACnB,mBAAmB;GACnB,wCAAwC;GACxC;EACD,cAAc;EACd"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"@better-auth/core\";\nimport type { apiKey } from \".\";\nimport { API_KEY_ERROR_CODES } from \"./error-codes\";\n\nexport * from \"./error-codes\";\n\nexport const apiKeyClient = () => {\n\treturn {\n\t\tid: \"api-key\",\n\t\t$InferServerPlugin: {} as ReturnType<typeof apiKey>,\n\t\tpathMethods: {\n\t\t\t\"/api-key/create\": \"POST\",\n\t\t\t\"/api-key/delete\": \"POST\",\n\t\t\t\"/api-key/delete-all-expired-api-keys\": \"POST\",\n\t\t},\n\t\t$ERROR_CODES: API_KEY_ERROR_CODES,\n\t} satisfies BetterAuthClientPlugin;\n};\n\nexport type ApiKeyClientPlugin = ReturnType<typeof apiKeyClient>;\n\nexport type * from \"./types\";\n"],"mappings":";;AAMA,MAAa,qBAAqB;AACjC,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EACtB,aAAa;GACZ,mBAAmB;GACnB,mBAAmB;GACnB,wCAAwC;GACxC;EACD,cAAc;EACd"}
@@ -1,5 +1,4 @@
1
1
  import { defineErrorCodes } from "@better-auth/core/utils/error-codes";
2
-
3
2
  //#region src/error-codes.ts
4
3
  const API_KEY_ERROR_CODES = defineErrorCodes({
5
4
  INVALID_METADATA_TYPE: "metadata must be an object or undefined",
@@ -34,7 +33,7 @@ const API_KEY_ERROR_CODES = defineErrorCodes({
34
33
  NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: "No default api-key configuration found.",
35
34
  ORGANIZATION_PLUGIN_REQUIRED: "Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."
36
35
  });
37
-
38
36
  //#endregion
39
37
  export { API_KEY_ERROR_CODES as t };
40
- //# sourceMappingURL=error-codes-vwTWW2ez.mjs.map
38
+
39
+ //# sourceMappingURL=error-codes-C8MQDPqn.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes-vwTWW2ez.mjs","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["import { defineErrorCodes } from \"@better-auth/core/utils/error-codes\";\n\nexport const API_KEY_ERROR_CODES = defineErrorCodes({\n\tINVALID_METADATA_TYPE: \"metadata must be an object or undefined\",\n\tREFILL_AMOUNT_AND_INTERVAL_REQUIRED:\n\t\t\"refillAmount is required when refillInterval is provided\",\n\tREFILL_INTERVAL_AND_AMOUNT_REQUIRED:\n\t\t\"refillInterval is required when refillAmount is provided\",\n\tUSER_BANNED: \"User is banned\",\n\tUNAUTHORIZED_SESSION: \"Unauthorized or invalid session\",\n\tKEY_NOT_FOUND: \"API Key not found\",\n\tKEY_DISABLED: \"API Key is disabled\",\n\tKEY_EXPIRED: \"API Key has expired\",\n\tUSAGE_EXCEEDED: \"API Key has reached its usage limit\",\n\tKEY_NOT_RECOVERABLE: \"API Key is not recoverable\",\n\tEXPIRES_IN_IS_TOO_SMALL:\n\t\t\"The expiresIn is smaller than the predefined minimum value.\",\n\tEXPIRES_IN_IS_TOO_LARGE:\n\t\t\"The expiresIn is larger than the predefined maximum value.\",\n\tINVALID_REMAINING: \"The remaining count is either too large or too small.\",\n\tINVALID_PREFIX_LENGTH: \"The prefix length is either too large or too small.\",\n\tINVALID_NAME_LENGTH: \"The name length is either too large or too small.\",\n\tMETADATA_DISABLED: \"Metadata is disabled.\",\n\tRATE_LIMIT_EXCEEDED: \"Rate limit exceeded.\",\n\tNO_VALUES_TO_UPDATE: \"No values to update.\",\n\tKEY_DISABLED_EXPIRATION: \"Custom key expiration values are disabled.\",\n\tINVALID_API_KEY: \"Invalid API key.\",\n\tINVALID_USER_ID_FROM_API_KEY: \"The user id from the API key is invalid.\",\n\tINVALID_REFERENCE_ID_FROM_API_KEY:\n\t\t\"The reference id from the API key is invalid.\",\n\tINVALID_API_KEY_GETTER_RETURN_TYPE:\n\t\t\"API Key getter returned an invalid key type. Expected string.\",\n\tSERVER_ONLY_PROPERTY:\n\t\t\"The property you're trying to set can only be set from the server auth instance only.\",\n\tFAILED_TO_UPDATE_API_KEY: \"Failed to update API key\",\n\tNAME_REQUIRED: \"API Key name is required.\",\n\tORGANIZATION_ID_REQUIRED:\n\t\t\"Organization ID is required for organization-owned API keys.\",\n\tUSER_NOT_MEMBER_OF_ORGANIZATION:\n\t\t\"You are not a member of the organization that owns this API key.\",\n\tINSUFFICIENT_API_KEY_PERMISSIONS:\n\t\t\"You do not have permission to perform this action on organization API keys.\",\n\tNO_DEFAULT_API_KEY_CONFIGURATION_FOUND:\n\t\t\"No default api-key configuration found.\",\n\tORGANIZATION_PLUGIN_REQUIRED:\n\t\t\"Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin.\",\n});\n"],"mappings":";;;AAEA,MAAa,sBAAsB,iBAAiB;CACnD,uBAAuB;CACvB,qCACC;CACD,qCACC;CACD,aAAa;CACb,sBAAsB;CACtB,eAAe;CACf,cAAc;CACd,aAAa;CACb,gBAAgB;CAChB,qBAAqB;CACrB,yBACC;CACD,yBACC;CACD,mBAAmB;CACnB,uBAAuB;CACvB,qBAAqB;CACrB,mBAAmB;CACnB,qBAAqB;CACrB,qBAAqB;CACrB,yBAAyB;CACzB,iBAAiB;CACjB,8BAA8B;CAC9B,mCACC;CACD,oCACC;CACD,sBACC;CACD,0BAA0B;CAC1B,eAAe;CACf,0BACC;CACD,iCACC;CACD,kCACC;CACD,wCACC;CACD,8BACC;CACD,CAAC"}
1
+ {"version":3,"file":"error-codes-C8MQDPqn.mjs","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["import { defineErrorCodes } from \"@better-auth/core/utils/error-codes\";\n\nexport const API_KEY_ERROR_CODES = defineErrorCodes({\n\tINVALID_METADATA_TYPE: \"metadata must be an object or undefined\",\n\tREFILL_AMOUNT_AND_INTERVAL_REQUIRED:\n\t\t\"refillAmount is required when refillInterval is provided\",\n\tREFILL_INTERVAL_AND_AMOUNT_REQUIRED:\n\t\t\"refillInterval is required when refillAmount is provided\",\n\tUSER_BANNED: \"User is banned\",\n\tUNAUTHORIZED_SESSION: \"Unauthorized or invalid session\",\n\tKEY_NOT_FOUND: \"API Key not found\",\n\tKEY_DISABLED: \"API Key is disabled\",\n\tKEY_EXPIRED: \"API Key has expired\",\n\tUSAGE_EXCEEDED: \"API Key has reached its usage limit\",\n\tKEY_NOT_RECOVERABLE: \"API Key is not recoverable\",\n\tEXPIRES_IN_IS_TOO_SMALL:\n\t\t\"The expiresIn is smaller than the predefined minimum value.\",\n\tEXPIRES_IN_IS_TOO_LARGE:\n\t\t\"The expiresIn is larger than the predefined maximum value.\",\n\tINVALID_REMAINING: \"The remaining count is either too large or too small.\",\n\tINVALID_PREFIX_LENGTH: \"The prefix length is either too large or too small.\",\n\tINVALID_NAME_LENGTH: \"The name length is either too large or too small.\",\n\tMETADATA_DISABLED: \"Metadata is disabled.\",\n\tRATE_LIMIT_EXCEEDED: \"Rate limit exceeded.\",\n\tNO_VALUES_TO_UPDATE: \"No values to update.\",\n\tKEY_DISABLED_EXPIRATION: \"Custom key expiration values are disabled.\",\n\tINVALID_API_KEY: \"Invalid API key.\",\n\tINVALID_USER_ID_FROM_API_KEY: \"The user id from the API key is invalid.\",\n\tINVALID_REFERENCE_ID_FROM_API_KEY:\n\t\t\"The reference id from the API key is invalid.\",\n\tINVALID_API_KEY_GETTER_RETURN_TYPE:\n\t\t\"API Key getter returned an invalid key type. Expected string.\",\n\tSERVER_ONLY_PROPERTY:\n\t\t\"The property you're trying to set can only be set from the server auth instance only.\",\n\tFAILED_TO_UPDATE_API_KEY: \"Failed to update API key\",\n\tNAME_REQUIRED: \"API Key name is required.\",\n\tORGANIZATION_ID_REQUIRED:\n\t\t\"Organization ID is required for organization-owned API keys.\",\n\tUSER_NOT_MEMBER_OF_ORGANIZATION:\n\t\t\"You are not a member of the organization that owns this API key.\",\n\tINSUFFICIENT_API_KEY_PERMISSIONS:\n\t\t\"You do not have permission to perform this action on organization API keys.\",\n\tNO_DEFAULT_API_KEY_CONFIGURATION_FOUND:\n\t\t\"No default api-key configuration found.\",\n\tORGANIZATION_PLUGIN_REQUIRED:\n\t\t\"Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin.\",\n});\n"],"mappings":";;AAEA,MAAa,sBAAsB,iBAAiB;CACnD,uBAAuB;CACvB,qCACC;CACD,qCACC;CACD,aAAa;CACb,sBAAsB;CACtB,eAAe;CACf,cAAc;CACd,aAAa;CACb,gBAAgB;CAChB,qBAAqB;CACrB,yBACC;CACD,yBACC;CACD,mBAAmB;CACnB,uBAAuB;CACvB,qBAAqB;CACrB,mBAAmB;CACnB,qBAAqB;CACrB,qBAAqB;CACrB,yBAAyB;CACzB,iBAAiB;CACjB,8BAA8B;CAC9B,mCACC;CACD,oCACC;CACD,sBACC;CACD,0BAA0B;CAC1B,eAAe;CACf,0BACC;CACD,iCACC;CACD,kCACC;CACD,wCACC;CACD,8BACC;CACD,CAAC"}