@stripe/extensibility-sdk 0.22.4
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/LICENSE.md +19 -0
- package/dist/config-values/generate.cjs +262 -0
- package/dist/config-values/generate.d.ts +38 -0
- package/dist/config-values/generate.d.ts.map +1 -0
- package/dist/config-values/generate.js +232 -0
- package/dist/config-values/parse.d.ts +87 -0
- package/dist/config-values/parse.d.ts.map +1 -0
- package/dist/extensibility-sdk-alpha.d.ts +542 -0
- package/dist/extensibility-sdk-beta.d.ts +542 -0
- package/dist/extensibility-sdk-config-values-alpha.d.ts +27 -0
- package/dist/extensibility-sdk-config-values-beta.d.ts +27 -0
- package/dist/extensibility-sdk-config-values-internal.d.ts +118 -0
- package/dist/extensibility-sdk-config-values-public.d.ts +27 -0
- package/dist/extensibility-sdk-extensions-alpha.d.ts +1592 -0
- package/dist/extensibility-sdk-extensions-beta.d.ts +1592 -0
- package/dist/extensibility-sdk-extensions-internal.d.ts +1655 -0
- package/dist/extensibility-sdk-extensions-public.d.ts +1592 -0
- package/dist/extensibility-sdk-internal-alpha.d.ts +9 -0
- package/dist/extensibility-sdk-internal-beta.d.ts +9 -0
- package/dist/extensibility-sdk-internal-internal.d.ts +23 -0
- package/dist/extensibility-sdk-internal-public.d.ts +9 -0
- package/dist/extensibility-sdk-internal.d.ts +915 -0
- package/dist/extensibility-sdk-jsonschema-alpha.d.ts +3 -0
- package/dist/extensibility-sdk-jsonschema-beta.d.ts +3 -0
- package/dist/extensibility-sdk-jsonschema-internal.d.ts +15 -0
- package/dist/extensibility-sdk-jsonschema-public.d.ts +3 -0
- package/dist/extensibility-sdk-public.d.ts +542 -0
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +531 -0
- package/dist/extensibility-sdk-stdlib-beta.d.ts +531 -0
- package/dist/extensibility-sdk-stdlib-internal.d.ts +904 -0
- package/dist/extensibility-sdk-stdlib-public.d.ts +531 -0
- package/dist/extensions/billing/bill/discount_calculation.d.ts +226 -0
- package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -0
- package/dist/extensions/billing/bill/index.d.ts +2 -0
- package/dist/extensions/billing/bill/index.d.ts.map +1 -0
- package/dist/extensions/billing/customer_balance_application.d.ts +82 -0
- package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -0
- package/dist/extensions/billing/index.d.ts +8 -0
- package/dist/extensions/billing/index.d.ts.map +1 -0
- package/dist/extensions/billing/invoice_collection_setting.d.ts +117 -0
- package/dist/extensions/billing/invoice_collection_setting.d.ts.map +1 -0
- package/dist/extensions/billing/prorations.d.ts +222 -0
- package/dist/extensions/billing/prorations.d.ts.map +1 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +326 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -0
- package/dist/extensions/billing/types.d.ts +33 -0
- package/dist/extensions/billing/types.d.ts.map +1 -0
- package/dist/extensions/context.d.ts +9 -0
- package/dist/extensions/context.d.ts.map +1 -0
- package/dist/extensions/core/index.d.ts +3 -0
- package/dist/extensions/core/index.d.ts.map +1 -0
- package/dist/extensions/core/workflows/custom_action.d.ts +142 -0
- package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -0
- package/dist/extensions/core/workflows/index.d.ts +2 -0
- package/dist/extensions/core/workflows/index.d.ts.map +1 -0
- package/dist/extensions/extend/index.d.ts +3 -0
- package/dist/extensions/extend/index.d.ts.map +1 -0
- package/dist/extensions/extend/workflows/custom_action.d.ts +142 -0
- package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -0
- package/dist/extensions/extend/workflows/index.d.ts +2 -0
- package/dist/extensions/extend/workflows/index.d.ts.map +1 -0
- package/dist/extensions/index.cjs +2356 -0
- package/dist/extensions/index.d.ts +9 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +2435 -0
- package/dist/extensions/registry.d.ts +19 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/extensions/types.d.ts +10 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/index.cjs +1519 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1460 -0
- package/dist/internal.cjs +156 -0
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +128 -0
- package/dist/jsonschema.cjs +18 -0
- package/dist/jsonschema.d.ts +2 -0
- package/dist/jsonschema.d.ts.map +1 -0
- package/dist/jsonschema.js +0 -0
- package/dist/stdlib/brand.d.ts +27 -0
- package/dist/stdlib/brand.d.ts.map +1 -0
- package/dist/stdlib/decimal.d.ts +324 -0
- package/dist/stdlib/decimal.d.ts.map +1 -0
- package/dist/stdlib/extension-method.d.ts +27 -0
- package/dist/stdlib/extension-method.d.ts.map +1 -0
- package/dist/stdlib/generated.d.ts +15 -0
- package/dist/stdlib/generated.d.ts.map +1 -0
- package/dist/stdlib/index.cjs +1519 -0
- package/dist/stdlib/index.d.ts +18 -0
- package/dist/stdlib/index.d.ts.map +1 -0
- package/dist/stdlib/index.js +1460 -0
- package/dist/stdlib/refs.d.ts +62 -0
- package/dist/stdlib/refs.d.ts.map +1 -0
- package/dist/stdlib/scalars.d.ts +141 -0
- package/dist/stdlib/scalars.d.ts.map +1 -0
- package/dist/stdlib/transform-strategies.d.ts +74 -0
- package/dist/stdlib/transform-strategies.d.ts.map +1 -0
- package/dist/stdlib/transforms.d.ts +97 -0
- package/dist/stdlib/transforms.d.ts.map +1 -0
- package/dist/stdlib/type-utils.d.ts +9 -0
- package/dist/stdlib/type-utils.d.ts.map +1 -0
- package/dist/stdlib/types.d.ts +281 -0
- package/dist/stdlib/types.d.ts.map +1 -0
- package/dist/stdlib/utils.d.ts +7 -0
- package/dist/stdlib/utils.d.ts.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +111 -0
- package/tslibs/5.9.3/lib.es2022.egress.d.ts +4328 -0
- package/tslibs/5.9.3/lib.es2022.restricted.d.ts +4067 -0
- package/tslibs/lib.egress.globals.d.ts +112 -0
- package/tslibs/lib.restricted.globals.d.ts +1 -0
|
@@ -0,0 +1,2435 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/extensions/index.ts
|
|
8
|
+
import { Decimal, DecimalRoundingPresets } from "@stripe/extensibility-sdk/stdlib";
|
|
9
|
+
|
|
10
|
+
// src/extensions/billing/index.ts
|
|
11
|
+
var billing_exports = {};
|
|
12
|
+
__export(billing_exports, {
|
|
13
|
+
Bill: () => bill_exports,
|
|
14
|
+
CustomerBalanceApplication: () => CustomerBalanceApplication,
|
|
15
|
+
InvoiceCollectionSetting: () => InvoiceCollectionSetting,
|
|
16
|
+
Prorations: () => Prorations,
|
|
17
|
+
RecurringBillingItemHandling: () => RecurringBillingItemHandling
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/extensions/billing/bill/index.ts
|
|
21
|
+
var bill_exports = {};
|
|
22
|
+
__export(bill_exports, {
|
|
23
|
+
DiscountCalculation: () => DiscountCalculation
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/extensions/billing/bill/discount_calculation.ts
|
|
27
|
+
import {
|
|
28
|
+
_ProtoEnum,
|
|
29
|
+
_ProtoWireToType,
|
|
30
|
+
_ShapeDescriptor,
|
|
31
|
+
_TypeToProtoWire,
|
|
32
|
+
_UnionDescriptor,
|
|
33
|
+
_apply,
|
|
34
|
+
_configAppContextFromContext,
|
|
35
|
+
_identity,
|
|
36
|
+
_isPromiseLike,
|
|
37
|
+
_required,
|
|
38
|
+
_translateArray,
|
|
39
|
+
_translateDateTime,
|
|
40
|
+
_translateDecimal,
|
|
41
|
+
_translateEnum,
|
|
42
|
+
_translateMap,
|
|
43
|
+
_translateShape,
|
|
44
|
+
_translateUnion
|
|
45
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
46
|
+
var DiscountCalculation;
|
|
47
|
+
((DiscountCalculation2) => {
|
|
48
|
+
const billingReasonEnumValues = new _ProtoEnum({
|
|
49
|
+
BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE: "automatic_pending_invoice_item_invoice",
|
|
50
|
+
BILLING_REASON_MANUAL: "manual",
|
|
51
|
+
BILLING_REASON_SUBSCRIPTION: "subscription",
|
|
52
|
+
BILLING_REASON_SUBSCRIPTION_CREATE: "subscription_create",
|
|
53
|
+
BILLING_REASON_SUBSCRIPTION_CYCLE: "subscription_cycle",
|
|
54
|
+
BILLING_REASON_SUBSCRIPTION_CANCEL: "subscription_cancel",
|
|
55
|
+
BILLING_REASON_SUBSCRIPTION_THRESHOLD: "subscription_threshold",
|
|
56
|
+
BILLING_REASON_SUBSCRIPTION_TRIAL_ENDED: "subscription_trial_ended",
|
|
57
|
+
BILLING_REASON_SUBSCRIPTION_UPDATE: "subscription_update",
|
|
58
|
+
BILLING_REASON_UPCOMING: "upcoming",
|
|
59
|
+
BILLING_REASON_QUOTE_ACCEPT: "quote_accept"
|
|
60
|
+
});
|
|
61
|
+
const pricingTierModeEnumValues = new _ProtoEnum({
|
|
62
|
+
PRICING_TIER_MODE_GRADUATED: "graduated",
|
|
63
|
+
PRICING_TIER_MODE_VOLUME: "volume"
|
|
64
|
+
});
|
|
65
|
+
const priceTypeEnumValues = new _ProtoEnum({
|
|
66
|
+
PRICE_TYPE_ONE_TIME: "one_time",
|
|
67
|
+
PRICE_TYPE_RECURRING: "recurring"
|
|
68
|
+
});
|
|
69
|
+
const pricingSchemeEnumValues = new _ProtoEnum({
|
|
70
|
+
PRICING_SCHEME_PER_UNIT: "per_unit",
|
|
71
|
+
PRICING_SCHEME_TIERED: "tiered"
|
|
72
|
+
});
|
|
73
|
+
const usageTypeEnumValues = new _ProtoEnum({
|
|
74
|
+
USAGE_TYPE_LICENSED: "licensed",
|
|
75
|
+
USAGE_TYPE_METERED: "metered"
|
|
76
|
+
});
|
|
77
|
+
const recurringPriceIntervalEnumValues = new _ProtoEnum({
|
|
78
|
+
RECURRING_PRICE_INTERVAL_DAY: "day",
|
|
79
|
+
RECURRING_PRICE_INTERVAL_WEEK: "week",
|
|
80
|
+
RECURRING_PRICE_INTERVAL_MONTH: "month",
|
|
81
|
+
RECURRING_PRICE_INTERVAL_YEAR: "year"
|
|
82
|
+
});
|
|
83
|
+
const currencyEnumValues = new _ProtoEnum({
|
|
84
|
+
CURRENCY_AED: "aed",
|
|
85
|
+
CURRENCY_AFN: "afn",
|
|
86
|
+
CURRENCY_ALL: "all",
|
|
87
|
+
CURRENCY_AMD: "amd",
|
|
88
|
+
CURRENCY_ANG: "ang",
|
|
89
|
+
CURRENCY_AOA: "aoa",
|
|
90
|
+
CURRENCY_APT: "apt",
|
|
91
|
+
CURRENCY_ARB: "arb",
|
|
92
|
+
CURRENCY_ARS: "ars",
|
|
93
|
+
CURRENCY_AUD: "aud",
|
|
94
|
+
CURRENCY_AVAX: "avax",
|
|
95
|
+
CURRENCY_AWG: "awg",
|
|
96
|
+
CURRENCY_AZN: "azn",
|
|
97
|
+
CURRENCY_BAM: "bam",
|
|
98
|
+
CURRENCY_BBD: "bbd",
|
|
99
|
+
CURRENCY_BDT: "bdt",
|
|
100
|
+
CURRENCY_BGN: "bgn",
|
|
101
|
+
CURRENCY_BHD: "bhd",
|
|
102
|
+
CURRENCY_BIF: "bif",
|
|
103
|
+
CURRENCY_BMD: "bmd",
|
|
104
|
+
CURRENCY_BNB: "bnb",
|
|
105
|
+
CURRENCY_BND: "bnd",
|
|
106
|
+
CURRENCY_BOB: "bob",
|
|
107
|
+
CURRENCY_BOV: "bov",
|
|
108
|
+
CURRENCY_BRL: "brl",
|
|
109
|
+
CURRENCY_BSD: "bsd",
|
|
110
|
+
CURRENCY_BTC: "btc",
|
|
111
|
+
CURRENCY_BTN: "btn",
|
|
112
|
+
CURRENCY_BUIDL: "buidl",
|
|
113
|
+
CURRENCY_BWP: "bwp",
|
|
114
|
+
CURRENCY_BYN: "byn",
|
|
115
|
+
CURRENCY_BYR: "byr",
|
|
116
|
+
CURRENCY_BZD: "bzd",
|
|
117
|
+
CURRENCY_CAD: "cad",
|
|
118
|
+
CURRENCY_CDF: "cdf",
|
|
119
|
+
CURRENCY_CELO: "celo",
|
|
120
|
+
CURRENCY_CHE: "che",
|
|
121
|
+
CURRENCY_CHF: "chf",
|
|
122
|
+
CURRENCY_CHW: "chw",
|
|
123
|
+
CURRENCY_CLF: "clf",
|
|
124
|
+
CURRENCY_CLP: "clp",
|
|
125
|
+
CURRENCY_CNY: "cny",
|
|
126
|
+
CURRENCY_COP: "cop",
|
|
127
|
+
CURRENCY_COU: "cou",
|
|
128
|
+
CURRENCY_CRC: "crc",
|
|
129
|
+
CURRENCY_CUC: "cuc",
|
|
130
|
+
CURRENCY_CUP: "cup",
|
|
131
|
+
CURRENCY_CVE: "cve",
|
|
132
|
+
CURRENCY_CZK: "czk",
|
|
133
|
+
CURRENCY_DAI: "dai",
|
|
134
|
+
CURRENCY_DJF: "djf",
|
|
135
|
+
CURRENCY_DKK: "dkk",
|
|
136
|
+
CURRENCY_DOP: "dop",
|
|
137
|
+
CURRENCY_DZD: "dzd",
|
|
138
|
+
CURRENCY_EEK: "eek",
|
|
139
|
+
CURRENCY_EGP: "egp",
|
|
140
|
+
CURRENCY_ERN: "ern",
|
|
141
|
+
CURRENCY_ETB: "etb",
|
|
142
|
+
CURRENCY_ETH: "eth",
|
|
143
|
+
CURRENCY_EUR: "eur",
|
|
144
|
+
CURRENCY_EURC: "eurc",
|
|
145
|
+
CURRENCY_FJD: "fjd",
|
|
146
|
+
CURRENCY_FKP: "fkp",
|
|
147
|
+
CURRENCY_FRXUSD: "frxusd",
|
|
148
|
+
CURRENCY_GBP: "gbp",
|
|
149
|
+
CURRENCY_GEL: "gel",
|
|
150
|
+
CURRENCY_GHC: "ghc",
|
|
151
|
+
CURRENCY_GHS: "ghs",
|
|
152
|
+
CURRENCY_GIP: "gip",
|
|
153
|
+
CURRENCY_GMD: "gmd",
|
|
154
|
+
CURRENCY_GNF: "gnf",
|
|
155
|
+
CURRENCY_GTQ: "gtq",
|
|
156
|
+
CURRENCY_GYD: "gyd",
|
|
157
|
+
CURRENCY_HKD: "hkd",
|
|
158
|
+
CURRENCY_HNL: "hnl",
|
|
159
|
+
CURRENCY_HRK: "hrk",
|
|
160
|
+
CURRENCY_HTG: "htg",
|
|
161
|
+
CURRENCY_HUF: "huf",
|
|
162
|
+
CURRENCY_HYPE: "hype",
|
|
163
|
+
CURRENCY_IDR: "idr",
|
|
164
|
+
CURRENCY_ILS: "ils",
|
|
165
|
+
CURRENCY_INR: "inr",
|
|
166
|
+
CURRENCY_IQD: "iqd",
|
|
167
|
+
CURRENCY_IRR: "irr",
|
|
168
|
+
CURRENCY_ISK: "isk",
|
|
169
|
+
CURRENCY_JMD: "jmd",
|
|
170
|
+
CURRENCY_JOD: "jod",
|
|
171
|
+
CURRENCY_JPY: "jpy",
|
|
172
|
+
CURRENCY_KES: "kes",
|
|
173
|
+
CURRENCY_KGS: "kgs",
|
|
174
|
+
CURRENCY_KHR: "khr",
|
|
175
|
+
CURRENCY_KMF: "kmf",
|
|
176
|
+
CURRENCY_KPW: "kpw",
|
|
177
|
+
CURRENCY_KRW: "krw",
|
|
178
|
+
CURRENCY_KWD: "kwd",
|
|
179
|
+
CURRENCY_KYD: "kyd",
|
|
180
|
+
CURRENCY_KZT: "kzt",
|
|
181
|
+
CURRENCY_LAK: "lak",
|
|
182
|
+
CURRENCY_LBP: "lbp",
|
|
183
|
+
CURRENCY_LKR: "lkr",
|
|
184
|
+
CURRENCY_LRD: "lrd",
|
|
185
|
+
CURRENCY_LSL: "lsl",
|
|
186
|
+
CURRENCY_LTL: "ltl",
|
|
187
|
+
CURRENCY_LVL: "lvl",
|
|
188
|
+
CURRENCY_LYD: "lyd",
|
|
189
|
+
CURRENCY_LZD: "lzd",
|
|
190
|
+
CURRENCY_M: "m",
|
|
191
|
+
CURRENCY_MAD: "mad",
|
|
192
|
+
CURRENCY_MDL: "mdl",
|
|
193
|
+
CURRENCY_MGA: "mga",
|
|
194
|
+
CURRENCY_MKD: "mkd",
|
|
195
|
+
CURRENCY_MMK: "mmk",
|
|
196
|
+
CURRENCY_MNT: "mnt",
|
|
197
|
+
CURRENCY_MOP: "mop",
|
|
198
|
+
CURRENCY_MRO: "mro",
|
|
199
|
+
CURRENCY_MRU: "mru",
|
|
200
|
+
CURRENCY_MUR: "mur",
|
|
201
|
+
CURRENCY_MVR: "mvr",
|
|
202
|
+
CURRENCY_MWK: "mwk",
|
|
203
|
+
CURRENCY_MXN: "mxn",
|
|
204
|
+
CURRENCY_MXV: "mxv",
|
|
205
|
+
CURRENCY_MYR: "myr",
|
|
206
|
+
CURRENCY_MZN: "mzn",
|
|
207
|
+
CURRENCY_NAD: "nad",
|
|
208
|
+
CURRENCY_NGN: "ngn",
|
|
209
|
+
CURRENCY_NIO: "nio",
|
|
210
|
+
CURRENCY_NOK: "nok",
|
|
211
|
+
CURRENCY_NPR: "npr",
|
|
212
|
+
CURRENCY_NZD: "nzd",
|
|
213
|
+
CURRENCY_OMR: "omr",
|
|
214
|
+
CURRENCY_PAB: "pab",
|
|
215
|
+
CURRENCY_PEN: "pen",
|
|
216
|
+
CURRENCY_PGK: "pgk",
|
|
217
|
+
CURRENCY_PHP: "php",
|
|
218
|
+
CURRENCY_PKR: "pkr",
|
|
219
|
+
CURRENCY_PLN: "pln",
|
|
220
|
+
CURRENCY_POL: "pol",
|
|
221
|
+
CURRENCY_PYG: "pyg",
|
|
222
|
+
CURRENCY_PYUSD: "pyusd",
|
|
223
|
+
CURRENCY_QAR: "qar",
|
|
224
|
+
CURRENCY_RD: "rd",
|
|
225
|
+
CURRENCY_RE: "re",
|
|
226
|
+
CURRENCY_RON: "ron",
|
|
227
|
+
CURRENCY_RSD: "rsd",
|
|
228
|
+
CURRENCY_RUB: "rub",
|
|
229
|
+
CURRENCY_RWF: "rwf",
|
|
230
|
+
CURRENCY_SAR: "sar",
|
|
231
|
+
CURRENCY_SBD: "sbd",
|
|
232
|
+
CURRENCY_SCR: "scr",
|
|
233
|
+
CURRENCY_SDG: "sdg",
|
|
234
|
+
CURRENCY_SEK: "sek",
|
|
235
|
+
CURRENCY_SGD: "sgd",
|
|
236
|
+
CURRENCY_SHP: "shp",
|
|
237
|
+
CURRENCY_SLE: "sle",
|
|
238
|
+
CURRENCY_SLL: "sll",
|
|
239
|
+
CURRENCY_SOL: "sol",
|
|
240
|
+
CURRENCY_SOS: "sos",
|
|
241
|
+
CURRENCY_SRD: "srd",
|
|
242
|
+
CURRENCY_SSP: "ssp",
|
|
243
|
+
CURRENCY_STD: "std",
|
|
244
|
+
CURRENCY_STN: "stn",
|
|
245
|
+
CURRENCY_SUI: "sui",
|
|
246
|
+
CURRENCY_SVC: "svc",
|
|
247
|
+
CURRENCY_SYP: "syp",
|
|
248
|
+
CURRENCY_SZL: "szl",
|
|
249
|
+
CURRENCY_THB: "thb",
|
|
250
|
+
CURRENCY_TJS: "tjs",
|
|
251
|
+
CURRENCY_TMT: "tmt",
|
|
252
|
+
CURRENCY_TND: "tnd",
|
|
253
|
+
CURRENCY_TOP: "top",
|
|
254
|
+
CURRENCY_TRX: "trx",
|
|
255
|
+
CURRENCY_TRY: "try",
|
|
256
|
+
CURRENCY_TTD: "ttd",
|
|
257
|
+
CURRENCY_TWD: "twd",
|
|
258
|
+
CURRENCY_TZS: "tzs",
|
|
259
|
+
CURRENCY_UAH: "uah",
|
|
260
|
+
CURRENCY_UGX: "ugx",
|
|
261
|
+
CURRENCY_USD: "usd",
|
|
262
|
+
CURRENCY_USDB: "usdb",
|
|
263
|
+
CURRENCY_USDC: "usdc",
|
|
264
|
+
CURRENCY_USDG: "usdg",
|
|
265
|
+
CURRENCY_USDP: "usdp",
|
|
266
|
+
CURRENCY_USDT: "usdt",
|
|
267
|
+
CURRENCY_USN: "usn",
|
|
268
|
+
CURRENCY_USTB: "ustb",
|
|
269
|
+
CURRENCY_UYI: "uyi",
|
|
270
|
+
CURRENCY_UYU: "uyu",
|
|
271
|
+
CURRENCY_UZS: "uzs",
|
|
272
|
+
CURRENCY_VEF: "vef",
|
|
273
|
+
CURRENCY_VES: "ves",
|
|
274
|
+
CURRENCY_VND: "vnd",
|
|
275
|
+
CURRENCY_VUV: "vuv",
|
|
276
|
+
CURRENCY_WST: "wst",
|
|
277
|
+
CURRENCY_XAF: "xaf",
|
|
278
|
+
CURRENCY_XCD: "xcd",
|
|
279
|
+
CURRENCY_XCG: "xcg",
|
|
280
|
+
CURRENCY_XEUR: "xeur",
|
|
281
|
+
CURRENCY_XLM: "xlm",
|
|
282
|
+
CURRENCY_XOF: "xof",
|
|
283
|
+
CURRENCY_XPF: "xpf",
|
|
284
|
+
CURRENCY_XPL: "xpl",
|
|
285
|
+
CURRENCY_XUSD: "xusd",
|
|
286
|
+
CURRENCY_YER: "yer",
|
|
287
|
+
CURRENCY_ZAR: "zar",
|
|
288
|
+
CURRENCY_ZMK: "zmk",
|
|
289
|
+
CURRENCY_ZMW: "zmw",
|
|
290
|
+
CURRENCY_ZWD: "zwd",
|
|
291
|
+
CURRENCY_ZWG: "zwg",
|
|
292
|
+
CURRENCY_ZWL: "zwl"
|
|
293
|
+
});
|
|
294
|
+
const DiscountResultDescriptor = new _ShapeDescriptor(
|
|
295
|
+
"DiscountResult",
|
|
296
|
+
[
|
|
297
|
+
{
|
|
298
|
+
type: "discount",
|
|
299
|
+
transform: _required(_translateShape(() => DiscountDescriptor))
|
|
300
|
+
}
|
|
301
|
+
]
|
|
302
|
+
);
|
|
303
|
+
const DiscountDescriptor = new _ShapeDescriptor("Discount", [
|
|
304
|
+
{
|
|
305
|
+
type: "amount",
|
|
306
|
+
transform: _required(_translateShape(() => MonetaryAmountDescriptor))
|
|
307
|
+
}
|
|
308
|
+
]);
|
|
309
|
+
const DiscountableItemDescriptor = new _ShapeDescriptor(
|
|
310
|
+
"DiscountableItem",
|
|
311
|
+
[
|
|
312
|
+
{
|
|
313
|
+
type: "lineItems",
|
|
314
|
+
transform: _required(
|
|
315
|
+
_translateArray(_translateShape(() => DiscountableLineItemDescriptor))
|
|
316
|
+
)
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
type: "grossAmount",
|
|
320
|
+
transform: _required(_translateShape(() => MonetaryAmountDescriptor))
|
|
321
|
+
},
|
|
322
|
+
{ type: "customer", transform: _translateShape(() => CustomerDescriptor) },
|
|
323
|
+
{ type: "billingReason", transform: _translateEnum(billingReasonEnumValues) },
|
|
324
|
+
{ type: "subscription", transform: _translateShape(() => SubscriptionDescriptor) }
|
|
325
|
+
]
|
|
326
|
+
);
|
|
327
|
+
const SubscriptionDescriptor = new _ShapeDescriptor(
|
|
328
|
+
"Subscription",
|
|
329
|
+
[
|
|
330
|
+
{ type: "id", transform: _required() },
|
|
331
|
+
{ type: "billingCycleAnchor", transform: _identity },
|
|
332
|
+
{
|
|
333
|
+
type: "billingCycleAnchorConfig",
|
|
334
|
+
transform: _translateShape(() => BillingCycleAnchorConfigDescriptor)
|
|
335
|
+
},
|
|
336
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) }
|
|
337
|
+
]
|
|
338
|
+
);
|
|
339
|
+
const BillingCycleAnchorConfigDescriptor = new _ShapeDescriptor("BillingCycleAnchorConfig", [
|
|
340
|
+
{ type: "month", transform: _required() },
|
|
341
|
+
{ type: "dayOfMonth", transform: _required() },
|
|
342
|
+
{ type: "hour", transform: _required() },
|
|
343
|
+
{ type: "minute", transform: _required() },
|
|
344
|
+
{ type: "second", transform: _required() }
|
|
345
|
+
]);
|
|
346
|
+
const CustomerDescriptor = new _ShapeDescriptor("Customer", [
|
|
347
|
+
{ type: "id", transform: _required() },
|
|
348
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) }
|
|
349
|
+
]);
|
|
350
|
+
const DiscountableLineItemDescriptor = new _ShapeDescriptor(
|
|
351
|
+
"DiscountableLineItem",
|
|
352
|
+
[
|
|
353
|
+
{
|
|
354
|
+
type: "subtotal",
|
|
355
|
+
transform: _required(_translateShape(() => MonetaryAmountDescriptor))
|
|
356
|
+
},
|
|
357
|
+
{ type: "quantity", transform: _translateDecimal },
|
|
358
|
+
{
|
|
359
|
+
type: "period",
|
|
360
|
+
transform: _required(_translateUnion(() => AnyTimeRangeDescriptor))
|
|
361
|
+
},
|
|
362
|
+
{ type: "price", transform: _translateShape(() => PriceDescriptor) }
|
|
363
|
+
]
|
|
364
|
+
);
|
|
365
|
+
const PriceDescriptor = new _ShapeDescriptor("Price", [
|
|
366
|
+
{ type: "id", transform: _required() },
|
|
367
|
+
{ type: "product", transform: _translateShape(() => ProductDescriptor) },
|
|
368
|
+
{ type: "recurring", transform: _translateShape(() => RecurringPriceDescriptor) },
|
|
369
|
+
{ type: "billingScheme", transform: _translateEnum(pricingSchemeEnumValues) },
|
|
370
|
+
{
|
|
371
|
+
type: "tiers",
|
|
372
|
+
transform: _required(_translateArray(_translateShape(() => PriceTierDescriptor)))
|
|
373
|
+
},
|
|
374
|
+
{ type: "type", transform: _translateEnum(priceTypeEnumValues) },
|
|
375
|
+
{ type: "tiersMode", transform: _translateEnum(pricingTierModeEnumValues) },
|
|
376
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) },
|
|
377
|
+
{ type: "unitAmount", transform: _translateDecimal }
|
|
378
|
+
]);
|
|
379
|
+
const PriceTierDescriptor = new _ShapeDescriptor(
|
|
380
|
+
"PriceTier",
|
|
381
|
+
[
|
|
382
|
+
{ type: "flatAmount", transform: _translateDecimal },
|
|
383
|
+
{ type: "unitAmount", transform: _translateDecimal },
|
|
384
|
+
{ type: "upTo", transform: _translateDecimal }
|
|
385
|
+
]
|
|
386
|
+
);
|
|
387
|
+
const RecurringPriceDescriptor = new _ShapeDescriptor(
|
|
388
|
+
"RecurringPrice",
|
|
389
|
+
[
|
|
390
|
+
{
|
|
391
|
+
type: "interval",
|
|
392
|
+
transform: _required(_translateEnum(recurringPriceIntervalEnumValues))
|
|
393
|
+
},
|
|
394
|
+
{ type: "intervalCount", transform: _required() },
|
|
395
|
+
{ type: "usageType", transform: _translateEnum(usageTypeEnumValues) },
|
|
396
|
+
{ type: "meter", transform: _identity }
|
|
397
|
+
]
|
|
398
|
+
);
|
|
399
|
+
const ProductDescriptor = new _ShapeDescriptor("Product", [
|
|
400
|
+
{ type: "id", transform: _required() },
|
|
401
|
+
{ type: "name", transform: _required() },
|
|
402
|
+
{ type: "metadata", transform: _required(_translateMap(_identity, _identity)) }
|
|
403
|
+
]);
|
|
404
|
+
const MonetaryAmountDescriptor = new _ShapeDescriptor("MonetaryAmount", [
|
|
405
|
+
{ type: "amount", transform: _required(_translateDecimal) },
|
|
406
|
+
{ type: "currency", transform: _required(_translateEnum(currencyEnumValues)) }
|
|
407
|
+
]);
|
|
408
|
+
const AnyTimeRangeDescriptor = new _UnionDescriptor(
|
|
409
|
+
"AnyTimeRange",
|
|
410
|
+
"value",
|
|
411
|
+
[
|
|
412
|
+
{
|
|
413
|
+
wireKey: "oneTime",
|
|
414
|
+
typeKey: "oneTime",
|
|
415
|
+
shape: [{ type: "at", transform: _required(_translateDateTime) }]
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
wireKey: "timeRange",
|
|
419
|
+
typeKey: "timeRange",
|
|
420
|
+
shape: [
|
|
421
|
+
{ type: "startDate", transform: _required(_translateDateTime) },
|
|
422
|
+
{ type: "endDate", transform: _required(_translateDateTime) }
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
]
|
|
426
|
+
);
|
|
427
|
+
let __stripe_shim_active__ = false;
|
|
428
|
+
function prepareArgsComputeDiscounts(proto) {
|
|
429
|
+
if (__stripe_shim_active__) {
|
|
430
|
+
return proto;
|
|
431
|
+
}
|
|
432
|
+
return _apply(
|
|
433
|
+
DiscountableItemDescriptor,
|
|
434
|
+
_ProtoWireToType,
|
|
435
|
+
proto
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
DiscountCalculation2.prepareArgsComputeDiscounts = prepareArgsComputeDiscounts;
|
|
439
|
+
function prepareResultComputeDiscounts(result) {
|
|
440
|
+
if (__stripe_shim_active__) return result;
|
|
441
|
+
return _apply(
|
|
442
|
+
DiscountResultDescriptor,
|
|
443
|
+
_TypeToProtoWire,
|
|
444
|
+
result
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
DiscountCalculation2.prepareResultComputeDiscounts = prepareResultComputeDiscounts;
|
|
448
|
+
function $platformWrapComputeDiscounts(configTransformer) {
|
|
449
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
450
|
+
__stripe_shim_active__ = true;
|
|
451
|
+
const instance = new cls();
|
|
452
|
+
const request = _apply(
|
|
453
|
+
DiscountableItemDescriptor,
|
|
454
|
+
_ProtoWireToType,
|
|
455
|
+
wireArgs
|
|
456
|
+
);
|
|
457
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext(ctx)) : wireConfig;
|
|
458
|
+
const result = instance.computeDiscounts(request, config, ctx);
|
|
459
|
+
if (_isPromiseLike(result)) {
|
|
460
|
+
return Promise.resolve(result).then((r) => {
|
|
461
|
+
const typedR = r;
|
|
462
|
+
return _apply(DiscountResultDescriptor, _TypeToProtoWire, typedR);
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
const typedResult = result;
|
|
466
|
+
return _apply(DiscountResultDescriptor, _TypeToProtoWire, typedResult);
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
DiscountCalculation2.$platformWrapComputeDiscounts = $platformWrapComputeDiscounts;
|
|
470
|
+
const _prepareArgsAlias = prepareArgsComputeDiscounts;
|
|
471
|
+
DiscountCalculation2.prepareArgs = _prepareArgsAlias;
|
|
472
|
+
const _prepareResultAlias = prepareResultComputeDiscounts;
|
|
473
|
+
DiscountCalculation2.prepareResult = _prepareResultAlias;
|
|
474
|
+
})(DiscountCalculation || (DiscountCalculation = {}));
|
|
475
|
+
|
|
476
|
+
// src/extensions/billing/customer_balance_application.ts
|
|
477
|
+
import {
|
|
478
|
+
_ProtoEnum as _ProtoEnum2,
|
|
479
|
+
_ProtoWireToType as _ProtoWireToType2,
|
|
480
|
+
_ShapeDescriptor as _ShapeDescriptor2,
|
|
481
|
+
_TypeToProtoWire as _TypeToProtoWire2,
|
|
482
|
+
_apply as _apply2,
|
|
483
|
+
_configAppContextFromContext as _configAppContextFromContext2,
|
|
484
|
+
_isPromiseLike as _isPromiseLike2,
|
|
485
|
+
_required as _required2,
|
|
486
|
+
_translateDecimal as _translateDecimal2,
|
|
487
|
+
_translateEnum as _translateEnum2,
|
|
488
|
+
_translateShape as _translateShape2
|
|
489
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
490
|
+
var CustomerBalanceApplication;
|
|
491
|
+
((CustomerBalanceApplication2) => {
|
|
492
|
+
const currencyEnumValues = new _ProtoEnum2({
|
|
493
|
+
CURRENCY_AED: "aed",
|
|
494
|
+
CURRENCY_AFN: "afn",
|
|
495
|
+
CURRENCY_ALL: "all",
|
|
496
|
+
CURRENCY_AMD: "amd",
|
|
497
|
+
CURRENCY_ANG: "ang",
|
|
498
|
+
CURRENCY_AOA: "aoa",
|
|
499
|
+
CURRENCY_APT: "apt",
|
|
500
|
+
CURRENCY_ARB: "arb",
|
|
501
|
+
CURRENCY_ARS: "ars",
|
|
502
|
+
CURRENCY_AUD: "aud",
|
|
503
|
+
CURRENCY_AVAX: "avax",
|
|
504
|
+
CURRENCY_AWG: "awg",
|
|
505
|
+
CURRENCY_AZN: "azn",
|
|
506
|
+
CURRENCY_BAM: "bam",
|
|
507
|
+
CURRENCY_BBD: "bbd",
|
|
508
|
+
CURRENCY_BDT: "bdt",
|
|
509
|
+
CURRENCY_BGN: "bgn",
|
|
510
|
+
CURRENCY_BHD: "bhd",
|
|
511
|
+
CURRENCY_BIF: "bif",
|
|
512
|
+
CURRENCY_BMD: "bmd",
|
|
513
|
+
CURRENCY_BNB: "bnb",
|
|
514
|
+
CURRENCY_BND: "bnd",
|
|
515
|
+
CURRENCY_BOB: "bob",
|
|
516
|
+
CURRENCY_BOV: "bov",
|
|
517
|
+
CURRENCY_BRL: "brl",
|
|
518
|
+
CURRENCY_BSD: "bsd",
|
|
519
|
+
CURRENCY_BTC: "btc",
|
|
520
|
+
CURRENCY_BTN: "btn",
|
|
521
|
+
CURRENCY_BUIDL: "buidl",
|
|
522
|
+
CURRENCY_BWP: "bwp",
|
|
523
|
+
CURRENCY_BYN: "byn",
|
|
524
|
+
CURRENCY_BYR: "byr",
|
|
525
|
+
CURRENCY_BZD: "bzd",
|
|
526
|
+
CURRENCY_CAD: "cad",
|
|
527
|
+
CURRENCY_CDF: "cdf",
|
|
528
|
+
CURRENCY_CELO: "celo",
|
|
529
|
+
CURRENCY_CHE: "che",
|
|
530
|
+
CURRENCY_CHF: "chf",
|
|
531
|
+
CURRENCY_CHW: "chw",
|
|
532
|
+
CURRENCY_CLF: "clf",
|
|
533
|
+
CURRENCY_CLP: "clp",
|
|
534
|
+
CURRENCY_CNY: "cny",
|
|
535
|
+
CURRENCY_COP: "cop",
|
|
536
|
+
CURRENCY_COU: "cou",
|
|
537
|
+
CURRENCY_CRC: "crc",
|
|
538
|
+
CURRENCY_CUC: "cuc",
|
|
539
|
+
CURRENCY_CUP: "cup",
|
|
540
|
+
CURRENCY_CVE: "cve",
|
|
541
|
+
CURRENCY_CZK: "czk",
|
|
542
|
+
CURRENCY_DAI: "dai",
|
|
543
|
+
CURRENCY_DJF: "djf",
|
|
544
|
+
CURRENCY_DKK: "dkk",
|
|
545
|
+
CURRENCY_DOP: "dop",
|
|
546
|
+
CURRENCY_DZD: "dzd",
|
|
547
|
+
CURRENCY_EEK: "eek",
|
|
548
|
+
CURRENCY_EGP: "egp",
|
|
549
|
+
CURRENCY_ERN: "ern",
|
|
550
|
+
CURRENCY_ETB: "etb",
|
|
551
|
+
CURRENCY_ETH: "eth",
|
|
552
|
+
CURRENCY_EUR: "eur",
|
|
553
|
+
CURRENCY_EURC: "eurc",
|
|
554
|
+
CURRENCY_FJD: "fjd",
|
|
555
|
+
CURRENCY_FKP: "fkp",
|
|
556
|
+
CURRENCY_FRXUSD: "frxusd",
|
|
557
|
+
CURRENCY_GBP: "gbp",
|
|
558
|
+
CURRENCY_GEL: "gel",
|
|
559
|
+
CURRENCY_GHC: "ghc",
|
|
560
|
+
CURRENCY_GHS: "ghs",
|
|
561
|
+
CURRENCY_GIP: "gip",
|
|
562
|
+
CURRENCY_GMD: "gmd",
|
|
563
|
+
CURRENCY_GNF: "gnf",
|
|
564
|
+
CURRENCY_GTQ: "gtq",
|
|
565
|
+
CURRENCY_GYD: "gyd",
|
|
566
|
+
CURRENCY_HKD: "hkd",
|
|
567
|
+
CURRENCY_HNL: "hnl",
|
|
568
|
+
CURRENCY_HRK: "hrk",
|
|
569
|
+
CURRENCY_HTG: "htg",
|
|
570
|
+
CURRENCY_HUF: "huf",
|
|
571
|
+
CURRENCY_HYPE: "hype",
|
|
572
|
+
CURRENCY_IDR: "idr",
|
|
573
|
+
CURRENCY_ILS: "ils",
|
|
574
|
+
CURRENCY_INR: "inr",
|
|
575
|
+
CURRENCY_IQD: "iqd",
|
|
576
|
+
CURRENCY_IRR: "irr",
|
|
577
|
+
CURRENCY_ISK: "isk",
|
|
578
|
+
CURRENCY_JMD: "jmd",
|
|
579
|
+
CURRENCY_JOD: "jod",
|
|
580
|
+
CURRENCY_JPY: "jpy",
|
|
581
|
+
CURRENCY_KES: "kes",
|
|
582
|
+
CURRENCY_KGS: "kgs",
|
|
583
|
+
CURRENCY_KHR: "khr",
|
|
584
|
+
CURRENCY_KMF: "kmf",
|
|
585
|
+
CURRENCY_KPW: "kpw",
|
|
586
|
+
CURRENCY_KRW: "krw",
|
|
587
|
+
CURRENCY_KWD: "kwd",
|
|
588
|
+
CURRENCY_KYD: "kyd",
|
|
589
|
+
CURRENCY_KZT: "kzt",
|
|
590
|
+
CURRENCY_LAK: "lak",
|
|
591
|
+
CURRENCY_LBP: "lbp",
|
|
592
|
+
CURRENCY_LKR: "lkr",
|
|
593
|
+
CURRENCY_LRD: "lrd",
|
|
594
|
+
CURRENCY_LSL: "lsl",
|
|
595
|
+
CURRENCY_LTL: "ltl",
|
|
596
|
+
CURRENCY_LVL: "lvl",
|
|
597
|
+
CURRENCY_LYD: "lyd",
|
|
598
|
+
CURRENCY_LZD: "lzd",
|
|
599
|
+
CURRENCY_M: "m",
|
|
600
|
+
CURRENCY_MAD: "mad",
|
|
601
|
+
CURRENCY_MDL: "mdl",
|
|
602
|
+
CURRENCY_MGA: "mga",
|
|
603
|
+
CURRENCY_MKD: "mkd",
|
|
604
|
+
CURRENCY_MMK: "mmk",
|
|
605
|
+
CURRENCY_MNT: "mnt",
|
|
606
|
+
CURRENCY_MOP: "mop",
|
|
607
|
+
CURRENCY_MRO: "mro",
|
|
608
|
+
CURRENCY_MRU: "mru",
|
|
609
|
+
CURRENCY_MUR: "mur",
|
|
610
|
+
CURRENCY_MVR: "mvr",
|
|
611
|
+
CURRENCY_MWK: "mwk",
|
|
612
|
+
CURRENCY_MXN: "mxn",
|
|
613
|
+
CURRENCY_MXV: "mxv",
|
|
614
|
+
CURRENCY_MYR: "myr",
|
|
615
|
+
CURRENCY_MZN: "mzn",
|
|
616
|
+
CURRENCY_NAD: "nad",
|
|
617
|
+
CURRENCY_NGN: "ngn",
|
|
618
|
+
CURRENCY_NIO: "nio",
|
|
619
|
+
CURRENCY_NOK: "nok",
|
|
620
|
+
CURRENCY_NPR: "npr",
|
|
621
|
+
CURRENCY_NZD: "nzd",
|
|
622
|
+
CURRENCY_OMR: "omr",
|
|
623
|
+
CURRENCY_PAB: "pab",
|
|
624
|
+
CURRENCY_PEN: "pen",
|
|
625
|
+
CURRENCY_PGK: "pgk",
|
|
626
|
+
CURRENCY_PHP: "php",
|
|
627
|
+
CURRENCY_PKR: "pkr",
|
|
628
|
+
CURRENCY_PLN: "pln",
|
|
629
|
+
CURRENCY_POL: "pol",
|
|
630
|
+
CURRENCY_PYG: "pyg",
|
|
631
|
+
CURRENCY_PYUSD: "pyusd",
|
|
632
|
+
CURRENCY_QAR: "qar",
|
|
633
|
+
CURRENCY_RD: "rd",
|
|
634
|
+
CURRENCY_RE: "re",
|
|
635
|
+
CURRENCY_RON: "ron",
|
|
636
|
+
CURRENCY_RSD: "rsd",
|
|
637
|
+
CURRENCY_RUB: "rub",
|
|
638
|
+
CURRENCY_RWF: "rwf",
|
|
639
|
+
CURRENCY_SAR: "sar",
|
|
640
|
+
CURRENCY_SBD: "sbd",
|
|
641
|
+
CURRENCY_SCR: "scr",
|
|
642
|
+
CURRENCY_SDG: "sdg",
|
|
643
|
+
CURRENCY_SEK: "sek",
|
|
644
|
+
CURRENCY_SGD: "sgd",
|
|
645
|
+
CURRENCY_SHP: "shp",
|
|
646
|
+
CURRENCY_SLE: "sle",
|
|
647
|
+
CURRENCY_SLL: "sll",
|
|
648
|
+
CURRENCY_SOL: "sol",
|
|
649
|
+
CURRENCY_SOS: "sos",
|
|
650
|
+
CURRENCY_SRD: "srd",
|
|
651
|
+
CURRENCY_SSP: "ssp",
|
|
652
|
+
CURRENCY_STD: "std",
|
|
653
|
+
CURRENCY_STN: "stn",
|
|
654
|
+
CURRENCY_SUI: "sui",
|
|
655
|
+
CURRENCY_SVC: "svc",
|
|
656
|
+
CURRENCY_SYP: "syp",
|
|
657
|
+
CURRENCY_SZL: "szl",
|
|
658
|
+
CURRENCY_THB: "thb",
|
|
659
|
+
CURRENCY_TJS: "tjs",
|
|
660
|
+
CURRENCY_TMT: "tmt",
|
|
661
|
+
CURRENCY_TND: "tnd",
|
|
662
|
+
CURRENCY_TOP: "top",
|
|
663
|
+
CURRENCY_TRX: "trx",
|
|
664
|
+
CURRENCY_TRY: "try",
|
|
665
|
+
CURRENCY_TTD: "ttd",
|
|
666
|
+
CURRENCY_TWD: "twd",
|
|
667
|
+
CURRENCY_TZS: "tzs",
|
|
668
|
+
CURRENCY_UAH: "uah",
|
|
669
|
+
CURRENCY_UGX: "ugx",
|
|
670
|
+
CURRENCY_USD: "usd",
|
|
671
|
+
CURRENCY_USDB: "usdb",
|
|
672
|
+
CURRENCY_USDC: "usdc",
|
|
673
|
+
CURRENCY_USDG: "usdg",
|
|
674
|
+
CURRENCY_USDP: "usdp",
|
|
675
|
+
CURRENCY_USDT: "usdt",
|
|
676
|
+
CURRENCY_USN: "usn",
|
|
677
|
+
CURRENCY_USTB: "ustb",
|
|
678
|
+
CURRENCY_UYI: "uyi",
|
|
679
|
+
CURRENCY_UYU: "uyu",
|
|
680
|
+
CURRENCY_UZS: "uzs",
|
|
681
|
+
CURRENCY_VEF: "vef",
|
|
682
|
+
CURRENCY_VES: "ves",
|
|
683
|
+
CURRENCY_VND: "vnd",
|
|
684
|
+
CURRENCY_VUV: "vuv",
|
|
685
|
+
CURRENCY_WST: "wst",
|
|
686
|
+
CURRENCY_XAF: "xaf",
|
|
687
|
+
CURRENCY_XCD: "xcd",
|
|
688
|
+
CURRENCY_XCG: "xcg",
|
|
689
|
+
CURRENCY_XEUR: "xeur",
|
|
690
|
+
CURRENCY_XLM: "xlm",
|
|
691
|
+
CURRENCY_XOF: "xof",
|
|
692
|
+
CURRENCY_XPF: "xpf",
|
|
693
|
+
CURRENCY_XPL: "xpl",
|
|
694
|
+
CURRENCY_XUSD: "xusd",
|
|
695
|
+
CURRENCY_YER: "yer",
|
|
696
|
+
CURRENCY_ZAR: "zar",
|
|
697
|
+
CURRENCY_ZMK: "zmk",
|
|
698
|
+
CURRENCY_ZMW: "zmw",
|
|
699
|
+
CURRENCY_ZWD: "zwd",
|
|
700
|
+
CURRENCY_ZWG: "zwg",
|
|
701
|
+
CURRENCY_ZWL: "zwl"
|
|
702
|
+
});
|
|
703
|
+
const CustomerBalanceApplicationResultDescriptor = new _ShapeDescriptor2("CustomerBalanceApplicationResult", [
|
|
704
|
+
{
|
|
705
|
+
type: "appliedCustomerBalance",
|
|
706
|
+
transform: _required2(_translateShape2(() => MonetaryAmountDescriptor))
|
|
707
|
+
}
|
|
708
|
+
]);
|
|
709
|
+
const CustomerBalanceApplicationInputDescriptor = new _ShapeDescriptor2("CustomerBalanceApplicationInput", [
|
|
710
|
+
{
|
|
711
|
+
type: "totalAmount",
|
|
712
|
+
transform: _required2(_translateShape2(() => MonetaryAmountDescriptor))
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
type: "customerBalance",
|
|
716
|
+
transform: _required2(_translateShape2(() => MonetaryAmountDescriptor))
|
|
717
|
+
}
|
|
718
|
+
]);
|
|
719
|
+
const MonetaryAmountDescriptor = new _ShapeDescriptor2("MonetaryAmount", [
|
|
720
|
+
{ type: "amount", transform: _required2(_translateDecimal2) },
|
|
721
|
+
{ type: "currency", transform: _required2(_translateEnum2(currencyEnumValues)) }
|
|
722
|
+
]);
|
|
723
|
+
let __stripe_shim_active__ = false;
|
|
724
|
+
function prepareArgsComputeAppliedCustomerBalance(proto) {
|
|
725
|
+
if (__stripe_shim_active__) {
|
|
726
|
+
return proto;
|
|
727
|
+
}
|
|
728
|
+
return _apply2(
|
|
729
|
+
CustomerBalanceApplicationInputDescriptor,
|
|
730
|
+
_ProtoWireToType2,
|
|
731
|
+
proto
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
CustomerBalanceApplication2.prepareArgsComputeAppliedCustomerBalance = prepareArgsComputeAppliedCustomerBalance;
|
|
735
|
+
function prepareResultComputeAppliedCustomerBalance(result) {
|
|
736
|
+
if (__stripe_shim_active__) return result;
|
|
737
|
+
return _apply2(
|
|
738
|
+
CustomerBalanceApplicationResultDescriptor,
|
|
739
|
+
_TypeToProtoWire2,
|
|
740
|
+
result
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
CustomerBalanceApplication2.prepareResultComputeAppliedCustomerBalance = prepareResultComputeAppliedCustomerBalance;
|
|
744
|
+
function $platformWrapComputeAppliedCustomerBalance(configTransformer) {
|
|
745
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
746
|
+
__stripe_shim_active__ = true;
|
|
747
|
+
const instance = new cls();
|
|
748
|
+
const request = _apply2(
|
|
749
|
+
CustomerBalanceApplicationInputDescriptor,
|
|
750
|
+
_ProtoWireToType2,
|
|
751
|
+
wireArgs
|
|
752
|
+
);
|
|
753
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext2(ctx)) : wireConfig;
|
|
754
|
+
const result = instance.computeAppliedCustomerBalance(request, config, ctx);
|
|
755
|
+
if (_isPromiseLike2(result)) {
|
|
756
|
+
return Promise.resolve(result).then((r) => {
|
|
757
|
+
const typedR = r;
|
|
758
|
+
return _apply2(
|
|
759
|
+
CustomerBalanceApplicationResultDescriptor,
|
|
760
|
+
_TypeToProtoWire2,
|
|
761
|
+
typedR
|
|
762
|
+
);
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
const typedResult = result;
|
|
766
|
+
return _apply2(
|
|
767
|
+
CustomerBalanceApplicationResultDescriptor,
|
|
768
|
+
_TypeToProtoWire2,
|
|
769
|
+
typedResult
|
|
770
|
+
);
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
CustomerBalanceApplication2.$platformWrapComputeAppliedCustomerBalance = $platformWrapComputeAppliedCustomerBalance;
|
|
774
|
+
const _prepareArgsAlias = prepareArgsComputeAppliedCustomerBalance;
|
|
775
|
+
CustomerBalanceApplication2.prepareArgs = _prepareArgsAlias;
|
|
776
|
+
const _prepareResultAlias = prepareResultComputeAppliedCustomerBalance;
|
|
777
|
+
CustomerBalanceApplication2.prepareResult = _prepareResultAlias;
|
|
778
|
+
})(CustomerBalanceApplication || (CustomerBalanceApplication = {}));
|
|
779
|
+
|
|
780
|
+
// src/extensions/billing/invoice_collection_setting.ts
|
|
781
|
+
import {
|
|
782
|
+
_ProtoEnum as _ProtoEnum3,
|
|
783
|
+
_ProtoWireToType as _ProtoWireToType3,
|
|
784
|
+
_ShapeDescriptor as _ShapeDescriptor3,
|
|
785
|
+
_TypeToProtoWire as _TypeToProtoWire3,
|
|
786
|
+
_apply as _apply3,
|
|
787
|
+
_configAppContextFromContext as _configAppContextFromContext3,
|
|
788
|
+
_identity as _identity3,
|
|
789
|
+
_isPromiseLike as _isPromiseLike3,
|
|
790
|
+
_required as _required3,
|
|
791
|
+
_translateArray as _translateArray3,
|
|
792
|
+
_translateEnum as _translateEnum3,
|
|
793
|
+
_translateMap as _translateMap3,
|
|
794
|
+
_translateShape as _translateShape3
|
|
795
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
796
|
+
var InvoiceCollectionSetting;
|
|
797
|
+
((InvoiceCollectionSetting2) => {
|
|
798
|
+
const parentTypeEnumValues = new _ProtoEnum3({
|
|
799
|
+
PARENT_TYPE_SUBSCRIPTION: "subscription",
|
|
800
|
+
PARENT_TYPE_CONTRACT: "contract",
|
|
801
|
+
PARENT_TYPE_QUOTE: "quote",
|
|
802
|
+
PARENT_TYPE_BILLING_CADENCE: "billing_cadence",
|
|
803
|
+
PARENT_TYPE_SUBSCRIPTION_SCHEDULE: "subscription_schedule",
|
|
804
|
+
PARENT_TYPE_STANDALONE: "standalone"
|
|
805
|
+
});
|
|
806
|
+
const paymentMethodTypeEnumValues = new _ProtoEnum3({
|
|
807
|
+
PAYMENT_METHOD_TYPE_CARD: "card",
|
|
808
|
+
PAYMENT_METHOD_TYPE_ACH_DEBIT: "ach_debit",
|
|
809
|
+
PAYMENT_METHOD_TYPE_ACH_CREDIT_TRANSFER: "ach_credit_transfer",
|
|
810
|
+
PAYMENT_METHOD_TYPE_SEPA_DEBIT: "sepa_debit",
|
|
811
|
+
PAYMENT_METHOD_TYPE_SEPA_CREDIT_TRANSFER: "sepa_credit_transfer",
|
|
812
|
+
PAYMENT_METHOD_TYPE_BACS_DEBIT: "bacs_debit",
|
|
813
|
+
PAYMENT_METHOD_TYPE_AU_BECS_DEBIT: "au_becs_debit",
|
|
814
|
+
PAYMENT_METHOD_TYPE_US_BANK_ACCOUNT: "us_bank_account",
|
|
815
|
+
PAYMENT_METHOD_TYPE_LINK: "link",
|
|
816
|
+
PAYMENT_METHOD_TYPE_BOLETO: "boleto",
|
|
817
|
+
PAYMENT_METHOD_TYPE_OXXO: "oxxo",
|
|
818
|
+
PAYMENT_METHOD_TYPE_IDEAL: "ideal",
|
|
819
|
+
PAYMENT_METHOD_TYPE_BANCONTACT: "bancontact",
|
|
820
|
+
PAYMENT_METHOD_TYPE_GIROPAY: "giropay",
|
|
821
|
+
PAYMENT_METHOD_TYPE_EPS: "eps",
|
|
822
|
+
PAYMENT_METHOD_TYPE_P24: "p24",
|
|
823
|
+
PAYMENT_METHOD_TYPE_SOFORT: "sofort",
|
|
824
|
+
PAYMENT_METHOD_TYPE_ALIPAY: "alipay",
|
|
825
|
+
PAYMENT_METHOD_TYPE_WECHAT_PAY: "wechat_pay",
|
|
826
|
+
PAYMENT_METHOD_TYPE_KLARNA: "klarna",
|
|
827
|
+
PAYMENT_METHOD_TYPE_AFFIRM: "affirm",
|
|
828
|
+
PAYMENT_METHOD_TYPE_AFTERPAY_CLEARPAY: "afterpay_clearpay",
|
|
829
|
+
PAYMENT_METHOD_TYPE_CASHAPP: "cashapp",
|
|
830
|
+
PAYMENT_METHOD_TYPE_PAYPAL: "paypal",
|
|
831
|
+
PAYMENT_METHOD_TYPE_MULTIBANCO: "multibanco",
|
|
832
|
+
PAYMENT_METHOD_TYPE_KONBINI: "konbini",
|
|
833
|
+
PAYMENT_METHOD_TYPE_PROMPTPAY: "promptpay",
|
|
834
|
+
PAYMENT_METHOD_TYPE_PAYNOW: "paynow",
|
|
835
|
+
PAYMENT_METHOD_TYPE_GRABPAY: "grabpay",
|
|
836
|
+
PAYMENT_METHOD_TYPE_FPX: "fpx"
|
|
837
|
+
});
|
|
838
|
+
const collectionMethodEnumValues = new _ProtoEnum3({
|
|
839
|
+
COLLECTION_METHOD_SEND_INVOICE: "send_invoice",
|
|
840
|
+
COLLECTION_METHOD_CHARGE_AUTOMATICALLY: "charge_automatically"
|
|
841
|
+
});
|
|
842
|
+
const InvoiceCollectionResponseDescriptor = new _ShapeDescriptor3("InvoiceCollectionResponse", [
|
|
843
|
+
{ type: "autoAdvance", transform: _identity3 }
|
|
844
|
+
]);
|
|
845
|
+
const InvoiceCollectionRequestDescriptor = new _ShapeDescriptor3(
|
|
846
|
+
"InvoiceCollectionRequest",
|
|
847
|
+
[
|
|
848
|
+
{
|
|
849
|
+
type: "collectionSettings",
|
|
850
|
+
transform: _required3(_translateShape3(() => CollectionSettingsDescriptor))
|
|
851
|
+
},
|
|
852
|
+
{ type: "parent", transform: _required3(_translateShape3(() => ParentDescriptor)) }
|
|
853
|
+
],
|
|
854
|
+
[
|
|
855
|
+
{
|
|
856
|
+
discriminant: "payer",
|
|
857
|
+
optional: false,
|
|
858
|
+
branches: [
|
|
859
|
+
{
|
|
860
|
+
wireKey: "customer",
|
|
861
|
+
typeKey: "customer",
|
|
862
|
+
transform: _translateShape3(() => CustomerDescriptor)
|
|
863
|
+
}
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
]
|
|
867
|
+
);
|
|
868
|
+
const CustomerDescriptor = new _ShapeDescriptor3("Customer", [
|
|
869
|
+
{ type: "id", transform: _required3() },
|
|
870
|
+
{ type: "metadata", transform: _required3(_translateMap3(_identity3, _identity3)) }
|
|
871
|
+
]);
|
|
872
|
+
const ParentDescriptor = new _ShapeDescriptor3("Parent", [
|
|
873
|
+
{ type: "type", transform: _required3(_translateEnum3(parentTypeEnumValues)) },
|
|
874
|
+
{ type: "metadata", transform: _required3(_translateMap3(_identity3, _identity3)) }
|
|
875
|
+
]);
|
|
876
|
+
const CollectionSettingsDescriptor = new _ShapeDescriptor3(
|
|
877
|
+
"CollectionSettings",
|
|
878
|
+
[
|
|
879
|
+
{ type: "autoAdvance", transform: _required3() },
|
|
880
|
+
{
|
|
881
|
+
type: "collectionMethod",
|
|
882
|
+
transform: _required3(_translateEnum3(collectionMethodEnumValues))
|
|
883
|
+
},
|
|
884
|
+
{ type: "finalizationGracePeriod", transform: _required3() },
|
|
885
|
+
{
|
|
886
|
+
type: "paymentMethods",
|
|
887
|
+
transform: _required3(
|
|
888
|
+
_translateArray3(_translateEnum3(paymentMethodTypeEnumValues))
|
|
889
|
+
)
|
|
890
|
+
}
|
|
891
|
+
]
|
|
892
|
+
);
|
|
893
|
+
let __stripe_shim_active__ = false;
|
|
894
|
+
function prepareArgsCollectionOverride(proto) {
|
|
895
|
+
if (__stripe_shim_active__) {
|
|
896
|
+
return proto;
|
|
897
|
+
}
|
|
898
|
+
return _apply3(
|
|
899
|
+
InvoiceCollectionRequestDescriptor,
|
|
900
|
+
_ProtoWireToType3,
|
|
901
|
+
proto
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
InvoiceCollectionSetting2.prepareArgsCollectionOverride = prepareArgsCollectionOverride;
|
|
905
|
+
function prepareResultCollectionOverride(result) {
|
|
906
|
+
if (__stripe_shim_active__) return result;
|
|
907
|
+
return _apply3(
|
|
908
|
+
InvoiceCollectionResponseDescriptor,
|
|
909
|
+
_TypeToProtoWire3,
|
|
910
|
+
result
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
InvoiceCollectionSetting2.prepareResultCollectionOverride = prepareResultCollectionOverride;
|
|
914
|
+
function $platformWrapCollectionOverride(configTransformer) {
|
|
915
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
916
|
+
__stripe_shim_active__ = true;
|
|
917
|
+
const instance = new cls();
|
|
918
|
+
const request = _apply3(
|
|
919
|
+
InvoiceCollectionRequestDescriptor,
|
|
920
|
+
_ProtoWireToType3,
|
|
921
|
+
wireArgs
|
|
922
|
+
);
|
|
923
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext3(ctx)) : wireConfig;
|
|
924
|
+
const result = instance.collectionOverride(request, config, ctx);
|
|
925
|
+
if (_isPromiseLike3(result)) {
|
|
926
|
+
return Promise.resolve(result).then((r) => {
|
|
927
|
+
const typedR = r;
|
|
928
|
+
return _apply3(InvoiceCollectionResponseDescriptor, _TypeToProtoWire3, typedR);
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
const typedResult = result;
|
|
932
|
+
return _apply3(InvoiceCollectionResponseDescriptor, _TypeToProtoWire3, typedResult);
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
InvoiceCollectionSetting2.$platformWrapCollectionOverride = $platformWrapCollectionOverride;
|
|
936
|
+
const _prepareArgsAlias = prepareArgsCollectionOverride;
|
|
937
|
+
InvoiceCollectionSetting2.prepareArgs = _prepareArgsAlias;
|
|
938
|
+
const _prepareResultAlias = prepareResultCollectionOverride;
|
|
939
|
+
InvoiceCollectionSetting2.prepareResult = _prepareResultAlias;
|
|
940
|
+
})(InvoiceCollectionSetting || (InvoiceCollectionSetting = {}));
|
|
941
|
+
|
|
942
|
+
// src/extensions/billing/prorations.ts
|
|
943
|
+
import {
|
|
944
|
+
_ProtoEnum as _ProtoEnum4,
|
|
945
|
+
_ProtoWireToType as _ProtoWireToType4,
|
|
946
|
+
_ShapeDescriptor as _ShapeDescriptor4,
|
|
947
|
+
_TypeToProtoWire as _TypeToProtoWire4,
|
|
948
|
+
_apply as _apply4,
|
|
949
|
+
_configAppContextFromContext as _configAppContextFromContext4,
|
|
950
|
+
_identity as _identity4,
|
|
951
|
+
_isPromiseLike as _isPromiseLike4,
|
|
952
|
+
_required as _required4,
|
|
953
|
+
_translateArray as _translateArray4,
|
|
954
|
+
_translateDateTime as _translateDateTime4,
|
|
955
|
+
_translateDecimal as _translateDecimal4,
|
|
956
|
+
_translateEnum as _translateEnum4,
|
|
957
|
+
_translateMap as _translateMap4,
|
|
958
|
+
_translateShape as _translateShape4
|
|
959
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
960
|
+
var Prorations;
|
|
961
|
+
((Prorations2) => {
|
|
962
|
+
const pricingTierModeEnumValues = new _ProtoEnum4({
|
|
963
|
+
PRICING_TIER_MODE_GRADUATED: "graduated",
|
|
964
|
+
PRICING_TIER_MODE_VOLUME: "volume"
|
|
965
|
+
});
|
|
966
|
+
const recurringPriceIntervalEnumValues = new _ProtoEnum4({
|
|
967
|
+
RECURRING_PRICE_INTERVAL_DAY: "day",
|
|
968
|
+
RECURRING_PRICE_INTERVAL_WEEK: "week",
|
|
969
|
+
RECURRING_PRICE_INTERVAL_MONTH: "month",
|
|
970
|
+
RECURRING_PRICE_INTERVAL_YEAR: "year"
|
|
971
|
+
});
|
|
972
|
+
const priceTypeEnumValues = new _ProtoEnum4({
|
|
973
|
+
PRICE_TYPE_ONE_TIME: "one_time",
|
|
974
|
+
PRICE_TYPE_RECURRING: "recurring"
|
|
975
|
+
});
|
|
976
|
+
const pricingSchemeEnumValues = new _ProtoEnum4({
|
|
977
|
+
PRICING_SCHEME_PER_UNIT: "per_unit",
|
|
978
|
+
PRICING_SCHEME_TIERED: "tiered"
|
|
979
|
+
});
|
|
980
|
+
const usageTypeEnumValues = new _ProtoEnum4({
|
|
981
|
+
USAGE_TYPE_LICENSED: "licensed",
|
|
982
|
+
USAGE_TYPE_METERED: "metered"
|
|
983
|
+
});
|
|
984
|
+
const itemTypeEnumValues = new _ProtoEnum4({
|
|
985
|
+
ITEM_TYPE_CREDIT: "credit",
|
|
986
|
+
ITEM_TYPE_DEBIT: "debit"
|
|
987
|
+
});
|
|
988
|
+
const currencyEnumValues = new _ProtoEnum4({
|
|
989
|
+
CURRENCY_AED: "aed",
|
|
990
|
+
CURRENCY_AFN: "afn",
|
|
991
|
+
CURRENCY_ALL: "all",
|
|
992
|
+
CURRENCY_AMD: "amd",
|
|
993
|
+
CURRENCY_ANG: "ang",
|
|
994
|
+
CURRENCY_AOA: "aoa",
|
|
995
|
+
CURRENCY_APT: "apt",
|
|
996
|
+
CURRENCY_ARB: "arb",
|
|
997
|
+
CURRENCY_ARS: "ars",
|
|
998
|
+
CURRENCY_AUD: "aud",
|
|
999
|
+
CURRENCY_AVAX: "avax",
|
|
1000
|
+
CURRENCY_AWG: "awg",
|
|
1001
|
+
CURRENCY_AZN: "azn",
|
|
1002
|
+
CURRENCY_BAM: "bam",
|
|
1003
|
+
CURRENCY_BBD: "bbd",
|
|
1004
|
+
CURRENCY_BDT: "bdt",
|
|
1005
|
+
CURRENCY_BGN: "bgn",
|
|
1006
|
+
CURRENCY_BHD: "bhd",
|
|
1007
|
+
CURRENCY_BIF: "bif",
|
|
1008
|
+
CURRENCY_BMD: "bmd",
|
|
1009
|
+
CURRENCY_BNB: "bnb",
|
|
1010
|
+
CURRENCY_BND: "bnd",
|
|
1011
|
+
CURRENCY_BOB: "bob",
|
|
1012
|
+
CURRENCY_BOV: "bov",
|
|
1013
|
+
CURRENCY_BRL: "brl",
|
|
1014
|
+
CURRENCY_BSD: "bsd",
|
|
1015
|
+
CURRENCY_BTC: "btc",
|
|
1016
|
+
CURRENCY_BTN: "btn",
|
|
1017
|
+
CURRENCY_BUIDL: "buidl",
|
|
1018
|
+
CURRENCY_BWP: "bwp",
|
|
1019
|
+
CURRENCY_BYN: "byn",
|
|
1020
|
+
CURRENCY_BYR: "byr",
|
|
1021
|
+
CURRENCY_BZD: "bzd",
|
|
1022
|
+
CURRENCY_CAD: "cad",
|
|
1023
|
+
CURRENCY_CDF: "cdf",
|
|
1024
|
+
CURRENCY_CELO: "celo",
|
|
1025
|
+
CURRENCY_CHE: "che",
|
|
1026
|
+
CURRENCY_CHF: "chf",
|
|
1027
|
+
CURRENCY_CHW: "chw",
|
|
1028
|
+
CURRENCY_CLF: "clf",
|
|
1029
|
+
CURRENCY_CLP: "clp",
|
|
1030
|
+
CURRENCY_CNY: "cny",
|
|
1031
|
+
CURRENCY_COP: "cop",
|
|
1032
|
+
CURRENCY_COU: "cou",
|
|
1033
|
+
CURRENCY_CRC: "crc",
|
|
1034
|
+
CURRENCY_CUC: "cuc",
|
|
1035
|
+
CURRENCY_CUP: "cup",
|
|
1036
|
+
CURRENCY_CVE: "cve",
|
|
1037
|
+
CURRENCY_CZK: "czk",
|
|
1038
|
+
CURRENCY_DAI: "dai",
|
|
1039
|
+
CURRENCY_DJF: "djf",
|
|
1040
|
+
CURRENCY_DKK: "dkk",
|
|
1041
|
+
CURRENCY_DOP: "dop",
|
|
1042
|
+
CURRENCY_DZD: "dzd",
|
|
1043
|
+
CURRENCY_EEK: "eek",
|
|
1044
|
+
CURRENCY_EGP: "egp",
|
|
1045
|
+
CURRENCY_ERN: "ern",
|
|
1046
|
+
CURRENCY_ETB: "etb",
|
|
1047
|
+
CURRENCY_ETH: "eth",
|
|
1048
|
+
CURRENCY_EUR: "eur",
|
|
1049
|
+
CURRENCY_EURC: "eurc",
|
|
1050
|
+
CURRENCY_FJD: "fjd",
|
|
1051
|
+
CURRENCY_FKP: "fkp",
|
|
1052
|
+
CURRENCY_FRXUSD: "frxusd",
|
|
1053
|
+
CURRENCY_GBP: "gbp",
|
|
1054
|
+
CURRENCY_GEL: "gel",
|
|
1055
|
+
CURRENCY_GHC: "ghc",
|
|
1056
|
+
CURRENCY_GHS: "ghs",
|
|
1057
|
+
CURRENCY_GIP: "gip",
|
|
1058
|
+
CURRENCY_GMD: "gmd",
|
|
1059
|
+
CURRENCY_GNF: "gnf",
|
|
1060
|
+
CURRENCY_GTQ: "gtq",
|
|
1061
|
+
CURRENCY_GYD: "gyd",
|
|
1062
|
+
CURRENCY_HKD: "hkd",
|
|
1063
|
+
CURRENCY_HNL: "hnl",
|
|
1064
|
+
CURRENCY_HRK: "hrk",
|
|
1065
|
+
CURRENCY_HTG: "htg",
|
|
1066
|
+
CURRENCY_HUF: "huf",
|
|
1067
|
+
CURRENCY_HYPE: "hype",
|
|
1068
|
+
CURRENCY_IDR: "idr",
|
|
1069
|
+
CURRENCY_ILS: "ils",
|
|
1070
|
+
CURRENCY_INR: "inr",
|
|
1071
|
+
CURRENCY_IQD: "iqd",
|
|
1072
|
+
CURRENCY_IRR: "irr",
|
|
1073
|
+
CURRENCY_ISK: "isk",
|
|
1074
|
+
CURRENCY_JMD: "jmd",
|
|
1075
|
+
CURRENCY_JOD: "jod",
|
|
1076
|
+
CURRENCY_JPY: "jpy",
|
|
1077
|
+
CURRENCY_KES: "kes",
|
|
1078
|
+
CURRENCY_KGS: "kgs",
|
|
1079
|
+
CURRENCY_KHR: "khr",
|
|
1080
|
+
CURRENCY_KMF: "kmf",
|
|
1081
|
+
CURRENCY_KPW: "kpw",
|
|
1082
|
+
CURRENCY_KRW: "krw",
|
|
1083
|
+
CURRENCY_KWD: "kwd",
|
|
1084
|
+
CURRENCY_KYD: "kyd",
|
|
1085
|
+
CURRENCY_KZT: "kzt",
|
|
1086
|
+
CURRENCY_LAK: "lak",
|
|
1087
|
+
CURRENCY_LBP: "lbp",
|
|
1088
|
+
CURRENCY_LKR: "lkr",
|
|
1089
|
+
CURRENCY_LRD: "lrd",
|
|
1090
|
+
CURRENCY_LSL: "lsl",
|
|
1091
|
+
CURRENCY_LTL: "ltl",
|
|
1092
|
+
CURRENCY_LVL: "lvl",
|
|
1093
|
+
CURRENCY_LYD: "lyd",
|
|
1094
|
+
CURRENCY_LZD: "lzd",
|
|
1095
|
+
CURRENCY_M: "m",
|
|
1096
|
+
CURRENCY_MAD: "mad",
|
|
1097
|
+
CURRENCY_MDL: "mdl",
|
|
1098
|
+
CURRENCY_MGA: "mga",
|
|
1099
|
+
CURRENCY_MKD: "mkd",
|
|
1100
|
+
CURRENCY_MMK: "mmk",
|
|
1101
|
+
CURRENCY_MNT: "mnt",
|
|
1102
|
+
CURRENCY_MOP: "mop",
|
|
1103
|
+
CURRENCY_MRO: "mro",
|
|
1104
|
+
CURRENCY_MRU: "mru",
|
|
1105
|
+
CURRENCY_MUR: "mur",
|
|
1106
|
+
CURRENCY_MVR: "mvr",
|
|
1107
|
+
CURRENCY_MWK: "mwk",
|
|
1108
|
+
CURRENCY_MXN: "mxn",
|
|
1109
|
+
CURRENCY_MXV: "mxv",
|
|
1110
|
+
CURRENCY_MYR: "myr",
|
|
1111
|
+
CURRENCY_MZN: "mzn",
|
|
1112
|
+
CURRENCY_NAD: "nad",
|
|
1113
|
+
CURRENCY_NGN: "ngn",
|
|
1114
|
+
CURRENCY_NIO: "nio",
|
|
1115
|
+
CURRENCY_NOK: "nok",
|
|
1116
|
+
CURRENCY_NPR: "npr",
|
|
1117
|
+
CURRENCY_NZD: "nzd",
|
|
1118
|
+
CURRENCY_OMR: "omr",
|
|
1119
|
+
CURRENCY_PAB: "pab",
|
|
1120
|
+
CURRENCY_PEN: "pen",
|
|
1121
|
+
CURRENCY_PGK: "pgk",
|
|
1122
|
+
CURRENCY_PHP: "php",
|
|
1123
|
+
CURRENCY_PKR: "pkr",
|
|
1124
|
+
CURRENCY_PLN: "pln",
|
|
1125
|
+
CURRENCY_POL: "pol",
|
|
1126
|
+
CURRENCY_PYG: "pyg",
|
|
1127
|
+
CURRENCY_PYUSD: "pyusd",
|
|
1128
|
+
CURRENCY_QAR: "qar",
|
|
1129
|
+
CURRENCY_RD: "rd",
|
|
1130
|
+
CURRENCY_RE: "re",
|
|
1131
|
+
CURRENCY_RON: "ron",
|
|
1132
|
+
CURRENCY_RSD: "rsd",
|
|
1133
|
+
CURRENCY_RUB: "rub",
|
|
1134
|
+
CURRENCY_RWF: "rwf",
|
|
1135
|
+
CURRENCY_SAR: "sar",
|
|
1136
|
+
CURRENCY_SBD: "sbd",
|
|
1137
|
+
CURRENCY_SCR: "scr",
|
|
1138
|
+
CURRENCY_SDG: "sdg",
|
|
1139
|
+
CURRENCY_SEK: "sek",
|
|
1140
|
+
CURRENCY_SGD: "sgd",
|
|
1141
|
+
CURRENCY_SHP: "shp",
|
|
1142
|
+
CURRENCY_SLE: "sle",
|
|
1143
|
+
CURRENCY_SLL: "sll",
|
|
1144
|
+
CURRENCY_SOL: "sol",
|
|
1145
|
+
CURRENCY_SOS: "sos",
|
|
1146
|
+
CURRENCY_SRD: "srd",
|
|
1147
|
+
CURRENCY_SSP: "ssp",
|
|
1148
|
+
CURRENCY_STD: "std",
|
|
1149
|
+
CURRENCY_STN: "stn",
|
|
1150
|
+
CURRENCY_SUI: "sui",
|
|
1151
|
+
CURRENCY_SVC: "svc",
|
|
1152
|
+
CURRENCY_SYP: "syp",
|
|
1153
|
+
CURRENCY_SZL: "szl",
|
|
1154
|
+
CURRENCY_THB: "thb",
|
|
1155
|
+
CURRENCY_TJS: "tjs",
|
|
1156
|
+
CURRENCY_TMT: "tmt",
|
|
1157
|
+
CURRENCY_TND: "tnd",
|
|
1158
|
+
CURRENCY_TOP: "top",
|
|
1159
|
+
CURRENCY_TRX: "trx",
|
|
1160
|
+
CURRENCY_TRY: "try",
|
|
1161
|
+
CURRENCY_TTD: "ttd",
|
|
1162
|
+
CURRENCY_TWD: "twd",
|
|
1163
|
+
CURRENCY_TZS: "tzs",
|
|
1164
|
+
CURRENCY_UAH: "uah",
|
|
1165
|
+
CURRENCY_UGX: "ugx",
|
|
1166
|
+
CURRENCY_USD: "usd",
|
|
1167
|
+
CURRENCY_USDB: "usdb",
|
|
1168
|
+
CURRENCY_USDC: "usdc",
|
|
1169
|
+
CURRENCY_USDG: "usdg",
|
|
1170
|
+
CURRENCY_USDP: "usdp",
|
|
1171
|
+
CURRENCY_USDT: "usdt",
|
|
1172
|
+
CURRENCY_USN: "usn",
|
|
1173
|
+
CURRENCY_USTB: "ustb",
|
|
1174
|
+
CURRENCY_UYI: "uyi",
|
|
1175
|
+
CURRENCY_UYU: "uyu",
|
|
1176
|
+
CURRENCY_UZS: "uzs",
|
|
1177
|
+
CURRENCY_VEF: "vef",
|
|
1178
|
+
CURRENCY_VES: "ves",
|
|
1179
|
+
CURRENCY_VND: "vnd",
|
|
1180
|
+
CURRENCY_VUV: "vuv",
|
|
1181
|
+
CURRENCY_WST: "wst",
|
|
1182
|
+
CURRENCY_XAF: "xaf",
|
|
1183
|
+
CURRENCY_XCD: "xcd",
|
|
1184
|
+
CURRENCY_XCG: "xcg",
|
|
1185
|
+
CURRENCY_XEUR: "xeur",
|
|
1186
|
+
CURRENCY_XLM: "xlm",
|
|
1187
|
+
CURRENCY_XOF: "xof",
|
|
1188
|
+
CURRENCY_XPF: "xpf",
|
|
1189
|
+
CURRENCY_XPL: "xpl",
|
|
1190
|
+
CURRENCY_XUSD: "xusd",
|
|
1191
|
+
CURRENCY_YER: "yer",
|
|
1192
|
+
CURRENCY_ZAR: "zar",
|
|
1193
|
+
CURRENCY_ZMK: "zmk",
|
|
1194
|
+
CURRENCY_ZMW: "zmw",
|
|
1195
|
+
CURRENCY_ZWD: "zwd",
|
|
1196
|
+
CURRENCY_ZWG: "zwg",
|
|
1197
|
+
CURRENCY_ZWL: "zwl"
|
|
1198
|
+
});
|
|
1199
|
+
const ProrateItemsResultDescriptor = new _ShapeDescriptor4(
|
|
1200
|
+
"ProrateItemsResult",
|
|
1201
|
+
[
|
|
1202
|
+
{
|
|
1203
|
+
type: "items",
|
|
1204
|
+
transform: _required4(
|
|
1205
|
+
_translateArray4(_translateShape4(() => ItemWithProrationDescriptor))
|
|
1206
|
+
)
|
|
1207
|
+
}
|
|
1208
|
+
]
|
|
1209
|
+
);
|
|
1210
|
+
const ItemWithProrationDescriptor = new _ShapeDescriptor4(
|
|
1211
|
+
"ItemWithProration",
|
|
1212
|
+
[
|
|
1213
|
+
{ type: "key", transform: _required4() },
|
|
1214
|
+
{ type: "prorationFactor", transform: _required4(_translateDecimal4) },
|
|
1215
|
+
{
|
|
1216
|
+
type: "lineItemPeriod",
|
|
1217
|
+
transform: _required4(_translateShape4(() => TimeRangeDescriptor))
|
|
1218
|
+
}
|
|
1219
|
+
]
|
|
1220
|
+
);
|
|
1221
|
+
const ProrateItemsInputDescriptor = new _ShapeDescriptor4(
|
|
1222
|
+
"ProrateItemsInput",
|
|
1223
|
+
[
|
|
1224
|
+
{
|
|
1225
|
+
type: "items",
|
|
1226
|
+
transform: _required4(
|
|
1227
|
+
_translateArray4(_translateShape4(() => ProratableItemDescriptor))
|
|
1228
|
+
)
|
|
1229
|
+
}
|
|
1230
|
+
]
|
|
1231
|
+
);
|
|
1232
|
+
const ProratableItemDescriptor = new _ShapeDescriptor4(
|
|
1233
|
+
"ProratableItem",
|
|
1234
|
+
[
|
|
1235
|
+
{ type: "key", transform: _required4() },
|
|
1236
|
+
{ type: "type", transform: _required4(_translateEnum4(itemTypeEnumValues)) },
|
|
1237
|
+
{ type: "isProration", transform: _required4() },
|
|
1238
|
+
{
|
|
1239
|
+
type: "servicePeriod",
|
|
1240
|
+
transform: _required4(_translateShape4(() => TimeRangeDescriptor))
|
|
1241
|
+
},
|
|
1242
|
+
{ type: "currentProrationFactor", transform: _required4(_translateDecimal4) },
|
|
1243
|
+
{ type: "priceIntervalDuration", transform: _required4() },
|
|
1244
|
+
{
|
|
1245
|
+
type: "correspondingDebit",
|
|
1246
|
+
transform: _translateShape4(() => PreviousDebitDescriptor)
|
|
1247
|
+
}
|
|
1248
|
+
],
|
|
1249
|
+
[
|
|
1250
|
+
{
|
|
1251
|
+
discriminant: "priceKind",
|
|
1252
|
+
optional: false,
|
|
1253
|
+
branches: [
|
|
1254
|
+
{
|
|
1255
|
+
wireKey: "price",
|
|
1256
|
+
typeKey: "price",
|
|
1257
|
+
transform: _translateShape4(() => PriceDescriptor)
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
wireKey: "licenseFee",
|
|
1261
|
+
typeKey: "licenseFee",
|
|
1262
|
+
transform: _translateShape4(() => LicenseFeeDescriptor)
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
wireKey: "rateCardRate",
|
|
1266
|
+
typeKey: "rateCardRate",
|
|
1267
|
+
transform: _translateShape4(() => RateCardRateDescriptor)
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
wireKey: "customPricingUnitOverageRate",
|
|
1271
|
+
typeKey: "customPricingUnitOverageRate",
|
|
1272
|
+
transform: _translateShape4(() => CustomPricingUnitOverageRateDescriptor)
|
|
1273
|
+
}
|
|
1274
|
+
]
|
|
1275
|
+
}
|
|
1276
|
+
]
|
|
1277
|
+
);
|
|
1278
|
+
const PreviousDebitDescriptor = new _ShapeDescriptor4(
|
|
1279
|
+
"PreviousDebit",
|
|
1280
|
+
[
|
|
1281
|
+
{
|
|
1282
|
+
type: "servicePeriod",
|
|
1283
|
+
transform: _required4(_translateShape4(() => TimeRangeDescriptor))
|
|
1284
|
+
}
|
|
1285
|
+
]
|
|
1286
|
+
);
|
|
1287
|
+
const CustomPricingUnitOverageRateDescriptor = new _ShapeDescriptor4("CustomPricingUnitOverageRate", [
|
|
1288
|
+
{ type: "id", transform: _required4() },
|
|
1289
|
+
{ type: "metadata", transform: _required4(_translateMap4(_identity4, _identity4)) },
|
|
1290
|
+
{
|
|
1291
|
+
type: "rateCard",
|
|
1292
|
+
transform: _required4(_translateShape4(() => RateCardDescriptor))
|
|
1293
|
+
},
|
|
1294
|
+
{ type: "customPricingUnit", transform: _required4() },
|
|
1295
|
+
{ type: "unitAmount", transform: _required4(_translateDecimal4) }
|
|
1296
|
+
]);
|
|
1297
|
+
const RateCardDescriptor = new _ShapeDescriptor4("RateCard", [
|
|
1298
|
+
{ type: "id", transform: _required4() },
|
|
1299
|
+
{ type: "currency", transform: _required4(_translateEnum4(currencyEnumValues)) }
|
|
1300
|
+
]);
|
|
1301
|
+
const RateCardRateDescriptor = new _ShapeDescriptor4(
|
|
1302
|
+
"RateCardRate",
|
|
1303
|
+
[
|
|
1304
|
+
{ type: "id", transform: _required4() },
|
|
1305
|
+
{ type: "metadata", transform: _required4(_translateMap4(_identity4, _identity4)) },
|
|
1306
|
+
{
|
|
1307
|
+
type: "rateCard",
|
|
1308
|
+
transform: _required4(_translateShape4(() => RateCardDescriptor))
|
|
1309
|
+
},
|
|
1310
|
+
{ type: "tieringMode", transform: _translateEnum4(pricingTierModeEnumValues) },
|
|
1311
|
+
{
|
|
1312
|
+
type: "tiers",
|
|
1313
|
+
transform: _required4(
|
|
1314
|
+
_translateArray4(_translateShape4(() => RateCardRateTierDescriptor))
|
|
1315
|
+
)
|
|
1316
|
+
},
|
|
1317
|
+
{ type: "unitAmount", transform: _translateDecimal4 }
|
|
1318
|
+
]
|
|
1319
|
+
);
|
|
1320
|
+
const RateCardRateTierDescriptor = new _ShapeDescriptor4(
|
|
1321
|
+
"RateCardRateTier",
|
|
1322
|
+
[
|
|
1323
|
+
{ type: "flatAmount", transform: _translateDecimal4 },
|
|
1324
|
+
{ type: "unitAmount", transform: _translateDecimal4 },
|
|
1325
|
+
{ type: "upTo", transform: _translateDecimal4 }
|
|
1326
|
+
]
|
|
1327
|
+
);
|
|
1328
|
+
const LicenseFeeDescriptor = new _ShapeDescriptor4(
|
|
1329
|
+
"LicenseFee",
|
|
1330
|
+
[
|
|
1331
|
+
{ type: "id", transform: _required4() },
|
|
1332
|
+
{ type: "lookupKey", transform: _identity4 },
|
|
1333
|
+
{ type: "metadata", transform: _required4(_translateMap4(_identity4, _identity4)) },
|
|
1334
|
+
{
|
|
1335
|
+
type: "serviceInterval",
|
|
1336
|
+
transform: _required4(_translateEnum4(recurringPriceIntervalEnumValues))
|
|
1337
|
+
},
|
|
1338
|
+
{ type: "serviceIntervalCount", transform: _required4() },
|
|
1339
|
+
{ type: "tieringMode", transform: _translateEnum4(pricingTierModeEnumValues) },
|
|
1340
|
+
{
|
|
1341
|
+
type: "tiers",
|
|
1342
|
+
transform: _required4(
|
|
1343
|
+
_translateArray4(_translateShape4(() => LicenseFeeTierDescriptor))
|
|
1344
|
+
)
|
|
1345
|
+
},
|
|
1346
|
+
{ type: "currency", transform: _required4(_translateEnum4(currencyEnumValues)) },
|
|
1347
|
+
{ type: "unitAmount", transform: _translateDecimal4 }
|
|
1348
|
+
]
|
|
1349
|
+
);
|
|
1350
|
+
const LicenseFeeTierDescriptor = new _ShapeDescriptor4(
|
|
1351
|
+
"LicenseFeeTier",
|
|
1352
|
+
[
|
|
1353
|
+
{ type: "flatAmount", transform: _translateDecimal4 },
|
|
1354
|
+
{ type: "unitAmount", transform: _translateDecimal4 },
|
|
1355
|
+
{ type: "upTo", transform: _translateDecimal4 }
|
|
1356
|
+
]
|
|
1357
|
+
);
|
|
1358
|
+
const PriceDescriptor = new _ShapeDescriptor4("Price", [
|
|
1359
|
+
{ type: "id", transform: _required4() },
|
|
1360
|
+
{ type: "product", transform: _required4(_translateShape4(() => ProductDescriptor)) },
|
|
1361
|
+
{ type: "recurring", transform: _translateShape4(() => RecurringPriceDescriptor) },
|
|
1362
|
+
{
|
|
1363
|
+
type: "billingScheme",
|
|
1364
|
+
transform: _required4(_translateEnum4(pricingSchemeEnumValues))
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
type: "tiers",
|
|
1368
|
+
transform: _required4(_translateArray4(_translateShape4(() => PriceTierDescriptor)))
|
|
1369
|
+
},
|
|
1370
|
+
{ type: "type", transform: _required4(_translateEnum4(priceTypeEnumValues)) },
|
|
1371
|
+
{ type: "tiersMode", transform: _translateEnum4(pricingTierModeEnumValues) },
|
|
1372
|
+
{ type: "metadata", transform: _required4(_translateMap4(_identity4, _identity4)) },
|
|
1373
|
+
{ type: "currency", transform: _required4(_translateEnum4(currencyEnumValues)) },
|
|
1374
|
+
{ type: "unitAmount", transform: _translateDecimal4 }
|
|
1375
|
+
]);
|
|
1376
|
+
const PriceTierDescriptor = new _ShapeDescriptor4(
|
|
1377
|
+
"PriceTier",
|
|
1378
|
+
[
|
|
1379
|
+
{ type: "flatAmount", transform: _translateDecimal4 },
|
|
1380
|
+
{ type: "unitAmount", transform: _translateDecimal4 },
|
|
1381
|
+
{ type: "upTo", transform: _identity4 }
|
|
1382
|
+
]
|
|
1383
|
+
);
|
|
1384
|
+
const RecurringPriceDescriptor = new _ShapeDescriptor4(
|
|
1385
|
+
"RecurringPrice",
|
|
1386
|
+
[
|
|
1387
|
+
{
|
|
1388
|
+
type: "interval",
|
|
1389
|
+
transform: _required4(_translateEnum4(recurringPriceIntervalEnumValues))
|
|
1390
|
+
},
|
|
1391
|
+
{ type: "intervalCount", transform: _required4() },
|
|
1392
|
+
{ type: "usageType", transform: _translateEnum4(usageTypeEnumValues) },
|
|
1393
|
+
{ type: "meter", transform: _identity4 }
|
|
1394
|
+
]
|
|
1395
|
+
);
|
|
1396
|
+
const ProductDescriptor = new _ShapeDescriptor4("Product", [
|
|
1397
|
+
{ type: "id", transform: _required4() },
|
|
1398
|
+
{ type: "name", transform: _required4() },
|
|
1399
|
+
{ type: "metadata", transform: _required4(_translateMap4(_identity4, _identity4)) }
|
|
1400
|
+
]);
|
|
1401
|
+
const TimeRangeDescriptor = new _ShapeDescriptor4("TimeRange", [
|
|
1402
|
+
{ type: "startDate", transform: _required4(_translateDateTime4) },
|
|
1403
|
+
{ type: "endDate", transform: _required4(_translateDateTime4) }
|
|
1404
|
+
]);
|
|
1405
|
+
let __stripe_shim_active__ = false;
|
|
1406
|
+
function prepareArgsProrateItems(proto) {
|
|
1407
|
+
if (__stripe_shim_active__) {
|
|
1408
|
+
return proto;
|
|
1409
|
+
}
|
|
1410
|
+
return _apply4(
|
|
1411
|
+
ProrateItemsInputDescriptor,
|
|
1412
|
+
_ProtoWireToType4,
|
|
1413
|
+
proto
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
Prorations2.prepareArgsProrateItems = prepareArgsProrateItems;
|
|
1417
|
+
function prepareResultProrateItems(result) {
|
|
1418
|
+
if (__stripe_shim_active__) return result;
|
|
1419
|
+
return _apply4(
|
|
1420
|
+
ProrateItemsResultDescriptor,
|
|
1421
|
+
_TypeToProtoWire4,
|
|
1422
|
+
result
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
Prorations2.prepareResultProrateItems = prepareResultProrateItems;
|
|
1426
|
+
function $platformWrapProrateItems(configTransformer) {
|
|
1427
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
1428
|
+
__stripe_shim_active__ = true;
|
|
1429
|
+
const instance = new cls();
|
|
1430
|
+
const request = _apply4(
|
|
1431
|
+
ProrateItemsInputDescriptor,
|
|
1432
|
+
_ProtoWireToType4,
|
|
1433
|
+
wireArgs
|
|
1434
|
+
);
|
|
1435
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext4(ctx)) : wireConfig;
|
|
1436
|
+
const result = instance.prorateItems(request, config, ctx);
|
|
1437
|
+
if (_isPromiseLike4(result)) {
|
|
1438
|
+
return Promise.resolve(result).then((r) => {
|
|
1439
|
+
const typedR = r;
|
|
1440
|
+
return _apply4(ProrateItemsResultDescriptor, _TypeToProtoWire4, typedR);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
const typedResult = result;
|
|
1444
|
+
return _apply4(ProrateItemsResultDescriptor, _TypeToProtoWire4, typedResult);
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
Prorations2.$platformWrapProrateItems = $platformWrapProrateItems;
|
|
1448
|
+
const _prepareArgsAlias = prepareArgsProrateItems;
|
|
1449
|
+
Prorations2.prepareArgs = _prepareArgsAlias;
|
|
1450
|
+
const _prepareResultAlias = prepareResultProrateItems;
|
|
1451
|
+
Prorations2.prepareResult = _prepareResultAlias;
|
|
1452
|
+
})(Prorations || (Prorations = {}));
|
|
1453
|
+
|
|
1454
|
+
// src/extensions/billing/recurring_billing_item_handling.ts
|
|
1455
|
+
import {
|
|
1456
|
+
_ProtoEnum as _ProtoEnum5,
|
|
1457
|
+
_ProtoWireToType as _ProtoWireToType5,
|
|
1458
|
+
_ShapeDescriptor as _ShapeDescriptor5,
|
|
1459
|
+
_TypeToProtoWire as _TypeToProtoWire5,
|
|
1460
|
+
_UnionDescriptor as _UnionDescriptor5,
|
|
1461
|
+
_apply as _apply5,
|
|
1462
|
+
_configAppContextFromContext as _configAppContextFromContext5,
|
|
1463
|
+
_identity as _identity5,
|
|
1464
|
+
_isPromiseLike as _isPromiseLike5,
|
|
1465
|
+
_required as _required5,
|
|
1466
|
+
_translateArray as _translateArray5,
|
|
1467
|
+
_translateDateTime as _translateDateTime5,
|
|
1468
|
+
_translateDecimal as _translateDecimal5,
|
|
1469
|
+
_translateEnum as _translateEnum5,
|
|
1470
|
+
_translateMap as _translateMap5,
|
|
1471
|
+
_translateShape as _translateShape5,
|
|
1472
|
+
_translateUnion as _translateUnion5
|
|
1473
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
1474
|
+
var RecurringBillingItemHandling;
|
|
1475
|
+
((RecurringBillingItemHandling2) => {
|
|
1476
|
+
const pricingTierModeEnumValues = new _ProtoEnum5({
|
|
1477
|
+
PRICING_TIER_MODE_GRADUATED: "graduated",
|
|
1478
|
+
PRICING_TIER_MODE_VOLUME: "volume"
|
|
1479
|
+
});
|
|
1480
|
+
const recurringPriceIntervalEnumValues = new _ProtoEnum5({
|
|
1481
|
+
RECURRING_PRICE_INTERVAL_DAY: "day",
|
|
1482
|
+
RECURRING_PRICE_INTERVAL_WEEK: "week",
|
|
1483
|
+
RECURRING_PRICE_INTERVAL_MONTH: "month",
|
|
1484
|
+
RECURRING_PRICE_INTERVAL_YEAR: "year"
|
|
1485
|
+
});
|
|
1486
|
+
const priceTypeEnumValues = new _ProtoEnum5({
|
|
1487
|
+
PRICE_TYPE_ONE_TIME: "one_time",
|
|
1488
|
+
PRICE_TYPE_RECURRING: "recurring"
|
|
1489
|
+
});
|
|
1490
|
+
const pricingSchemeEnumValues = new _ProtoEnum5({
|
|
1491
|
+
PRICING_SCHEME_PER_UNIT: "per_unit",
|
|
1492
|
+
PRICING_SCHEME_TIERED: "tiered"
|
|
1493
|
+
});
|
|
1494
|
+
const usageTypeEnumValues = new _ProtoEnum5({
|
|
1495
|
+
USAGE_TYPE_LICENSED: "licensed",
|
|
1496
|
+
USAGE_TYPE_METERED: "metered"
|
|
1497
|
+
});
|
|
1498
|
+
const itemTypeEnumValues = new _ProtoEnum5({
|
|
1499
|
+
ITEM_TYPE_CREDIT: "credit",
|
|
1500
|
+
ITEM_TYPE_DEBIT: "debit"
|
|
1501
|
+
});
|
|
1502
|
+
const currencyEnumValues = new _ProtoEnum5({
|
|
1503
|
+
CURRENCY_AED: "aed",
|
|
1504
|
+
CURRENCY_AFN: "afn",
|
|
1505
|
+
CURRENCY_ALL: "all",
|
|
1506
|
+
CURRENCY_AMD: "amd",
|
|
1507
|
+
CURRENCY_ANG: "ang",
|
|
1508
|
+
CURRENCY_AOA: "aoa",
|
|
1509
|
+
CURRENCY_APT: "apt",
|
|
1510
|
+
CURRENCY_ARB: "arb",
|
|
1511
|
+
CURRENCY_ARS: "ars",
|
|
1512
|
+
CURRENCY_AUD: "aud",
|
|
1513
|
+
CURRENCY_AVAX: "avax",
|
|
1514
|
+
CURRENCY_AWG: "awg",
|
|
1515
|
+
CURRENCY_AZN: "azn",
|
|
1516
|
+
CURRENCY_BAM: "bam",
|
|
1517
|
+
CURRENCY_BBD: "bbd",
|
|
1518
|
+
CURRENCY_BDT: "bdt",
|
|
1519
|
+
CURRENCY_BGN: "bgn",
|
|
1520
|
+
CURRENCY_BHD: "bhd",
|
|
1521
|
+
CURRENCY_BIF: "bif",
|
|
1522
|
+
CURRENCY_BMD: "bmd",
|
|
1523
|
+
CURRENCY_BNB: "bnb",
|
|
1524
|
+
CURRENCY_BND: "bnd",
|
|
1525
|
+
CURRENCY_BOB: "bob",
|
|
1526
|
+
CURRENCY_BOV: "bov",
|
|
1527
|
+
CURRENCY_BRL: "brl",
|
|
1528
|
+
CURRENCY_BSD: "bsd",
|
|
1529
|
+
CURRENCY_BTC: "btc",
|
|
1530
|
+
CURRENCY_BTN: "btn",
|
|
1531
|
+
CURRENCY_BUIDL: "buidl",
|
|
1532
|
+
CURRENCY_BWP: "bwp",
|
|
1533
|
+
CURRENCY_BYN: "byn",
|
|
1534
|
+
CURRENCY_BYR: "byr",
|
|
1535
|
+
CURRENCY_BZD: "bzd",
|
|
1536
|
+
CURRENCY_CAD: "cad",
|
|
1537
|
+
CURRENCY_CDF: "cdf",
|
|
1538
|
+
CURRENCY_CELO: "celo",
|
|
1539
|
+
CURRENCY_CHE: "che",
|
|
1540
|
+
CURRENCY_CHF: "chf",
|
|
1541
|
+
CURRENCY_CHW: "chw",
|
|
1542
|
+
CURRENCY_CLF: "clf",
|
|
1543
|
+
CURRENCY_CLP: "clp",
|
|
1544
|
+
CURRENCY_CNY: "cny",
|
|
1545
|
+
CURRENCY_COP: "cop",
|
|
1546
|
+
CURRENCY_COU: "cou",
|
|
1547
|
+
CURRENCY_CRC: "crc",
|
|
1548
|
+
CURRENCY_CUC: "cuc",
|
|
1549
|
+
CURRENCY_CUP: "cup",
|
|
1550
|
+
CURRENCY_CVE: "cve",
|
|
1551
|
+
CURRENCY_CZK: "czk",
|
|
1552
|
+
CURRENCY_DAI: "dai",
|
|
1553
|
+
CURRENCY_DJF: "djf",
|
|
1554
|
+
CURRENCY_DKK: "dkk",
|
|
1555
|
+
CURRENCY_DOP: "dop",
|
|
1556
|
+
CURRENCY_DZD: "dzd",
|
|
1557
|
+
CURRENCY_EEK: "eek",
|
|
1558
|
+
CURRENCY_EGP: "egp",
|
|
1559
|
+
CURRENCY_ERN: "ern",
|
|
1560
|
+
CURRENCY_ETB: "etb",
|
|
1561
|
+
CURRENCY_ETH: "eth",
|
|
1562
|
+
CURRENCY_EUR: "eur",
|
|
1563
|
+
CURRENCY_EURC: "eurc",
|
|
1564
|
+
CURRENCY_FJD: "fjd",
|
|
1565
|
+
CURRENCY_FKP: "fkp",
|
|
1566
|
+
CURRENCY_FRXUSD: "frxusd",
|
|
1567
|
+
CURRENCY_GBP: "gbp",
|
|
1568
|
+
CURRENCY_GEL: "gel",
|
|
1569
|
+
CURRENCY_GHC: "ghc",
|
|
1570
|
+
CURRENCY_GHS: "ghs",
|
|
1571
|
+
CURRENCY_GIP: "gip",
|
|
1572
|
+
CURRENCY_GMD: "gmd",
|
|
1573
|
+
CURRENCY_GNF: "gnf",
|
|
1574
|
+
CURRENCY_GTQ: "gtq",
|
|
1575
|
+
CURRENCY_GYD: "gyd",
|
|
1576
|
+
CURRENCY_HKD: "hkd",
|
|
1577
|
+
CURRENCY_HNL: "hnl",
|
|
1578
|
+
CURRENCY_HRK: "hrk",
|
|
1579
|
+
CURRENCY_HTG: "htg",
|
|
1580
|
+
CURRENCY_HUF: "huf",
|
|
1581
|
+
CURRENCY_HYPE: "hype",
|
|
1582
|
+
CURRENCY_IDR: "idr",
|
|
1583
|
+
CURRENCY_ILS: "ils",
|
|
1584
|
+
CURRENCY_INR: "inr",
|
|
1585
|
+
CURRENCY_IQD: "iqd",
|
|
1586
|
+
CURRENCY_IRR: "irr",
|
|
1587
|
+
CURRENCY_ISK: "isk",
|
|
1588
|
+
CURRENCY_JMD: "jmd",
|
|
1589
|
+
CURRENCY_JOD: "jod",
|
|
1590
|
+
CURRENCY_JPY: "jpy",
|
|
1591
|
+
CURRENCY_KES: "kes",
|
|
1592
|
+
CURRENCY_KGS: "kgs",
|
|
1593
|
+
CURRENCY_KHR: "khr",
|
|
1594
|
+
CURRENCY_KMF: "kmf",
|
|
1595
|
+
CURRENCY_KPW: "kpw",
|
|
1596
|
+
CURRENCY_KRW: "krw",
|
|
1597
|
+
CURRENCY_KWD: "kwd",
|
|
1598
|
+
CURRENCY_KYD: "kyd",
|
|
1599
|
+
CURRENCY_KZT: "kzt",
|
|
1600
|
+
CURRENCY_LAK: "lak",
|
|
1601
|
+
CURRENCY_LBP: "lbp",
|
|
1602
|
+
CURRENCY_LKR: "lkr",
|
|
1603
|
+
CURRENCY_LRD: "lrd",
|
|
1604
|
+
CURRENCY_LSL: "lsl",
|
|
1605
|
+
CURRENCY_LTL: "ltl",
|
|
1606
|
+
CURRENCY_LVL: "lvl",
|
|
1607
|
+
CURRENCY_LYD: "lyd",
|
|
1608
|
+
CURRENCY_LZD: "lzd",
|
|
1609
|
+
CURRENCY_M: "m",
|
|
1610
|
+
CURRENCY_MAD: "mad",
|
|
1611
|
+
CURRENCY_MDL: "mdl",
|
|
1612
|
+
CURRENCY_MGA: "mga",
|
|
1613
|
+
CURRENCY_MKD: "mkd",
|
|
1614
|
+
CURRENCY_MMK: "mmk",
|
|
1615
|
+
CURRENCY_MNT: "mnt",
|
|
1616
|
+
CURRENCY_MOP: "mop",
|
|
1617
|
+
CURRENCY_MRO: "mro",
|
|
1618
|
+
CURRENCY_MRU: "mru",
|
|
1619
|
+
CURRENCY_MUR: "mur",
|
|
1620
|
+
CURRENCY_MVR: "mvr",
|
|
1621
|
+
CURRENCY_MWK: "mwk",
|
|
1622
|
+
CURRENCY_MXN: "mxn",
|
|
1623
|
+
CURRENCY_MXV: "mxv",
|
|
1624
|
+
CURRENCY_MYR: "myr",
|
|
1625
|
+
CURRENCY_MZN: "mzn",
|
|
1626
|
+
CURRENCY_NAD: "nad",
|
|
1627
|
+
CURRENCY_NGN: "ngn",
|
|
1628
|
+
CURRENCY_NIO: "nio",
|
|
1629
|
+
CURRENCY_NOK: "nok",
|
|
1630
|
+
CURRENCY_NPR: "npr",
|
|
1631
|
+
CURRENCY_NZD: "nzd",
|
|
1632
|
+
CURRENCY_OMR: "omr",
|
|
1633
|
+
CURRENCY_PAB: "pab",
|
|
1634
|
+
CURRENCY_PEN: "pen",
|
|
1635
|
+
CURRENCY_PGK: "pgk",
|
|
1636
|
+
CURRENCY_PHP: "php",
|
|
1637
|
+
CURRENCY_PKR: "pkr",
|
|
1638
|
+
CURRENCY_PLN: "pln",
|
|
1639
|
+
CURRENCY_POL: "pol",
|
|
1640
|
+
CURRENCY_PYG: "pyg",
|
|
1641
|
+
CURRENCY_PYUSD: "pyusd",
|
|
1642
|
+
CURRENCY_QAR: "qar",
|
|
1643
|
+
CURRENCY_RD: "rd",
|
|
1644
|
+
CURRENCY_RE: "re",
|
|
1645
|
+
CURRENCY_RON: "ron",
|
|
1646
|
+
CURRENCY_RSD: "rsd",
|
|
1647
|
+
CURRENCY_RUB: "rub",
|
|
1648
|
+
CURRENCY_RWF: "rwf",
|
|
1649
|
+
CURRENCY_SAR: "sar",
|
|
1650
|
+
CURRENCY_SBD: "sbd",
|
|
1651
|
+
CURRENCY_SCR: "scr",
|
|
1652
|
+
CURRENCY_SDG: "sdg",
|
|
1653
|
+
CURRENCY_SEK: "sek",
|
|
1654
|
+
CURRENCY_SGD: "sgd",
|
|
1655
|
+
CURRENCY_SHP: "shp",
|
|
1656
|
+
CURRENCY_SLE: "sle",
|
|
1657
|
+
CURRENCY_SLL: "sll",
|
|
1658
|
+
CURRENCY_SOL: "sol",
|
|
1659
|
+
CURRENCY_SOS: "sos",
|
|
1660
|
+
CURRENCY_SRD: "srd",
|
|
1661
|
+
CURRENCY_SSP: "ssp",
|
|
1662
|
+
CURRENCY_STD: "std",
|
|
1663
|
+
CURRENCY_STN: "stn",
|
|
1664
|
+
CURRENCY_SUI: "sui",
|
|
1665
|
+
CURRENCY_SVC: "svc",
|
|
1666
|
+
CURRENCY_SYP: "syp",
|
|
1667
|
+
CURRENCY_SZL: "szl",
|
|
1668
|
+
CURRENCY_THB: "thb",
|
|
1669
|
+
CURRENCY_TJS: "tjs",
|
|
1670
|
+
CURRENCY_TMT: "tmt",
|
|
1671
|
+
CURRENCY_TND: "tnd",
|
|
1672
|
+
CURRENCY_TOP: "top",
|
|
1673
|
+
CURRENCY_TRX: "trx",
|
|
1674
|
+
CURRENCY_TRY: "try",
|
|
1675
|
+
CURRENCY_TTD: "ttd",
|
|
1676
|
+
CURRENCY_TWD: "twd",
|
|
1677
|
+
CURRENCY_TZS: "tzs",
|
|
1678
|
+
CURRENCY_UAH: "uah",
|
|
1679
|
+
CURRENCY_UGX: "ugx",
|
|
1680
|
+
CURRENCY_USD: "usd",
|
|
1681
|
+
CURRENCY_USDB: "usdb",
|
|
1682
|
+
CURRENCY_USDC: "usdc",
|
|
1683
|
+
CURRENCY_USDG: "usdg",
|
|
1684
|
+
CURRENCY_USDP: "usdp",
|
|
1685
|
+
CURRENCY_USDT: "usdt",
|
|
1686
|
+
CURRENCY_USN: "usn",
|
|
1687
|
+
CURRENCY_USTB: "ustb",
|
|
1688
|
+
CURRENCY_UYI: "uyi",
|
|
1689
|
+
CURRENCY_UYU: "uyu",
|
|
1690
|
+
CURRENCY_UZS: "uzs",
|
|
1691
|
+
CURRENCY_VEF: "vef",
|
|
1692
|
+
CURRENCY_VES: "ves",
|
|
1693
|
+
CURRENCY_VND: "vnd",
|
|
1694
|
+
CURRENCY_VUV: "vuv",
|
|
1695
|
+
CURRENCY_WST: "wst",
|
|
1696
|
+
CURRENCY_XAF: "xaf",
|
|
1697
|
+
CURRENCY_XCD: "xcd",
|
|
1698
|
+
CURRENCY_XCG: "xcg",
|
|
1699
|
+
CURRENCY_XEUR: "xeur",
|
|
1700
|
+
CURRENCY_XLM: "xlm",
|
|
1701
|
+
CURRENCY_XOF: "xof",
|
|
1702
|
+
CURRENCY_XPF: "xpf",
|
|
1703
|
+
CURRENCY_XPL: "xpl",
|
|
1704
|
+
CURRENCY_XUSD: "xusd",
|
|
1705
|
+
CURRENCY_YER: "yer",
|
|
1706
|
+
CURRENCY_ZAR: "zar",
|
|
1707
|
+
CURRENCY_ZMK: "zmk",
|
|
1708
|
+
CURRENCY_ZMW: "zmw",
|
|
1709
|
+
CURRENCY_ZWD: "zwd",
|
|
1710
|
+
CURRENCY_ZWG: "zwg",
|
|
1711
|
+
CURRENCY_ZWL: "zwl"
|
|
1712
|
+
});
|
|
1713
|
+
const GroupItemsResultDescriptor = new _ShapeDescriptor5(
|
|
1714
|
+
"GroupItemsResult",
|
|
1715
|
+
[
|
|
1716
|
+
{
|
|
1717
|
+
type: "groups",
|
|
1718
|
+
transform: _required5(_translateArray5(_translateShape5(() => ItemGroupDescriptor)))
|
|
1719
|
+
}
|
|
1720
|
+
]
|
|
1721
|
+
);
|
|
1722
|
+
const ItemGroupDescriptor = new _ShapeDescriptor5(
|
|
1723
|
+
"ItemGroup",
|
|
1724
|
+
[
|
|
1725
|
+
{
|
|
1726
|
+
type: "items",
|
|
1727
|
+
transform: _required5(
|
|
1728
|
+
_translateArray5(_translateShape5(() => GroupedItemDescriptor))
|
|
1729
|
+
)
|
|
1730
|
+
},
|
|
1731
|
+
{ type: "setsLatestInvoice", transform: _required5() }
|
|
1732
|
+
]
|
|
1733
|
+
);
|
|
1734
|
+
const GroupedItemDescriptor = new _ShapeDescriptor5(
|
|
1735
|
+
"GroupedItem",
|
|
1736
|
+
[{ type: "key", transform: _required5() }]
|
|
1737
|
+
);
|
|
1738
|
+
const GroupItemsInputDescriptor = new _ShapeDescriptor5(
|
|
1739
|
+
"GroupItemsInput",
|
|
1740
|
+
[
|
|
1741
|
+
{
|
|
1742
|
+
type: "items",
|
|
1743
|
+
transform: _required5(_translateArray5(_translateShape5(() => ItemDescriptor)))
|
|
1744
|
+
}
|
|
1745
|
+
]
|
|
1746
|
+
);
|
|
1747
|
+
const ItemDescriptor = new _ShapeDescriptor5(
|
|
1748
|
+
"Item",
|
|
1749
|
+
[
|
|
1750
|
+
{ type: "key", transform: _required5() },
|
|
1751
|
+
{ type: "type", transform: _required5(_translateEnum5(itemTypeEnumValues)) },
|
|
1752
|
+
{ type: "isProration", transform: _required5() },
|
|
1753
|
+
{
|
|
1754
|
+
type: "servicePeriod",
|
|
1755
|
+
transform: _required5(_translateUnion5(() => AnyTimeRangeDescriptor))
|
|
1756
|
+
},
|
|
1757
|
+
{ type: "prorationFactor", transform: _required5(_translateDecimal5) }
|
|
1758
|
+
],
|
|
1759
|
+
[
|
|
1760
|
+
{
|
|
1761
|
+
discriminant: "priceKind",
|
|
1762
|
+
optional: false,
|
|
1763
|
+
branches: [
|
|
1764
|
+
{
|
|
1765
|
+
wireKey: "price",
|
|
1766
|
+
typeKey: "price",
|
|
1767
|
+
transform: _translateShape5(() => PriceDescriptor)
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
wireKey: "licenseFee",
|
|
1771
|
+
typeKey: "licenseFee",
|
|
1772
|
+
transform: _translateShape5(() => LicenseFeeDescriptor)
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
wireKey: "rateCardRate",
|
|
1776
|
+
typeKey: "rateCardRate",
|
|
1777
|
+
transform: _translateShape5(() => RateCardRateDescriptor)
|
|
1778
|
+
},
|
|
1779
|
+
{
|
|
1780
|
+
wireKey: "customPricingUnitOverageRate",
|
|
1781
|
+
typeKey: "customPricingUnitOverageRate",
|
|
1782
|
+
transform: _translateShape5(() => CustomPricingUnitOverageRateDescriptor)
|
|
1783
|
+
}
|
|
1784
|
+
]
|
|
1785
|
+
}
|
|
1786
|
+
]
|
|
1787
|
+
);
|
|
1788
|
+
const CustomPricingUnitOverageRateDescriptor = new _ShapeDescriptor5("CustomPricingUnitOverageRate", [
|
|
1789
|
+
{ type: "id", transform: _required5() },
|
|
1790
|
+
{ type: "metadata", transform: _required5(_translateMap5(_identity5, _identity5)) },
|
|
1791
|
+
{
|
|
1792
|
+
type: "rateCard",
|
|
1793
|
+
transform: _required5(_translateShape5(() => RateCardDescriptor))
|
|
1794
|
+
},
|
|
1795
|
+
{ type: "customPricingUnit", transform: _required5() },
|
|
1796
|
+
{ type: "unitAmount", transform: _required5(_translateDecimal5) }
|
|
1797
|
+
]);
|
|
1798
|
+
const RateCardDescriptor = new _ShapeDescriptor5("RateCard", [
|
|
1799
|
+
{ type: "id", transform: _required5() },
|
|
1800
|
+
{ type: "currency", transform: _required5(_translateEnum5(currencyEnumValues)) }
|
|
1801
|
+
]);
|
|
1802
|
+
const RateCardRateDescriptor = new _ShapeDescriptor5(
|
|
1803
|
+
"RateCardRate",
|
|
1804
|
+
[
|
|
1805
|
+
{ type: "id", transform: _required5() },
|
|
1806
|
+
{ type: "metadata", transform: _required5(_translateMap5(_identity5, _identity5)) },
|
|
1807
|
+
{
|
|
1808
|
+
type: "rateCard",
|
|
1809
|
+
transform: _required5(_translateShape5(() => RateCardDescriptor))
|
|
1810
|
+
},
|
|
1811
|
+
{ type: "tieringMode", transform: _translateEnum5(pricingTierModeEnumValues) },
|
|
1812
|
+
{
|
|
1813
|
+
type: "tiers",
|
|
1814
|
+
transform: _required5(
|
|
1815
|
+
_translateArray5(_translateShape5(() => RateCardRateTierDescriptor))
|
|
1816
|
+
)
|
|
1817
|
+
},
|
|
1818
|
+
{ type: "unitAmount", transform: _translateDecimal5 }
|
|
1819
|
+
]
|
|
1820
|
+
);
|
|
1821
|
+
const RateCardRateTierDescriptor = new _ShapeDescriptor5(
|
|
1822
|
+
"RateCardRateTier",
|
|
1823
|
+
[
|
|
1824
|
+
{ type: "flatAmount", transform: _translateDecimal5 },
|
|
1825
|
+
{ type: "unitAmount", transform: _translateDecimal5 },
|
|
1826
|
+
{ type: "upTo", transform: _translateDecimal5 }
|
|
1827
|
+
]
|
|
1828
|
+
);
|
|
1829
|
+
const LicenseFeeDescriptor = new _ShapeDescriptor5(
|
|
1830
|
+
"LicenseFee",
|
|
1831
|
+
[
|
|
1832
|
+
{ type: "id", transform: _required5() },
|
|
1833
|
+
{ type: "lookupKey", transform: _identity5 },
|
|
1834
|
+
{ type: "metadata", transform: _required5(_translateMap5(_identity5, _identity5)) },
|
|
1835
|
+
{
|
|
1836
|
+
type: "serviceInterval",
|
|
1837
|
+
transform: _required5(_translateEnum5(recurringPriceIntervalEnumValues))
|
|
1838
|
+
},
|
|
1839
|
+
{ type: "serviceIntervalCount", transform: _required5() },
|
|
1840
|
+
{ type: "tieringMode", transform: _translateEnum5(pricingTierModeEnumValues) },
|
|
1841
|
+
{
|
|
1842
|
+
type: "tiers",
|
|
1843
|
+
transform: _required5(
|
|
1844
|
+
_translateArray5(_translateShape5(() => LicenseFeeTierDescriptor))
|
|
1845
|
+
)
|
|
1846
|
+
},
|
|
1847
|
+
{ type: "currency", transform: _required5(_translateEnum5(currencyEnumValues)) },
|
|
1848
|
+
{ type: "unitAmount", transform: _translateDecimal5 }
|
|
1849
|
+
]
|
|
1850
|
+
);
|
|
1851
|
+
const LicenseFeeTierDescriptor = new _ShapeDescriptor5(
|
|
1852
|
+
"LicenseFeeTier",
|
|
1853
|
+
[
|
|
1854
|
+
{ type: "flatAmount", transform: _translateDecimal5 },
|
|
1855
|
+
{ type: "unitAmount", transform: _translateDecimal5 },
|
|
1856
|
+
{ type: "upTo", transform: _translateDecimal5 }
|
|
1857
|
+
]
|
|
1858
|
+
);
|
|
1859
|
+
const PriceDescriptor = new _ShapeDescriptor5("Price", [
|
|
1860
|
+
{ type: "id", transform: _required5() },
|
|
1861
|
+
{ type: "product", transform: _required5(_translateShape5(() => ProductDescriptor)) },
|
|
1862
|
+
{ type: "recurring", transform: _translateShape5(() => RecurringPriceDescriptor) },
|
|
1863
|
+
{
|
|
1864
|
+
type: "billingScheme",
|
|
1865
|
+
transform: _required5(_translateEnum5(pricingSchemeEnumValues))
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
type: "tiers",
|
|
1869
|
+
transform: _required5(_translateArray5(_translateShape5(() => PriceTierDescriptor)))
|
|
1870
|
+
},
|
|
1871
|
+
{ type: "type", transform: _required5(_translateEnum5(priceTypeEnumValues)) },
|
|
1872
|
+
{ type: "tiersMode", transform: _translateEnum5(pricingTierModeEnumValues) },
|
|
1873
|
+
{ type: "metadata", transform: _required5(_translateMap5(_identity5, _identity5)) },
|
|
1874
|
+
{ type: "currency", transform: _required5(_translateEnum5(currencyEnumValues)) },
|
|
1875
|
+
{ type: "unitAmount", transform: _translateDecimal5 }
|
|
1876
|
+
]);
|
|
1877
|
+
const PriceTierDescriptor = new _ShapeDescriptor5(
|
|
1878
|
+
"PriceTier",
|
|
1879
|
+
[
|
|
1880
|
+
{ type: "flatAmount", transform: _translateDecimal5 },
|
|
1881
|
+
{ type: "unitAmount", transform: _translateDecimal5 },
|
|
1882
|
+
{ type: "upTo", transform: _identity5 }
|
|
1883
|
+
]
|
|
1884
|
+
);
|
|
1885
|
+
const RecurringPriceDescriptor = new _ShapeDescriptor5(
|
|
1886
|
+
"RecurringPrice",
|
|
1887
|
+
[
|
|
1888
|
+
{
|
|
1889
|
+
type: "interval",
|
|
1890
|
+
transform: _required5(_translateEnum5(recurringPriceIntervalEnumValues))
|
|
1891
|
+
},
|
|
1892
|
+
{ type: "intervalCount", transform: _required5() },
|
|
1893
|
+
{ type: "usageType", transform: _translateEnum5(usageTypeEnumValues) },
|
|
1894
|
+
{ type: "meter", transform: _identity5 }
|
|
1895
|
+
]
|
|
1896
|
+
);
|
|
1897
|
+
const ProductDescriptor = new _ShapeDescriptor5("Product", [
|
|
1898
|
+
{ type: "id", transform: _required5() },
|
|
1899
|
+
{ type: "name", transform: _required5() },
|
|
1900
|
+
{ type: "metadata", transform: _required5(_translateMap5(_identity5, _identity5)) }
|
|
1901
|
+
]);
|
|
1902
|
+
const FilterItemsResultDescriptor = new _ShapeDescriptor5(
|
|
1903
|
+
"FilterItemsResult",
|
|
1904
|
+
[
|
|
1905
|
+
{
|
|
1906
|
+
type: "items",
|
|
1907
|
+
transform: _required5(
|
|
1908
|
+
_translateArray5(_translateShape5(() => ItemToInvoiceDescriptor))
|
|
1909
|
+
)
|
|
1910
|
+
}
|
|
1911
|
+
]
|
|
1912
|
+
);
|
|
1913
|
+
const ItemToInvoiceDescriptor = new _ShapeDescriptor5(
|
|
1914
|
+
"ItemToInvoice",
|
|
1915
|
+
[{ type: "key", transform: _required5() }]
|
|
1916
|
+
);
|
|
1917
|
+
const FilterItemsInputDescriptor = new _ShapeDescriptor5(
|
|
1918
|
+
"FilterItemsInput",
|
|
1919
|
+
[
|
|
1920
|
+
{
|
|
1921
|
+
type: "items",
|
|
1922
|
+
transform: _required5(_translateArray5(_translateShape5(() => ItemDescriptor)))
|
|
1923
|
+
}
|
|
1924
|
+
]
|
|
1925
|
+
);
|
|
1926
|
+
const BeforeItemCreationResultDescriptor = new _ShapeDescriptor5("BeforeItemCreationResult", [
|
|
1927
|
+
{
|
|
1928
|
+
type: "items",
|
|
1929
|
+
transform: _required5(
|
|
1930
|
+
_translateArray5(_translateShape5(() => ItemWithCreationStrategyDescriptor))
|
|
1931
|
+
)
|
|
1932
|
+
}
|
|
1933
|
+
]);
|
|
1934
|
+
const ItemWithCreationStrategyDescriptor = new _ShapeDescriptor5(
|
|
1935
|
+
"ItemWithCreationStrategy",
|
|
1936
|
+
[{ type: "key", transform: _required5() }],
|
|
1937
|
+
[
|
|
1938
|
+
{
|
|
1939
|
+
discriminant: "creationStrategy",
|
|
1940
|
+
optional: false,
|
|
1941
|
+
branches: [
|
|
1942
|
+
{ wireKey: "doNotCreate", typeKey: "doNotCreate" },
|
|
1943
|
+
{ wireKey: "invoice", typeKey: "invoice" }
|
|
1944
|
+
]
|
|
1945
|
+
}
|
|
1946
|
+
]
|
|
1947
|
+
);
|
|
1948
|
+
const BeforeItemCreationInputDescriptor = new _ShapeDescriptor5("BeforeItemCreationInput", [
|
|
1949
|
+
{
|
|
1950
|
+
type: "items",
|
|
1951
|
+
transform: _required5(_translateArray5(_translateShape5(() => ItemDescriptor)))
|
|
1952
|
+
}
|
|
1953
|
+
]);
|
|
1954
|
+
const AnyTimeRangeDescriptor = new _UnionDescriptor5(
|
|
1955
|
+
"AnyTimeRange",
|
|
1956
|
+
"value",
|
|
1957
|
+
[
|
|
1958
|
+
{
|
|
1959
|
+
wireKey: "oneTime",
|
|
1960
|
+
typeKey: "oneTime",
|
|
1961
|
+
shape: [{ type: "at", transform: _required5(_translateDateTime5) }]
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
wireKey: "timeRange",
|
|
1965
|
+
typeKey: "timeRange",
|
|
1966
|
+
shape: [
|
|
1967
|
+
{ type: "startDate", transform: _required5(_translateDateTime5) },
|
|
1968
|
+
{ type: "endDate", transform: _required5(_translateDateTime5) }
|
|
1969
|
+
]
|
|
1970
|
+
}
|
|
1971
|
+
]
|
|
1972
|
+
);
|
|
1973
|
+
let __stripe_shim_active__ = false;
|
|
1974
|
+
function prepareArgsBeforeItemCreation(proto) {
|
|
1975
|
+
if (__stripe_shim_active__) {
|
|
1976
|
+
return proto;
|
|
1977
|
+
}
|
|
1978
|
+
return _apply5(
|
|
1979
|
+
BeforeItemCreationInputDescriptor,
|
|
1980
|
+
_ProtoWireToType5,
|
|
1981
|
+
proto
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1984
|
+
RecurringBillingItemHandling2.prepareArgsBeforeItemCreation = prepareArgsBeforeItemCreation;
|
|
1985
|
+
function prepareResultBeforeItemCreation(result) {
|
|
1986
|
+
if (__stripe_shim_active__) return result;
|
|
1987
|
+
return _apply5(
|
|
1988
|
+
BeforeItemCreationResultDescriptor,
|
|
1989
|
+
_TypeToProtoWire5,
|
|
1990
|
+
result
|
|
1991
|
+
);
|
|
1992
|
+
}
|
|
1993
|
+
RecurringBillingItemHandling2.prepareResultBeforeItemCreation = prepareResultBeforeItemCreation;
|
|
1994
|
+
function $platformWrapBeforeItemCreation(configTransformer) {
|
|
1995
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
1996
|
+
__stripe_shim_active__ = true;
|
|
1997
|
+
const instance = new cls();
|
|
1998
|
+
const request = _apply5(
|
|
1999
|
+
BeforeItemCreationInputDescriptor,
|
|
2000
|
+
_ProtoWireToType5,
|
|
2001
|
+
wireArgs
|
|
2002
|
+
);
|
|
2003
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext5(ctx)) : wireConfig;
|
|
2004
|
+
const result = instance.beforeItemCreation(request, config, ctx);
|
|
2005
|
+
if (_isPromiseLike5(result)) {
|
|
2006
|
+
return Promise.resolve(result).then((r) => {
|
|
2007
|
+
const typedR = r;
|
|
2008
|
+
return _apply5(BeforeItemCreationResultDescriptor, _TypeToProtoWire5, typedR);
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
const typedResult = result;
|
|
2012
|
+
return _apply5(BeforeItemCreationResultDescriptor, _TypeToProtoWire5, typedResult);
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
RecurringBillingItemHandling2.$platformWrapBeforeItemCreation = $platformWrapBeforeItemCreation;
|
|
2016
|
+
function prepareArgsFilterItems(proto) {
|
|
2017
|
+
if (__stripe_shim_active__) {
|
|
2018
|
+
return proto;
|
|
2019
|
+
}
|
|
2020
|
+
return _apply5(
|
|
2021
|
+
FilterItemsInputDescriptor,
|
|
2022
|
+
_ProtoWireToType5,
|
|
2023
|
+
proto
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
RecurringBillingItemHandling2.prepareArgsFilterItems = prepareArgsFilterItems;
|
|
2027
|
+
function prepareResultFilterItems(result) {
|
|
2028
|
+
if (__stripe_shim_active__) return result;
|
|
2029
|
+
return _apply5(
|
|
2030
|
+
FilterItemsResultDescriptor,
|
|
2031
|
+
_TypeToProtoWire5,
|
|
2032
|
+
result
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
RecurringBillingItemHandling2.prepareResultFilterItems = prepareResultFilterItems;
|
|
2036
|
+
function $platformWrapFilterItems(configTransformer) {
|
|
2037
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2038
|
+
__stripe_shim_active__ = true;
|
|
2039
|
+
const instance = new cls();
|
|
2040
|
+
const request = _apply5(
|
|
2041
|
+
FilterItemsInputDescriptor,
|
|
2042
|
+
_ProtoWireToType5,
|
|
2043
|
+
wireArgs
|
|
2044
|
+
);
|
|
2045
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext5(ctx)) : wireConfig;
|
|
2046
|
+
const result = instance.filterItems(request, config, ctx);
|
|
2047
|
+
if (_isPromiseLike5(result)) {
|
|
2048
|
+
return Promise.resolve(result).then((r) => {
|
|
2049
|
+
const typedR = r;
|
|
2050
|
+
return _apply5(FilterItemsResultDescriptor, _TypeToProtoWire5, typedR);
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
const typedResult = result;
|
|
2054
|
+
return _apply5(FilterItemsResultDescriptor, _TypeToProtoWire5, typedResult);
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
RecurringBillingItemHandling2.$platformWrapFilterItems = $platformWrapFilterItems;
|
|
2058
|
+
function prepareArgsGroupItems(proto) {
|
|
2059
|
+
if (__stripe_shim_active__) {
|
|
2060
|
+
return proto;
|
|
2061
|
+
}
|
|
2062
|
+
return _apply5(
|
|
2063
|
+
GroupItemsInputDescriptor,
|
|
2064
|
+
_ProtoWireToType5,
|
|
2065
|
+
proto
|
|
2066
|
+
);
|
|
2067
|
+
}
|
|
2068
|
+
RecurringBillingItemHandling2.prepareArgsGroupItems = prepareArgsGroupItems;
|
|
2069
|
+
function prepareResultGroupItems(result) {
|
|
2070
|
+
if (__stripe_shim_active__) return result;
|
|
2071
|
+
return _apply5(
|
|
2072
|
+
GroupItemsResultDescriptor,
|
|
2073
|
+
_TypeToProtoWire5,
|
|
2074
|
+
result
|
|
2075
|
+
);
|
|
2076
|
+
}
|
|
2077
|
+
RecurringBillingItemHandling2.prepareResultGroupItems = prepareResultGroupItems;
|
|
2078
|
+
function $platformWrapGroupItems(configTransformer) {
|
|
2079
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2080
|
+
__stripe_shim_active__ = true;
|
|
2081
|
+
const instance = new cls();
|
|
2082
|
+
const request = _apply5(
|
|
2083
|
+
GroupItemsInputDescriptor,
|
|
2084
|
+
_ProtoWireToType5,
|
|
2085
|
+
wireArgs
|
|
2086
|
+
);
|
|
2087
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext5(ctx)) : wireConfig;
|
|
2088
|
+
const result = instance.groupItems(request, config, ctx);
|
|
2089
|
+
if (_isPromiseLike5(result)) {
|
|
2090
|
+
return Promise.resolve(result).then((r) => {
|
|
2091
|
+
const typedR = r;
|
|
2092
|
+
return _apply5(GroupItemsResultDescriptor, _TypeToProtoWire5, typedR);
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
const typedResult = result;
|
|
2096
|
+
return _apply5(GroupItemsResultDescriptor, _TypeToProtoWire5, typedResult);
|
|
2097
|
+
};
|
|
2098
|
+
}
|
|
2099
|
+
RecurringBillingItemHandling2.$platformWrapGroupItems = $platformWrapGroupItems;
|
|
2100
|
+
})(RecurringBillingItemHandling || (RecurringBillingItemHandling = {}));
|
|
2101
|
+
|
|
2102
|
+
// src/extensions/core/index.ts
|
|
2103
|
+
var core_exports = {};
|
|
2104
|
+
__export(core_exports, {
|
|
2105
|
+
Workflows: () => workflows_exports
|
|
2106
|
+
});
|
|
2107
|
+
|
|
2108
|
+
// src/extensions/core/workflows/index.ts
|
|
2109
|
+
var workflows_exports = {};
|
|
2110
|
+
__export(workflows_exports, {
|
|
2111
|
+
CustomAction: () => CustomAction
|
|
2112
|
+
});
|
|
2113
|
+
|
|
2114
|
+
// src/extensions/core/workflows/custom_action.ts
|
|
2115
|
+
import {
|
|
2116
|
+
_ProtoWireToType as _ProtoWireToType6,
|
|
2117
|
+
_ShapeDescriptor as _ShapeDescriptor6,
|
|
2118
|
+
_TypeToProtoWire as _TypeToProtoWire6,
|
|
2119
|
+
_apply as _apply6,
|
|
2120
|
+
_configAppContextFromContext as _configAppContextFromContext6,
|
|
2121
|
+
_identity as _identity6,
|
|
2122
|
+
_isPromiseLike as _isPromiseLike6,
|
|
2123
|
+
_required as _required6,
|
|
2124
|
+
_translateArray as _translateArray6,
|
|
2125
|
+
_translateMap as _translateMap6,
|
|
2126
|
+
_translateShape as _translateShape6
|
|
2127
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
2128
|
+
var CustomAction;
|
|
2129
|
+
((CustomAction3) => {
|
|
2130
|
+
const GetFormStateResponseDescriptor = new _ShapeDescriptor6(
|
|
2131
|
+
"GetFormStateResponse",
|
|
2132
|
+
[
|
|
2133
|
+
{ type: "values", transform: _required6(_translateMap6(_identity6, _identity6)) },
|
|
2134
|
+
{
|
|
2135
|
+
type: "config",
|
|
2136
|
+
transform: _required6(
|
|
2137
|
+
_translateMap6(
|
|
2138
|
+
_identity6,
|
|
2139
|
+
_translateShape6(() => FormStateFieldConfigDescriptor)
|
|
2140
|
+
)
|
|
2141
|
+
)
|
|
2142
|
+
}
|
|
2143
|
+
]
|
|
2144
|
+
);
|
|
2145
|
+
const FormStateFieldConfigDescriptor = new _ShapeDescriptor6(
|
|
2146
|
+
"FormStateFieldConfig",
|
|
2147
|
+
[
|
|
2148
|
+
{
|
|
2149
|
+
type: "options",
|
|
2150
|
+
transform: _required6(
|
|
2151
|
+
_translateArray6(_translateShape6(() => SelectOptionDescriptor))
|
|
2152
|
+
)
|
|
2153
|
+
},
|
|
2154
|
+
{ type: "schema", transform: _required6(_translateMap6(_identity6, _identity6)) },
|
|
2155
|
+
{ type: "disabled", transform: _identity6 },
|
|
2156
|
+
{ type: "hidden", transform: _identity6 },
|
|
2157
|
+
{ type: "warning", transform: _identity6 },
|
|
2158
|
+
{ type: "error", transform: _identity6 }
|
|
2159
|
+
]
|
|
2160
|
+
);
|
|
2161
|
+
const SelectOptionDescriptor = new _ShapeDescriptor6(
|
|
2162
|
+
"SelectOption",
|
|
2163
|
+
[
|
|
2164
|
+
{ type: "value", transform: _required6() },
|
|
2165
|
+
{ type: "label", transform: _required6() }
|
|
2166
|
+
]
|
|
2167
|
+
);
|
|
2168
|
+
const GetFormStateRequestDescriptor = new _ShapeDescriptor6(
|
|
2169
|
+
"GetFormStateRequest",
|
|
2170
|
+
[
|
|
2171
|
+
{ type: "values", transform: _required6(_translateMap6(_identity6, _identity6)) },
|
|
2172
|
+
{ type: "changedField", transform: _identity6 }
|
|
2173
|
+
]
|
|
2174
|
+
);
|
|
2175
|
+
const ExecuteCustomActionResponseDescriptor = new _ShapeDescriptor6("ExecuteCustomActionResponse", []);
|
|
2176
|
+
const ExecuteCustomActionRequestDescriptor = new _ShapeDescriptor6("ExecuteCustomActionRequest", [
|
|
2177
|
+
{ type: "customInput", transform: _required6(_translateMap6(_identity6, _identity6)) }
|
|
2178
|
+
]);
|
|
2179
|
+
let __stripe_shim_active__ = false;
|
|
2180
|
+
function prepareArgsExecute(proto) {
|
|
2181
|
+
if (__stripe_shim_active__) {
|
|
2182
|
+
return proto;
|
|
2183
|
+
}
|
|
2184
|
+
return _apply6(
|
|
2185
|
+
ExecuteCustomActionRequestDescriptor,
|
|
2186
|
+
_ProtoWireToType6,
|
|
2187
|
+
proto
|
|
2188
|
+
);
|
|
2189
|
+
}
|
|
2190
|
+
CustomAction3.prepareArgsExecute = prepareArgsExecute;
|
|
2191
|
+
function prepareResultExecute(result) {
|
|
2192
|
+
if (__stripe_shim_active__) return result;
|
|
2193
|
+
return _apply6(
|
|
2194
|
+
ExecuteCustomActionResponseDescriptor,
|
|
2195
|
+
_TypeToProtoWire6,
|
|
2196
|
+
result
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
CustomAction3.prepareResultExecute = prepareResultExecute;
|
|
2200
|
+
function $platformWrapExecute(configTransformer) {
|
|
2201
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2202
|
+
__stripe_shim_active__ = true;
|
|
2203
|
+
const instance = new cls();
|
|
2204
|
+
const request = _apply6(
|
|
2205
|
+
ExecuteCustomActionRequestDescriptor,
|
|
2206
|
+
_ProtoWireToType6,
|
|
2207
|
+
wireArgs
|
|
2208
|
+
);
|
|
2209
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext6(ctx)) : wireConfig;
|
|
2210
|
+
const result = instance.execute(request, config, ctx);
|
|
2211
|
+
if (_isPromiseLike6(result)) {
|
|
2212
|
+
return Promise.resolve(result).then((r) => {
|
|
2213
|
+
const typedR = r;
|
|
2214
|
+
return _apply6(ExecuteCustomActionResponseDescriptor, _TypeToProtoWire6, typedR);
|
|
2215
|
+
});
|
|
2216
|
+
}
|
|
2217
|
+
const typedResult = result;
|
|
2218
|
+
return _apply6(ExecuteCustomActionResponseDescriptor, _TypeToProtoWire6, typedResult);
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
CustomAction3.$platformWrapExecute = $platformWrapExecute;
|
|
2222
|
+
function prepareArgsGetFormState(proto) {
|
|
2223
|
+
if (__stripe_shim_active__) {
|
|
2224
|
+
return proto;
|
|
2225
|
+
}
|
|
2226
|
+
return _apply6(
|
|
2227
|
+
GetFormStateRequestDescriptor,
|
|
2228
|
+
_ProtoWireToType6,
|
|
2229
|
+
proto
|
|
2230
|
+
);
|
|
2231
|
+
}
|
|
2232
|
+
CustomAction3.prepareArgsGetFormState = prepareArgsGetFormState;
|
|
2233
|
+
function prepareResultGetFormState(result) {
|
|
2234
|
+
if (__stripe_shim_active__) return result;
|
|
2235
|
+
return _apply6(
|
|
2236
|
+
GetFormStateResponseDescriptor,
|
|
2237
|
+
_TypeToProtoWire6,
|
|
2238
|
+
result
|
|
2239
|
+
);
|
|
2240
|
+
}
|
|
2241
|
+
CustomAction3.prepareResultGetFormState = prepareResultGetFormState;
|
|
2242
|
+
function $platformWrapGetFormState(configTransformer) {
|
|
2243
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2244
|
+
__stripe_shim_active__ = true;
|
|
2245
|
+
const instance = new cls();
|
|
2246
|
+
const request = _apply6(
|
|
2247
|
+
GetFormStateRequestDescriptor,
|
|
2248
|
+
_ProtoWireToType6,
|
|
2249
|
+
wireArgs
|
|
2250
|
+
);
|
|
2251
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext6(ctx)) : wireConfig;
|
|
2252
|
+
const result = instance.getFormState(request, config, ctx);
|
|
2253
|
+
if (_isPromiseLike6(result)) {
|
|
2254
|
+
return Promise.resolve(result).then((r) => {
|
|
2255
|
+
const typedR = r;
|
|
2256
|
+
return _apply6(GetFormStateResponseDescriptor, _TypeToProtoWire6, typedR);
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
const typedResult = result;
|
|
2260
|
+
return _apply6(GetFormStateResponseDescriptor, _TypeToProtoWire6, typedResult);
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
CustomAction3.$platformWrapGetFormState = $platformWrapGetFormState;
|
|
2264
|
+
})(CustomAction || (CustomAction = {}));
|
|
2265
|
+
|
|
2266
|
+
// src/extensions/extend/index.ts
|
|
2267
|
+
var extend_exports = {};
|
|
2268
|
+
__export(extend_exports, {
|
|
2269
|
+
Workflows: () => workflows_exports2
|
|
2270
|
+
});
|
|
2271
|
+
|
|
2272
|
+
// src/extensions/extend/workflows/index.ts
|
|
2273
|
+
var workflows_exports2 = {};
|
|
2274
|
+
__export(workflows_exports2, {
|
|
2275
|
+
CustomAction: () => CustomAction2
|
|
2276
|
+
});
|
|
2277
|
+
|
|
2278
|
+
// src/extensions/extend/workflows/custom_action.ts
|
|
2279
|
+
import {
|
|
2280
|
+
_ProtoWireToType as _ProtoWireToType7,
|
|
2281
|
+
_ShapeDescriptor as _ShapeDescriptor7,
|
|
2282
|
+
_TypeToProtoWire as _TypeToProtoWire7,
|
|
2283
|
+
_apply as _apply7,
|
|
2284
|
+
_configAppContextFromContext as _configAppContextFromContext7,
|
|
2285
|
+
_identity as _identity7,
|
|
2286
|
+
_isPromiseLike as _isPromiseLike7,
|
|
2287
|
+
_required as _required7,
|
|
2288
|
+
_translateArray as _translateArray7,
|
|
2289
|
+
_translateMap as _translateMap7,
|
|
2290
|
+
_translateShape as _translateShape7
|
|
2291
|
+
} from "@stripe/extensibility-sdk/stdlib";
|
|
2292
|
+
var CustomAction2;
|
|
2293
|
+
((CustomAction3) => {
|
|
2294
|
+
const GetFormStateResponseDescriptor = new _ShapeDescriptor7(
|
|
2295
|
+
"GetFormStateResponse",
|
|
2296
|
+
[
|
|
2297
|
+
{ type: "values", transform: _required7(_translateMap7(_identity7, _identity7)) },
|
|
2298
|
+
{
|
|
2299
|
+
type: "config",
|
|
2300
|
+
transform: _required7(
|
|
2301
|
+
_translateMap7(
|
|
2302
|
+
_identity7,
|
|
2303
|
+
_translateShape7(() => FormStateFieldConfigDescriptor)
|
|
2304
|
+
)
|
|
2305
|
+
)
|
|
2306
|
+
}
|
|
2307
|
+
]
|
|
2308
|
+
);
|
|
2309
|
+
const FormStateFieldConfigDescriptor = new _ShapeDescriptor7(
|
|
2310
|
+
"FormStateFieldConfig",
|
|
2311
|
+
[
|
|
2312
|
+
{
|
|
2313
|
+
type: "options",
|
|
2314
|
+
transform: _required7(
|
|
2315
|
+
_translateArray7(_translateShape7(() => SelectOptionDescriptor))
|
|
2316
|
+
)
|
|
2317
|
+
},
|
|
2318
|
+
{ type: "schema", transform: _required7(_translateMap7(_identity7, _identity7)) },
|
|
2319
|
+
{ type: "disabled", transform: _identity7 },
|
|
2320
|
+
{ type: "hidden", transform: _identity7 },
|
|
2321
|
+
{ type: "warning", transform: _identity7 },
|
|
2322
|
+
{ type: "error", transform: _identity7 }
|
|
2323
|
+
]
|
|
2324
|
+
);
|
|
2325
|
+
const SelectOptionDescriptor = new _ShapeDescriptor7(
|
|
2326
|
+
"SelectOption",
|
|
2327
|
+
[
|
|
2328
|
+
{ type: "value", transform: _required7() },
|
|
2329
|
+
{ type: "label", transform: _required7() }
|
|
2330
|
+
]
|
|
2331
|
+
);
|
|
2332
|
+
const GetFormStateRequestDescriptor = new _ShapeDescriptor7(
|
|
2333
|
+
"GetFormStateRequest",
|
|
2334
|
+
[
|
|
2335
|
+
{ type: "values", transform: _required7(_translateMap7(_identity7, _identity7)) },
|
|
2336
|
+
{ type: "changedField", transform: _identity7 }
|
|
2337
|
+
]
|
|
2338
|
+
);
|
|
2339
|
+
const ExecuteCustomActionResponseDescriptor = new _ShapeDescriptor7("ExecuteCustomActionResponse", []);
|
|
2340
|
+
const ExecuteCustomActionRequestDescriptor = new _ShapeDescriptor7("ExecuteCustomActionRequest", [
|
|
2341
|
+
{ type: "customInput", transform: _required7(_translateMap7(_identity7, _identity7)) }
|
|
2342
|
+
]);
|
|
2343
|
+
let __stripe_shim_active__ = false;
|
|
2344
|
+
function prepareArgsExecute(proto) {
|
|
2345
|
+
if (__stripe_shim_active__) {
|
|
2346
|
+
return proto;
|
|
2347
|
+
}
|
|
2348
|
+
return _apply7(
|
|
2349
|
+
ExecuteCustomActionRequestDescriptor,
|
|
2350
|
+
_ProtoWireToType7,
|
|
2351
|
+
proto
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
CustomAction3.prepareArgsExecute = prepareArgsExecute;
|
|
2355
|
+
function prepareResultExecute(result) {
|
|
2356
|
+
if (__stripe_shim_active__) return result;
|
|
2357
|
+
return _apply7(
|
|
2358
|
+
ExecuteCustomActionResponseDescriptor,
|
|
2359
|
+
_TypeToProtoWire7,
|
|
2360
|
+
result
|
|
2361
|
+
);
|
|
2362
|
+
}
|
|
2363
|
+
CustomAction3.prepareResultExecute = prepareResultExecute;
|
|
2364
|
+
function $platformWrapExecute(configTransformer) {
|
|
2365
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2366
|
+
__stripe_shim_active__ = true;
|
|
2367
|
+
const instance = new cls();
|
|
2368
|
+
const request = _apply7(
|
|
2369
|
+
ExecuteCustomActionRequestDescriptor,
|
|
2370
|
+
_ProtoWireToType7,
|
|
2371
|
+
wireArgs
|
|
2372
|
+
);
|
|
2373
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext7(ctx)) : wireConfig;
|
|
2374
|
+
const result = instance.execute(request, config, ctx);
|
|
2375
|
+
if (_isPromiseLike7(result)) {
|
|
2376
|
+
return Promise.resolve(result).then((r) => {
|
|
2377
|
+
const typedR = r;
|
|
2378
|
+
return _apply7(ExecuteCustomActionResponseDescriptor, _TypeToProtoWire7, typedR);
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
const typedResult = result;
|
|
2382
|
+
return _apply7(ExecuteCustomActionResponseDescriptor, _TypeToProtoWire7, typedResult);
|
|
2383
|
+
};
|
|
2384
|
+
}
|
|
2385
|
+
CustomAction3.$platformWrapExecute = $platformWrapExecute;
|
|
2386
|
+
function prepareArgsGetFormState(proto) {
|
|
2387
|
+
if (__stripe_shim_active__) {
|
|
2388
|
+
return proto;
|
|
2389
|
+
}
|
|
2390
|
+
return _apply7(
|
|
2391
|
+
GetFormStateRequestDescriptor,
|
|
2392
|
+
_ProtoWireToType7,
|
|
2393
|
+
proto
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
CustomAction3.prepareArgsGetFormState = prepareArgsGetFormState;
|
|
2397
|
+
function prepareResultGetFormState(result) {
|
|
2398
|
+
if (__stripe_shim_active__) return result;
|
|
2399
|
+
return _apply7(
|
|
2400
|
+
GetFormStateResponseDescriptor,
|
|
2401
|
+
_TypeToProtoWire7,
|
|
2402
|
+
result
|
|
2403
|
+
);
|
|
2404
|
+
}
|
|
2405
|
+
CustomAction3.prepareResultGetFormState = prepareResultGetFormState;
|
|
2406
|
+
function $platformWrapGetFormState(configTransformer) {
|
|
2407
|
+
return (cls, wireArgs, wireConfig, ctx) => {
|
|
2408
|
+
__stripe_shim_active__ = true;
|
|
2409
|
+
const instance = new cls();
|
|
2410
|
+
const request = _apply7(
|
|
2411
|
+
GetFormStateRequestDescriptor,
|
|
2412
|
+
_ProtoWireToType7,
|
|
2413
|
+
wireArgs
|
|
2414
|
+
);
|
|
2415
|
+
const config = configTransformer !== void 0 ? configTransformer(wireConfig, _configAppContextFromContext7(ctx)) : wireConfig;
|
|
2416
|
+
const result = instance.getFormState(request, config, ctx);
|
|
2417
|
+
if (_isPromiseLike7(result)) {
|
|
2418
|
+
return Promise.resolve(result).then((r) => {
|
|
2419
|
+
const typedR = r;
|
|
2420
|
+
return _apply7(GetFormStateResponseDescriptor, _TypeToProtoWire7, typedR);
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
const typedResult = result;
|
|
2424
|
+
return _apply7(GetFormStateResponseDescriptor, _TypeToProtoWire7, typedResult);
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
CustomAction3.$platformWrapGetFormState = $platformWrapGetFormState;
|
|
2428
|
+
})(CustomAction2 || (CustomAction2 = {}));
|
|
2429
|
+
export {
|
|
2430
|
+
billing_exports as Billing,
|
|
2431
|
+
core_exports as Core,
|
|
2432
|
+
Decimal,
|
|
2433
|
+
DecimalRoundingPresets,
|
|
2434
|
+
extend_exports as Extend
|
|
2435
|
+
};
|