@cookiemunch/sdk 0.33.0 → 0.35.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.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
23
|
+
export declare const SDK_VERSION = "0.35.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
|
|
@@ -3681,6 +3703,8 @@ export interface CookieMunchClient {
|
|
|
3681
3703
|
task(requestId: string, taskId: string): Promise<DsarTask>;
|
|
3682
3704
|
/** Approve an erasure awaiting approval: it is sent now. Audited with your key. 409 when it is not waiting. */
|
|
3683
3705
|
approveTask(requestId: string, taskId: string): Promise<DsarTask>;
|
|
3706
|
+
/** Send a failed task again once its system is fixed: a new request upstream; an erasure needing approval waits for it again. 409 unless failed and the request in progress. Audited. */
|
|
3707
|
+
retryTask(requestId: string, taskId: string): Promise<DsarTask>;
|
|
3684
3708
|
/** Reject an erasure awaiting approval: nothing is sent and the task fails with `reason`. Audited. */
|
|
3685
3709
|
rejectTask(requestId: string, taskId: string, opts?: {
|
|
3686
3710
|
reason?: string;
|
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.
|
|
92
|
+
var SDK_VERSION = "0.35.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),
|
|
@@ -455,6 +457,7 @@ function createCookieMunch(opts) {
|
|
|
455
457
|
taskExport: (requestId, taskId) => get(`/dsar/${enc(requestId)}/tasks/${enc(taskId)}/export`),
|
|
456
458
|
task: (requestId, taskId) => get(`/dsar/${enc(requestId)}/tasks/${enc(taskId)}`),
|
|
457
459
|
approveTask: (requestId, taskId) => request("POST", `/dsar/${enc(requestId)}/tasks/${enc(taskId)}/approve`),
|
|
460
|
+
retryTask: (requestId, taskId) => request("POST", `/dsar/${enc(requestId)}/tasks/${enc(taskId)}/retry`),
|
|
458
461
|
rejectTask: (requestId, taskId, o = {}) => request("POST", `/dsar/${enc(requestId)}/tasks/${enc(taskId)}/reject`, o.reason !== void 0 ? { reason: o.reason } : {}),
|
|
459
462
|
testExecutor: (id, input) => request("POST", `/dsar/executors/${enc(id)}/test`, input),
|
|
460
463
|
recheckExecutor: (id) => request("POST", `/dsar/executors/${enc(id)}/recheck`),
|