@cookiemunch/sdk 0.33.0 → 0.34.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.33.0";
23
+ export declare const SDK_VERSION = "0.34.0";
24
24
  export interface CookieMunchOptions {
25
25
  apiKey: string;
26
26
  /** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
@@ -107,6 +107,11 @@ export interface StandardPartnerLink {
107
107
  externalId?: string;
108
108
  label?: string;
109
109
  }
110
+ /** PATCH a partner link in place (CM-17): one or both. Scopes and events cannot change in place. */
111
+ export interface PartnerLinkUpdate {
112
+ externalId?: string;
113
+ label?: string;
114
+ }
110
115
  export interface StandardPartnerLinkCreate extends ResourceTagsInput {
111
116
  partner: string;
112
117
  /** `site:<cbid>` or `org:<org id>`. */
@@ -2932,6 +2937,14 @@ export interface CookieMunchClient {
2932
2937
  list(opts?: MetadataFilter): Promise<StandardPartnerLink[]>;
2933
2938
  create(input: StandardPartnerLinkCreate): Promise<StandardPartnerLink>;
2934
2939
  revoke(id: string): Promise<StandardPartnerLink>;
2940
+ /** Fix a link's externalId or label in place, keeping the grant. `warnings` names executor keys to re-mint. */
2941
+ update(id: string, input: PartnerLinkUpdate, opts?: {
2942
+ dryRun?: boolean;
2943
+ }): Promise<StandardPartnerLink & {
2944
+ change: 'updated' | 'unchanged';
2945
+ dryRun?: true;
2946
+ warnings?: string[];
2947
+ }>;
2935
2948
  };
2936
2949
  /** What `env` writes for a product provisioned with this stack ref: names, values, secret references. */
2937
2950
  provisionEnv(ref: string): Promise<ProvisionEnv>;
@@ -2966,6 +2979,15 @@ export interface CookieMunchClient {
2966
2979
  unlinkPartner(cbid: string, linkId: string): Promise<{
2967
2980
  link: PartnerLink;
2968
2981
  }>;
2982
+ /** Fix a site link's externalId or label in place, keeping the grant. `warnings` names executor keys to re-mint. */
2983
+ updatePartner(cbid: string, linkId: string, input: PartnerLinkUpdate, opts?: {
2984
+ dryRun?: boolean;
2985
+ }): Promise<{
2986
+ change: 'updated' | 'unchanged';
2987
+ link: PartnerLink;
2988
+ dryRun?: true;
2989
+ warnings?: string[];
2990
+ }>;
2969
2991
  getConfig(cbid: string): Promise<SiteConfig>;
2970
2992
  /**
2971
2993
  * Replaces the whole config — a top-level field you omit reverts to its default. With
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.33.0";
92
+ var SDK_VERSION = "0.34.0";
93
93
  var CookieMunchApiError = class extends Error {
94
94
  constructor(status, message, code, body) {
95
95
  super(message);
@@ -189,7 +189,8 @@ function createCookieMunch(opts) {
189
189
  partnerLinks: {
190
190
  list: (o) => get(`/partner_links${metaQs(o)}`),
191
191
  create: (input) => request("POST", "/partner_links", input),
192
- revoke: (id) => request("DELETE", `/partner_links/${enc(id)}`)
192
+ revoke: (id) => request("DELETE", `/partner_links/${enc(id)}`),
193
+ update: (id, input, o) => request("PATCH", `/partner_links/${enc(id)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input)
193
194
  },
194
195
  provisionEnv: (ref) => get(`/provision/env${qs({ ref })}`),
195
196
  sites: {
@@ -204,6 +205,7 @@ function createCookieMunch(opts) {
204
205
  listPartners: (cbid) => get(`/sites/${enc(cbid)}/partners`),
205
206
  linkPartner: (cbid, input, o) => request("POST", `/sites/${enc(cbid)}/partners${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
206
207
  unlinkPartner: (cbid, linkId) => request("DELETE", `/sites/${enc(cbid)}/partners/${enc(linkId)}`),
208
+ updatePartner: (cbid, linkId, input, o) => request("PATCH", `/sites/${enc(cbid)}/partners/${enc(linkId)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
207
209
  getConfig: (cbid) => get(`/sites/${enc(cbid)}/config`),
208
210
  putConfig: (cbid, config, opts2) => request("PUT", `/sites/${enc(cbid)}/config${qs({ keep: opts2?.keep })}`, config),
209
211
  patchConfig: (cbid, config) => request("PATCH", `/sites/${enc(cbid)}/config`, config),