@cookiemunch/sdk 0.12.1 → 0.13.1
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.js +3 -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.13.1";
|
|
24
24
|
export interface CookieMunchOptions {
|
|
25
25
|
apiKey: string;
|
|
26
26
|
/** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
|
|
@@ -2263,6 +2263,8 @@ export interface DsarExecutor {
|
|
|
2263
2263
|
completionsUrl?: string;
|
|
2264
2264
|
/** True: its erasures wait (status `awaiting_approval`) for `approveTask` or `rejectTask`. */
|
|
2265
2265
|
requireApproval?: boolean;
|
|
2266
|
+
/** Made with `verify: 'defer'` and no probe has passed yet: not planned into requests, not alerted on. Absent: active. */
|
|
2267
|
+
state?: 'awaiting_first_probe';
|
|
2266
2268
|
/** On create only: the completion secret, shown this once. */
|
|
2267
2269
|
completionSecret?: string;
|
|
2268
2270
|
}
|
|
@@ -3321,10 +3323,11 @@ export interface CookieMunchClient {
|
|
|
3321
3323
|
connectExecutor(input: (DsarExecutorInput | DsarExecutorPresetInput) & ResourceTagsInput,
|
|
3322
3324
|
/**
|
|
3323
3325
|
* `verify: true` probes it first (a canary locate; no erasure is sent) and refuses a failing one
|
|
3324
|
-
* (422 `verify_failed`, nothing stored); `'warn'` stores it with the verdict in `warnings`.
|
|
3326
|
+
* (422 `verify_failed`, nothing stored); `'warn'` stores it with the verdict in `warnings`. `'defer'` (its API
|
|
3327
|
+
* is not deployed yet) probes nothing and stores it as `state: 'awaiting_first_probe'` until a probe passes.
|
|
3325
3328
|
*/
|
|
3326
3329
|
opts?: {
|
|
3327
|
-
verify?: true | 'warn';
|
|
3330
|
+
verify?: true | 'warn' | 'defer';
|
|
3328
3331
|
}): Promise<DsarExecutorCreated>;
|
|
3329
3332
|
/**
|
|
3330
3333
|
* Change a connection in place. Only what you send changes, and the stored credential
|
|
@@ -3332,6 +3335,16 @@ export interface CookieMunchClient {
|
|
|
3332
3335
|
* cost you the connection or its id.
|
|
3333
3336
|
*/
|
|
3334
3337
|
updateExecutor(id: string, patch: DsarExecutorPatch): Promise<DsarExecutor>;
|
|
3338
|
+
/**
|
|
3339
|
+
* Create or update the connection for a system from the same body as `connectExecutor` (`PUT /v1/dsar/executors`).
|
|
3340
|
+
* Re-running it changes nothing; a changed create-only field (system, preset, presetVersion, preset params,
|
|
3341
|
+
* mintFrom, externalId) is `409 immutable_field` with every such field in `fields`.
|
|
3342
|
+
*/
|
|
3343
|
+
upsertExecutor(input: DsarExecutorInput | DsarExecutorPresetInput | Record<string, unknown>, opts?: {
|
|
3344
|
+
verify?: true | 'warn' | 'defer';
|
|
3345
|
+
}): Promise<DsarExecutor & {
|
|
3346
|
+
upserted: 'created' | 'updated';
|
|
3347
|
+
}>;
|
|
3335
3348
|
/** What `connectExecutor` would create, validated in full; nothing is stored (`?dryRun=1`). */
|
|
3336
3349
|
dryRunConnectExecutor(input: DsarExecutorInput | DsarExecutorPresetInput): Promise<DsarExecutorDryRun>;
|
|
3337
3350
|
/** The versioned presets, whether each is usable now (or waits on another platform), and the org canary address. */
|
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ async function exchangeOperatorToken(input) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// src/index.ts
|
|
91
|
-
var SDK_VERSION = "0.
|
|
91
|
+
var SDK_VERSION = "0.13.1";
|
|
92
92
|
var CookieMunchApiError = class extends Error {
|
|
93
93
|
constructor(status, message, code, body) {
|
|
94
94
|
super(message);
|
|
@@ -426,8 +426,9 @@ function createCookieMunch(opts) {
|
|
|
426
426
|
reportTask: (taskId, ok, error) => request("POST", `/dsar/agent/tasks/${enc(taskId)}/result`, { ok, ...error !== void 0 ? { error } : {} }),
|
|
427
427
|
executors: (o) => get(`/dsar/executors${metaQs(o)}`),
|
|
428
428
|
executor: (id) => get(`/dsar/executors/${enc(id)}`),
|
|
429
|
-
connectExecutor: (input, o) => request("POST", `/dsar/executors${qs({ verify: o?.verify
|
|
429
|
+
connectExecutor: (input, o) => request("POST", `/dsar/executors${qs({ verify: o?.verify === true ? "1" : o?.verify })}`, input),
|
|
430
430
|
updateExecutor: (id, patch) => request("PATCH", `/dsar/executors/${enc(id)}`, patch),
|
|
431
|
+
upsertExecutor: (input, o) => request("PUT", `/dsar/executors${qs({ verify: o?.verify === true ? "1" : o?.verify })}`, input),
|
|
431
432
|
dryRunConnectExecutor: (input) => request("POST", "/dsar/executors?dryRun=1", input),
|
|
432
433
|
executorPresets: () => get("/dsar/executors/presets"),
|
|
433
434
|
upgradeExecutorPreset: (id, input = {}) => request("POST", `/dsar/executors/${enc(id)}/upgrade-preset`, input),
|