@cookiemunch/sdk 0.36.0 → 0.38.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.ts CHANGED
@@ -20,7 +20,7 @@ import type { ConformanceReport } from './executor-conformance.js';
20
20
  * This package's version, sent in the default User-Agent. Cloudflare answers a request with
21
21
  * no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
22
22
  */
23
- export declare const SDK_VERSION = "0.36.0";
23
+ export declare const SDK_VERSION = "0.38.0";
24
24
  export interface CookieMunchOptions {
25
25
  apiKey: string;
26
26
  /** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
@@ -3780,6 +3780,16 @@ export interface CookieMunchClient {
3780
3780
  issue(input?: ApiKeyIssueInput): Promise<ApiKeyIssued>;
3781
3781
  /** Revoke a key by its prefix. Immediate. */
3782
3782
  revoke(prefix: string): Promise<void>;
3783
+ /** Full-access or account key (`orgs:keys`): list another org's key prefixes. Same answer as `list()`. */
3784
+ listInOrg(orgId: string): Promise<ApiKeyPrefix[]>;
3785
+ /** Full-access or account key (`orgs:keys`): mint a key in another org of the same account. `scopes` is required with an account key. */
3786
+ createInOrg(orgId: string, input: ApiKeyIssueInput): Promise<ApiKeyIssued>;
3787
+ /** Full-access or account key (`orgs:keys`): update a key in another org. Same body and answer as `update()`. */
3788
+ updateInOrg(orgId: string, prefix: string, patch: ApiKeyUpdate): Promise<{
3789
+ ok: true;
3790
+ }>;
3791
+ /** Full-access or account key (`orgs:keys`): revoke a key in another org. Immediate. */
3792
+ revokeInOrg(orgId: string, prefix: string): Promise<void>;
3783
3793
  /** Rotate a key: a new secret, returned once, with the same scopes, lock and expiry. The old one stops working. */
3784
3794
  roll(prefix: string): Promise<ApiKeyIssued>;
3785
3795
  /** Rename a key, or replace its scopes or property lock. Only the fields sent change. */
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ async function exchangeOperatorToken(input) {
89
89
  }
90
90
 
91
91
  // src/index.ts
92
- var SDK_VERSION = "0.36.0";
92
+ var SDK_VERSION = "0.38.0";
93
93
  var CookieMunchApiError = class extends Error {
94
94
  constructor(status, message, code, body) {
95
95
  super(message);
@@ -486,6 +486,12 @@ function createCookieMunch(opts) {
486
486
  revoke: async (prefix) => {
487
487
  await request("DELETE", `/keys/${enc(prefix)}`);
488
488
  },
489
+ listInOrg: (orgId) => get(`/orgs/${enc(orgId)}/keys`),
490
+ createInOrg: (orgId, input) => request("POST", `/orgs/${enc(orgId)}/keys`, input),
491
+ updateInOrg: (orgId, prefix, patch) => request("PATCH", `/orgs/${enc(orgId)}/keys/${enc(prefix)}`, patch),
492
+ revokeInOrg: async (orgId, prefix) => {
493
+ await request("DELETE", `/orgs/${enc(orgId)}/keys/${enc(prefix)}`);
494
+ },
489
495
  roll: (prefix) => request("POST", `/keys/${enc(prefix)}/roll`),
490
496
  update: (prefix, patch) => request("PATCH", `/keys/${enc(prefix)}`, patch),
491
497
  report: (o) => get(`/keys/report${qs({ unusedDays: o?.unusedDays, expiringDays: o?.expiringDays })}`),