@delopay/sdk 0.101.0 → 0.103.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 CHANGED
@@ -2299,6 +2299,22 @@ var Routing = class {
2299
2299
  async deactivate(params = {}) {
2300
2300
  return this.request("POST", "/routing/deactivate", { body: params });
2301
2301
  }
2302
+ /**
2303
+ * Edit a static routing configuration.
2304
+ *
2305
+ * Partial: send only the fields to change. `name`/`description` are
2306
+ * metadata-only; `algorithm` is a wholesale rule replacement, validated
2307
+ * against the shop exactly as at create. `modified_at` is bumped either way.
2308
+ *
2309
+ * `PUT /routing/{algorithmId}`
2310
+ *
2311
+ * @param algorithmId - The routing algorithm ID to edit.
2312
+ * @param params - The fields to change (at least one required).
2313
+ * @returns The updated routing configuration including the algorithm body.
2314
+ */
2315
+ async update(algorithmId, params) {
2316
+ return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, { body: params });
2317
+ }
2302
2318
  /**
2303
2319
  * List all routing algorithms for the current merchant.
2304
2320
  *
@@ -3894,6 +3910,46 @@ var Settlement = class {
3894
3910
  ...options
3895
3911
  });
3896
3912
  }
3913
+ /**
3914
+ * What a period's payments cost, and what was left over: gross, the
3915
+ * platform fee, hosting fees, what the rails took, and the margin, with a
3916
+ * per-connector breakdown.
3917
+ *
3918
+ * Send `year` and `month` together to report one UTC calendar month, or
3919
+ * neither for the running month so far.
3920
+ *
3921
+ * **Host-only.** The response is the host's cost base, which a shop owner
3922
+ * must never see, so a profile-scoped caller is refused with a 403 rather
3923
+ * than given a redacted shell. Gate the surface on the caller's scope
3924
+ * instead of calling it and handling the failure.
3925
+ *
3926
+ * Two things not to flatten when rendering the result:
3927
+ * `margin_usd` is absent — not zero — whenever `margin_quality` is
3928
+ * `'unknown'`, and `unlined_captured_attempt_count` (cost definitely
3929
+ * missing) means something different from `unlined_unresolved_attempt_count`
3930
+ * (mostly ordinary abandonment).
3931
+ *
3932
+ * `GET /settlement/cost`
3933
+ *
3934
+ * @example
3935
+ * ```typescript
3936
+ * const cost = await delopay.settlement.cost({ test_mode: false, year: 2026, month: 7 });
3937
+ * if (cost.margin_quality === 'unknown') {
3938
+ * // cost.margin_usd is absent — say so, do not render 0.00
3939
+ * }
3940
+ * ```
3941
+ */
3942
+ async cost(params, options) {
3943
+ return this.request("GET", "/settlement/cost", {
3944
+ query: {
3945
+ profile_id: params?.profile_id,
3946
+ test_mode: params?.test_mode,
3947
+ year: params?.year,
3948
+ month: params?.month
3949
+ },
3950
+ ...options
3951
+ });
3952
+ }
3897
3953
  /**
3898
3954
  * List generated settlement statements, newest first.
3899
3955
  *