@backendfree/payments 0.0.0-stage → 0.1.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/README.md +125 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/.tsbuildinfo 3 +1 -0
- package/dist/index 3.js +154 -0
- package/dist/index.d 3.ts +129 -0
- package/dist/index.d.ts +129 -0
- package/dist/index.d.ts 3.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +154 -0
- package/dist/index.js 3.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/types 3.js +16 -0
- package/dist/types.d 3.ts +110 -0
- package/dist/types.d.ts +112 -0
- package/dist/types.d.ts 3.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js 3.map +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +45 -4
- package/src/index.ts +210 -0
- package/src/types.ts +123 -0
package/README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @backendfree/payments
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A project's money: what has been taken, and taking some. Built on
|
|
4
|
+
[`@backendfree/core`](../core).
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install @backendfree/core @backendfree/payments
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { Client } from '@backendfree/core';
|
|
12
|
+
import { Payments } from '@backendfree/payments';
|
|
13
|
+
|
|
14
|
+
const payments = new Payments(
|
|
15
|
+
new Client({ origin: 'https://backendfree.com', key: process.env.BACKENDFREE_SECRET_KEY! }),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const payment = await payments.checkout({
|
|
19
|
+
amount: 3500, // minor units: CHF 35.00
|
|
20
|
+
description: 'Deposit',
|
|
21
|
+
success_url: 'https://shop.example/thanks',
|
|
22
|
+
cancel_url: 'https://shop.example/cart',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
redirect(payment.checkout_url);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Server only
|
|
29
|
+
|
|
30
|
+
Every method here needs a secret key, and constructing `Payments` with a
|
|
31
|
+
publishable one throws. A payment carries the paying customer's name and email,
|
|
32
|
+
and a checkout is a charge on a bank account, so none of it belongs in a bundle
|
|
33
|
+
whoever loads the site can read.
|
|
34
|
+
|
|
35
|
+
That is also why the mistake is refused at construction rather than by a 403 in
|
|
36
|
+
production: the stack trace points at the line that is wrong.
|
|
37
|
+
|
|
38
|
+
## Why there is no refund method
|
|
39
|
+
|
|
40
|
+
Refunding is the one act that moves money out of the business's own account, so
|
|
41
|
+
it lives in the payments screen in the dashboard, behind a capability only the
|
|
42
|
+
account owner holds.
|
|
43
|
+
|
|
44
|
+
A secret key lives in server code, deploy settings and CI, which is further than
|
|
45
|
+
the account owner's own screen. A leaked key that can read payment records is one
|
|
46
|
+
incident; one that could refund would drain the account. Reading payment records
|
|
47
|
+
with a key is deliberate and bounded, so a developer can render a receipt;
|
|
48
|
+
issuing money back is not the same thing and is not in the API.
|
|
49
|
+
|
|
50
|
+
## Nothing here says a payment was made
|
|
51
|
+
|
|
52
|
+
A checkout is a page that exists. The provider's webhook is what says money
|
|
53
|
+
moved, and the page the customer lands on afterwards says nothing at all.
|
|
54
|
+
|
|
55
|
+
Take the platform's `payment.succeeded` webhook and verify it:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { verifyWebhook } from '@backendfree/core';
|
|
59
|
+
|
|
60
|
+
const event = await verifyWebhook({ body: await request.text(), headers, secret });
|
|
61
|
+
if (event.name === 'payment.succeeded') {
|
|
62
|
+
markPaid(event.data.subject_id, event.data.amount, event.data.currency);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## When the provider refuses
|
|
67
|
+
|
|
68
|
+
`checkout()` does not throw for a provider that would not open a page. The
|
|
69
|
+
payment comes back with an empty `checkout_url` and the reason on it, so the
|
|
70
|
+
attempt is on record and you have an id to try again with.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
if (!payment.checkout_url) {
|
|
74
|
+
payment = await payments.offerAgain(payment.id, { success_url, cancel_url });
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`offerAgain` is keyed on the payment, so asking twice is one page, and what is
|
|
79
|
+
owed comes off the payment rather than off the call. Calling `checkout()` a
|
|
80
|
+
second time would record a second payment for one order, and a customer handed
|
|
81
|
+
both pages could pay twice.
|
|
82
|
+
|
|
83
|
+
## Reading what has been taken
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
await payments.list({ status: 'paid' });
|
|
87
|
+
await payments.payment(id);
|
|
88
|
+
await payments.forSubject('bookings.booking', bookingId); // was it paid for?
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A payment says what it settled, how much, what has gone back and what is left to
|
|
92
|
+
give back. It never says which provider account the money landed in: that is the
|
|
93
|
+
business's own and appears nowhere in this API.
|
|
94
|
+
|
|
95
|
+
`refundable` is published rather than left to you to work out, because the
|
|
96
|
+
arithmetic is not what it looks like. A refund that is still settling is money
|
|
97
|
+
already spent, so subtracting only the settled ones shows more left than there
|
|
98
|
+
is.
|
|
99
|
+
|
|
100
|
+
## Money
|
|
101
|
+
|
|
102
|
+
Always minor units and a currency. `3500` with `CHF` is 35 francs.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { formatMoney } from '@backendfree/payments';
|
|
106
|
+
|
|
107
|
+
formatMoney({ amount: 6500, currency: 'CHF' }, 'de-CH'); // CHF 65.00
|
|
108
|
+
formatMoney({ amount: 6500, currency: 'JPY' }, 'en-US'); // ¥6,500
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Dividing by a hundred yourself is wrong in both directions: JPY has no minor
|
|
112
|
+
unit and KWD has three places. The number of places comes from the currency
|
|
113
|
+
rather than from a constant.
|
|
114
|
+
|
|
115
|
+
## Reading a status
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
import { hasPaid, isOver } from '@backendfree/payments';
|
|
119
|
+
|
|
120
|
+
hasPaid(payment); // the money arrived, refunded payments included
|
|
121
|
+
isOver(payment); // nothing further will happen, so do not offer a page
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
A status only ever moves forward. A provider redelivers events for days and
|
|
125
|
+
promises no order, so the platform applies each one as a maximum and a late
|
|
126
|
+
"still pending" cannot undo a payment that arrived.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../core/dist/types.d.ts","../../core/dist/client.d.ts","../../core/dist/errors.d.ts","../../core/dist/webhooks.d.ts","../../core/dist/index.d.ts","../src/types.ts","../src/index.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/round-robin-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../../../../../../node_modules/@types/use-sync-external-store/index.d.ts"],"fileIdsList":[[70,122,123,125,142,143],[70,124,125,142,143],[125,142,143],[70,125,130,142,143,160],[70,125,126,131,136,142,143,145,157,168],[70,125,126,127,136,142,143,145],[70,125,142,143],[70,125,128,142,143,169],[70,125,129,130,137,142,143,146],[70,125,130,142,143,157,165],[70,125,131,133,136,142,143,145],[70,124,125,132,142,143],[70,125,133,134,142,143],[70,125,135,136,142,143],[70,124,125,136,142,143],[70,125,136,137,138,142,143,157,168],[70,125,136,137,138,142,143,152,157,160],[70,117,125,133,136,139,142,143,145,157,168],[70,125,136,137,139,140,142,143,145,157,165,168],[70,125,139,141,142,143,157,165,168],[68,69,70,71,72,73,74,75,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174],[70,125,136,142,143],[70,125,142,143,144,168],[70,125,133,136,142,143,145,157],[70,125,142,143,146],[70,125,142,143,147],[70,124,125,142,143,148],[70,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174],[70,125,142,143,150],[70,125,142,143,151],[70,125,136,142,143,152,153],[70,125,142,143,152,154,169,171],[70,125,137,142,143],[70,125,136,142,143,157,158,160],[70,125,142,143,159,160],[70,125,142,143,157,158],[70,125,142,143,160],[70,125,142,143,161],[70,122,125,142,143,157,162,168],[70,125,136,142,143,163,164],[70,125,142,143,163,164],[70,125,130,142,143,145,157,165],[70,125,142,143,166],[70,125,142,143,145,167],[70,125,139,142,143,151,168],[70,125,130,142,143,169],[70,125,142,143,157,170],[70,125,142,143,144,171],[70,125,142,143,172],[70,125,130,142,143],[70,117,125,142,143],[70,125,142,143,173],[70,117,125,136,138,142,143,148,157,160,168,170,171,173],[70,125,142,143,157,174],[70,82,85,88,89,125,142,143,168],[70,85,125,142,143,157,168],[70,85,89,125,142,143,168],[70,125,142,143,157],[70,79,125,142,143],[70,83,125,142,143],[70,81,82,85,125,142,143,168],[70,125,142,143,145,165],[70,125,142,143,175],[70,79,125,142,143,175],[70,81,85,125,142,143,145,168],[70,76,77,78,80,84,125,136,142,143,157,168],[70,85,94,102,125,142,143],[70,77,83,125,142,143],[70,85,111,112,125,142,143],[70,77,80,85,125,142,143,160,168,175],[70,85,125,142,143],[70,81,85,125,142,143,168],[70,76,125,142,143],[70,79,80,81,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,112,113,114,115,116,125,142,143],[70,85,104,107,125,133,142,143],[70,85,94,95,96,125,142,143],[70,83,85,95,97,125,142,143],[70,84,125,142,143],[70,77,79,85,125,142,143],[70,85,89,95,97,125,142,143],[70,89,125,142,143],[70,83,85,88,125,142,143,168],[70,77,81,85,94,125,142,143],[70,85,104,125,142,143],[70,97,125,142,143],[70,79,85,111,125,142,143,160,173,175],[61,70,125,142,143],[61,62,63,64,70,125,142,143],[63,70,125,142,143],[65,66,70,125,142,143]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1fd2a0fd0d723bc5f0c7a45564bccf9c19f17f244bebdfda73a954fceb747d95","impliedFormat":99},{"version":"90322bec0644e23332de310a1dc3b078dee1955bb299d15d61381c79393ebeaf","impliedFormat":99},{"version":"f38ea2796a1641ceff6b6c660273031fbfe3f194edcde5d43e0cd7425394fe5d","impliedFormat":99},{"version":"1dceb3d3ac3986d06a1a5d6fad256a42556b1d9269be019cf29e618016ce8618","impliedFormat":99},{"version":"eceb8dc64b11def752a0766ed854b04fa747a61a2bea686f1823e6da8db0e63a","impliedFormat":99},{"version":"2167faa8665930ca45425771909d31c373cd4ac6269a64a3d9b8f69aa7c7256c","signature":"3a21f6aa96dc9c9a01f6ec962750f76f3e747bf61b66de4391a27e7e938edfd3","impliedFormat":99},{"version":"e00c4fd43127a886b1b4997c8105fbbb3f49bbd63907fa52cb47d3c6d38c718a","signature":"db2d5c5ee7bc8f7b352d86f2905e192ab83e3d9a6bd8b901fda870de165d3397","impliedFormat":99},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"378281aa35786c27d5811af7e6bcaa492eebd0c7013d48137c35bbc69a2b9751","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"1b2dd1cbeb0cc6ae20795958ba5950395ebb2849b7c8326853dd15530c77ab0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"387a023d363f755eb63450a66c28b14cdd7bc30a104565e2dbf0a8988bb4a56c","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"156a859e21ef3244d13afeeba4e49760a6afa035c149dda52f0c45ea8903b338","impliedFormat":1},{"version":"10ec5e82144dfac6f04fa5d1d6c11763b3e4dbbac6d99101427219ab3e2ae887","impliedFormat":1},{"version":"615754924717c0b1e293e083b83503c0a872717ad5aa60ed7f1a699eb1b4ea5c","impliedFormat":1},{"version":"074de5b2fdead0165a2757e3aaef20f27a6347b1c36adea27d51456795b37682","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"24371e69a38fc33e268d4a8716dbcda430d6c2c414a99ff9669239c4b8f40dea","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"3e11fce78ad8c0e1d1db4ba5f0652285509be3acdd519529bc8fcef85f7dafd9","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"9c32412007b5662fd34a8eb04292fb5314ec370d7016d1c2fb8aa193c807fe22","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"4d327f7d72ad0918275cea3eee49a6a8dc8114ae1d5b7f3f5d0774de75f7439a","impliedFormat":1},{"version":"6ebe8ebb8659aaa9d1acbf3710d7dae3e923e97610238b9511c25dc39023a166","impliedFormat":1},{"version":"e85d7f8068f6a26710bff0cc8c0fc5e47f71089c3780fbede05857331d2ddec9","impliedFormat":1},{"version":"7befaf0e76b5671be1d47b77fcc65f2b0aad91cc26529df1904f4a7c46d216e9","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"8aee8b6d4f9f62cf3776cda1305fb18763e2aade7e13cea5bbe699112df85214","impliedFormat":1},{"version":"c63b9ada8c72f95aac5db92aea07e5e87ec810353cdf63b2d78f49a58662cf6c","impliedFormat":1},{"version":"1cc2a09e1a61a5222d4174ab358a9f9de5e906afe79dbf7363d871a7edda3955","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"b64d4d1c5f877f9c666e98e833f0205edb9384acc46e98a1fef344f64d6aba44","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"12950411eeab8563b349cb7959543d92d8d02c289ed893d78499a19becb5a8cc","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"c9381908473a1c92cb8c516b184e75f4d226dad95c3a85a5af35f670064d9a2f","impliedFormat":1},{"version":"f724236417941ea77ec8d38c6b7021f5fb7f8521c7f8c1538e87661f2c6a0774","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d97fb21da858fb18b8ae72c314e9743fd52f73ebe2764e12af1db32fc03f853f","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ea15fd99b2e34cb25fe8346c955000bb70c8b423ae4377a972ef46bfb37f595","impliedFormat":1},{"version":"7cf69dd5502c41644c9e5106210b5da7144800670cbe861f66726fa209e231c4","impliedFormat":1},{"version":"72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7","impliedFormat":1},{"version":"f9b4137a0d285bd77dba2e6e895530112264310ae47e07bf311feae428fb8b61","affectsGlobalScope":true,"impliedFormat":1},{"version":"c06b2652ffeb89afd0f1c52c165ced77032f9cd09bc481153fbd6b5504c69494","impliedFormat":1},{"version":"51aecd2df90a3cffea1eb4696b33b2d78594ea2aa2138e6b9471ec4841c6c2ee","impliedFormat":1},{"version":"9d8f9e63e29a3396285620908e7f14d874d066caea747dc4b2c378f0599166b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"612422d5ba6b4a5c4537f423e9199645468ad80a689801da63ab7edb43f7b835","impliedFormat":1},{"version":"db9ada976f9e52e13f7ae8b9a320f4b67b87685938c5879187d8864b2fbe97f3","impliedFormat":1},{"version":"9f39e70a354d0fba29ac3cdf6eca00b7f9e96f64b2b2780c432e8ea27f133743","impliedFormat":1},{"version":"0dace96cc0f7bc6d0ee2044921bdf19fe42d16284dbcc8ae200800d1c9579335","impliedFormat":1},{"version":"a2e2bbde231b65c53c764c12313897ffdfb6c49183dd31823ee2405f2f7b5378","impliedFormat":1},{"version":"1cbdcdef62bf42688e5d825898c3a59458466c48ad8a4ef3f88d8a1cd04310d6","impliedFormat":1},{"version":"c64e1888baaa3253ca4405b455e4bf44f76357868a1bd0a52998ade9a092ad78","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc8c6f5322961b56d9906601b20798725df60baeab45ec014fba9f795d5596fd","impliedFormat":1},{"version":"67e435fa530778903f5525904e6645b7368eb5ac622055febd19bb399e328ccd","impliedFormat":1},{"version":"060d305fe4494d8cb2b99d620928d369d1ee55c1645f5e729a2aca07d0f108cb","impliedFormat":1},{"version":"5b22bf96be06fca1e134e3a85351ffe7aa2edf0c9a5bd175b7239ee48186dbf5","impliedFormat":1},{"version":"0c50296ee73dae94efc3f0da4936b1146ca6ce2217acfabb44c19c9a33fa30e5","impliedFormat":1},{"version":"bbf42f98a5819f4f06e18c8b669a994afe9a17fe520ae3454a195e6eabf7700d","impliedFormat":1},{"version":"5b48cc670da1dfe926036deaf349085caf822def460a6d50de23f1cc12a5f8cd","impliedFormat":1},{"version":"418f34087d52d001e2688a6282a5de9bf583ff771ed5546af0ae36e4f60a458b","affectsGlobalScope":true,"impliedFormat":1},{"version":"036c9a03b01281f99f8251fdc7088e894566be44b3f139a9d48501a978b611df","impliedFormat":1},{"version":"ff65b8a8bd380c6d129becc35de02f7c29ad7ce03300331ca91311fb4044d1a9","impliedFormat":1},{"version":"04bf1aa481d1adfb16d93d76e44ce71c51c8ef68039d849926551199489637f6","impliedFormat":1},{"version":"2c9adcc85574b002c9a6311ff2141055769e0071856ec979d92ff989042b1f1b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1569ad5969ae0de6ad0bdfaaab0dabcd8878bc3147ab096206eed2019bb84e7f","affectsGlobalScope":true,"impliedFormat":1},{"version":"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","impliedFormat":1},{"version":"b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","impliedFormat":1},{"version":"42a350ce4f6f291198dc89833afcc4fd078248b4e1fdc9d05c846c66a670f710","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"8c81fd4a110490c43d7c578e8c6f69b3af01717189196899a6a44f93daa57a3a","impliedFormat":1},{"version":"5fb39858b2459864b139950a09adae4f38dad87c25bf572ce414f10e4bd7baab","impliedFormat":1},{"version":"b03754211d839cdc48979996525a32eb62130682c2f9801dfc2f25533ce7238d","impliedFormat":1},{"version":"3910dab597c40e173bf0e0d419d3ce9682c54ebf6ae84849f9b829b1451a17ec","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"486c074a5c0f2254345c0d1c9540380f5463999e42d7e1a159305ea823d3c4b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"c119835edf36415081dfd9ed15fc0cd37aaa28d232be029ad073f15f3d88c323","impliedFormat":1},{"version":"f4d99ac08c4097a3cc202bec2c7198c19dcdd80d4ec6c62d1356b10d03b119d5","impliedFormat":1},{"version":"9705cd157ffbb91c5cab48bdd2de5a437a372e63f870f8a8472e72ff634d47c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","impliedFormat":1},{"version":"ca77e83162eccec633513723d178d4203bdd5465297267696be08013bab0aa1d","impliedFormat":1},{"version":"e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","impliedFormat":1},{"version":"4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055","impliedFormat":1},{"version":"f61c153d5abbe4381a1fba0d41be0babdd5de51c626ee7ff14cede14dedc33f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7803171d745ab18e77f16bf82e742268ff72b7f7382ab191e4277527580c2d89","affectsGlobalScope":true,"impliedFormat":1},{"version":"0e9ba65cd3d6d194bdda7343f9f2917f7144ead96a924ca58d1a14919992dc20","impliedFormat":1},{"version":"255d948f87f24ffd57bcb2fdf95792fd418a2e1f712a98cf2cce88744d75085c","impliedFormat":1},{"version":"0d5b085f36e6dc55bc6332ecb9c733be3a534958c238fb8d8d18d4a2b6f2a15a","impliedFormat":1},{"version":"0b0dfb2d3e8420ead06f6a11acfb02ddcec42257e6ce391993e895ba0af86de4","affectsGlobalScope":true,"impliedFormat":1},{"version":"bfd3b3c21a56104693183942e221c1896ee23bcb8f8d91ab0b941f7b32985411","impliedFormat":1},{"version":"d7e9ab1b0996639047c61c1e62f85c620e4382206b3abb430d9a21fb7bc23c77","impliedFormat":1},{"version":"61f41da9aaa809e5142b1d849d4e70f3e09913a5cb32c629bf6e61ef27967ff7","impliedFormat":1}],"root":[66,67],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[122,1],[123,1],[124,2],[70,3],[125,4],[126,5],[127,6],[68,7],[128,8],[129,9],[130,10],[131,11],[132,12],[133,13],[134,13],[135,14],[136,15],[137,16],[138,17],[71,7],[69,7],[139,18],[140,19],[141,20],[175,21],[142,22],[143,7],[144,23],[145,24],[146,25],[147,26],[148,27],[149,28],[150,29],[151,30],[152,31],[153,31],[154,32],[155,7],[156,33],[157,34],[159,35],[158,36],[160,37],[161,38],[162,39],[163,40],[164,41],[165,42],[166,43],[167,44],[168,45],[169,46],[170,47],[171,48],[172,49],[72,7],[73,50],[74,7],[75,7],[118,51],[119,52],[120,7],[121,37],[173,53],[174,54],[59,7],[60,7],[10,7],[12,7],[11,7],[2,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[20,7],[3,7],[21,7],[22,7],[4,7],[23,7],[27,7],[24,7],[25,7],[26,7],[28,7],[29,7],[30,7],[5,7],[31,7],[32,7],[33,7],[34,7],[6,7],[38,7],[35,7],[36,7],[37,7],[39,7],[7,7],[40,7],[45,7],[46,7],[41,7],[42,7],[43,7],[44,7],[8,7],[50,7],[47,7],[48,7],[49,7],[51,7],[9,7],[52,7],[53,7],[54,7],[56,7],[55,7],[1,7],[57,7],[58,7],[94,55],[106,56],[91,57],[107,58],[116,59],[82,60],[83,61],[81,62],[115,63],[110,64],[114,65],[85,66],[103,67],[84,68],[113,69],[79,70],[80,64],[86,71],[87,7],[93,72],[90,71],[77,73],[117,74],[108,75],[97,76],[96,71],[98,77],[101,78],[95,79],[99,80],[111,63],[88,81],[89,82],[102,83],[78,58],[105,84],[104,71],[92,82],[100,85],[109,7],[76,7],[112,86],[62,87],[63,7],[65,88],[61,7],[64,89],[67,90],[66,7],[176,7]],"latestChangedDtsFile":"./types.d.ts","version":"5.9.3"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../core/dist/types.d.ts","../../core/dist/client.d.ts","../../core/dist/errors.d.ts","../../core/dist/webhooks.d.ts","../../core/dist/index.d.ts","../src/types.ts","../src/index.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/round-robin-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../../../../../../node_modules/@types/use-sync-external-store/index.d.ts"],"fileIdsList":[[70,122,123,125,142,143],[70,124,125,142,143],[125,142,143],[70,125,130,142,143,160],[70,125,126,131,136,142,143,145,157,168],[70,125,126,127,136,142,143,145],[70,125,142,143],[70,125,128,142,143,169],[70,125,129,130,137,142,143,146],[70,125,130,142,143,157,165],[70,125,131,133,136,142,143,145],[70,124,125,132,142,143],[70,125,133,134,142,143],[70,125,135,136,142,143],[70,124,125,136,142,143],[70,125,136,137,138,142,143,157,168],[70,125,136,137,138,142,143,152,157,160],[70,117,125,133,136,139,142,143,145,157,168],[70,125,136,137,139,140,142,143,145,157,165,168],[70,125,139,141,142,143,157,165,168],[68,69,70,71,72,73,74,75,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174],[70,125,136,142,143],[70,125,142,143,144,168],[70,125,133,136,142,143,145,157],[70,125,142,143,146],[70,125,142,143,147],[70,124,125,142,143,148],[70,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174],[70,125,142,143,150],[70,125,142,143,151],[70,125,136,142,143,152,153],[70,125,142,143,152,154,169,171],[70,125,137,142,143],[70,125,136,142,143,157,158,160],[70,125,142,143,159,160],[70,125,142,143,157,158],[70,125,142,143,160],[70,125,142,143,161],[70,122,125,142,143,157,162,168],[70,125,136,142,143,163,164],[70,125,142,143,163,164],[70,125,130,142,143,145,157,165],[70,125,142,143,166],[70,125,142,143,145,167],[70,125,139,142,143,151,168],[70,125,130,142,143,169],[70,125,142,143,157,170],[70,125,142,143,144,171],[70,125,142,143,172],[70,125,130,142,143],[70,117,125,142,143],[70,125,142,143,173],[70,117,125,136,138,142,143,148,157,160,168,170,171,173],[70,125,142,143,157,174],[70,82,85,88,89,125,142,143,168],[70,85,125,142,143,157,168],[70,85,89,125,142,143,168],[70,125,142,143,157],[70,79,125,142,143],[70,83,125,142,143],[70,81,82,85,125,142,143,168],[70,125,142,143,145,165],[70,125,142,143,175],[70,79,125,142,143,175],[70,81,85,125,142,143,145,168],[70,76,77,78,80,84,125,136,142,143,157,168],[70,85,94,102,125,142,143],[70,77,83,125,142,143],[70,85,111,112,125,142,143],[70,77,80,85,125,142,143,160,168,175],[70,85,125,142,143],[70,81,85,125,142,143,168],[70,76,125,142,143],[70,79,80,81,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,112,113,114,115,116,125,142,143],[70,85,104,107,125,133,142,143],[70,85,94,95,96,125,142,143],[70,83,85,95,97,125,142,143],[70,84,125,142,143],[70,77,79,85,125,142,143],[70,85,89,95,97,125,142,143],[70,89,125,142,143],[70,83,85,88,125,142,143,168],[70,77,81,85,94,125,142,143],[70,85,104,125,142,143],[70,97,125,142,143],[70,79,85,111,125,142,143,160,173,175],[61,70,125,142,143],[61,62,63,64,70,125,142,143],[63,70,125,142,143],[65,66,70,125,142,143]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1fd2a0fd0d723bc5f0c7a45564bccf9c19f17f244bebdfda73a954fceb747d95","impliedFormat":99},{"version":"43834224f60e5fb7b303941aeb6fc5203e334565b6dfc7c413ba57cbc44b6f01","impliedFormat":99},{"version":"635341ecf3d8a2f642034d50ee66855c5aa2b96ac619ffcfb132b3efb24fca2a","impliedFormat":99},{"version":"9d0426f3cf33d2bbbd9f83a2fbc9f5013498840b602e78722a63a02ce20526e6","impliedFormat":99},{"version":"5e68df21d1bc831a42c3b14c2b4a28570ba74548fd63268a2afa1368c59704c6","impliedFormat":99},{"version":"d8331211d5becb93a14ca5baa1123e7fccbf73acf0adbd875e2b622432498d0b","signature":"863ef78d4fc106995bcd42311422bb3cd47d3557f04a6fff5d5125b37890c79a","impliedFormat":99},{"version":"f7ca2004994cc7177683b8097480a2404bd2858ae36f826484caa73cb45275f1","signature":"30f8eb565dcec0fad3c644e3e88adfffb31c73afd6376880ba341a6ddece5cbe","impliedFormat":99},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"378281aa35786c27d5811af7e6bcaa492eebd0c7013d48137c35bbc69a2b9751","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"1b2dd1cbeb0cc6ae20795958ba5950395ebb2849b7c8326853dd15530c77ab0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"387a023d363f755eb63450a66c28b14cdd7bc30a104565e2dbf0a8988bb4a56c","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"156a859e21ef3244d13afeeba4e49760a6afa035c149dda52f0c45ea8903b338","impliedFormat":1},{"version":"10ec5e82144dfac6f04fa5d1d6c11763b3e4dbbac6d99101427219ab3e2ae887","impliedFormat":1},{"version":"615754924717c0b1e293e083b83503c0a872717ad5aa60ed7f1a699eb1b4ea5c","impliedFormat":1},{"version":"074de5b2fdead0165a2757e3aaef20f27a6347b1c36adea27d51456795b37682","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"24371e69a38fc33e268d4a8716dbcda430d6c2c414a99ff9669239c4b8f40dea","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"3e11fce78ad8c0e1d1db4ba5f0652285509be3acdd519529bc8fcef85f7dafd9","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"9c32412007b5662fd34a8eb04292fb5314ec370d7016d1c2fb8aa193c807fe22","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"4d327f7d72ad0918275cea3eee49a6a8dc8114ae1d5b7f3f5d0774de75f7439a","impliedFormat":1},{"version":"6ebe8ebb8659aaa9d1acbf3710d7dae3e923e97610238b9511c25dc39023a166","impliedFormat":1},{"version":"e85d7f8068f6a26710bff0cc8c0fc5e47f71089c3780fbede05857331d2ddec9","impliedFormat":1},{"version":"7befaf0e76b5671be1d47b77fcc65f2b0aad91cc26529df1904f4a7c46d216e9","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"8aee8b6d4f9f62cf3776cda1305fb18763e2aade7e13cea5bbe699112df85214","impliedFormat":1},{"version":"c63b9ada8c72f95aac5db92aea07e5e87ec810353cdf63b2d78f49a58662cf6c","impliedFormat":1},{"version":"1cc2a09e1a61a5222d4174ab358a9f9de5e906afe79dbf7363d871a7edda3955","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"b64d4d1c5f877f9c666e98e833f0205edb9384acc46e98a1fef344f64d6aba44","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"12950411eeab8563b349cb7959543d92d8d02c289ed893d78499a19becb5a8cc","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"c9381908473a1c92cb8c516b184e75f4d226dad95c3a85a5af35f670064d9a2f","impliedFormat":1},{"version":"f724236417941ea77ec8d38c6b7021f5fb7f8521c7f8c1538e87661f2c6a0774","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d97fb21da858fb18b8ae72c314e9743fd52f73ebe2764e12af1db32fc03f853f","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ea15fd99b2e34cb25fe8346c955000bb70c8b423ae4377a972ef46bfb37f595","impliedFormat":1},{"version":"7cf69dd5502c41644c9e5106210b5da7144800670cbe861f66726fa209e231c4","impliedFormat":1},{"version":"72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7","impliedFormat":1},{"version":"f9b4137a0d285bd77dba2e6e895530112264310ae47e07bf311feae428fb8b61","affectsGlobalScope":true,"impliedFormat":1},{"version":"c06b2652ffeb89afd0f1c52c165ced77032f9cd09bc481153fbd6b5504c69494","impliedFormat":1},{"version":"51aecd2df90a3cffea1eb4696b33b2d78594ea2aa2138e6b9471ec4841c6c2ee","impliedFormat":1},{"version":"9d8f9e63e29a3396285620908e7f14d874d066caea747dc4b2c378f0599166b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"612422d5ba6b4a5c4537f423e9199645468ad80a689801da63ab7edb43f7b835","impliedFormat":1},{"version":"db9ada976f9e52e13f7ae8b9a320f4b67b87685938c5879187d8864b2fbe97f3","impliedFormat":1},{"version":"9f39e70a354d0fba29ac3cdf6eca00b7f9e96f64b2b2780c432e8ea27f133743","impliedFormat":1},{"version":"0dace96cc0f7bc6d0ee2044921bdf19fe42d16284dbcc8ae200800d1c9579335","impliedFormat":1},{"version":"a2e2bbde231b65c53c764c12313897ffdfb6c49183dd31823ee2405f2f7b5378","impliedFormat":1},{"version":"1cbdcdef62bf42688e5d825898c3a59458466c48ad8a4ef3f88d8a1cd04310d6","impliedFormat":1},{"version":"c64e1888baaa3253ca4405b455e4bf44f76357868a1bd0a52998ade9a092ad78","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc8c6f5322961b56d9906601b20798725df60baeab45ec014fba9f795d5596fd","impliedFormat":1},{"version":"67e435fa530778903f5525904e6645b7368eb5ac622055febd19bb399e328ccd","impliedFormat":1},{"version":"060d305fe4494d8cb2b99d620928d369d1ee55c1645f5e729a2aca07d0f108cb","impliedFormat":1},{"version":"5b22bf96be06fca1e134e3a85351ffe7aa2edf0c9a5bd175b7239ee48186dbf5","impliedFormat":1},{"version":"0c50296ee73dae94efc3f0da4936b1146ca6ce2217acfabb44c19c9a33fa30e5","impliedFormat":1},{"version":"bbf42f98a5819f4f06e18c8b669a994afe9a17fe520ae3454a195e6eabf7700d","impliedFormat":1},{"version":"5b48cc670da1dfe926036deaf349085caf822def460a6d50de23f1cc12a5f8cd","impliedFormat":1},{"version":"418f34087d52d001e2688a6282a5de9bf583ff771ed5546af0ae36e4f60a458b","affectsGlobalScope":true,"impliedFormat":1},{"version":"036c9a03b01281f99f8251fdc7088e894566be44b3f139a9d48501a978b611df","impliedFormat":1},{"version":"ff65b8a8bd380c6d129becc35de02f7c29ad7ce03300331ca91311fb4044d1a9","impliedFormat":1},{"version":"04bf1aa481d1adfb16d93d76e44ce71c51c8ef68039d849926551199489637f6","impliedFormat":1},{"version":"2c9adcc85574b002c9a6311ff2141055769e0071856ec979d92ff989042b1f1b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1569ad5969ae0de6ad0bdfaaab0dabcd8878bc3147ab096206eed2019bb84e7f","affectsGlobalScope":true,"impliedFormat":1},{"version":"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","impliedFormat":1},{"version":"b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","impliedFormat":1},{"version":"42a350ce4f6f291198dc89833afcc4fd078248b4e1fdc9d05c846c66a670f710","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"8c81fd4a110490c43d7c578e8c6f69b3af01717189196899a6a44f93daa57a3a","impliedFormat":1},{"version":"5fb39858b2459864b139950a09adae4f38dad87c25bf572ce414f10e4bd7baab","impliedFormat":1},{"version":"b03754211d839cdc48979996525a32eb62130682c2f9801dfc2f25533ce7238d","impliedFormat":1},{"version":"3910dab597c40e173bf0e0d419d3ce9682c54ebf6ae84849f9b829b1451a17ec","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"486c074a5c0f2254345c0d1c9540380f5463999e42d7e1a159305ea823d3c4b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"c119835edf36415081dfd9ed15fc0cd37aaa28d232be029ad073f15f3d88c323","impliedFormat":1},{"version":"f4d99ac08c4097a3cc202bec2c7198c19dcdd80d4ec6c62d1356b10d03b119d5","impliedFormat":1},{"version":"9705cd157ffbb91c5cab48bdd2de5a437a372e63f870f8a8472e72ff634d47c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","impliedFormat":1},{"version":"ca77e83162eccec633513723d178d4203bdd5465297267696be08013bab0aa1d","impliedFormat":1},{"version":"e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","impliedFormat":1},{"version":"4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055","impliedFormat":1},{"version":"f61c153d5abbe4381a1fba0d41be0babdd5de51c626ee7ff14cede14dedc33f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7803171d745ab18e77f16bf82e742268ff72b7f7382ab191e4277527580c2d89","affectsGlobalScope":true,"impliedFormat":1},{"version":"0e9ba65cd3d6d194bdda7343f9f2917f7144ead96a924ca58d1a14919992dc20","impliedFormat":1},{"version":"255d948f87f24ffd57bcb2fdf95792fd418a2e1f712a98cf2cce88744d75085c","impliedFormat":1},{"version":"0d5b085f36e6dc55bc6332ecb9c733be3a534958c238fb8d8d18d4a2b6f2a15a","impliedFormat":1},{"version":"0b0dfb2d3e8420ead06f6a11acfb02ddcec42257e6ce391993e895ba0af86de4","affectsGlobalScope":true,"impliedFormat":1},{"version":"bfd3b3c21a56104693183942e221c1896ee23bcb8f8d91ab0b941f7b32985411","impliedFormat":1},{"version":"d7e9ab1b0996639047c61c1e62f85c620e4382206b3abb430d9a21fb7bc23c77","impliedFormat":1},{"version":"61f41da9aaa809e5142b1d849d4e70f3e09913a5cb32c629bf6e61ef27967ff7","impliedFormat":1}],"root":[66,67],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[122,1],[123,1],[124,2],[70,3],[125,4],[126,5],[127,6],[68,7],[128,8],[129,9],[130,10],[131,11],[132,12],[133,13],[134,13],[135,14],[136,15],[137,16],[138,17],[71,7],[69,7],[139,18],[140,19],[141,20],[175,21],[142,22],[143,7],[144,23],[145,24],[146,25],[147,26],[148,27],[149,28],[150,29],[151,30],[152,31],[153,31],[154,32],[155,7],[156,33],[157,34],[159,35],[158,36],[160,37],[161,38],[162,39],[163,40],[164,41],[165,42],[166,43],[167,44],[168,45],[169,46],[170,47],[171,48],[172,49],[72,7],[73,50],[74,7],[75,7],[118,51],[119,52],[120,7],[121,37],[173,53],[174,54],[59,7],[60,7],[10,7],[12,7],[11,7],[2,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[20,7],[3,7],[21,7],[22,7],[4,7],[23,7],[27,7],[24,7],[25,7],[26,7],[28,7],[29,7],[30,7],[5,7],[31,7],[32,7],[33,7],[34,7],[6,7],[38,7],[35,7],[36,7],[37,7],[39,7],[7,7],[40,7],[45,7],[46,7],[41,7],[42,7],[43,7],[44,7],[8,7],[50,7],[47,7],[48,7],[49,7],[51,7],[9,7],[52,7],[53,7],[54,7],[56,7],[55,7],[1,7],[57,7],[58,7],[94,55],[106,56],[91,57],[107,58],[116,59],[82,60],[83,61],[81,62],[115,63],[110,64],[114,65],[85,66],[103,67],[84,68],[113,69],[79,70],[80,64],[86,71],[87,7],[93,72],[90,71],[77,73],[117,74],[108,75],[97,76],[96,71],[98,77],[101,78],[95,79],[99,80],[111,63],[88,81],[89,82],[102,83],[78,58],[105,84],[104,71],[92,82],[100,85],[109,7],[76,7],[112,86],[62,87],[63,7],[65,88],[61,7],[64,89],[67,90],[66,7],[176,7]],"latestChangedDtsFile":"./types.d.ts","version":"5.9.3"}
|
package/dist/index 3.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @georithaminator/payments
|
|
3
|
+
*
|
|
4
|
+
* A project's money: what has been taken, and taking some.
|
|
5
|
+
*
|
|
6
|
+
* import { Client } from '@georithaminator/core';
|
|
7
|
+
* import { Payments } from '@georithaminator/payments';
|
|
8
|
+
*
|
|
9
|
+
* const payments = new Payments(new Client({ origin, key: process.env.SECRET_KEY }));
|
|
10
|
+
* const payment = await payments.checkout({ amount: 3500, success_url, cancel_url });
|
|
11
|
+
* redirect(payment.checkout_url);
|
|
12
|
+
*
|
|
13
|
+
* Four things are worth knowing before using it.
|
|
14
|
+
*
|
|
15
|
+
* **All of it needs a secret key, and this throws on a publishable one.** A
|
|
16
|
+
* payment carries the paying customer's name and email, and a checkout is a
|
|
17
|
+
* charge on somebody's bank account. Neither belongs in a bundle whoever loads
|
|
18
|
+
* the site can read, so the mistake is refused at construction rather than by a
|
|
19
|
+
* 403 in production.
|
|
20
|
+
*
|
|
21
|
+
* **There is no refund method, and that is deliberate.** Refunding is the one
|
|
22
|
+
* act that moves money out of the business's own account, and it lives with the
|
|
23
|
+
* business: the payments screen in the dashboard, behind a capability no agency
|
|
24
|
+
* role reaches. A key is minted by the agency, so a refund on a key would be a
|
|
25
|
+
* refund the agency can make. See the README.
|
|
26
|
+
*
|
|
27
|
+
* **Nothing here says a payment was made.** A checkout is a page that exists.
|
|
28
|
+
* The provider's webhook is what says money moved, and the page the customer
|
|
29
|
+
* lands on afterwards says nothing at all. Read `payment.status` back, or
|
|
30
|
+
* better, take the platform's `payment.succeeded` webhook and verify it with
|
|
31
|
+
* `verifyWebhook` from core.
|
|
32
|
+
*
|
|
33
|
+
* **Money is minor units and a currency, everywhere.** 3500 is CHF 35.00.
|
|
34
|
+
* `formatMoney` turns that into something to show a person, and dividing by a
|
|
35
|
+
* hundred yourself is wrong in both directions depending on the currency.
|
|
36
|
+
*/
|
|
37
|
+
import { ConfigError } from '@georithaminator/core';
|
|
38
|
+
export class Payments {
|
|
39
|
+
#client;
|
|
40
|
+
constructor(client) {
|
|
41
|
+
// Refused here rather than by the API, because the answer is the same
|
|
42
|
+
// either way and finding out at construction is a stack trace pointing at
|
|
43
|
+
// the line that is wrong.
|
|
44
|
+
if (client.publishable) {
|
|
45
|
+
throw new ConfigError('secret_key_required', 'Payments needs a secret key. A payment carries a customer name and email and a ' +
|
|
46
|
+
'checkout is a charge on a bank account, so none of it is safe in a browser.');
|
|
47
|
+
}
|
|
48
|
+
this.#client = client;
|
|
49
|
+
}
|
|
50
|
+
// --- what has been taken -----------------------------------------------------
|
|
51
|
+
/**
|
|
52
|
+
* Payments, newest first.
|
|
53
|
+
*
|
|
54
|
+
* Not cached, on purpose: a payment moves when the provider says so, and a
|
|
55
|
+
* stored answer would outlive the money it describes.
|
|
56
|
+
*/
|
|
57
|
+
list(query = {}) {
|
|
58
|
+
const { status, subject_type, subject_id, ...rest } = query;
|
|
59
|
+
return this.#client.get('/payments', {
|
|
60
|
+
...rest,
|
|
61
|
+
query: { status, subject_type, subject_id, ...rest.query },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
payment(id, options = {}) {
|
|
65
|
+
return this.#client.get(`/payments/${encodeURIComponent(id)}`, options);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether something on the platform has been paid for, in one call.
|
|
69
|
+
*
|
|
70
|
+
* What a booking confirmation page asks. Returns the payments against that
|
|
71
|
+
* object, because there can be more than one: a deposit and a balance, or a
|
|
72
|
+
* first attempt that failed and a second that did not.
|
|
73
|
+
*/
|
|
74
|
+
async forSubject(subject_type, subject_id, options = {}) {
|
|
75
|
+
const { results } = await this.list({ ...options, subject_type, subject_id });
|
|
76
|
+
return results;
|
|
77
|
+
}
|
|
78
|
+
// --- taking some -------------------------------------------------------------
|
|
79
|
+
/**
|
|
80
|
+
* Open a payment page for one amount.
|
|
81
|
+
*
|
|
82
|
+
* An invoice, a deposit taken over the phone, a donation button. It settles
|
|
83
|
+
* nothing on the platform and names no booking, which is why it cannot be
|
|
84
|
+
* used to mark somebody else's appointment paid.
|
|
85
|
+
*
|
|
86
|
+
* Retrying this call is safe: core puts an idempotency key on it, and the
|
|
87
|
+
* same key is always the same charge. Pass your own order id as
|
|
88
|
+
* `idempotencyKey` to make a retry from another process count as the same
|
|
89
|
+
* request.
|
|
90
|
+
*
|
|
91
|
+
* A provider that refuses does not fail the call. The payment comes back with
|
|
92
|
+
* an empty `checkout_url` and the reason in `failure_message`, so the attempt
|
|
93
|
+
* is on record and you have an id to try again with. `offerAgain` is what
|
|
94
|
+
* tries again; calling this a second time would be a second payment for one
|
|
95
|
+
* order.
|
|
96
|
+
*/
|
|
97
|
+
checkout(request, options = {}) {
|
|
98
|
+
return this.#client.post('/checkouts', request, options);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Offer the page again for a payment that already exists.
|
|
102
|
+
*
|
|
103
|
+
* What a customer needs when the provider refused, or when they closed the
|
|
104
|
+
* tab. Keyed on the payment rather than on a fresh idempotency key, so asking
|
|
105
|
+
* twice is one page.
|
|
106
|
+
*
|
|
107
|
+
* What is owed comes off the payment, never off this call: the price was
|
|
108
|
+
* agreed when the payment was made. A payment that is settled or over is
|
|
109
|
+
* answered rather than re-opened, because re-opening one is how somebody pays
|
|
110
|
+
* twice.
|
|
111
|
+
*/
|
|
112
|
+
offerAgain(id, options) {
|
|
113
|
+
const { success_url, cancel_url, description, ...rest } = options;
|
|
114
|
+
return this.#client.post(`/payments/${encodeURIComponent(id)}/checkout`, { success_url, cancel_url, description }, rest);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// --- reading a payment ---------------------------------------------------------
|
|
118
|
+
/** Whether the money arrived. True of a refunded payment too: it did arrive. */
|
|
119
|
+
export function hasPaid(payment) {
|
|
120
|
+
return (payment.status === 'paid' ||
|
|
121
|
+
payment.status === 'partially_refunded' ||
|
|
122
|
+
payment.status === 'refunded');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Whether nothing further will happen to this payment.
|
|
126
|
+
*
|
|
127
|
+
* What decides whether offering the page again is worth anything. A failed,
|
|
128
|
+
* cancelled, expired or fully refunded payment is over; a created or pending
|
|
129
|
+
* one can still be paid.
|
|
130
|
+
*/
|
|
131
|
+
export function isOver(payment) {
|
|
132
|
+
return (payment.status === 'failed' ||
|
|
133
|
+
payment.status === 'cancelled' ||
|
|
134
|
+
payment.status === 'expired' ||
|
|
135
|
+
payment.status === 'refunded');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* An amount, written the way a person in a given place writes it.
|
|
139
|
+
*
|
|
140
|
+
* The one formatting helper worth shipping, for the same reason bookings ships
|
|
141
|
+
* one for time: the obvious version is wrong. Dividing by a hundred is right
|
|
142
|
+
* for CHF, wrong for JPY, which has no minor unit at all, and wrong the other
|
|
143
|
+
* way for KWD, which has three. The number of places comes from the currency
|
|
144
|
+
* rather than from a constant, so this is correct for currencies nobody thought
|
|
145
|
+
* about when writing it.
|
|
146
|
+
*
|
|
147
|
+
* `locales` defaults to the reader's own. Pass one to match a page's language.
|
|
148
|
+
*/
|
|
149
|
+
export function formatMoney(money, locales) {
|
|
150
|
+
const format = new Intl.NumberFormat(locales, { style: 'currency', currency: money.currency });
|
|
151
|
+
const places = format.resolvedOptions().maximumFractionDigits ?? 2;
|
|
152
|
+
return format.format(money.amount / 10 ** places);
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @georithaminator/payments
|
|
3
|
+
*
|
|
4
|
+
* A project's money: what has been taken, and taking some.
|
|
5
|
+
*
|
|
6
|
+
* import { Client } from '@georithaminator/core';
|
|
7
|
+
* import { Payments } from '@georithaminator/payments';
|
|
8
|
+
*
|
|
9
|
+
* const payments = new Payments(new Client({ origin, key: process.env.SECRET_KEY }));
|
|
10
|
+
* const payment = await payments.checkout({ amount: 3500, success_url, cancel_url });
|
|
11
|
+
* redirect(payment.checkout_url);
|
|
12
|
+
*
|
|
13
|
+
* Four things are worth knowing before using it.
|
|
14
|
+
*
|
|
15
|
+
* **All of it needs a secret key, and this throws on a publishable one.** A
|
|
16
|
+
* payment carries the paying customer's name and email, and a checkout is a
|
|
17
|
+
* charge on somebody's bank account. Neither belongs in a bundle whoever loads
|
|
18
|
+
* the site can read, so the mistake is refused at construction rather than by a
|
|
19
|
+
* 403 in production.
|
|
20
|
+
*
|
|
21
|
+
* **There is no refund method, and that is deliberate.** Refunding is the one
|
|
22
|
+
* act that moves money out of the business's own account, and it lives with the
|
|
23
|
+
* business: the payments screen in the dashboard, behind a capability no agency
|
|
24
|
+
* role reaches. A key is minted by the agency, so a refund on a key would be a
|
|
25
|
+
* refund the agency can make. See the README.
|
|
26
|
+
*
|
|
27
|
+
* **Nothing here says a payment was made.** A checkout is a page that exists.
|
|
28
|
+
* The provider's webhook is what says money moved, and the page the customer
|
|
29
|
+
* lands on afterwards says nothing at all. Read `payment.status` back, or
|
|
30
|
+
* better, take the platform's `payment.succeeded` webhook and verify it with
|
|
31
|
+
* `verifyWebhook` from core.
|
|
32
|
+
*
|
|
33
|
+
* **Money is minor units and a currency, everywhere.** 3500 is CHF 35.00.
|
|
34
|
+
* `formatMoney` turns that into something to show a person, and dividing by a
|
|
35
|
+
* hundred yourself is wrong in both directions depending on the currency.
|
|
36
|
+
*/
|
|
37
|
+
import type { Client, Page as Paginated, RequestOptions } from '@georithaminator/core';
|
|
38
|
+
import type { CheckoutRequest, Money, Payment } from './types.js';
|
|
39
|
+
/** Which payments to list. Every filter is optional and they combine. */
|
|
40
|
+
export interface PaymentQuery extends RequestOptions {
|
|
41
|
+
status?: string;
|
|
42
|
+
/** For example `bookings.booking`. */
|
|
43
|
+
subject_type?: string;
|
|
44
|
+
/** That object's id, to answer "was this one paid for?". */
|
|
45
|
+
subject_id?: string;
|
|
46
|
+
}
|
|
47
|
+
/** Where to send the customer, when offering a page for a payment that exists. */
|
|
48
|
+
export interface OfferOptions extends RequestOptions {
|
|
49
|
+
success_url: string;
|
|
50
|
+
cancel_url: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class Payments {
|
|
54
|
+
#private;
|
|
55
|
+
constructor(client: Client);
|
|
56
|
+
/**
|
|
57
|
+
* Payments, newest first.
|
|
58
|
+
*
|
|
59
|
+
* Not cached, on purpose: a payment moves when the provider says so, and a
|
|
60
|
+
* stored answer would outlive the money it describes.
|
|
61
|
+
*/
|
|
62
|
+
list(query?: PaymentQuery): Promise<Paginated<Payment>>;
|
|
63
|
+
payment(id: string, options?: RequestOptions): Promise<Payment>;
|
|
64
|
+
/**
|
|
65
|
+
* Whether something on the platform has been paid for, in one call.
|
|
66
|
+
*
|
|
67
|
+
* What a booking confirmation page asks. Returns the payments against that
|
|
68
|
+
* object, because there can be more than one: a deposit and a balance, or a
|
|
69
|
+
* first attempt that failed and a second that did not.
|
|
70
|
+
*/
|
|
71
|
+
forSubject(subject_type: string, subject_id: string, options?: RequestOptions): Promise<Payment[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Open a payment page for one amount.
|
|
74
|
+
*
|
|
75
|
+
* An invoice, a deposit taken over the phone, a donation button. It settles
|
|
76
|
+
* nothing on the platform and names no booking, which is why it cannot be
|
|
77
|
+
* used to mark somebody else's appointment paid.
|
|
78
|
+
*
|
|
79
|
+
* Retrying this call is safe: core puts an idempotency key on it, and the
|
|
80
|
+
* same key is always the same charge. Pass your own order id as
|
|
81
|
+
* `idempotencyKey` to make a retry from another process count as the same
|
|
82
|
+
* request.
|
|
83
|
+
*
|
|
84
|
+
* A provider that refuses does not fail the call. The payment comes back with
|
|
85
|
+
* an empty `checkout_url` and the reason in `failure_message`, so the attempt
|
|
86
|
+
* is on record and you have an id to try again with. `offerAgain` is what
|
|
87
|
+
* tries again; calling this a second time would be a second payment for one
|
|
88
|
+
* order.
|
|
89
|
+
*/
|
|
90
|
+
checkout(request: CheckoutRequest, options?: RequestOptions): Promise<Payment>;
|
|
91
|
+
/**
|
|
92
|
+
* Offer the page again for a payment that already exists.
|
|
93
|
+
*
|
|
94
|
+
* What a customer needs when the provider refused, or when they closed the
|
|
95
|
+
* tab. Keyed on the payment rather than on a fresh idempotency key, so asking
|
|
96
|
+
* twice is one page.
|
|
97
|
+
*
|
|
98
|
+
* What is owed comes off the payment, never off this call: the price was
|
|
99
|
+
* agreed when the payment was made. A payment that is settled or over is
|
|
100
|
+
* answered rather than re-opened, because re-opening one is how somebody pays
|
|
101
|
+
* twice.
|
|
102
|
+
*/
|
|
103
|
+
offerAgain(id: string, options: OfferOptions): Promise<Payment>;
|
|
104
|
+
}
|
|
105
|
+
/** Whether the money arrived. True of a refunded payment too: it did arrive. */
|
|
106
|
+
export declare function hasPaid(payment: Payment): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Whether nothing further will happen to this payment.
|
|
109
|
+
*
|
|
110
|
+
* What decides whether offering the page again is worth anything. A failed,
|
|
111
|
+
* cancelled, expired or fully refunded payment is over; a created or pending
|
|
112
|
+
* one can still be paid.
|
|
113
|
+
*/
|
|
114
|
+
export declare function isOver(payment: Payment): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* An amount, written the way a person in a given place writes it.
|
|
117
|
+
*
|
|
118
|
+
* The one formatting helper worth shipping, for the same reason bookings ships
|
|
119
|
+
* one for time: the obvious version is wrong. Dividing by a hundred is right
|
|
120
|
+
* for CHF, wrong for JPY, which has no minor unit at all, and wrong the other
|
|
121
|
+
* way for KWD, which has three. The number of places comes from the currency
|
|
122
|
+
* rather than from a constant, so this is correct for currencies nobody thought
|
|
123
|
+
* about when writing it.
|
|
124
|
+
*
|
|
125
|
+
* `locales` defaults to the reader's own. Pass one to match a page's language.
|
|
126
|
+
*/
|
|
127
|
+
export declare function formatMoney(money: Money, locales?: string | string[]): string;
|
|
128
|
+
export type { CheckoutRequest, Money, Payment, PaymentStatus, Refund, RefundStatus, } from './types.js';
|
|
129
|
+
//# sourceMappingURL=index.d.ts.map
|