@delopay/sdk 0.358.0 → 0.362.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.
@@ -1962,6 +1962,77 @@ var Disputes = class {
1962
1962
  }
1963
1963
  };
1964
1964
 
1965
+ // src/resources/chargebackPrevention.ts
1966
+ function preventionCaseQuery(params) {
1967
+ if (!params) return void 0;
1968
+ const { provider, source, status, outcome, match_status, ...query } = params;
1969
+ return {
1970
+ ...query,
1971
+ ...provider?.length ? { provider: provider.join(",") } : {},
1972
+ ...source?.length ? { source: source.join(",") } : {},
1973
+ ...status?.length ? { status: status.join(",") } : {},
1974
+ ...outcome?.length ? { outcome: outcome.join(",") } : {},
1975
+ ...match_status?.length ? { match_status: match_status.join(",") } : {}
1976
+ };
1977
+ }
1978
+ var ChargebackPrevention = class {
1979
+ constructor(request) {
1980
+ this.request = request;
1981
+ }
1982
+ /** The merchant's connections, with their business accounts and sync health. */
1983
+ async listConnections() {
1984
+ return this.request("GET", "/chargeback-prevention/connections");
1985
+ }
1986
+ /**
1987
+ * Connect a provider account. DeloPay checks the key with the provider,
1988
+ * registers its webhooks there and starts reading alerts. Dashboard session
1989
+ * only.
1990
+ */
1991
+ async connect(params) {
1992
+ return this.request("POST", "/chargeback-prevention/connections", { body: params });
1993
+ }
1994
+ /** Replace a connection's key; reconnects one whose key was refused. */
1995
+ async replaceKey(connectionId, params) {
1996
+ return this.request(
1997
+ "PUT",
1998
+ `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/key`,
1999
+ { body: params }
2000
+ );
2001
+ }
2002
+ /** Stop reading a connection. Its cases are kept. */
2003
+ async disconnect(connectionId) {
2004
+ return this.request(
2005
+ "DELETE",
2006
+ `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}`
2007
+ );
2008
+ }
2009
+ /** Read the connection's alerts again as soon as the provider allows. */
2010
+ async syncNow(connectionId) {
2011
+ return this.request(
2012
+ "POST",
2013
+ `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/sync`
2014
+ );
2015
+ }
2016
+ /** Set the shops a provider business account sells through; its cases are matched again. */
2017
+ async mapAccount(connectionId, providerAccountId, params) {
2018
+ return this.request(
2019
+ "PUT",
2020
+ `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/accounts/${encodeURIComponent(providerAccountId)}`,
2021
+ { body: params }
2022
+ );
2023
+ }
2024
+ /** Cases with what DeloPay's records say happened to each payment. */
2025
+ async listCases(params) {
2026
+ return this.request("GET", "/chargeback-prevention/cases", {
2027
+ query: preventionCaseQuery(params)
2028
+ });
2029
+ }
2030
+ /** One case with its references and observed history. */
2031
+ async retrieveCase(caseId) {
2032
+ return this.request("GET", `/chargeback-prevention/cases/${encodeURIComponent(caseId)}`);
2033
+ }
2034
+ };
2035
+
1965
2036
  // src/resources/paypalDisputes.ts
1966
2037
  var PaypalDisputes = class {
1967
2038
  constructor(request) {
@@ -4201,7 +4272,12 @@ var Routing = class {
4201
4272
  async getDefaultForProfile(profileId) {
4202
4273
  return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
4203
4274
  }
4204
- /** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
4275
+ /**
4276
+ * Update default config for a profile. `POST /routing/default/profile/{profileId}`
4277
+ *
4278
+ * Send the list alone to keep the shop's fallback mode, or `{ connectors, mode, splits }` to set
4279
+ * it. A `volume_split` whose shares do not total 100 is refused.
4280
+ */
4205
4281
  async updateDefaultProfile(profileId, params, options) {
4206
4282
  return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
4207
4283
  body: params,
@@ -10815,6 +10891,7 @@ var Delopay = class {
10815
10891
  this.paymentLinks = new PaymentLinks(request);
10816
10892
  this.mandates = new Mandates(request);
10817
10893
  this.disputes = new Disputes(request);
10894
+ this.chargebackPrevention = new ChargebackPrevention(request);
10818
10895
  this.paypalDisputes = new PaypalDisputes(request);
10819
10896
  this.whopResolutionCases = new WhopResolutionCases(request);
10820
10897
  this.payouts = new Payouts(request);
@@ -12267,6 +12344,7 @@ function enigmaCustomCssProblem(css) {
12267
12344
  if (/[^\x20-\x7e\n\r\t]/.test(css)) return "not_ascii";
12268
12345
  if (css.includes("<")) return "markup";
12269
12346
  if (css.includes("\\")) return "escape";
12347
+ if (/["']/.test(css)) return "quote";
12270
12348
  const lower = css.toLowerCase();
12271
12349
  if (lower.includes("/*")) return "comment";
12272
12350
  if (["url(", "image-set(", "image(", "element(", "cross-fade(", "src(", "data:"].some(
@@ -12282,9 +12360,19 @@ function enigmaCustomCssProblem(css) {
12282
12360
  if (/@(?!media)/.test(lower)) return "at_rule";
12283
12361
  const compact = lower.split(/\s+/).filter(Boolean).join(" ");
12284
12362
  const blocks = [];
12363
+ const brackets = [];
12285
12364
  let text = "";
12286
12365
  for (const ch of compact) {
12287
- if (ch === "{") {
12366
+ if ((ch === "{" || ch === "}" || ch === ";") && brackets.length > 0) return "misplaced";
12367
+ if (ch === "(" || ch === "[") {
12368
+ brackets.push(ch);
12369
+ text += ch;
12370
+ } else if (ch === ")" || ch === "]") {
12371
+ if (brackets.pop() !== (ch === ")" ? "(" : "[")) return "unbalanced";
12372
+ text += ch;
12373
+ } else if (ch === "{") {
12374
+ const outer = blocks[blocks.length - 1];
12375
+ if (outer && !outer.media) return "misplaced";
12288
12376
  const prelude = text.trim();
12289
12377
  text = "";
12290
12378
  const media = prelude.startsWith("@media");
@@ -12299,9 +12387,11 @@ function enigmaCustomCssProblem(css) {
12299
12387
  const top = blocks[blocks.length - 1];
12300
12388
  if (!top) {
12301
12389
  if (ch === "}") return "unbalanced";
12390
+ if (declaration.trim()) return "misplaced";
12302
12391
  continue;
12303
12392
  }
12304
- if (!top.media && declaration.trim()) {
12393
+ if (declaration.trim()) {
12394
+ if (top.media) return "misplaced";
12305
12395
  const problem = declarationProblem(top.selector.replace(/, /g, ","), declaration);
12306
12396
  if (problem) return problem;
12307
12397
  }
@@ -12310,7 +12400,8 @@ function enigmaCustomCssProblem(css) {
12310
12400
  text += ch;
12311
12401
  }
12312
12402
  }
12313
- return blocks.length > 0 ? "unbalanced" : null;
12403
+ if (blocks.length > 0 || brackets.length > 0) return "unbalanced";
12404
+ return text.trim() ? "misplaced" : null;
12314
12405
  }
12315
12406
  function enigmaCornerPx(corner) {
12316
12407
  return { square: 0, small: 6, medium: 8, large: 12, pill: 22 }[corner];
@@ -16597,6 +16688,8 @@ export {
16597
16688
  DelopayError,
16598
16689
  DelopayAuthenticationError,
16599
16690
  runExport,
16691
+ preventionCaseQuery,
16692
+ ChargebackPrevention,
16600
16693
  PaypalDisputes,
16601
16694
  WhopResolutionCases,
16602
16695
  Search,
@@ -16892,4 +16985,4 @@ export {
16892
16985
  decodeNativePanes,
16893
16986
  encodeNativePanes
16894
16987
  };
16895
- //# sourceMappingURL=chunk-E7CYYHZ3.js.map
16988
+ //# sourceMappingURL=chunk-RI3ZRID4.js.map