@replit/revenuecat-sdk 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2280 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // revenuecat-sdk/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Country: () => Country,
24
+ Currency: () => Currency,
25
+ CustomerAttributeReservedName: () => CustomerAttributeReservedName,
26
+ Duration: () => Duration,
27
+ EligibilityCriteria: () => EligibilityCriteria,
28
+ Environment: () => Environment,
29
+ Ownership: () => Ownership,
30
+ ProductType: () => ProductType,
31
+ RcBillingCurrency: () => RcBillingCurrency,
32
+ WebhookEventType: () => WebhookEventType,
33
+ archiveEntitlement: () => archiveEntitlement,
34
+ archiveOffering: () => archiveOffering,
35
+ archiveProduct: () => archiveProduct,
36
+ archiveVirtualCurrency: () => archiveVirtualCurrency,
37
+ assignCustomerOffering: () => assignCustomerOffering,
38
+ attachProductsToEntitlement: () => attachProductsToEntitlement,
39
+ attachProductsToPackage: () => attachProductsToPackage,
40
+ cancelSubscription: () => cancelSubscription,
41
+ createApp: () => createApp,
42
+ createCustomer: () => createCustomer,
43
+ createEntitlement: () => createEntitlement,
44
+ createOffering: () => createOffering,
45
+ createPackages: () => createPackages,
46
+ createPaywall: () => createPaywall,
47
+ createProduct: () => createProduct,
48
+ createProductInStore: () => createProductInStore,
49
+ createProject: () => createProject,
50
+ createVirtualCurrenciesTransaction: () => createVirtualCurrenciesTransaction,
51
+ createVirtualCurrency: () => createVirtualCurrency,
52
+ createWebhookIntegration: () => createWebhookIntegration,
53
+ deleteApp: () => deleteApp,
54
+ deleteCustomer: () => deleteCustomer,
55
+ deleteEntitlement: () => deleteEntitlement,
56
+ deleteOffering: () => deleteOffering,
57
+ deletePackageFromOffering: () => deletePackageFromOffering,
58
+ deletePaywall: () => deletePaywall,
59
+ deleteProduct: () => deleteProduct,
60
+ deleteVirtualCurrency: () => deleteVirtualCurrency,
61
+ deleteWebhookIntegration: () => deleteWebhookIntegration,
62
+ detachProductsFromEntitlement: () => detachProductsFromEntitlement,
63
+ detachProductsFromPackage: () => detachProductsFromPackage,
64
+ getApp: () => getApp,
65
+ getAppStorekitConfig: () => getAppStorekitConfig,
66
+ getAuthorizedSubscriptionManagementUrl: () => getAuthorizedSubscriptionManagementUrl,
67
+ getChartData: () => getChartData,
68
+ getChartOptions: () => getChartOptions,
69
+ getCustomer: () => getCustomer,
70
+ getEntitlement: () => getEntitlement,
71
+ getInvoice: () => getInvoice,
72
+ getOffering: () => getOffering,
73
+ getOverviewMetrics: () => getOverviewMetrics,
74
+ getPackage: () => getPackage,
75
+ getPaywall: () => getPaywall,
76
+ getPlayStoreOrAppStoreSubscriptionTransactions: () => getPlayStoreOrAppStoreSubscriptionTransactions,
77
+ getProduct: () => getProduct,
78
+ getProductStoreState: () => getProductStoreState,
79
+ getProductStoreStateOperation: () => getProductStoreStateOperation,
80
+ getProductsFromEntitlement: () => getProductsFromEntitlement,
81
+ getProductsFromPackage: () => getProductsFromPackage,
82
+ getPurchase: () => getPurchase,
83
+ getSubscription: () => getSubscription,
84
+ getVirtualCurrency: () => getVirtualCurrency,
85
+ getWebhookIntegration: () => getWebhookIntegration,
86
+ grantCustomerEntitlement: () => grantCustomerEntitlement,
87
+ listAppPublicApiKeys: () => listAppPublicApiKeys,
88
+ listApps: () => listApps,
89
+ listAuditLogs: () => listAuditLogs,
90
+ listCollaborators: () => listCollaborators,
91
+ listCustomerActiveEntitlements: () => listCustomerActiveEntitlements,
92
+ listCustomerAliases: () => listCustomerAliases,
93
+ listCustomerAttributes: () => listCustomerAttributes,
94
+ listCustomerInvoices: () => listCustomerInvoices,
95
+ listCustomers: () => listCustomers,
96
+ listEntitlements: () => listEntitlements,
97
+ listOfferings: () => listOfferings,
98
+ listPackages: () => listPackages,
99
+ listPaywalls: () => listPaywalls,
100
+ listProducts: () => listProducts,
101
+ listProjects: () => listProjects,
102
+ listPurchaseEntitlements: () => listPurchaseEntitlements,
103
+ listPurchases: () => listPurchases,
104
+ listSubscriptionEntitlements: () => listSubscriptionEntitlements,
105
+ listSubscriptions: () => listSubscriptions,
106
+ listVirtualCurrencies: () => listVirtualCurrencies,
107
+ listVirtualCurrenciesBalances: () => listVirtualCurrenciesBalances,
108
+ listWebhookIntegrations: () => listWebhookIntegrations,
109
+ refundPlayStoreSubscriptionTransaction: () => refundPlayStoreSubscriptionTransaction,
110
+ refundPurchase: () => refundPurchase,
111
+ refundSubscription: () => refundSubscription,
112
+ revokeCustomerGrantedEntitlement: () => revokeCustomerGrantedEntitlement,
113
+ searchPurchases: () => searchPurchases,
114
+ searchSubscriptions: () => searchSubscriptions,
115
+ setCustomerAttributes: () => setCustomerAttributes,
116
+ setProductStoreState: () => setProductStoreState,
117
+ transferCustomerData: () => transferCustomerData,
118
+ unarchiveEntitlement: () => unarchiveEntitlement,
119
+ unarchiveOffering: () => unarchiveOffering,
120
+ unarchiveProduct: () => unarchiveProduct,
121
+ unarchiveVirtualCurrency: () => unarchiveVirtualCurrency,
122
+ updateApp: () => updateApp,
123
+ updateEntitlement: () => updateEntitlement,
124
+ updateOffering: () => updateOffering,
125
+ updatePackage: () => updatePackage,
126
+ updateProduct: () => updateProduct,
127
+ updateVirtualCurrenciesBalance: () => updateVirtualCurrenciesBalance,
128
+ updateVirtualCurrency: () => updateVirtualCurrency,
129
+ updateWebhookIntegration: () => updateWebhookIntegration,
130
+ uploadProductStoreStateScreenshot: () => uploadProductStoreStateScreenshot
131
+ });
132
+ module.exports = __toCommonJS(index_exports);
133
+
134
+ // revenuecat-sdk/core/bodySerializer.gen.ts
135
+ var jsonBodySerializer = {
136
+ bodySerializer: (body) => JSON.stringify(
137
+ body,
138
+ (_key, value) => typeof value === "bigint" ? value.toString() : value
139
+ )
140
+ };
141
+
142
+ // revenuecat-sdk/core/params.gen.ts
143
+ var extraPrefixesMap = {
144
+ $body_: "body",
145
+ $headers_: "headers",
146
+ $path_: "path",
147
+ $query_: "query"
148
+ };
149
+ var extraPrefixes = Object.entries(extraPrefixesMap);
150
+
151
+ // revenuecat-sdk/core/serverSentEvents.gen.ts
152
+ var createSseClient = ({
153
+ onRequest,
154
+ onSseError,
155
+ onSseEvent,
156
+ responseTransformer,
157
+ responseValidator,
158
+ sseDefaultRetryDelay,
159
+ sseMaxRetryAttempts,
160
+ sseMaxRetryDelay,
161
+ sseSleepFn,
162
+ url,
163
+ ...options
164
+ }) => {
165
+ let lastEventId;
166
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
167
+ const createStream = async function* () {
168
+ let retryDelay = sseDefaultRetryDelay ?? 3e3;
169
+ let attempt = 0;
170
+ const signal = options.signal ?? new AbortController().signal;
171
+ while (true) {
172
+ if (signal.aborted) break;
173
+ attempt++;
174
+ const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
175
+ if (lastEventId !== void 0) {
176
+ headers.set("Last-Event-ID", lastEventId);
177
+ }
178
+ try {
179
+ const requestInit = {
180
+ redirect: "follow",
181
+ ...options,
182
+ body: options.serializedBody,
183
+ headers,
184
+ signal
185
+ };
186
+ let request = new Request(url, requestInit);
187
+ if (onRequest) {
188
+ request = await onRequest(url, requestInit);
189
+ }
190
+ const _fetch = options.fetch ?? globalThis.fetch;
191
+ const response = await _fetch(request);
192
+ if (!response.ok)
193
+ throw new Error(
194
+ `SSE failed: ${response.status} ${response.statusText}`
195
+ );
196
+ if (!response.body) throw new Error("No body in SSE response");
197
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
198
+ let buffer = "";
199
+ const abortHandler = () => {
200
+ try {
201
+ reader.cancel();
202
+ } catch {
203
+ }
204
+ };
205
+ signal.addEventListener("abort", abortHandler);
206
+ try {
207
+ while (true) {
208
+ const { done, value } = await reader.read();
209
+ if (done) break;
210
+ buffer += value;
211
+ buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
212
+ const chunks = buffer.split("\n\n");
213
+ buffer = chunks.pop() ?? "";
214
+ for (const chunk of chunks) {
215
+ const lines = chunk.split("\n");
216
+ const dataLines = [];
217
+ let eventName;
218
+ for (const line of lines) {
219
+ if (line.startsWith("data:")) {
220
+ dataLines.push(line.replace(/^data:\s*/, ""));
221
+ } else if (line.startsWith("event:")) {
222
+ eventName = line.replace(/^event:\s*/, "");
223
+ } else if (line.startsWith("id:")) {
224
+ lastEventId = line.replace(/^id:\s*/, "");
225
+ } else if (line.startsWith("retry:")) {
226
+ const parsed = Number.parseInt(
227
+ line.replace(/^retry:\s*/, ""),
228
+ 10
229
+ );
230
+ if (!Number.isNaN(parsed)) {
231
+ retryDelay = parsed;
232
+ }
233
+ }
234
+ }
235
+ let data;
236
+ let parsedJson = false;
237
+ if (dataLines.length) {
238
+ const rawData = dataLines.join("\n");
239
+ try {
240
+ data = JSON.parse(rawData);
241
+ parsedJson = true;
242
+ } catch {
243
+ data = rawData;
244
+ }
245
+ }
246
+ if (parsedJson) {
247
+ if (responseValidator) {
248
+ await responseValidator(data);
249
+ }
250
+ if (responseTransformer) {
251
+ data = await responseTransformer(data);
252
+ }
253
+ }
254
+ onSseEvent?.({
255
+ data,
256
+ event: eventName,
257
+ id: lastEventId,
258
+ retry: retryDelay
259
+ });
260
+ if (dataLines.length) {
261
+ yield data;
262
+ }
263
+ }
264
+ }
265
+ } finally {
266
+ signal.removeEventListener("abort", abortHandler);
267
+ reader.releaseLock();
268
+ }
269
+ break;
270
+ } catch (error) {
271
+ onSseError?.(error);
272
+ if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
273
+ break;
274
+ }
275
+ const backoff = Math.min(
276
+ retryDelay * 2 ** (attempt - 1),
277
+ sseMaxRetryDelay ?? 3e4
278
+ );
279
+ await sleep(backoff);
280
+ }
281
+ }
282
+ };
283
+ const stream = createStream();
284
+ return { stream };
285
+ };
286
+
287
+ // revenuecat-sdk/core/pathSerializer.gen.ts
288
+ var separatorArrayExplode = (style) => {
289
+ switch (style) {
290
+ case "label":
291
+ return ".";
292
+ case "matrix":
293
+ return ";";
294
+ case "simple":
295
+ return ",";
296
+ default:
297
+ return "&";
298
+ }
299
+ };
300
+ var separatorArrayNoExplode = (style) => {
301
+ switch (style) {
302
+ case "form":
303
+ return ",";
304
+ case "pipeDelimited":
305
+ return "|";
306
+ case "spaceDelimited":
307
+ return "%20";
308
+ default:
309
+ return ",";
310
+ }
311
+ };
312
+ var separatorObjectExplode = (style) => {
313
+ switch (style) {
314
+ case "label":
315
+ return ".";
316
+ case "matrix":
317
+ return ";";
318
+ case "simple":
319
+ return ",";
320
+ default:
321
+ return "&";
322
+ }
323
+ };
324
+ var serializeArrayParam = ({
325
+ allowReserved,
326
+ explode,
327
+ name,
328
+ style,
329
+ value
330
+ }) => {
331
+ if (!explode) {
332
+ const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
333
+ switch (style) {
334
+ case "label":
335
+ return `.${joinedValues2}`;
336
+ case "matrix":
337
+ return `;${name}=${joinedValues2}`;
338
+ case "simple":
339
+ return joinedValues2;
340
+ default:
341
+ return `${name}=${joinedValues2}`;
342
+ }
343
+ }
344
+ const separator = separatorArrayExplode(style);
345
+ const joinedValues = value.map((v) => {
346
+ if (style === "label" || style === "simple") {
347
+ return allowReserved ? v : encodeURIComponent(v);
348
+ }
349
+ return serializePrimitiveParam({
350
+ allowReserved,
351
+ name,
352
+ value: v
353
+ });
354
+ }).join(separator);
355
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
356
+ };
357
+ var serializePrimitiveParam = ({
358
+ allowReserved,
359
+ name,
360
+ value
361
+ }) => {
362
+ if (value === void 0 || value === null) {
363
+ return "";
364
+ }
365
+ if (typeof value === "object") {
366
+ throw new Error(
367
+ "Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."
368
+ );
369
+ }
370
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
371
+ };
372
+ var serializeObjectParam = ({
373
+ allowReserved,
374
+ explode,
375
+ name,
376
+ style,
377
+ value,
378
+ valueOnly
379
+ }) => {
380
+ if (value instanceof Date) {
381
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
382
+ }
383
+ if (style !== "deepObject" && !explode) {
384
+ let values = [];
385
+ Object.entries(value).forEach(([key, v]) => {
386
+ values = [
387
+ ...values,
388
+ key,
389
+ allowReserved ? v : encodeURIComponent(v)
390
+ ];
391
+ });
392
+ const joinedValues2 = values.join(",");
393
+ switch (style) {
394
+ case "form":
395
+ return `${name}=${joinedValues2}`;
396
+ case "label":
397
+ return `.${joinedValues2}`;
398
+ case "matrix":
399
+ return `;${name}=${joinedValues2}`;
400
+ default:
401
+ return joinedValues2;
402
+ }
403
+ }
404
+ const separator = separatorObjectExplode(style);
405
+ const joinedValues = Object.entries(value).map(
406
+ ([key, v]) => serializePrimitiveParam({
407
+ allowReserved,
408
+ name: style === "deepObject" ? `${name}[${key}]` : key,
409
+ value: v
410
+ })
411
+ ).join(separator);
412
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
413
+ };
414
+
415
+ // revenuecat-sdk/core/utils.gen.ts
416
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
417
+ var defaultPathSerializer = ({ path, url: _url }) => {
418
+ let url = _url;
419
+ const matches = _url.match(PATH_PARAM_RE);
420
+ if (matches) {
421
+ for (const match of matches) {
422
+ let explode = false;
423
+ let name = match.substring(1, match.length - 1);
424
+ let style = "simple";
425
+ if (name.endsWith("*")) {
426
+ explode = true;
427
+ name = name.substring(0, name.length - 1);
428
+ }
429
+ if (name.startsWith(".")) {
430
+ name = name.substring(1);
431
+ style = "label";
432
+ } else if (name.startsWith(";")) {
433
+ name = name.substring(1);
434
+ style = "matrix";
435
+ }
436
+ const value = path[name];
437
+ if (value === void 0 || value === null) {
438
+ continue;
439
+ }
440
+ if (Array.isArray(value)) {
441
+ url = url.replace(
442
+ match,
443
+ serializeArrayParam({ explode, name, style, value })
444
+ );
445
+ continue;
446
+ }
447
+ if (typeof value === "object") {
448
+ url = url.replace(
449
+ match,
450
+ serializeObjectParam({
451
+ explode,
452
+ name,
453
+ style,
454
+ value,
455
+ valueOnly: true
456
+ })
457
+ );
458
+ continue;
459
+ }
460
+ if (style === "matrix") {
461
+ url = url.replace(
462
+ match,
463
+ `;${serializePrimitiveParam({
464
+ name,
465
+ value
466
+ })}`
467
+ );
468
+ continue;
469
+ }
470
+ const replaceValue = encodeURIComponent(
471
+ style === "label" ? `.${value}` : value
472
+ );
473
+ url = url.replace(match, replaceValue);
474
+ }
475
+ }
476
+ return url;
477
+ };
478
+ var getUrl = ({
479
+ baseUrl,
480
+ path,
481
+ query,
482
+ querySerializer,
483
+ url: _url
484
+ }) => {
485
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
486
+ let url = (baseUrl ?? "") + pathUrl;
487
+ if (path) {
488
+ url = defaultPathSerializer({ path, url });
489
+ }
490
+ let search = query ? querySerializer(query) : "";
491
+ if (search.startsWith("?")) {
492
+ search = search.substring(1);
493
+ }
494
+ if (search) {
495
+ url += `?${search}`;
496
+ }
497
+ return url;
498
+ };
499
+ function getValidRequestBody(options) {
500
+ const hasBody = options.body !== void 0;
501
+ const isSerializedBody = hasBody && options.bodySerializer;
502
+ if (isSerializedBody) {
503
+ if ("serializedBody" in options) {
504
+ const hasSerializedBody = options.serializedBody !== void 0 && options.serializedBody !== "";
505
+ return hasSerializedBody ? options.serializedBody : null;
506
+ }
507
+ return options.body !== "" ? options.body : null;
508
+ }
509
+ if (hasBody) {
510
+ return options.body;
511
+ }
512
+ return void 0;
513
+ }
514
+
515
+ // revenuecat-sdk/core/auth.gen.ts
516
+ var getAuthToken = async (auth, callback) => {
517
+ const token = typeof callback === "function" ? await callback(auth) : callback;
518
+ if (!token) {
519
+ return;
520
+ }
521
+ if (auth.scheme === "bearer") {
522
+ return `Bearer ${token}`;
523
+ }
524
+ if (auth.scheme === "basic") {
525
+ return `Basic ${btoa(token)}`;
526
+ }
527
+ return token;
528
+ };
529
+
530
+ // revenuecat-sdk/client/utils.gen.ts
531
+ var createQuerySerializer = ({
532
+ parameters = {},
533
+ ...args
534
+ } = {}) => {
535
+ const querySerializer = (queryParams) => {
536
+ const search = [];
537
+ if (queryParams && typeof queryParams === "object") {
538
+ for (const name in queryParams) {
539
+ const value = queryParams[name];
540
+ if (value === void 0 || value === null) {
541
+ continue;
542
+ }
543
+ const options = parameters[name] || args;
544
+ if (Array.isArray(value)) {
545
+ const serializedArray = serializeArrayParam({
546
+ allowReserved: options.allowReserved,
547
+ explode: true,
548
+ name,
549
+ style: "form",
550
+ value,
551
+ ...options.array
552
+ });
553
+ if (serializedArray) search.push(serializedArray);
554
+ } else if (typeof value === "object") {
555
+ const serializedObject = serializeObjectParam({
556
+ allowReserved: options.allowReserved,
557
+ explode: true,
558
+ name,
559
+ style: "deepObject",
560
+ value,
561
+ ...options.object
562
+ });
563
+ if (serializedObject) search.push(serializedObject);
564
+ } else {
565
+ const serializedPrimitive = serializePrimitiveParam({
566
+ allowReserved: options.allowReserved,
567
+ name,
568
+ value
569
+ });
570
+ if (serializedPrimitive) search.push(serializedPrimitive);
571
+ }
572
+ }
573
+ }
574
+ return search.join("&");
575
+ };
576
+ return querySerializer;
577
+ };
578
+ var getParseAs = (contentType) => {
579
+ if (!contentType) {
580
+ return "stream";
581
+ }
582
+ const cleanContent = contentType.split(";")[0]?.trim();
583
+ if (!cleanContent) {
584
+ return;
585
+ }
586
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
587
+ return "json";
588
+ }
589
+ if (cleanContent === "multipart/form-data") {
590
+ return "formData";
591
+ }
592
+ if (["application/", "audio/", "image/", "video/"].some(
593
+ (type) => cleanContent.startsWith(type)
594
+ )) {
595
+ return "blob";
596
+ }
597
+ if (cleanContent.startsWith("text/")) {
598
+ return "text";
599
+ }
600
+ return;
601
+ };
602
+ var checkForExistence = (options, name) => {
603
+ if (!name) {
604
+ return false;
605
+ }
606
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
607
+ return true;
608
+ }
609
+ return false;
610
+ };
611
+ var setAuthParams = async ({
612
+ security,
613
+ ...options
614
+ }) => {
615
+ for (const auth of security) {
616
+ if (checkForExistence(options, auth.name)) {
617
+ continue;
618
+ }
619
+ const token = await getAuthToken(auth, options.auth);
620
+ if (!token) {
621
+ continue;
622
+ }
623
+ const name = auth.name ?? "Authorization";
624
+ switch (auth.in) {
625
+ case "query":
626
+ if (!options.query) {
627
+ options.query = {};
628
+ }
629
+ options.query[name] = token;
630
+ break;
631
+ case "cookie":
632
+ options.headers.append("Cookie", `${name}=${token}`);
633
+ break;
634
+ case "header":
635
+ default:
636
+ options.headers.set(name, token);
637
+ break;
638
+ }
639
+ }
640
+ };
641
+ var buildUrl = (options) => getUrl({
642
+ baseUrl: options.baseUrl,
643
+ path: options.path,
644
+ query: options.query,
645
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
646
+ url: options.url
647
+ });
648
+ var mergeConfigs = (a, b) => {
649
+ const config = { ...a, ...b };
650
+ if (config.baseUrl?.endsWith("/")) {
651
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
652
+ }
653
+ config.headers = mergeHeaders(a.headers, b.headers);
654
+ return config;
655
+ };
656
+ var headersEntries = (headers) => {
657
+ const entries = [];
658
+ headers.forEach((value, key) => {
659
+ entries.push([key, value]);
660
+ });
661
+ return entries;
662
+ };
663
+ var mergeHeaders = (...headers) => {
664
+ const mergedHeaders = new Headers();
665
+ for (const header of headers) {
666
+ if (!header) {
667
+ continue;
668
+ }
669
+ const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
670
+ for (const [key, value] of iterator) {
671
+ if (value === null) {
672
+ mergedHeaders.delete(key);
673
+ } else if (Array.isArray(value)) {
674
+ for (const v of value) {
675
+ mergedHeaders.append(key, v);
676
+ }
677
+ } else if (value !== void 0) {
678
+ mergedHeaders.set(
679
+ key,
680
+ typeof value === "object" ? JSON.stringify(value) : value
681
+ );
682
+ }
683
+ }
684
+ }
685
+ return mergedHeaders;
686
+ };
687
+ var Interceptors = class {
688
+ fns = [];
689
+ clear() {
690
+ this.fns = [];
691
+ }
692
+ eject(id) {
693
+ const index = this.getInterceptorIndex(id);
694
+ if (this.fns[index]) {
695
+ this.fns[index] = null;
696
+ }
697
+ }
698
+ exists(id) {
699
+ const index = this.getInterceptorIndex(id);
700
+ return Boolean(this.fns[index]);
701
+ }
702
+ getInterceptorIndex(id) {
703
+ if (typeof id === "number") {
704
+ return this.fns[id] ? id : -1;
705
+ }
706
+ return this.fns.indexOf(id);
707
+ }
708
+ update(id, fn) {
709
+ const index = this.getInterceptorIndex(id);
710
+ if (this.fns[index]) {
711
+ this.fns[index] = fn;
712
+ return id;
713
+ }
714
+ return false;
715
+ }
716
+ use(fn) {
717
+ this.fns.push(fn);
718
+ return this.fns.length - 1;
719
+ }
720
+ };
721
+ var createInterceptors = () => ({
722
+ error: new Interceptors(),
723
+ request: new Interceptors(),
724
+ response: new Interceptors()
725
+ });
726
+ var defaultQuerySerializer = createQuerySerializer({
727
+ allowReserved: false,
728
+ array: {
729
+ explode: true,
730
+ style: "form"
731
+ },
732
+ object: {
733
+ explode: true,
734
+ style: "deepObject"
735
+ }
736
+ });
737
+ var defaultHeaders = {
738
+ "Content-Type": "application/json"
739
+ };
740
+ var createConfig = (override = {}) => ({
741
+ ...jsonBodySerializer,
742
+ headers: defaultHeaders,
743
+ parseAs: "auto",
744
+ querySerializer: defaultQuerySerializer,
745
+ ...override
746
+ });
747
+
748
+ // revenuecat-sdk/client/client.gen.ts
749
+ var createClient = (config = {}) => {
750
+ let _config = mergeConfigs(createConfig(), config);
751
+ const getConfig = () => ({ ..._config });
752
+ const setConfig = (config2) => {
753
+ _config = mergeConfigs(_config, config2);
754
+ return getConfig();
755
+ };
756
+ const interceptors = createInterceptors();
757
+ const beforeRequest = async (options) => {
758
+ const opts = {
759
+ ..._config,
760
+ ...options,
761
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
762
+ headers: mergeHeaders(_config.headers, options.headers),
763
+ serializedBody: void 0
764
+ };
765
+ if (opts.security) {
766
+ await setAuthParams({
767
+ ...opts,
768
+ security: opts.security
769
+ });
770
+ }
771
+ if (opts.requestValidator) {
772
+ await opts.requestValidator(opts);
773
+ }
774
+ if (opts.body !== void 0 && opts.bodySerializer) {
775
+ opts.serializedBody = opts.bodySerializer(opts.body);
776
+ }
777
+ if (opts.body === void 0 || opts.serializedBody === "") {
778
+ opts.headers.delete("Content-Type");
779
+ }
780
+ const url = buildUrl(opts);
781
+ return { opts, url };
782
+ };
783
+ const request = async (options) => {
784
+ const { opts, url } = await beforeRequest(options);
785
+ const requestInit = {
786
+ redirect: "follow",
787
+ ...opts,
788
+ body: getValidRequestBody(opts)
789
+ };
790
+ let request2 = new Request(url, requestInit);
791
+ for (const fn of interceptors.request.fns) {
792
+ if (fn) {
793
+ request2 = await fn(request2, opts);
794
+ }
795
+ }
796
+ const _fetch = opts.fetch;
797
+ let response;
798
+ try {
799
+ response = await _fetch(request2);
800
+ } catch (error2) {
801
+ let finalError2 = error2;
802
+ for (const fn of interceptors.error.fns) {
803
+ if (fn) {
804
+ finalError2 = await fn(
805
+ error2,
806
+ void 0,
807
+ request2,
808
+ opts
809
+ );
810
+ }
811
+ }
812
+ finalError2 = finalError2 || {};
813
+ if (opts.throwOnError) {
814
+ throw finalError2;
815
+ }
816
+ return opts.responseStyle === "data" ? void 0 : {
817
+ error: finalError2,
818
+ request: request2,
819
+ response: void 0
820
+ };
821
+ }
822
+ for (const fn of interceptors.response.fns) {
823
+ if (fn) {
824
+ response = await fn(response, request2, opts);
825
+ }
826
+ }
827
+ const result = {
828
+ request: request2,
829
+ response
830
+ };
831
+ if (response.ok) {
832
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
833
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
834
+ let emptyData;
835
+ switch (parseAs) {
836
+ case "arrayBuffer":
837
+ case "blob":
838
+ case "text":
839
+ emptyData = await response[parseAs]();
840
+ break;
841
+ case "formData":
842
+ emptyData = new FormData();
843
+ break;
844
+ case "stream":
845
+ emptyData = response.body;
846
+ break;
847
+ case "json":
848
+ default:
849
+ emptyData = {};
850
+ break;
851
+ }
852
+ return opts.responseStyle === "data" ? emptyData : {
853
+ data: emptyData,
854
+ ...result
855
+ };
856
+ }
857
+ let data;
858
+ switch (parseAs) {
859
+ case "arrayBuffer":
860
+ case "blob":
861
+ case "formData":
862
+ case "text":
863
+ data = await response[parseAs]();
864
+ break;
865
+ case "json": {
866
+ const text = await response.text();
867
+ data = text ? JSON.parse(text) : {};
868
+ break;
869
+ }
870
+ case "stream":
871
+ return opts.responseStyle === "data" ? response.body : {
872
+ data: response.body,
873
+ ...result
874
+ };
875
+ }
876
+ if (parseAs === "json") {
877
+ if (opts.responseValidator) {
878
+ await opts.responseValidator(data);
879
+ }
880
+ if (opts.responseTransformer) {
881
+ data = await opts.responseTransformer(data);
882
+ }
883
+ }
884
+ return opts.responseStyle === "data" ? data : {
885
+ data,
886
+ ...result
887
+ };
888
+ }
889
+ const textError = await response.text();
890
+ let jsonError;
891
+ try {
892
+ jsonError = JSON.parse(textError);
893
+ } catch {
894
+ }
895
+ const error = jsonError ?? textError;
896
+ let finalError = error;
897
+ for (const fn of interceptors.error.fns) {
898
+ if (fn) {
899
+ finalError = await fn(error, response, request2, opts);
900
+ }
901
+ }
902
+ finalError = finalError || {};
903
+ if (opts.throwOnError) {
904
+ throw finalError;
905
+ }
906
+ return opts.responseStyle === "data" ? void 0 : {
907
+ error: finalError,
908
+ ...result
909
+ };
910
+ };
911
+ const makeMethodFn = (method) => (options) => request({ ...options, method });
912
+ const makeSseFn = (method) => async (options) => {
913
+ const { opts, url } = await beforeRequest(options);
914
+ return createSseClient({
915
+ ...opts,
916
+ body: opts.body,
917
+ headers: opts.headers,
918
+ method,
919
+ onRequest: async (url2, init) => {
920
+ let request2 = new Request(url2, init);
921
+ for (const fn of interceptors.request.fns) {
922
+ if (fn) {
923
+ request2 = await fn(request2, opts);
924
+ }
925
+ }
926
+ return request2;
927
+ },
928
+ serializedBody: getValidRequestBody(opts),
929
+ url
930
+ });
931
+ };
932
+ return {
933
+ buildUrl,
934
+ connect: makeMethodFn("CONNECT"),
935
+ delete: makeMethodFn("DELETE"),
936
+ get: makeMethodFn("GET"),
937
+ getConfig,
938
+ head: makeMethodFn("HEAD"),
939
+ interceptors,
940
+ options: makeMethodFn("OPTIONS"),
941
+ patch: makeMethodFn("PATCH"),
942
+ post: makeMethodFn("POST"),
943
+ put: makeMethodFn("PUT"),
944
+ request,
945
+ setConfig,
946
+ sse: {
947
+ connect: makeSseFn("CONNECT"),
948
+ delete: makeSseFn("DELETE"),
949
+ get: makeSseFn("GET"),
950
+ head: makeSseFn("HEAD"),
951
+ options: makeSseFn("OPTIONS"),
952
+ patch: makeSseFn("PATCH"),
953
+ post: makeSseFn("POST"),
954
+ put: makeSseFn("PUT"),
955
+ trace: makeSseFn("TRACE")
956
+ },
957
+ trace: makeMethodFn("TRACE")
958
+ };
959
+ };
960
+
961
+ // revenuecat-sdk/client.gen.ts
962
+ var client = createClient(createConfig({ baseUrl: "https://api.revenuecat.com/v2" }));
963
+
964
+ // revenuecat-sdk/transformers.gen.ts
965
+ var overviewMetricSchemaResponseTransformer = (data) => {
966
+ if (data.last_updated_at_iso8601) {
967
+ data.last_updated_at_iso8601 = new Date(data.last_updated_at_iso8601);
968
+ }
969
+ return data;
970
+ };
971
+ var overviewMetricsSchemaResponseTransformer = (data) => {
972
+ data.metrics = data.metrics.map((item) => overviewMetricSchemaResponseTransformer(item));
973
+ return data;
974
+ };
975
+ var getOverviewMetricsResponseTransformer = async (data) => {
976
+ data = overviewMetricsSchemaResponseTransformer(data);
977
+ return data;
978
+ };
979
+
980
+ // revenuecat-sdk/sdk.gen.ts
981
+ var listPaywalls = (options) => (options.client ?? client).get({
982
+ security: [{ scheme: "bearer", type: "http" }],
983
+ url: "/projects/{project_id}/paywalls",
984
+ ...options
985
+ });
986
+ var createPaywall = (options) => (options.client ?? client).post({
987
+ security: [{ scheme: "bearer", type: "http" }],
988
+ url: "/projects/{project_id}/paywalls",
989
+ ...options,
990
+ headers: {
991
+ "Content-Type": "application/json",
992
+ ...options.headers
993
+ }
994
+ });
995
+ var deletePaywall = (options) => (options.client ?? client).delete({
996
+ security: [{ scheme: "bearer", type: "http" }],
997
+ url: "/projects/{project_id}/paywalls/{paywall_id}",
998
+ ...options
999
+ });
1000
+ var getPaywall = (options) => (options.client ?? client).get({
1001
+ security: [{ scheme: "bearer", type: "http" }],
1002
+ url: "/projects/{project_id}/paywalls/{paywall_id}",
1003
+ ...options
1004
+ });
1005
+ var listAppPublicApiKeys = (options) => (options.client ?? client).get({
1006
+ security: [{ scheme: "bearer", type: "http" }],
1007
+ url: "/projects/{project_id}/apps/{app_id}/public_api_keys",
1008
+ ...options
1009
+ });
1010
+ var listProjects = (options) => (options?.client ?? client).get({
1011
+ security: [{ scheme: "bearer", type: "http" }],
1012
+ url: "/projects",
1013
+ ...options
1014
+ });
1015
+ var createProject = (options) => (options.client ?? client).post({
1016
+ security: [{ scheme: "bearer", type: "http" }],
1017
+ url: "/projects",
1018
+ ...options,
1019
+ headers: {
1020
+ "Content-Type": "application/json",
1021
+ ...options.headers
1022
+ }
1023
+ });
1024
+ var listApps = (options) => (options.client ?? client).get({
1025
+ security: [{ scheme: "bearer", type: "http" }],
1026
+ url: "/projects/{project_id}/apps",
1027
+ ...options
1028
+ });
1029
+ var createApp = (options) => (options.client ?? client).post({
1030
+ security: [{ scheme: "bearer", type: "http" }],
1031
+ url: "/projects/{project_id}/apps",
1032
+ ...options,
1033
+ headers: {
1034
+ "Content-Type": "application/json",
1035
+ ...options.headers
1036
+ }
1037
+ });
1038
+ var deleteApp = (options) => (options.client ?? client).delete({
1039
+ security: [{ scheme: "bearer", type: "http" }],
1040
+ url: "/projects/{project_id}/apps/{app_id}",
1041
+ ...options
1042
+ });
1043
+ var getApp = (options) => (options.client ?? client).get({
1044
+ security: [{ scheme: "bearer", type: "http" }],
1045
+ url: "/projects/{project_id}/apps/{app_id}",
1046
+ ...options
1047
+ });
1048
+ var updateApp = (options) => (options.client ?? client).post({
1049
+ security: [{ scheme: "bearer", type: "http" }],
1050
+ url: "/projects/{project_id}/apps/{app_id}",
1051
+ ...options,
1052
+ headers: {
1053
+ "Content-Type": "application/json",
1054
+ ...options.headers
1055
+ }
1056
+ });
1057
+ var getAppStorekitConfig = (options) => (options.client ?? client).get({
1058
+ security: [{ scheme: "bearer", type: "http" }],
1059
+ url: "/projects/{project_id}/apps/{app_id}/store_kit_config",
1060
+ ...options
1061
+ });
1062
+ var listAuditLogs = (options) => (options.client ?? client).get({
1063
+ security: [{ scheme: "bearer", type: "http" }],
1064
+ url: "/projects/{project_id}/audit_logs",
1065
+ ...options
1066
+ });
1067
+ var listCollaborators = (options) => (options.client ?? client).get({
1068
+ security: [{ scheme: "bearer", type: "http" }],
1069
+ url: "/projects/{project_id}/collaborators",
1070
+ ...options
1071
+ });
1072
+ var listCustomers = (options) => (options.client ?? client).get({
1073
+ security: [{ scheme: "bearer", type: "http" }],
1074
+ url: "/projects/{project_id}/customers",
1075
+ ...options
1076
+ });
1077
+ var createCustomer = (options) => (options.client ?? client).post({
1078
+ security: [{ scheme: "bearer", type: "http" }],
1079
+ url: "/projects/{project_id}/customers",
1080
+ ...options,
1081
+ headers: {
1082
+ "Content-Type": "application/json",
1083
+ ...options.headers
1084
+ }
1085
+ });
1086
+ var deleteCustomer = (options) => (options.client ?? client).delete({
1087
+ security: [{ scheme: "bearer", type: "http" }],
1088
+ url: "/projects/{project_id}/customers/{customer_id}",
1089
+ ...options
1090
+ });
1091
+ var getCustomer = (options) => (options.client ?? client).get({
1092
+ security: [{ scheme: "bearer", type: "http" }],
1093
+ url: "/projects/{project_id}/customers/{customer_id}",
1094
+ ...options
1095
+ });
1096
+ var transferCustomerData = (options) => (options.client ?? client).post({
1097
+ security: [{ scheme: "bearer", type: "http" }],
1098
+ url: "/projects/{project_id}/customers/{customer_id}/actions/transfer",
1099
+ ...options,
1100
+ headers: {
1101
+ "Content-Type": "application/json",
1102
+ ...options.headers
1103
+ }
1104
+ });
1105
+ var grantCustomerEntitlement = (options) => (options.client ?? client).post({
1106
+ security: [{ scheme: "bearer", type: "http" }],
1107
+ url: "/projects/{project_id}/customers/{customer_id}/actions/grant_entitlement",
1108
+ ...options,
1109
+ headers: {
1110
+ "Content-Type": "application/json",
1111
+ ...options.headers
1112
+ }
1113
+ });
1114
+ var revokeCustomerGrantedEntitlement = (options) => (options.client ?? client).post({
1115
+ security: [{ scheme: "bearer", type: "http" }],
1116
+ url: "/projects/{project_id}/customers/{customer_id}/actions/revoke_granted_entitlement",
1117
+ ...options,
1118
+ headers: {
1119
+ "Content-Type": "application/json",
1120
+ ...options.headers
1121
+ }
1122
+ });
1123
+ var assignCustomerOffering = (options) => (options.client ?? client).post({
1124
+ security: [{ scheme: "bearer", type: "http" }],
1125
+ url: "/projects/{project_id}/customers/{customer_id}/actions/assign_offering",
1126
+ ...options,
1127
+ headers: {
1128
+ "Content-Type": "application/json",
1129
+ ...options.headers
1130
+ }
1131
+ });
1132
+ var listWebhookIntegrations = (options) => (options.client ?? client).get({
1133
+ security: [{ scheme: "bearer", type: "http" }],
1134
+ url: "/projects/{project_id}/integrations/webhooks",
1135
+ ...options
1136
+ });
1137
+ var createWebhookIntegration = (options) => (options.client ?? client).post({
1138
+ security: [{ scheme: "bearer", type: "http" }],
1139
+ url: "/projects/{project_id}/integrations/webhooks",
1140
+ ...options,
1141
+ headers: {
1142
+ "Content-Type": "application/json",
1143
+ ...options.headers
1144
+ }
1145
+ });
1146
+ var deleteWebhookIntegration = (options) => (options.client ?? client).delete({
1147
+ security: [{ scheme: "bearer", type: "http" }],
1148
+ url: "/projects/{project_id}/integrations/webhooks/{webhook_integration_id}",
1149
+ ...options
1150
+ });
1151
+ var getWebhookIntegration = (options) => (options.client ?? client).get({
1152
+ security: [{ scheme: "bearer", type: "http" }],
1153
+ url: "/projects/{project_id}/integrations/webhooks/{webhook_integration_id}",
1154
+ ...options
1155
+ });
1156
+ var updateWebhookIntegration = (options) => (options.client ?? client).post({
1157
+ security: [{ scheme: "bearer", type: "http" }],
1158
+ url: "/projects/{project_id}/integrations/webhooks/{webhook_integration_id}",
1159
+ ...options,
1160
+ headers: {
1161
+ "Content-Type": "application/json",
1162
+ ...options.headers
1163
+ }
1164
+ });
1165
+ var deleteProduct = (options) => (options.client ?? client).delete({
1166
+ security: [{ scheme: "bearer", type: "http" }],
1167
+ url: "/projects/{project_id}/products/{product_id}",
1168
+ ...options
1169
+ });
1170
+ var getProduct = (options) => (options.client ?? client).get({
1171
+ security: [{ scheme: "bearer", type: "http" }],
1172
+ url: "/projects/{project_id}/products/{product_id}",
1173
+ ...options
1174
+ });
1175
+ var updateProduct = (options) => (options.client ?? client).post({
1176
+ security: [{ scheme: "bearer", type: "http" }],
1177
+ url: "/projects/{project_id}/products/{product_id}",
1178
+ ...options,
1179
+ headers: {
1180
+ "Content-Type": "application/json",
1181
+ ...options.headers
1182
+ }
1183
+ });
1184
+ var archiveProduct = (options) => (options.client ?? client).post({
1185
+ security: [{ scheme: "bearer", type: "http" }],
1186
+ url: "/projects/{project_id}/products/{product_id}/actions/archive",
1187
+ ...options
1188
+ });
1189
+ var unarchiveProduct = (options) => (options.client ?? client).post({
1190
+ security: [{ scheme: "bearer", type: "http" }],
1191
+ url: "/projects/{project_id}/products/{product_id}/actions/unarchive",
1192
+ ...options
1193
+ });
1194
+ var createProductInStore = (options) => (options.client ?? client).post({
1195
+ security: [{ scheme: "bearer", type: "http" }],
1196
+ url: "/projects/{project_id}/products/{product_id}/create_in_store",
1197
+ ...options,
1198
+ headers: {
1199
+ "Content-Type": "application/json",
1200
+ ...options.headers
1201
+ }
1202
+ });
1203
+ var listProducts = (options) => (options.client ?? client).get({
1204
+ security: [{ scheme: "bearer", type: "http" }],
1205
+ url: "/projects/{project_id}/products",
1206
+ ...options
1207
+ });
1208
+ var createProduct = (options) => (options.client ?? client).post({
1209
+ security: [{ scheme: "bearer", type: "http" }],
1210
+ url: "/projects/{project_id}/products",
1211
+ ...options,
1212
+ headers: {
1213
+ "Content-Type": "application/json",
1214
+ ...options.headers
1215
+ }
1216
+ });
1217
+ var listVirtualCurrencies = (options) => (options.client ?? client).get({
1218
+ security: [{ scheme: "bearer", type: "http" }],
1219
+ url: "/projects/{project_id}/virtual_currencies",
1220
+ ...options
1221
+ });
1222
+ var createVirtualCurrency = (options) => (options.client ?? client).post({
1223
+ security: [{ scheme: "bearer", type: "http" }],
1224
+ url: "/projects/{project_id}/virtual_currencies",
1225
+ ...options,
1226
+ headers: {
1227
+ "Content-Type": "application/json",
1228
+ ...options.headers
1229
+ }
1230
+ });
1231
+ var deleteVirtualCurrency = (options) => (options.client ?? client).delete({
1232
+ security: [{ scheme: "bearer", type: "http" }],
1233
+ url: "/projects/{project_id}/virtual_currencies/{virtual_currency_code}",
1234
+ ...options
1235
+ });
1236
+ var getVirtualCurrency = (options) => (options.client ?? client).get({
1237
+ security: [{ scheme: "bearer", type: "http" }],
1238
+ url: "/projects/{project_id}/virtual_currencies/{virtual_currency_code}",
1239
+ ...options
1240
+ });
1241
+ var updateVirtualCurrency = (options) => (options.client ?? client).post({
1242
+ security: [{ scheme: "bearer", type: "http" }],
1243
+ url: "/projects/{project_id}/virtual_currencies/{virtual_currency_code}",
1244
+ ...options,
1245
+ headers: {
1246
+ "Content-Type": "application/json",
1247
+ ...options.headers
1248
+ }
1249
+ });
1250
+ var archiveVirtualCurrency = (options) => (options.client ?? client).post({
1251
+ security: [{ scheme: "bearer", type: "http" }],
1252
+ url: "/projects/{project_id}/virtual_currencies/{virtual_currency_code}/actions/archive",
1253
+ ...options
1254
+ });
1255
+ var unarchiveVirtualCurrency = (options) => (options.client ?? client).post({
1256
+ security: [{ scheme: "bearer", type: "http" }],
1257
+ url: "/projects/{project_id}/virtual_currencies/{virtual_currency_code}/actions/unarchive",
1258
+ ...options
1259
+ });
1260
+ var deleteEntitlement = (options) => (options.client ?? client).delete({
1261
+ security: [{ scheme: "bearer", type: "http" }],
1262
+ url: "/projects/{project_id}/entitlements/{entitlement_id}",
1263
+ ...options
1264
+ });
1265
+ var getEntitlement = (options) => (options.client ?? client).get({
1266
+ security: [{ scheme: "bearer", type: "http" }],
1267
+ url: "/projects/{project_id}/entitlements/{entitlement_id}",
1268
+ ...options
1269
+ });
1270
+ var updateEntitlement = (options) => (options.client ?? client).post({
1271
+ security: [{ scheme: "bearer", type: "http" }],
1272
+ url: "/projects/{project_id}/entitlements/{entitlement_id}",
1273
+ ...options,
1274
+ headers: {
1275
+ "Content-Type": "application/json",
1276
+ ...options.headers
1277
+ }
1278
+ });
1279
+ var listEntitlements = (options) => (options.client ?? client).get({
1280
+ security: [{ scheme: "bearer", type: "http" }],
1281
+ url: "/projects/{project_id}/entitlements",
1282
+ ...options
1283
+ });
1284
+ var createEntitlement = (options) => (options.client ?? client).post({
1285
+ security: [{ scheme: "bearer", type: "http" }],
1286
+ url: "/projects/{project_id}/entitlements",
1287
+ ...options,
1288
+ headers: {
1289
+ "Content-Type": "application/json",
1290
+ ...options.headers
1291
+ }
1292
+ });
1293
+ var getProductsFromEntitlement = (options) => (options.client ?? client).get({
1294
+ security: [{ scheme: "bearer", type: "http" }],
1295
+ url: "/projects/{project_id}/entitlements/{entitlement_id}/products",
1296
+ ...options
1297
+ });
1298
+ var archiveEntitlement = (options) => (options.client ?? client).post({
1299
+ security: [{ scheme: "bearer", type: "http" }],
1300
+ url: "/projects/{project_id}/entitlements/{entitlement_id}/actions/archive",
1301
+ ...options
1302
+ });
1303
+ var unarchiveEntitlement = (options) => (options.client ?? client).post({
1304
+ security: [{ scheme: "bearer", type: "http" }],
1305
+ url: "/projects/{project_id}/entitlements/{entitlement_id}/actions/unarchive",
1306
+ ...options
1307
+ });
1308
+ var attachProductsToEntitlement = (options) => (options.client ?? client).post({
1309
+ security: [{ scheme: "bearer", type: "http" }],
1310
+ url: "/projects/{project_id}/entitlements/{entitlement_id}/actions/attach_products",
1311
+ ...options,
1312
+ headers: {
1313
+ "Content-Type": "application/json",
1314
+ ...options.headers
1315
+ }
1316
+ });
1317
+ var detachProductsFromEntitlement = (options) => (options.client ?? client).post({
1318
+ security: [{ scheme: "bearer", type: "http" }],
1319
+ url: "/projects/{project_id}/entitlements/{entitlement_id}/actions/detach_products",
1320
+ ...options,
1321
+ headers: {
1322
+ "Content-Type": "application/json",
1323
+ ...options.headers
1324
+ }
1325
+ });
1326
+ var deleteOffering = (options) => (options.client ?? client).delete({
1327
+ security: [{ scheme: "bearer", type: "http" }],
1328
+ url: "/projects/{project_id}/offerings/{offering_id}",
1329
+ ...options
1330
+ });
1331
+ var getOffering = (options) => (options.client ?? client).get({
1332
+ security: [{ scheme: "bearer", type: "http" }],
1333
+ url: "/projects/{project_id}/offerings/{offering_id}",
1334
+ ...options
1335
+ });
1336
+ var updateOffering = (options) => (options.client ?? client).post({
1337
+ security: [{ scheme: "bearer", type: "http" }],
1338
+ url: "/projects/{project_id}/offerings/{offering_id}",
1339
+ ...options,
1340
+ headers: {
1341
+ "Content-Type": "application/json",
1342
+ ...options.headers
1343
+ }
1344
+ });
1345
+ var archiveOffering = (options) => (options.client ?? client).post({
1346
+ security: [{ scheme: "bearer", type: "http" }],
1347
+ url: "/projects/{project_id}/offerings/{offering_id}/actions/archive",
1348
+ ...options
1349
+ });
1350
+ var unarchiveOffering = (options) => (options.client ?? client).post({
1351
+ security: [{ scheme: "bearer", type: "http" }],
1352
+ url: "/projects/{project_id}/offerings/{offering_id}/actions/unarchive",
1353
+ ...options,
1354
+ headers: {
1355
+ "Content-Type": "application/json",
1356
+ ...options.headers
1357
+ }
1358
+ });
1359
+ var listOfferings = (options) => (options.client ?? client).get({
1360
+ security: [{ scheme: "bearer", type: "http" }],
1361
+ url: "/projects/{project_id}/offerings",
1362
+ ...options
1363
+ });
1364
+ var createOffering = (options) => (options.client ?? client).post({
1365
+ security: [{ scheme: "bearer", type: "http" }],
1366
+ url: "/projects/{project_id}/offerings",
1367
+ ...options,
1368
+ headers: {
1369
+ "Content-Type": "application/json",
1370
+ ...options.headers
1371
+ }
1372
+ });
1373
+ var deletePackageFromOffering = (options) => (options.client ?? client).delete({
1374
+ security: [{ scheme: "bearer", type: "http" }],
1375
+ url: "/projects/{project_id}/packages/{package_id}",
1376
+ ...options
1377
+ });
1378
+ var getPackage = (options) => (options.client ?? client).get({
1379
+ security: [{ scheme: "bearer", type: "http" }],
1380
+ url: "/projects/{project_id}/packages/{package_id}",
1381
+ ...options
1382
+ });
1383
+ var updatePackage = (options) => (options.client ?? client).post({
1384
+ security: [{ scheme: "bearer", type: "http" }],
1385
+ url: "/projects/{project_id}/packages/{package_id}",
1386
+ ...options,
1387
+ headers: {
1388
+ "Content-Type": "application/json",
1389
+ ...options.headers
1390
+ }
1391
+ });
1392
+ var listPackages = (options) => (options.client ?? client).get({
1393
+ security: [{ scheme: "bearer", type: "http" }],
1394
+ url: "/projects/{project_id}/offerings/{offering_id}/packages",
1395
+ ...options
1396
+ });
1397
+ var createPackages = (options) => (options.client ?? client).post({
1398
+ security: [{ scheme: "bearer", type: "http" }],
1399
+ url: "/projects/{project_id}/offerings/{offering_id}/packages",
1400
+ ...options,
1401
+ headers: {
1402
+ "Content-Type": "application/json",
1403
+ ...options.headers
1404
+ }
1405
+ });
1406
+ var getProductsFromPackage = (options) => (options.client ?? client).get({
1407
+ security: [{ scheme: "bearer", type: "http" }],
1408
+ url: "/projects/{project_id}/packages/{package_id}/products",
1409
+ ...options
1410
+ });
1411
+ var attachProductsToPackage = (options) => (options.client ?? client).post({
1412
+ security: [{ scheme: "bearer", type: "http" }],
1413
+ url: "/projects/{project_id}/packages/{package_id}/actions/attach_products",
1414
+ ...options,
1415
+ headers: {
1416
+ "Content-Type": "application/json",
1417
+ ...options.headers
1418
+ }
1419
+ });
1420
+ var detachProductsFromPackage = (options) => (options.client ?? client).post({
1421
+ security: [{ scheme: "bearer", type: "http" }],
1422
+ url: "/projects/{project_id}/packages/{package_id}/actions/detach_products",
1423
+ ...options,
1424
+ headers: {
1425
+ "Content-Type": "application/json",
1426
+ ...options.headers
1427
+ }
1428
+ });
1429
+ var getSubscription = (options) => (options.client ?? client).get({
1430
+ security: [{ scheme: "bearer", type: "http" }],
1431
+ url: "/projects/{project_id}/subscriptions/{subscription_id}",
1432
+ ...options
1433
+ });
1434
+ var getPlayStoreOrAppStoreSubscriptionTransactions = (options) => (options.client ?? client).get({
1435
+ security: [{ scheme: "bearer", type: "http" }],
1436
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/transactions",
1437
+ ...options
1438
+ });
1439
+ var refundPlayStoreSubscriptionTransaction = (options) => (options.client ?? client).post({
1440
+ security: [{ scheme: "bearer", type: "http" }],
1441
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/transactions/{transaction_id}/actions/refund",
1442
+ ...options
1443
+ });
1444
+ var listSubscriptionEntitlements = (options) => (options.client ?? client).get({
1445
+ security: [{ scheme: "bearer", type: "http" }],
1446
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/entitlements",
1447
+ ...options
1448
+ });
1449
+ var cancelSubscription = (options) => (options.client ?? client).post({
1450
+ security: [{ scheme: "bearer", type: "http" }],
1451
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/actions/cancel",
1452
+ ...options
1453
+ });
1454
+ var refundSubscription = (options) => (options.client ?? client).post({
1455
+ security: [{ scheme: "bearer", type: "http" }],
1456
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/actions/refund",
1457
+ ...options
1458
+ });
1459
+ var getAuthorizedSubscriptionManagementUrl = (options) => (options.client ?? client).get({
1460
+ security: [{ scheme: "bearer", type: "http" }],
1461
+ url: "/projects/{project_id}/subscriptions/{subscription_id}/authenticated_management_url",
1462
+ ...options
1463
+ });
1464
+ var listSubscriptions = (options) => (options.client ?? client).get({
1465
+ security: [{ scheme: "bearer", type: "http" }],
1466
+ url: "/projects/{project_id}/customers/{customer_id}/subscriptions",
1467
+ ...options
1468
+ });
1469
+ var getPurchase = (options) => (options.client ?? client).get({
1470
+ security: [{ scheme: "bearer", type: "http" }],
1471
+ url: "/projects/{project_id}/purchases/{purchase_id}",
1472
+ ...options
1473
+ });
1474
+ var listPurchaseEntitlements = (options) => (options.client ?? client).get({
1475
+ security: [{ scheme: "bearer", type: "http" }],
1476
+ url: "/projects/{project_id}/purchases/{purchase_id}/entitlements",
1477
+ ...options
1478
+ });
1479
+ var refundPurchase = (options) => (options.client ?? client).post({
1480
+ security: [{ scheme: "bearer", type: "http" }],
1481
+ url: "/projects/{project_id}/purchases/{purchase_id}/actions/refund",
1482
+ ...options
1483
+ });
1484
+ var listPurchases = (options) => (options.client ?? client).get({
1485
+ security: [{ scheme: "bearer", type: "http" }],
1486
+ url: "/projects/{project_id}/customers/{customer_id}/purchases",
1487
+ ...options
1488
+ });
1489
+ var listCustomerActiveEntitlements = (options) => (options.client ?? client).get({
1490
+ security: [{ scheme: "bearer", type: "http" }],
1491
+ url: "/projects/{project_id}/customers/{customer_id}/active_entitlements",
1492
+ ...options
1493
+ });
1494
+ var listCustomerAliases = (options) => (options.client ?? client).get({
1495
+ security: [{ scheme: "bearer", type: "http" }],
1496
+ url: "/projects/{project_id}/customers/{customer_id}/aliases",
1497
+ ...options
1498
+ });
1499
+ var listVirtualCurrenciesBalances = (options) => (options.client ?? client).get({
1500
+ security: [{ scheme: "bearer", type: "http" }],
1501
+ url: "/projects/{project_id}/customers/{customer_id}/virtual_currencies",
1502
+ ...options
1503
+ });
1504
+ var createVirtualCurrenciesTransaction = (options) => (options.client ?? client).post({
1505
+ security: [{ scheme: "bearer", type: "http" }],
1506
+ url: "/projects/{project_id}/customers/{customer_id}/virtual_currencies/transactions",
1507
+ ...options,
1508
+ headers: {
1509
+ "Content-Type": "application/json",
1510
+ ...options.headers
1511
+ }
1512
+ });
1513
+ var updateVirtualCurrenciesBalance = (options) => (options.client ?? client).post({
1514
+ security: [{ scheme: "bearer", type: "http" }],
1515
+ url: "/projects/{project_id}/customers/{customer_id}/virtual_currencies/update_balance",
1516
+ ...options,
1517
+ headers: {
1518
+ "Content-Type": "application/json",
1519
+ ...options.headers
1520
+ }
1521
+ });
1522
+ var listCustomerAttributes = (options) => (options.client ?? client).get({
1523
+ security: [{ scheme: "bearer", type: "http" }],
1524
+ url: "/projects/{project_id}/customers/{customer_id}/attributes",
1525
+ ...options
1526
+ });
1527
+ var setCustomerAttributes = (options) => (options.client ?? client).post({
1528
+ security: [{ scheme: "bearer", type: "http" }],
1529
+ url: "/projects/{project_id}/customers/{customer_id}/attributes",
1530
+ ...options,
1531
+ headers: {
1532
+ "Content-Type": "application/json",
1533
+ ...options.headers
1534
+ }
1535
+ });
1536
+ var listCustomerInvoices = (options) => (options.client ?? client).get({
1537
+ security: [{ scheme: "bearer", type: "http" }],
1538
+ url: "/projects/{project_id}/customers/{customer_id}/invoices",
1539
+ ...options
1540
+ });
1541
+ var getInvoice = (options) => (options.client ?? client).get({
1542
+ security: [{ scheme: "bearer", type: "http" }],
1543
+ url: "/projects/{project_id}/customers/{customer_id}/invoices/{invoice_id}/file",
1544
+ ...options
1545
+ });
1546
+ var getOverviewMetrics = (options) => (options.client ?? client).get({
1547
+ responseTransformer: getOverviewMetricsResponseTransformer,
1548
+ security: [{ scheme: "bearer", type: "http" }],
1549
+ url: "/projects/{project_id}/metrics/overview",
1550
+ ...options
1551
+ });
1552
+ var getChartData = (options) => (options.client ?? client).get({
1553
+ querySerializer: { parameters: { aggregate: { array: { explode: false } } } },
1554
+ security: [{ scheme: "bearer", type: "http" }],
1555
+ url: "/projects/{project_id}/charts/{chart_name}",
1556
+ ...options
1557
+ });
1558
+ var getChartOptions = (options) => (options.client ?? client).get({
1559
+ security: [{ scheme: "bearer", type: "http" }],
1560
+ url: "/projects/{project_id}/charts/{chart_name}/options",
1561
+ ...options
1562
+ });
1563
+ var searchSubscriptions = (options) => (options.client ?? client).get({
1564
+ security: [{ scheme: "bearer", type: "http" }],
1565
+ url: "/projects/{project_id}/subscriptions",
1566
+ ...options
1567
+ });
1568
+ var searchPurchases = (options) => (options.client ?? client).get({
1569
+ security: [{ scheme: "bearer", type: "http" }],
1570
+ url: "/projects/{project_id}/purchases",
1571
+ ...options
1572
+ });
1573
+ var getProductStoreState = (options) => (options.client ?? client).get({
1574
+ security: [{ scheme: "bearer", type: "http" }],
1575
+ url: "/projects/{project_id}/products/{product_id}/store_state",
1576
+ ...options
1577
+ });
1578
+ var setProductStoreState = (options) => (options.client ?? client).post({
1579
+ security: [{ scheme: "bearer", type: "http" }],
1580
+ url: "/projects/{project_id}/products/{product_id}/store_state",
1581
+ ...options,
1582
+ headers: {
1583
+ "Content-Type": "application/json",
1584
+ ...options.headers
1585
+ }
1586
+ });
1587
+ var getProductStoreStateOperation = (options) => (options.client ?? client).get({
1588
+ security: [{ scheme: "bearer", type: "http" }],
1589
+ url: "/projects/{project_id}/products/{product_id}/store_state/{operation_id}",
1590
+ ...options
1591
+ });
1592
+ var uploadProductStoreStateScreenshot = (options) => (options.client ?? client).post({
1593
+ security: [{ scheme: "bearer", type: "http" }],
1594
+ url: "/projects/{project_id}/products/{product_id}/store_state/screenshot_upload",
1595
+ ...options,
1596
+ headers: {
1597
+ "Content-Type": "application/json",
1598
+ ...options.headers
1599
+ }
1600
+ });
1601
+
1602
+ // revenuecat-sdk/types.gen.ts
1603
+ var Country = {
1604
+ NULL: null,
1605
+ AF: "AF",
1606
+ AL: "AL",
1607
+ DZ: "DZ",
1608
+ AS: "AS",
1609
+ AD: "AD",
1610
+ AO: "AO",
1611
+ AI: "AI",
1612
+ AQ: "AQ",
1613
+ AG: "AG",
1614
+ AR: "AR",
1615
+ AM: "AM",
1616
+ AW: "AW",
1617
+ AU: "AU",
1618
+ AT: "AT",
1619
+ AZ: "AZ",
1620
+ BS: "BS",
1621
+ BH: "BH",
1622
+ BD: "BD",
1623
+ BB: "BB",
1624
+ BY: "BY",
1625
+ BE: "BE",
1626
+ BZ: "BZ",
1627
+ BJ: "BJ",
1628
+ BM: "BM",
1629
+ BT: "BT",
1630
+ BO: "BO",
1631
+ BQ: "BQ",
1632
+ BA: "BA",
1633
+ BW: "BW",
1634
+ BV: "BV",
1635
+ BR: "BR",
1636
+ IO: "IO",
1637
+ BN: "BN",
1638
+ BG: "BG",
1639
+ BF: "BF",
1640
+ BI: "BI",
1641
+ CV: "CV",
1642
+ KH: "KH",
1643
+ CM: "CM",
1644
+ CA: "CA",
1645
+ KY: "KY",
1646
+ CF: "CF",
1647
+ TD: "TD",
1648
+ CL: "CL",
1649
+ CN: "CN",
1650
+ CX: "CX",
1651
+ CC: "CC",
1652
+ CO: "CO",
1653
+ KM: "KM",
1654
+ CD: "CD",
1655
+ CG: "CG",
1656
+ CK: "CK",
1657
+ CR: "CR",
1658
+ HR: "HR",
1659
+ CU: "CU",
1660
+ CW: "CW",
1661
+ CY: "CY",
1662
+ CZ: "CZ",
1663
+ CI: "CI",
1664
+ DK: "DK",
1665
+ DJ: "DJ",
1666
+ DM: "DM",
1667
+ DO: "DO",
1668
+ EC: "EC",
1669
+ EG: "EG",
1670
+ SV: "SV",
1671
+ GQ: "GQ",
1672
+ ER: "ER",
1673
+ EE: "EE",
1674
+ SZ: "SZ",
1675
+ ET: "ET",
1676
+ FK: "FK",
1677
+ FO: "FO",
1678
+ FJ: "FJ",
1679
+ FI: "FI",
1680
+ FR: "FR",
1681
+ GF: "GF",
1682
+ PF: "PF",
1683
+ TF: "TF",
1684
+ GA: "GA",
1685
+ GM: "GM",
1686
+ GE: "GE",
1687
+ DE: "DE",
1688
+ GH: "GH",
1689
+ GI: "GI",
1690
+ GR: "GR",
1691
+ GL: "GL",
1692
+ GD: "GD",
1693
+ GP: "GP",
1694
+ GU: "GU",
1695
+ GT: "GT",
1696
+ GG: "GG",
1697
+ GN: "GN",
1698
+ GW: "GW",
1699
+ GY: "GY",
1700
+ HT: "HT",
1701
+ HM: "HM",
1702
+ VA: "VA",
1703
+ HN: "HN",
1704
+ HK: "HK",
1705
+ HU: "HU",
1706
+ IS: "IS",
1707
+ IN: "IN",
1708
+ ID: "ID",
1709
+ IR: "IR",
1710
+ IQ: "IQ",
1711
+ IE: "IE",
1712
+ IM: "IM",
1713
+ IL: "IL",
1714
+ IT: "IT",
1715
+ JM: "JM",
1716
+ JP: "JP",
1717
+ JE: "JE",
1718
+ JO: "JO",
1719
+ KZ: "KZ",
1720
+ KE: "KE",
1721
+ KI: "KI",
1722
+ KP: "KP",
1723
+ KR: "KR",
1724
+ KW: "KW",
1725
+ KG: "KG",
1726
+ LA: "LA",
1727
+ LV: "LV",
1728
+ LB: "LB",
1729
+ LS: "LS",
1730
+ LR: "LR",
1731
+ LY: "LY",
1732
+ LI: "LI",
1733
+ LT: "LT",
1734
+ LU: "LU",
1735
+ MO: "MO",
1736
+ MG: "MG",
1737
+ MW: "MW",
1738
+ MY: "MY",
1739
+ MV: "MV",
1740
+ ML: "ML",
1741
+ MT: "MT",
1742
+ MH: "MH",
1743
+ MQ: "MQ",
1744
+ MR: "MR",
1745
+ MU: "MU",
1746
+ YT: "YT",
1747
+ MX: "MX",
1748
+ FM: "FM",
1749
+ MD: "MD",
1750
+ MC: "MC",
1751
+ MN: "MN",
1752
+ ME: "ME",
1753
+ MS: "MS",
1754
+ MA: "MA",
1755
+ MZ: "MZ",
1756
+ MM: "MM",
1757
+ NA: "NA",
1758
+ NR: "NR",
1759
+ NP: "NP",
1760
+ NL: "NL",
1761
+ NC: "NC",
1762
+ NZ: "NZ",
1763
+ NI: "NI",
1764
+ NE: "NE",
1765
+ NG: "NG",
1766
+ NU: "NU",
1767
+ NF: "NF",
1768
+ MP: "MP",
1769
+ NO: "NO",
1770
+ OM: "OM",
1771
+ PK: "PK",
1772
+ PW: "PW",
1773
+ PS: "PS",
1774
+ PA: "PA",
1775
+ PG: "PG",
1776
+ PY: "PY",
1777
+ PE: "PE",
1778
+ PH: "PH",
1779
+ PN: "PN",
1780
+ PL: "PL",
1781
+ PT: "PT",
1782
+ PR: "PR",
1783
+ QA: "QA",
1784
+ MK: "MK",
1785
+ RO: "RO",
1786
+ RU: "RU",
1787
+ RW: "RW",
1788
+ RE: "RE",
1789
+ BL: "BL",
1790
+ SH: "SH",
1791
+ KN: "KN",
1792
+ LC: "LC",
1793
+ MF: "MF",
1794
+ PM: "PM",
1795
+ VC: "VC",
1796
+ WS: "WS",
1797
+ SM: "SM",
1798
+ ST: "ST",
1799
+ SA: "SA",
1800
+ SN: "SN",
1801
+ RS: "RS",
1802
+ SC: "SC",
1803
+ SL: "SL",
1804
+ SG: "SG",
1805
+ SX: "SX",
1806
+ SK: "SK",
1807
+ SI: "SI",
1808
+ SB: "SB",
1809
+ SO: "SO",
1810
+ ZA: "ZA",
1811
+ GS: "GS",
1812
+ SS: "SS",
1813
+ ES: "ES",
1814
+ LK: "LK",
1815
+ SD: "SD",
1816
+ SR: "SR",
1817
+ SJ: "SJ",
1818
+ SE: "SE",
1819
+ CH: "CH",
1820
+ SY: "SY",
1821
+ TW: "TW",
1822
+ TJ: "TJ",
1823
+ TZ: "TZ",
1824
+ TH: "TH",
1825
+ TL: "TL",
1826
+ TG: "TG",
1827
+ TK: "TK",
1828
+ TO: "TO",
1829
+ TT: "TT",
1830
+ TN: "TN",
1831
+ TR: "TR",
1832
+ TM: "TM",
1833
+ TC: "TC",
1834
+ TV: "TV",
1835
+ UG: "UG",
1836
+ UA: "UA",
1837
+ AE: "AE",
1838
+ GB: "GB",
1839
+ UM: "UM",
1840
+ US: "US",
1841
+ UY: "UY",
1842
+ UZ: "UZ",
1843
+ VU: "VU",
1844
+ VE: "VE",
1845
+ VN: "VN",
1846
+ VG: "VG",
1847
+ VI: "VI",
1848
+ WF: "WF",
1849
+ EH: "EH",
1850
+ YE: "YE",
1851
+ ZM: "ZM",
1852
+ ZW: "ZW",
1853
+ AX: "AX"
1854
+ };
1855
+ var Currency = {
1856
+ AED: "AED",
1857
+ AFN: "AFN",
1858
+ ALL: "ALL",
1859
+ AMD: "AMD",
1860
+ ANG: "ANG",
1861
+ AOA: "AOA",
1862
+ ARS: "ARS",
1863
+ AUD: "AUD",
1864
+ AWG: "AWG",
1865
+ AZN: "AZN",
1866
+ BAM: "BAM",
1867
+ BBD: "BBD",
1868
+ BDT: "BDT",
1869
+ BGN: "BGN",
1870
+ BHD: "BHD",
1871
+ BIF: "BIF",
1872
+ BMD: "BMD",
1873
+ BND: "BND",
1874
+ BOB: "BOB",
1875
+ BRL: "BRL",
1876
+ BSD: "BSD",
1877
+ BTC: "BTC",
1878
+ BTN: "BTN",
1879
+ BWP: "BWP",
1880
+ BYN: "BYN",
1881
+ BZD: "BZD",
1882
+ CAD: "CAD",
1883
+ CDF: "CDF",
1884
+ CHF: "CHF",
1885
+ CLF: "CLF",
1886
+ CLP: "CLP",
1887
+ CNH: "CNH",
1888
+ CNY: "CNY",
1889
+ COP: "COP",
1890
+ CRC: "CRC",
1891
+ CUC: "CUC",
1892
+ CUP: "CUP",
1893
+ CVE: "CVE",
1894
+ CZK: "CZK",
1895
+ DJF: "DJF",
1896
+ DKK: "DKK",
1897
+ DOP: "DOP",
1898
+ DZD: "DZD",
1899
+ EGP: "EGP",
1900
+ ERN: "ERN",
1901
+ ETB: "ETB",
1902
+ EUR: "EUR",
1903
+ FJD: "FJD",
1904
+ FKP: "FKP",
1905
+ GBP: "GBP",
1906
+ GEL: "GEL",
1907
+ GGP: "GGP",
1908
+ GHS: "GHS",
1909
+ GIP: "GIP",
1910
+ GMD: "GMD",
1911
+ GNF: "GNF",
1912
+ GTQ: "GTQ",
1913
+ GYD: "GYD",
1914
+ HKD: "HKD",
1915
+ HNL: "HNL",
1916
+ HRK: "HRK",
1917
+ HTG: "HTG",
1918
+ HUF: "HUF",
1919
+ IDR: "IDR",
1920
+ ILS: "ILS",
1921
+ IMP: "IMP",
1922
+ INR: "INR",
1923
+ IQD: "IQD",
1924
+ IRR: "IRR",
1925
+ ISK: "ISK",
1926
+ JEP: "JEP",
1927
+ JMD: "JMD",
1928
+ JOD: "JOD",
1929
+ JPY: "JPY",
1930
+ KES: "KES",
1931
+ KGS: "KGS",
1932
+ KHR: "KHR",
1933
+ KMF: "KMF",
1934
+ KPW: "KPW",
1935
+ KRW: "KRW",
1936
+ KWD: "KWD",
1937
+ KYD: "KYD",
1938
+ KZT: "KZT",
1939
+ LAK: "LAK",
1940
+ LBP: "LBP",
1941
+ LKR: "LKR",
1942
+ LRD: "LRD",
1943
+ LSL: "LSL",
1944
+ LYD: "LYD",
1945
+ MAD: "MAD",
1946
+ MDL: "MDL",
1947
+ MGA: "MGA",
1948
+ MKD: "MKD",
1949
+ MMK: "MMK",
1950
+ MNT: "MNT",
1951
+ MOP: "MOP",
1952
+ MRU: "MRU",
1953
+ MUR: "MUR",
1954
+ MVR: "MVR",
1955
+ MWK: "MWK",
1956
+ MXN: "MXN",
1957
+ MYR: "MYR",
1958
+ MZN: "MZN",
1959
+ NAD: "NAD",
1960
+ NGN: "NGN",
1961
+ NIO: "NIO",
1962
+ NOK: "NOK",
1963
+ NPR: "NPR",
1964
+ NZD: "NZD",
1965
+ OMR: "OMR",
1966
+ PAB: "PAB",
1967
+ PEN: "PEN",
1968
+ PGK: "PGK",
1969
+ PHP: "PHP",
1970
+ PKR: "PKR",
1971
+ PLN: "PLN",
1972
+ PYG: "PYG",
1973
+ QAR: "QAR",
1974
+ RON: "RON",
1975
+ RSD: "RSD",
1976
+ RUB: "RUB",
1977
+ RWF: "RWF",
1978
+ SAR: "SAR",
1979
+ SBD: "SBD",
1980
+ SCR: "SCR",
1981
+ SDG: "SDG",
1982
+ SEK: "SEK",
1983
+ SGD: "SGD",
1984
+ SHP: "SHP",
1985
+ SLL: "SLL",
1986
+ SOS: "SOS",
1987
+ SRD: "SRD",
1988
+ SSP: "SSP",
1989
+ STD: "STD",
1990
+ STN: "STN",
1991
+ SVC: "SVC",
1992
+ SYP: "SYP",
1993
+ SZL: "SZL",
1994
+ THB: "THB",
1995
+ TJS: "TJS",
1996
+ TMT: "TMT",
1997
+ TND: "TND",
1998
+ TOP: "TOP",
1999
+ TRY: "TRY",
2000
+ TTD: "TTD",
2001
+ TWD: "TWD",
2002
+ TZS: "TZS",
2003
+ UAH: "UAH",
2004
+ UGX: "UGX",
2005
+ USD: "USD",
2006
+ UYU: "UYU",
2007
+ UZS: "UZS",
2008
+ VEF: "VEF",
2009
+ VES: "VES",
2010
+ VND: "VND",
2011
+ VUV: "VUV",
2012
+ WST: "WST",
2013
+ XAF: "XAF",
2014
+ XAG: "XAG",
2015
+ XAU: "XAU",
2016
+ XCD: "XCD",
2017
+ XDR: "XDR",
2018
+ XOF: "XOF",
2019
+ XPD: "XPD",
2020
+ XPF: "XPF",
2021
+ XPT: "XPT",
2022
+ YER: "YER",
2023
+ ZAR: "ZAR",
2024
+ ZMW: "ZMW",
2025
+ ZWL: "ZWL"
2026
+ };
2027
+ var CustomerAttributeReservedName = {
2028
+ $AD: "$ad",
2029
+ $AD_GROUP: "$adGroup",
2030
+ $ADJUST_ID: "$adjustId",
2031
+ $AIRBRIDGE_DEVICE_ID: "$airbridgeDeviceId",
2032
+ $AIRSHIP_CHANNEL_ID: "$airshipChannelId",
2033
+ $AMAZON_AD_ID: "$amazonAdId",
2034
+ $AMPLITUDE_DEVICE_ID: "$amplitudeDeviceId",
2035
+ $AMPLITUDE_USER_ID: "$amplitudeUserId",
2036
+ $APPLE_REFUND_HANDLING_PREFERENCE: "$appleRefundHandlingPreference",
2037
+ $APPLE_ADS_AD_GROUP_ID: "$appleAdsAdGroupId",
2038
+ $APPLE_ADS_CAMPAIGN_ID: "$appleAdsCampaignId",
2039
+ $APPLE_ADS_KEYWORD_ID: "$appleAdsKeywordId",
2040
+ $APNS_TOKENS: "$apnsTokens",
2041
+ $APPSFLYER_ID: "$appsflyerId",
2042
+ $APPSFLYER_SHARING_FILTER: "$appsflyerSharingFilter",
2043
+ $ATT_CONSENT_STATUS: "$attConsentStatus",
2044
+ $BRANCH_ID: "$branchId",
2045
+ $BRAZE_ALIAS_LABEL: "$brazeAliasLabel",
2046
+ $BRAZE_ALIAS_NAME: "$brazeAliasName",
2047
+ $CAMPAIGN: "$campaign",
2048
+ $CLEVERTAP_ID: "$clevertapId",
2049
+ $CREATIVE: "$creative",
2050
+ $CUSTOMERIO_ID: "$customerioId",
2051
+ $DISPLAY_NAME: "$displayName",
2052
+ $EMAIL: "$email",
2053
+ $FB_ANON_ID: "$fbAnonId",
2054
+ $FCM_TOKENS: "$fcmTokens",
2055
+ $FIREBASE_APP_INSTANCE_ID: "$firebaseAppInstanceId",
2056
+ $GPS_AD_ID: "$gpsAdId",
2057
+ $IDFA: "$idfa",
2058
+ $IDFV: "$idfv",
2059
+ $IP: "$ip",
2060
+ $ITERABLE_CAMPAIGN_ID: "$iterableCampaignId",
2061
+ $ITERABLE_TEMPLATE_ID: "$iterableTemplateId",
2062
+ $ITERABLE_USER_ID: "$iterableUserId",
2063
+ $KEYWORD: "$keyword",
2064
+ $KOCHAVA_DEVICE_ID: "$kochavaDeviceId",
2065
+ $MEDIA_SOURCE: "$mediaSource",
2066
+ $MIXPANEL_DISTINCT_ID: "$mixpanelDistinctId",
2067
+ $MPARTICLE_ID: "$mparticleId",
2068
+ $ONESIGNAL_ID: "$onesignalId",
2069
+ $ONESIGNAL_USER_ID: "$onesignalUserId",
2070
+ $PHONE_NUMBER: "$phoneNumber",
2071
+ $POSTHOG_USER_ID: "$posthogUserId",
2072
+ $TELEMETRY_DECK_USER_ID: "$telemetryDeckUserId",
2073
+ $TELEMETRY_DECK_APP_ID: "$telemetryDeckAppId",
2074
+ TELEMETRY_DECK_USER_ID: "telemetry_deck_user_id",
2075
+ TELEMETRY_DECK_APP_ID: "telemetry_deck_app_id",
2076
+ $SEGMENT_ID: "$segmentId",
2077
+ $SOLAR_ENGINE_DISTINCT_ID: "$solarEngineDistinctId",
2078
+ $SOLAR_ENGINE_ACCOUNT_ID: "$solarEngineAccountId",
2079
+ $SOLAR_ENGINE_VISITOR_ID: "$solarEngineVisitorId",
2080
+ $TENJIN_ID: "$tenjinId",
2081
+ $DEVICE_VERSION: "$deviceVersion"
2082
+ };
2083
+ var Duration = {
2084
+ P1W: "P1W",
2085
+ P1M: "P1M",
2086
+ P2M: "P2M",
2087
+ P3M: "P3M",
2088
+ P6M: "P6M",
2089
+ P1Y: "P1Y"
2090
+ };
2091
+ var EligibilityCriteria = {
2092
+ ALL: "all",
2093
+ GOOGLE_SDK_LT_6: "google_sdk_lt_6",
2094
+ GOOGLE_SDK_GE_6: "google_sdk_ge_6"
2095
+ };
2096
+ var Environment = { PRODUCTION: "production", SANDBOX: "sandbox" };
2097
+ var Ownership = { PURCHASED: "purchased", FAMILY_SHARED: "family_shared" };
2098
+ var ProductType = {
2099
+ SUBSCRIPTION: "subscription",
2100
+ ONE_TIME: "one_time",
2101
+ CONSUMABLE: "consumable",
2102
+ NON_CONSUMABLE: "non_consumable",
2103
+ NON_RENEWING_SUBSCRIPTION: "non_renewing_subscription"
2104
+ };
2105
+ var RcBillingCurrency = {
2106
+ USD: "USD",
2107
+ EUR: "EUR",
2108
+ JPY: "JPY",
2109
+ GBP: "GBP",
2110
+ AUD: "AUD",
2111
+ CAD: "CAD",
2112
+ BRL: "BRL",
2113
+ KRW: "KRW",
2114
+ CNY: "CNY",
2115
+ MXN: "MXN",
2116
+ SEK: "SEK",
2117
+ PLN: "PLN",
2118
+ MYR: "MYR",
2119
+ PHP: "PHP",
2120
+ CHF: "CHF",
2121
+ SAR: "SAR",
2122
+ TWD: "TWD",
2123
+ NOK: "NOK",
2124
+ DKK: "DKK",
2125
+ THB: "THB",
2126
+ NZD: "NZD",
2127
+ SGD: "SGD",
2128
+ HKD: "HKD",
2129
+ CZK: "CZK",
2130
+ AED: "AED",
2131
+ CLP: "CLP",
2132
+ COP: "COP",
2133
+ CRC: "CRC",
2134
+ GEL: "GEL",
2135
+ HUF: "HUF",
2136
+ IDR: "IDR",
2137
+ ILS: "ILS",
2138
+ IQD: "IQD",
2139
+ JOD: "JOD",
2140
+ KES: "KES",
2141
+ KZT: "KZT",
2142
+ MAD: "MAD",
2143
+ PEN: "PEN",
2144
+ QAR: "QAR",
2145
+ RON: "RON",
2146
+ RSD: "RSD",
2147
+ TZS: "TZS",
2148
+ VND: "VND",
2149
+ ZAR: "ZAR",
2150
+ TRY: "TRY",
2151
+ UAH: "UAH"
2152
+ };
2153
+ var WebhookEventType = {
2154
+ INITIAL_PURCHASE: "initial_purchase",
2155
+ RENEWAL: "renewal",
2156
+ PRODUCT_CHANGE: "product_change",
2157
+ CANCELLATION: "cancellation",
2158
+ BILLING_ISSUE: "billing_issue",
2159
+ NON_RENEWING_PURCHASE: "non_renewing_purchase",
2160
+ UNCANCELLATION: "uncancellation",
2161
+ TRANSFER: "transfer",
2162
+ SUBSCRIPTION_PAUSED: "subscription_paused",
2163
+ EXPIRATION: "expiration",
2164
+ SUBSCRIPTION_EXTENDED: "subscription_extended",
2165
+ INVOICE_ISSUANCE: "invoice_issuance",
2166
+ TEMPORARY_ENTITLEMENT_GRANT: "temporary_entitlement_grant",
2167
+ REFUND_REVERSED: "refund_reversed",
2168
+ VIRTUAL_CURRENCY_TRANSACTION: "virtual_currency_transaction"
2169
+ };
2170
+ // Annotate the CommonJS export names for ESM import in node:
2171
+ 0 && (module.exports = {
2172
+ Country,
2173
+ Currency,
2174
+ CustomerAttributeReservedName,
2175
+ Duration,
2176
+ EligibilityCriteria,
2177
+ Environment,
2178
+ Ownership,
2179
+ ProductType,
2180
+ RcBillingCurrency,
2181
+ WebhookEventType,
2182
+ archiveEntitlement,
2183
+ archiveOffering,
2184
+ archiveProduct,
2185
+ archiveVirtualCurrency,
2186
+ assignCustomerOffering,
2187
+ attachProductsToEntitlement,
2188
+ attachProductsToPackage,
2189
+ cancelSubscription,
2190
+ createApp,
2191
+ createCustomer,
2192
+ createEntitlement,
2193
+ createOffering,
2194
+ createPackages,
2195
+ createPaywall,
2196
+ createProduct,
2197
+ createProductInStore,
2198
+ createProject,
2199
+ createVirtualCurrenciesTransaction,
2200
+ createVirtualCurrency,
2201
+ createWebhookIntegration,
2202
+ deleteApp,
2203
+ deleteCustomer,
2204
+ deleteEntitlement,
2205
+ deleteOffering,
2206
+ deletePackageFromOffering,
2207
+ deletePaywall,
2208
+ deleteProduct,
2209
+ deleteVirtualCurrency,
2210
+ deleteWebhookIntegration,
2211
+ detachProductsFromEntitlement,
2212
+ detachProductsFromPackage,
2213
+ getApp,
2214
+ getAppStorekitConfig,
2215
+ getAuthorizedSubscriptionManagementUrl,
2216
+ getChartData,
2217
+ getChartOptions,
2218
+ getCustomer,
2219
+ getEntitlement,
2220
+ getInvoice,
2221
+ getOffering,
2222
+ getOverviewMetrics,
2223
+ getPackage,
2224
+ getPaywall,
2225
+ getPlayStoreOrAppStoreSubscriptionTransactions,
2226
+ getProduct,
2227
+ getProductStoreState,
2228
+ getProductStoreStateOperation,
2229
+ getProductsFromEntitlement,
2230
+ getProductsFromPackage,
2231
+ getPurchase,
2232
+ getSubscription,
2233
+ getVirtualCurrency,
2234
+ getWebhookIntegration,
2235
+ grantCustomerEntitlement,
2236
+ listAppPublicApiKeys,
2237
+ listApps,
2238
+ listAuditLogs,
2239
+ listCollaborators,
2240
+ listCustomerActiveEntitlements,
2241
+ listCustomerAliases,
2242
+ listCustomerAttributes,
2243
+ listCustomerInvoices,
2244
+ listCustomers,
2245
+ listEntitlements,
2246
+ listOfferings,
2247
+ listPackages,
2248
+ listPaywalls,
2249
+ listProducts,
2250
+ listProjects,
2251
+ listPurchaseEntitlements,
2252
+ listPurchases,
2253
+ listSubscriptionEntitlements,
2254
+ listSubscriptions,
2255
+ listVirtualCurrencies,
2256
+ listVirtualCurrenciesBalances,
2257
+ listWebhookIntegrations,
2258
+ refundPlayStoreSubscriptionTransaction,
2259
+ refundPurchase,
2260
+ refundSubscription,
2261
+ revokeCustomerGrantedEntitlement,
2262
+ searchPurchases,
2263
+ searchSubscriptions,
2264
+ setCustomerAttributes,
2265
+ setProductStoreState,
2266
+ transferCustomerData,
2267
+ unarchiveEntitlement,
2268
+ unarchiveOffering,
2269
+ unarchiveProduct,
2270
+ unarchiveVirtualCurrency,
2271
+ updateApp,
2272
+ updateEntitlement,
2273
+ updateOffering,
2274
+ updatePackage,
2275
+ updateProduct,
2276
+ updateVirtualCurrenciesBalance,
2277
+ updateVirtualCurrency,
2278
+ updateWebhookIntegration,
2279
+ uploadProductStoreStateScreenshot
2280
+ });