@zinn-digital/sdk 0.1.1934 → 0.1.1938

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.
@@ -10873,7 +10873,7 @@ export interface paths {
10873
10873
  put?: never;
10874
10874
  /**
10875
10875
  * Record that nothing is owed for an unmatched payment (staff, audited).
10876
- * @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
10876
+ * @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`); on a `surplus` row it must be 20+ characters (`422 refusal.orphanPayment.surplusReasonRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
10877
10877
  */
10878
10878
  post: operations["ignoreOrphanPayment"];
10879
10879
  delete?: never;
@@ -10893,7 +10893,7 @@ export interface paths {
10893
10893
  put?: never;
10894
10894
  /**
10895
10895
  * Credit an unmatched payment to a customer's wallet (staff, audited).
10896
- * @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
10896
+ * @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. A `surplus` row credits only the account whose order it paid (`422 refusal.orphanPayment.surplusOrgMismatch`), the provider-confirmed amount, once (keyed on the provider payment). Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
10897
10897
  */
10898
10898
  post: operations["linkOrphanPayment"];
10899
10899
  delete?: never;
@@ -10913,7 +10913,7 @@ export interface paths {
10913
10913
  put?: never;
10914
10914
  /**
10915
10915
  * Refund an unmatched payment at the provider that took it (staff, audited).
10916
- * @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
10916
+ * @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. A `surplus` row is never refunded to its source: `422 refusal.orphanPayment.surplusCreditOnly` (refunds are account credit only; use link). Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
10917
10917
  */
10918
10918
  post: operations["refundOrphanPayment"];
10919
10919
  delete?: never;
@@ -40673,6 +40673,8 @@ export interface paths {
40673
40673
  * An offload writing to **our** storage answers `422` with `code: FEATURE_NOT_INCLUDED` and no URLs once the organisation no longer holds a plan that includes object storage — checked on every request, because a plugin token outlives the plan that paid for it (D26223). An offload writing to the customer's own bucket is unaffected.
40674
40674
  *
40675
40675
  * **Hard cap.** When the plan states `object_storage_overage_cap_gb` and the latest complete measurement of the organisation's storage on our buckets has reached the allowance plus that cap, this answers `422` with `code: STORAGE_CAP_REACHED`, no URLs, and `refusal: {key: refusal.objectstorage.storageCapReached, params: {limitGb}}`. Nothing stored is touched: reads and deletes continue. An upgrade lifts it at once.
40676
+ *
40677
+ * **Issue-time ledger.** On a capped plan, every URL issued on our storage reserves its stated size, and the reservation is held until a complete usage measurement that started after the URL expired has counted whatever it uploaded (never released by the clock alone). A batch is refused with the same `STORAGE_CAP_REACHED` answer when the last measurement plus every held reservation plus this batch would cross the limit; the body then also carries `reasons`: the cap refusal followed by `refusal.objectstorage.uploadSpaceFreesAfterCheck` (space held for recent uploads frees after the next usage check). Each size is signed into its URL: storage refuses a body of any other length. On a capped plan a batch WITHOUT `sizes` (a plugin older than 1.7.0) is always refused, whatever the room left, with `code: STORAGE_CAP_REACHED` and `refusal: {key: refusal.objectstorage.updatePluginForCap}`, so every URL a capped plan is issued is length-bound. Uncapped plans (old plugins included) and a customer's own bucket are unaffected.
40676
40678
  */
40677
40679
  post: operations["createMediaOffloadUploads"];
40678
40680
  delete?: never;
@@ -98276,18 +98278,30 @@ export interface components {
98276
98278
  claimed_org_id: string;
98277
98279
  /** @description ISO 4217; empty when the provider did not say. */
98278
98280
  currency: string;
98281
+ /** @description The provider's own figures for a `surplus` row (crypto: what actually arrived, pay currency and amount, the quote). Empty on every other kind. */
98282
+ details: {
98283
+ [key: string]: unknown;
98284
+ };
98279
98285
  event_type: string;
98280
98286
  /** Format: date-time */
98281
98287
  first_seen_at: string;
98282
98288
  /** Format: uuid */
98283
98289
  id: string;
98284
- /** @enum {string} */
98285
- kind: "payment" | "unmatched" | "subscription_charge" | "closed_org" | "provider_subscription";
98290
+ /**
98291
+ * @description `surplus` (DOUBLEPAY): a second payment for an order another payment (or account credit) had already paid. HELD for staff: credit it to the order's own account (link, with that org) or ignore it with a reason of 20+ characters; a refund to the source is refused (`422 refusal.orphanPayment.surplusCreditOnly`), as refunds are account credit only.
98292
+ * @enum {string}
98293
+ */
98294
+ kind: "payment" | "unmatched" | "subscription_charge" | "closed_org" | "provider_subscription" | "surplus";
98286
98295
  /** Format: date-time */
98287
98296
  last_seen_at: string;
98288
98297
  /** Format: uuid */
98289
98298
  linked_org_id: string | null;
98290
98299
  livemode: boolean;
98300
+ /**
98301
+ * Format: uuid
98302
+ * @description The order a `surplus` row paid twice; null on every other kind.
98303
+ */
98304
+ order_id: string | null;
98291
98305
  payer_email: string;
98292
98306
  /** @enum {string} */
98293
98307
  provider: "stripe" | "paypal" | "nowpayments";
@@ -191266,6 +191280,8 @@ export interface operations {
191266
191280
  "application/json": {
191267
191281
  keys: string[];
191268
191282
  plugin_version?: string;
191283
+ /** @description Optional. The byte size of each key, in key order (one per key, else a validation `422`). Each size is signed into its upload URL as `content-length`. */
191284
+ sizes?: number[];
191269
191285
  };
191270
191286
  };
191271
191287
  };
@@ -193205,7 +193221,7 @@ export interface operations {
193205
193221
  401: components["responses"]["Unauthorized"];
193206
193222
  403: components["responses"]["Forbidden"];
193207
193223
  404: components["responses"]["NotFound"];
193208
- /** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. */
193224
+ /** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. Also (DAY-0350): another payment for this order is already being processed (a second tab, or a PayPal capture in progress), so nothing was asked of any processor and nothing was charged; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order: it is either paid or payable again. A failed attempt frees the order at once; an attempt whose outcome is unknown frees it after 10 minutes. */
193209
193225
  409: {
193210
193226
  headers: {
193211
193227
  [name: string]: unknown;
@@ -193376,7 +193392,7 @@ export interface operations {
193376
193392
  401: components["responses"]["Unauthorized"];
193377
193393
  403: components["responses"]["Forbidden"];
193378
193394
  404: components["responses"]["NotFound"];
193379
- /** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. */
193395
+ /** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. Also (DAY-0350): another payment for this order is already being processed (a card payment or a second capture), so PayPal was not asked to capture and nothing was taken; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order. */
193380
193396
  409: {
193381
193397
  headers: {
193382
193398
  [name: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1934",
3
+ "version": "0.1.1938",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",