@delopay/sdk 0.361.0 → 0.363.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
@@ -2303,29 +2303,6 @@ var ChargebackPrevention = class {
2303
2303
  async listConnections() {
2304
2304
  return this.request("GET", "/chargeback-prevention/connections");
2305
2305
  }
2306
- /**
2307
- * Connect a provider account. DeloPay checks the key with the provider,
2308
- * registers its webhooks there and starts reading alerts. Dashboard session
2309
- * only.
2310
- */
2311
- async connect(params) {
2312
- return this.request("POST", "/chargeback-prevention/connections", { body: params });
2313
- }
2314
- /** Replace a connection's key; reconnects one whose key was refused. */
2315
- async replaceKey(connectionId, params) {
2316
- return this.request(
2317
- "PUT",
2318
- `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/key`,
2319
- { body: params }
2320
- );
2321
- }
2322
- /** Stop reading a connection. Its cases are kept. */
2323
- async disconnect(connectionId) {
2324
- return this.request(
2325
- "DELETE",
2326
- `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}`
2327
- );
2328
- }
2329
2306
  /** Read the connection's alerts again as soon as the provider allows. */
2330
2307
  async syncNow(connectionId) {
2331
2308
  return this.request(
@@ -2333,14 +2310,6 @@ var ChargebackPrevention = class {
2333
2310
  `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/sync`
2334
2311
  );
2335
2312
  }
2336
- /** Set the shops a provider business account sells through; its cases are matched again. */
2337
- async mapAccount(connectionId, providerAccountId, params) {
2338
- return this.request(
2339
- "PUT",
2340
- `/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/accounts/${encodeURIComponent(providerAccountId)}`,
2341
- { body: params }
2342
- );
2343
- }
2344
2313
  /** Cases with what DeloPay's records say happened to each payment. */
2345
2314
  async listCases(params) {
2346
2315
  return this.request("GET", "/chargeback-prevention/cases", {
@@ -12664,6 +12633,7 @@ function enigmaCustomCssProblem(css) {
12664
12633
  if (/[^\x20-\x7e\n\r\t]/.test(css)) return "not_ascii";
12665
12634
  if (css.includes("<")) return "markup";
12666
12635
  if (css.includes("\\")) return "escape";
12636
+ if (/["']/.test(css)) return "quote";
12667
12637
  const lower = css.toLowerCase();
12668
12638
  if (lower.includes("/*")) return "comment";
12669
12639
  if (["url(", "image-set(", "image(", "element(", "cross-fade(", "src(", "data:"].some(
@@ -12679,9 +12649,19 @@ function enigmaCustomCssProblem(css) {
12679
12649
  if (/@(?!media)/.test(lower)) return "at_rule";
12680
12650
  const compact = lower.split(/\s+/).filter(Boolean).join(" ");
12681
12651
  const blocks = [];
12652
+ const brackets = [];
12682
12653
  let text = "";
12683
12654
  for (const ch of compact) {
12684
- if (ch === "{") {
12655
+ if ((ch === "{" || ch === "}" || ch === ";") && brackets.length > 0) return "misplaced";
12656
+ if (ch === "(" || ch === "[") {
12657
+ brackets.push(ch);
12658
+ text += ch;
12659
+ } else if (ch === ")" || ch === "]") {
12660
+ if (brackets.pop() !== (ch === ")" ? "(" : "[")) return "unbalanced";
12661
+ text += ch;
12662
+ } else if (ch === "{") {
12663
+ const outer = blocks[blocks.length - 1];
12664
+ if (outer && !outer.media) return "misplaced";
12685
12665
  const prelude = text.trim();
12686
12666
  text = "";
12687
12667
  const media = prelude.startsWith("@media");
@@ -12696,9 +12676,11 @@ function enigmaCustomCssProblem(css) {
12696
12676
  const top = blocks[blocks.length - 1];
12697
12677
  if (!top) {
12698
12678
  if (ch === "}") return "unbalanced";
12679
+ if (declaration.trim()) return "misplaced";
12699
12680
  continue;
12700
12681
  }
12701
- if (!top.media && declaration.trim()) {
12682
+ if (declaration.trim()) {
12683
+ if (top.media) return "misplaced";
12702
12684
  const problem = declarationProblem(top.selector.replace(/, /g, ","), declaration);
12703
12685
  if (problem) return problem;
12704
12686
  }
@@ -12707,7 +12689,8 @@ function enigmaCustomCssProblem(css) {
12707
12689
  text += ch;
12708
12690
  }
12709
12691
  }
12710
- return blocks.length > 0 ? "unbalanced" : null;
12692
+ if (blocks.length > 0 || brackets.length > 0) return "unbalanced";
12693
+ return text.trim() ? "misplaced" : null;
12711
12694
  }
12712
12695
  function enigmaCornerPx(corner) {
12713
12696
  return { square: 0, small: 6, medium: 8, large: 12, pill: 22 }[corner];