@clerk/backend 3.0.0-snapshot.v20251208202852 → 3.0.0-snapshot.v20251215203425

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.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createAuthenticateRequest,
3
3
  createBackendApiClient,
4
4
  verifyToken
5
- } from "./chunk-XZ7V2XHT.mjs";
5
+ } from "./chunk-6QDP7O5L.mjs";
6
6
  import "./chunk-YBVFDYDR.mjs";
7
7
  import {
8
8
  withLegacyReturn
package/dist/internal.js CHANGED
@@ -56,7 +56,7 @@ module.exports = __toCommonJS(internal_exports);
56
56
  // src/constants.ts
57
57
  var API_URL = "https://api.clerk.com";
58
58
  var API_VERSION = "v1";
59
- var USER_AGENT = `${"@clerk/backend"}@${"3.0.0-snapshot.v20251208202852"}`;
59
+ var USER_AGENT = `${"@clerk/backend"}@${"3.0.0-snapshot.v20251215203425"}`;
60
60
  var MAX_CACHE_LAST_UPDATED_AT_SECONDS = 5 * 60;
61
61
  var SUPPORTED_BAPI_VERSION = "2025-11-10";
62
62
  var Attributes = {
@@ -1023,13 +1023,36 @@ var APIKeysAPI = class extends AbstractAPI {
1023
1023
  bodyParams: params
1024
1024
  });
1025
1025
  }
1026
- async revoke(params) {
1026
+ async get(apiKeyId) {
1027
+ this.requireId(apiKeyId);
1028
+ return this.request({
1029
+ method: "GET",
1030
+ path: joinPaths(basePath4, apiKeyId)
1031
+ });
1032
+ }
1033
+ async update(params) {
1027
1034
  const { apiKeyId, ...bodyParams } = params;
1028
1035
  this.requireId(apiKeyId);
1036
+ return this.request({
1037
+ method: "PATCH",
1038
+ path: joinPaths(basePath4, apiKeyId),
1039
+ bodyParams
1040
+ });
1041
+ }
1042
+ async delete(apiKeyId) {
1043
+ this.requireId(apiKeyId);
1044
+ return this.request({
1045
+ method: "DELETE",
1046
+ path: joinPaths(basePath4, apiKeyId)
1047
+ });
1048
+ }
1049
+ async revoke(params) {
1050
+ const { apiKeyId, revocationReason = null } = params;
1051
+ this.requireId(apiKeyId);
1029
1052
  return this.request({
1030
1053
  method: "POST",
1031
1054
  path: joinPaths(basePath4, apiKeyId, "revoke"),
1032
- bodyParams
1055
+ bodyParams: { revocationReason }
1033
1056
  });
1034
1057
  }
1035
1058
  async getSecret(apiKeyId) {
@@ -4811,7 +4834,11 @@ var ClerkRequest = class extends Request {
4811
4834
  if (origin === initialUrl.origin) {
4812
4835
  return createClerkUrl(initialUrl);
4813
4836
  }
4814
- return createClerkUrl(initialUrl.pathname + initialUrl.search, origin);
4837
+ try {
4838
+ return createClerkUrl(initialUrl.pathname + initialUrl.search, origin);
4839
+ } catch {
4840
+ return createClerkUrl(initialUrl);
4841
+ }
4815
4842
  }
4816
4843
  getFirstValueFromHeader(value) {
4817
4844
  return value?.split(",")[0];
@@ -4825,7 +4852,8 @@ var ClerkRequest = class extends Request {
4825
4852
  }
4826
4853
  };
4827
4854
  var createClerkRequest = (...args) => {
4828
- return args[0] instanceof ClerkRequest ? args[0] : new ClerkRequest(...args);
4855
+ const isClerkRequest = args[0] && typeof args[0] === "object" && "clerkUrl" in args[0] && "cookies" in args[0];
4856
+ return isClerkRequest ? args[0] : new ClerkRequest(...args);
4829
4857
  };
4830
4858
 
4831
4859
  // src/tokens/cookie.ts