@thirdweb-dev/service-utils 0.3.0 → 0.3.1-nightly-2a91113a-20230804173454

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.
@@ -201,5 +201,6 @@ exports.SERVICE_NAMES = services.SERVICE_NAMES;
201
201
  exports.getServiceByName = services.getServiceByName;
202
202
  exports.authorizeWorker = authorizeWorker;
203
203
  exports.deriveClientIdFromSecretKeyHash = deriveClientIdFromSecretKeyHash;
204
+ exports.extractAuthorizationData = extractAuthorizationData;
204
205
  exports.hashSecretKey = hashSecretKey;
205
206
  exports.publishUsageEvents = publishUsageEvents;
@@ -201,5 +201,6 @@ exports.SERVICE_NAMES = services.SERVICE_NAMES;
201
201
  exports.getServiceByName = services.getServiceByName;
202
202
  exports.authorizeWorker = authorizeWorker;
203
203
  exports.deriveClientIdFromSecretKeyHash = deriveClientIdFromSecretKeyHash;
204
+ exports.extractAuthorizationData = extractAuthorizationData;
204
205
  exports.hashSecretKey = hashSecretKey;
205
206
  exports.publishUsageEvents = publishUsageEvents;
@@ -191,4 +191,4 @@ function bufferToHex(buffer) {
191
191
  return [...new Uint8Array(buffer)].map(x => x.toString(16).padStart(2, "0")).join("");
192
192
  }
193
193
 
194
- export { authorizeWorker, deriveClientIdFromSecretKeyHash, hashSecretKey, publishUsageEvents };
194
+ export { authorizeWorker, deriveClientIdFromSecretKeyHash, extractAuthorizationData, hashSecretKey, publishUsageEvents };
@@ -1,6 +1,7 @@
1
1
  import type { ExecutionContext, KVNamespace } from "@cloudflare/workers-types";
2
2
  import type { CoreServiceConfig } from "../core/api";
3
3
  import type { Request } from "@cloudflare/workers-types";
4
+ import type { AuthorizationInput } from "../core/authorize";
4
5
  import type { AuthorizationResult } from "../core/authorize/types";
5
6
  import type { CoreAuthInput } from "../core/types";
6
7
  export * from "../core/services";
@@ -14,6 +15,7 @@ type AuthInput = CoreAuthInput & {
14
15
  req: Request;
15
16
  };
16
17
  export declare function authorizeWorker(authInput: AuthInput, serviceConfig: WorkerServiceConfig): Promise<AuthorizationResult>;
18
+ export declare function extractAuthorizationData(authInput: AuthInput): Promise<AuthorizationInput>;
17
19
  export declare function hashSecretKey(secretKey: string): Promise<string>;
18
20
  export declare function deriveClientIdFromSecretKeyHash(secretKeyHash: string): string;
19
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/cf-worker","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AAExB,KAAK,mBAAmB,GAAG,iBAAiB,GAAG;IAC7C,OAAO,EAAE,WAAW,CAAC;IACrB,GAAG,EAAE,gBAAgB,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAIF,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,wBAAsB,eAAe,CACnC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAiFD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,mBAIpD;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,UAEpE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/cf-worker","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AAExB,KAAK,mBAAmB,GAAG,iBAAiB,GAAG;IAC7C,OAAO,EAAE,WAAW,CAAC;IACrB,GAAG,EAAE,gBAAgB,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAIF,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,wBAAsB,eAAe,CACnC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA0C9B;AAED,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,kBAAkB,CAAC,CA2E7B;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,mBAIpD;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,UAEpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdweb-dev/service-utils",
3
- "version": "0.3.0",
3
+ "version": "0.3.1-nightly-2a91113a-20230804173454",
4
4
  "main": "dist/thirdweb-dev-service-utils.cjs.js",
5
5
  "module": "dist/thirdweb-dev-service-utils.esm.js",
6
6
  "exports": {