@cookiemunch/sdk 0.13.0 → 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/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.13.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
@@ -3337,7 +3340,9 @@ export interface CookieMunchClient {
3337
3340
  * Re-running it changes nothing; a changed create-only field (system, preset, presetVersion, preset params,
3338
3341
  * mintFrom, externalId) is `409 immutable_field` with every such field in `fields`.
3339
3342
  */
3340
- upsertExecutor(input: DsarExecutorInput | DsarExecutorPresetInput | Record<string, unknown>): Promise<DsarExecutor & {
3343
+ upsertExecutor(input: DsarExecutorInput | DsarExecutorPresetInput | Record<string, unknown>, opts?: {
3344
+ verify?: true | 'warn' | 'defer';
3345
+ }): Promise<DsarExecutor & {
3341
3346
  upserted: 'created' | 'updated';
3342
3347
  }>;
3343
3348
  /** What `connectExecutor` would create, validated in full; nothing is stored (`?dryRun=1`). */
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.13.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,9 +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 ? o.verify === "warn" ? "warn" : "1" : void 0 })}`, input),
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) => request("PUT", "/dsar/executors", input),
431
+ upsertExecutor: (input, o) => request("PUT", `/dsar/executors${qs({ verify: o?.verify === true ? "1" : o?.verify })}`, input),
432
432
  dryRunConnectExecutor: (input) => request("POST", "/dsar/executors?dryRun=1", input),
433
433
  executorPresets: () => get("/dsar/executors/presets"),
434
434
  upgradeExecutorPreset: (id, input = {}) => request("POST", `/dsar/executors/${enc(id)}/upgrade-preset`, input),