@pybara/pybara-js 0.5.0 → 0.7.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/pybara-js.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* Pybara.js - pybara.com */
2
2
  import { n as e, r as t, t as n } from "./admin-B1pVP25-.js";
3
- import { t as r } from "./modal-wfJS0oVP.js";
3
+ import { t as r } from "./modal-CvQ7qr5d.js";
4
4
  var i = {
5
5
  widget: "donate-widget",
6
6
  recurring: "donate-widget-recurring"
@@ -24,21 +24,25 @@ async function s(t, n, r) {
24
24
  } catch (e) {
25
25
  return {
26
26
  show: !1,
27
+ cause: "unreadable",
27
28
  reason: `could not read the widget's configuration (${e instanceof Error ? e.message : String(e)})`
28
29
  };
29
30
  }
30
31
  let f = u.kill_switch?.plugins ?? {};
31
32
  return f[i.widget]?.enabled === !0 ? !d.signed || !d.version ? {
32
33
  show: !1,
34
+ cause: "terms",
33
35
  reason: `${n} has not accepted the widget's terms in Pybara Wallet (Manage › Sites › Add a site without a plugin)`
34
36
  } : a(d.version, "1-0") ? {
35
37
  show: !0,
36
38
  recurring: f[i.recurring]?.enabled === !0
37
39
  } : {
38
40
  show: !1,
41
+ cause: "terms",
39
42
  reason: `this widget version requires terms 1-0, and ${n} accepted ${d.version}: accept the new terms in Pybara Wallet (Manage › Sites)`
40
43
  } : {
41
44
  show: !1,
45
+ cause: "switched-off",
42
46
  reason: "the widget is switched off by Pybara for now"
43
47
  };
44
48
  }
@@ -48,16 +52,142 @@ var c = class extends Error {
48
52
  constructor(e, t) {
49
53
  super(t), this.name = "PybaraError", this.code = e;
50
54
  }
51
- }, l = /^(0|[1-9]\d*)(\.\d+)?$/, u = /^[a-z0-9-]{1,64}$/, d = class {
55
+ };
56
+ //#endregion
57
+ //#region src/buttons.ts
58
+ function l(e) {
59
+ let t = typeof e?.height == "number" && Number.isFinite(e.height) ? Math.round(e.height) : 45;
60
+ return Math.min(55, Math.max(25, t));
61
+ }
62
+ function u(e, t) {
63
+ return e?.shape === "sharp" ? "0" : e?.shape === "rect" ? "4px" : `${t / 2}px`;
64
+ }
65
+ function d(e) {
66
+ let t = typeof e == "string" ? document.querySelector(e) : e;
67
+ if (!t) throw new c("INVALID_CONFIG", `buttons().render(): no element matches ${JSON.stringify(e)}`);
68
+ return t;
69
+ }
70
+ function f(e, t) {
71
+ if (typeof t?.createPayment != "function") throw new c("INVALID_CONFIG", "buttons(): \"createPayment\" is required, a function returning the payment from the form, e.g. () => ({ amount: form.amount.value, currency: \"EUR\" })");
72
+ let n = new URL(e.walletUrl).origin, r = [], i = null;
73
+ async function a() {
74
+ try {
75
+ let n = await t.createPayment();
76
+ await e.open({
77
+ ...n,
78
+ onSuccess: t.onSuccess,
79
+ onError: t.onError,
80
+ onClose: t.onClose
81
+ });
82
+ } catch (e) {
83
+ t.onError?.(e instanceof Error ? e : Error(String(e)));
84
+ }
85
+ }
86
+ function o(o) {
87
+ let s = d(o), c = l(t.style), f = document.createElement("div");
88
+ f.style.cssText = `position:relative;width:100%;height:${c}px;`;
89
+ let p = document.createElement("div");
90
+ p.setAttribute("aria-hidden", "true"), p.style.cssText = `position:absolute;inset:0;border-radius:${u(t.style, c)};background:rgba(128,128,128,0.16);`;
91
+ let m = document.createElement("iframe");
92
+ m.src = `${n}/button`, m.title = "Pybara", m.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0;opacity:0;color-scheme:normal;background:transparent;", f.append(p, m), s.appendChild(f);
93
+ let h = !1, g = null, _ = {};
94
+ i ??= _;
95
+ let v = (e) => {
96
+ m.contentWindow?.postMessage(e, n);
97
+ }, y = (e) => {
98
+ g = e, h && v({
99
+ type: "pybara_button_availability",
100
+ v: 1,
101
+ status: e.status
102
+ }), i ??= _, i === _ && t.onStateChange?.(e);
103
+ };
104
+ m.addEventListener("load", () => {
105
+ v({
106
+ type: "pybara_button_init",
107
+ v: 1,
108
+ style: t.style ?? {},
109
+ hideWhenUnavailable: t.hideWhenUnavailable === !0
110
+ });
111
+ }, { once: !0 });
112
+ let b = (e) => {
113
+ if (e.origin !== n || e.source !== m.contentWindow) return;
114
+ let t = e.data;
115
+ t?.type === "pybara_button_ready" || t?.type === "pybara_button_resize" ? (typeof t.height == "number" && (f.style.height = `${t.height}px`), h || (h = !0, m.style.opacity = "1", p.remove(), g && v({
116
+ type: "pybara_button_availability",
117
+ v: 1,
118
+ status: g.status
119
+ }))) : t?.type === "pybara_button_click" && a();
120
+ };
121
+ window.addEventListener("message", b);
122
+ let x = e.subscribeAvailability(y);
123
+ r.push(() => {
124
+ window.removeEventListener("message", b), x(), i === _ && (i = null), f.remove();
125
+ });
126
+ }
127
+ return {
128
+ render: o,
129
+ destroy() {
130
+ for (let e of r.splice(0)) e();
131
+ }
132
+ };
133
+ }
134
+ //#endregion
135
+ //#region src/checkout.ts
136
+ var p = /^(0|[1-9]\d*)(\.\d+)?$/, m = /^[a-z0-9-]{1,64}$/, h = class {
52
137
  constructor(e) {
53
- this.adminClient = null, this.modal = null, this.gateOutcome = null, this.isOpen = !1, this.completedPayment = !1, this.activePayment = null, this.config = m(e), this.ready = this.init();
138
+ this.adminClient = null, this.modal = null, this.gateOutcome = null, this.isOpen = !1, this.completedPayment = !1, this.activePayment = null, this.lastPrecheck = {}, this.availabilityListeners = /* @__PURE__ */ new Set(), this.latestAvailability = null, this.config = v(e), this.config.onAvailability && this.availabilityListeners.add(this.config.onAvailability), this.ready = this.init(), this.config.onAvailability && this.precheck();
139
+ }
140
+ buttons(e) {
141
+ return f({
142
+ walletUrl: t[this.config.staging ? "staging" : "prod"],
143
+ open: (e) => this.open(e),
144
+ subscribeAvailability: (e) => (this.availabilityListeners.add(e), this.latestAvailability ? e(this.latestAvailability) : !this.config.onAvailability && this.availabilityListeners.size === 1 && this.precheck(this.lastPrecheck), () => {
145
+ this.availabilityListeners.delete(e);
146
+ })
147
+ }, e);
148
+ }
149
+ emitAvailability(e) {
150
+ this.latestAvailability = e;
151
+ for (let t of this.availabilityListeners) t(e);
152
+ }
153
+ precheck(e = {}) {
154
+ let t = typeof e.amount == "number" && Number.isFinite(e.amount) ? String(e.amount) : e.amount;
155
+ this.lastPrecheck = {
156
+ amount: typeof t == "string" ? t : void 0,
157
+ currency: e.currency ?? this.config.currency
158
+ }, this.sendPrecheck();
159
+ }
160
+ async sendPrecheck() {
161
+ if (this.availabilityListeners.size === 0) return;
162
+ await this.ready;
163
+ let e = this.gateOutcome;
164
+ if (e && !e.show) {
165
+ let t = e.cause === "unreadable" ? {
166
+ status: "retry-later",
167
+ reason: "GATE_UNREADABLE",
168
+ detail: `Pybara: ${e.reason}; the checkout tries again at the click.`
169
+ } : e.cause === "switched-off" ? {
170
+ status: "unavailable",
171
+ reason: "SWITCHED_OFF",
172
+ detail: `Pybara: ${e.reason}.`
173
+ } : {
174
+ status: "unavailable",
175
+ reason: "SITE_NOT_READY",
176
+ detail: `Pybara: ${e.reason}; the site owner does this, not the page. https://docs.pybara.com/pybara-js/setup/`
177
+ };
178
+ t.detail && console.warn(t.detail), this.emitAvailability(t);
179
+ } else this.modal?.precheck({
180
+ beneficiary: this.config.recipientPrincipal,
181
+ siteUrl: this.config.siteUrl,
182
+ ...this.lastPrecheck
183
+ });
54
184
  }
55
185
  get gate() {
56
186
  return this.gateOutcome;
57
187
  }
58
188
  async open(e) {
59
189
  if (await this.ready, this.gateOutcome && !this.gateOutcome.show) throw new c("GATE_REFUSED", this.gateOutcome.reason ?? "This site cannot accept Pybara payments yet.");
60
- let t = f(e.amount);
190
+ let t = g(e.amount);
61
191
  if (t === null) throw new c("INVALID_CONFIG", `open(): "amount" must be a decimal string in the currency's major units, e.g. "12.34", or a positive number — got ${JSON.stringify(e.amount)}`);
62
192
  let n = e.currency ?? this.config.currency;
63
193
  if (!n) throw new c("INVALID_CONFIG", "open(): \"currency\" is required — pass it to open(), or set it once in Pybara.checkout()");
@@ -86,14 +216,14 @@ var c = class extends Error {
86
216
  a.show({
87
217
  modalData: {
88
218
  beneficiary: this.config.recipientPrincipal,
89
- salt: h(),
219
+ salt: y(),
90
220
  reference: this.config.siteName
91
221
  },
92
222
  recurring: r,
93
223
  checkout: this.checkoutFor(e, t, n)
94
224
  });
95
225
  } catch (e) {
96
- throw this.isOpen = !1, this.activePayment = null, g(e);
226
+ throw this.isOpen = !1, this.activePayment = null, b(e);
97
227
  }
98
228
  }
99
229
  }
@@ -128,6 +258,7 @@ var c = class extends Error {
128
258
  context: "donation",
129
259
  thankYouMessage: n.thankYouMessage,
130
260
  locale: n.locale,
261
+ onAvailability: (e) => i.emitAvailability(e),
131
262
  onSuccess: (e) => {
132
263
  i.completedPayment = !0;
133
264
  let t = i.activePayment, r = t?.frequency != null, a = {
@@ -146,14 +277,14 @@ var c = class extends Error {
146
277
  onError: (e) => {
147
278
  i.isOpen = !1;
148
279
  let t = i.activePayment;
149
- i.activePayment = null, t?.onError?.(g(e)), i.modal = null, i.initCheckoutModal();
280
+ i.activePayment = null, t?.onError?.(b(e)), i.modal = null, i.initCheckoutModal();
150
281
  },
151
282
  onClose: () => {
152
283
  i.isOpen = !1;
153
284
  let e = i.activePayment;
154
285
  i.activePayment = null, e?.onClose?.(), i.completedPayment && n.thankYouRedirectUrl ? window.location.href = n.thankYouRedirectUrl : (i.completedPayment = !1, i.modal = null, i.initCheckoutModal());
155
286
  }
156
- });
287
+ }), this.availabilityListeners.size > 0 && this.modal && Object.keys(this.lastPrecheck).length > 0 && this.sendPrecheck();
157
288
  }
158
289
  checkoutFor(e, t, n) {
159
290
  let r = this.config;
@@ -207,11 +338,11 @@ var c = class extends Error {
207
338
  n.rel = "preconnect", n.href = new URL(t[e]).origin, n.crossOrigin = "anonymous", document.head.appendChild(n);
208
339
  }
209
340
  };
210
- function f(e) {
341
+ function g(e) {
211
342
  let t = typeof e == "number" && Number.isFinite(e) ? String(e) : e;
212
- return typeof t != "string" || !l.test(t) || !/[1-9]/.test(t) ? null : t;
343
+ return typeof t != "string" || !p.test(t) || !/[1-9]/.test(t) ? null : t;
213
344
  }
214
- function p(e) {
345
+ function _(e) {
215
346
  let t = e.trim();
216
347
  if (!t) return null;
217
348
  let n;
@@ -222,14 +353,14 @@ function p(e) {
222
353
  }
223
354
  return n.protocol !== "https:" && n.protocol !== "http:" ? null : n.origin + n.pathname.replace(/\/+$/, "");
224
355
  }
225
- function m(e) {
356
+ function v(e) {
226
357
  if (!e.recipientPrincipal) throw new c("INVALID_CONFIG", "Pybara.checkout: \"recipientPrincipal\" is required");
227
358
  if (!e.siteUrl) throw new c("INVALID_CONFIG", "Pybara.checkout: \"siteUrl\" is required");
228
- let t = p(e.siteUrl);
359
+ let t = _(e.siteUrl);
229
360
  if (!t) throw new c("INVALID_CONFIG", `Pybara.checkout: "siteUrl" is not a valid http(s) URL: ${e.siteUrl}`);
230
361
  if (!e.siteName) throw new c("INVALID_CONFIG", "Pybara.checkout: \"siteName\" is required");
231
362
  if (e.currency != null && !/^[A-Z]{3}$/.test(e.currency)) throw new c("INVALID_CONFIG", `Pybara.checkout: "currency" must be an uppercase ISO 4217 code, e.g. "EUR" — got ${JSON.stringify(e.currency)}`);
232
- if (e.platform != null && !u.test(e.platform)) throw new c("INVALID_CONFIG", "Pybara.checkout: \"platform\" must be a lowercase slug (a-z, 0-9, -), at most 64 characters");
363
+ if (e.platform != null && !m.test(e.platform)) throw new c("INVALID_CONFIG", "Pybara.checkout: \"platform\" must be a lowercase slug (a-z, 0-9, -), at most 64 characters");
233
364
  return {
234
365
  ...e,
235
366
  siteUrl: t,
@@ -237,18 +368,18 @@ function m(e) {
237
368
  debug: e.debug ?? !1
238
369
  };
239
370
  }
240
- function h() {
371
+ function y() {
241
372
  let e = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
242
373
  return btoa(String.fromCharCode(...e));
243
374
  }
244
- function g(e) {
375
+ function b(e) {
245
376
  return e instanceof Error ? e : Error(String(e));
246
377
  }
247
378
  //#endregion
248
379
  //#region src/index.ts
249
- function _(e) {
250
- return new d(e);
380
+ function x(e) {
381
+ return new h(e);
251
382
  }
252
- var v = { checkout: _ };
383
+ var S = { checkout: x };
253
384
  //#endregion
254
- export { v as Pybara, d as PybaraCheckout, c as PybaraError, _ as checkout };
385
+ export { S as Pybara, h as PybaraCheckout, c as PybaraError, x as checkout };
package/dist/types.d.ts CHANGED
@@ -1,9 +1,4 @@
1
- /**
2
- * Public types for @pybara/pybara-js.
3
- *
4
- * The surface is deliberately shaped like stripe-js and paypal-js: a brand-level object (`Pybara`) with a verb (`checkout`) that returns a callable, instead of a rendered component.
5
- * The host owns its DOM — amount selector, payment-method list, form fields — and Pybara opens its own checkout surface over it.
6
- */
1
+ import { Availability } from './modal/modal';
7
2
  /** Recurring frequencies — must match subs.mo's allowedFrequencies, the canister that schedules the pulls. 'every2min' exists for testing. */
8
3
  export type Frequency = 'weekly' | 'monthly' | 'yearly' | 'every2min';
9
4
  /** Site-level configuration, bound once by Pybara.checkout(). */
@@ -40,6 +35,13 @@ export interface CheckoutConfig {
40
35
  staging?: boolean;
41
36
  /** Debug logging. Default false. */
42
37
  debug?: boolean;
38
+ /**
39
+ * Whether a payment would go through right now, before any click: called once the checkout is ready, then after each precheck({ amount, currency }).
40
+ * Act on `status`: `available`, show Pybara; `unavailable`, hide it (nothing on the page can fix it: the site isn't registered, its DNS record or terms are missing, the currency isn't served); `below-minimum`, keep it but disable the button, showing `message` ("Minimum €0.70"); `retry-later`, keep it.
41
+ * `message` is in the payer's language; `detail`, in English, says what is missing and who fixes it, and is also printed to the console.
42
+ * Without this callback nothing changes: open() checks everything at the click, as always.
43
+ */
44
+ onAvailability?: (availability: Availability) => void;
43
45
  }
44
46
  /** One payment attempt — the params of a single open() call. */
45
47
  export interface PaymentParams {
@@ -84,6 +86,39 @@ export interface PaymentParams {
84
86
  /** Called when the payer closes the modal — after success or on manual close. */
85
87
  onClose?: () => void;
86
88
  }
89
+ /** The payment a button's createPayment() returns: open()'s params, without the callbacks, which buttons() takes itself. */
90
+ export type ButtonPayment = Omit<PaymentParams, 'onSuccess' | 'onError' | 'onClose'>;
91
+ /** Options for checkout.buttons(): a "Pybara" button, served by Pybara, that opens this checkout on click. */
92
+ export interface ButtonsOptions {
93
+ /**
94
+ * Passed to the button as given, and read by it: `color` 'brand' | 'black' | 'white' (PayPal's names; its 'gold', 'blue' and 'silver' read as 'brand'), `shape` 'pill' | 'rect' | 'sharp', `height` 25–55 px (PayPal's range, default 45).
95
+ * Copy a PayPal button's style and the two match. A value the button doesn't know falls back to its default.
96
+ */
97
+ style?: {
98
+ color?: string;
99
+ shape?: string;
100
+ height?: number;
101
+ };
102
+ /** Collapse the button to no height when Pybara is unavailable on this page; by default its slot stays, empty, so the layout never moves. */
103
+ hideWhenUnavailable?: boolean;
104
+ /** Called on the payer's click: the payment from the form's current values, as open() takes it (amount, currency, frequency, donor fields). */
105
+ createPayment: () => ButtonPayment | Promise<ButtonPayment>;
106
+ /** The button's availability, the checkout's answer as onAvailability gives it: update the page around the button with it, e.g. show `message` below the minimum. */
107
+ onStateChange?: (availability: Availability) => void;
108
+ /** Called once the payment is confirmed on-chain. */
109
+ onSuccess?: (result: CheckoutResult) => void;
110
+ /** A refusal, from createPayment(), open() or the checkout. */
111
+ onError?: (error: Error) => void;
112
+ /** The payer closed the checkout. */
113
+ onClose?: () => void;
114
+ }
115
+ /** What checkout.buttons() returns. */
116
+ export interface PybaraButtons {
117
+ /** Draw a button in the element (or the first element matching the selector), at the style's height and the element's full width. Call it again to draw another button with the same options. */
118
+ render(container: string | HTMLElement): void;
119
+ /** Remove every button these options drew, and stop listening for them. */
120
+ destroy(): void;
121
+ }
87
122
  /** Result passed to the onSuccess callback once the payment is confirmed. */
88
123
  export interface CheckoutResult {
89
124
  /** Ledger block index of the confirmed transaction, as the frame reports it. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8IAA8I;AAC9I,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG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AM,CAAC;IACd,wHAAwH;IACxH,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,cAAc,GACd,qBAAqB,GACrB,iBAAiB,CAAC;AAEtB,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEnB,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAKnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pybara/pybara-js",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Accept crypto payments and donations with Pybara on any page — a callable checkout, in the stripe-js / paypal-js convention.",
5
5
  "keywords": [
6
6
  "pybara",