@extrahorizon/javascript-sdk 8.2.0-test

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.
Files changed (153) hide show
  1. package/CHANGELOG.md +1161 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -0
  4. package/build/index.cjs.js +1 -0
  5. package/build/index.mjs +1 -0
  6. package/build/types/btoa.d.ts +6 -0
  7. package/build/types/client.d.ts +136 -0
  8. package/build/types/constants.d.ts +15 -0
  9. package/build/types/errorHandler.d.ts +2 -0
  10. package/build/types/errors.d.ts +332 -0
  11. package/build/types/http/client.d.ts +2 -0
  12. package/build/types/http/index.d.ts +4 -0
  13. package/build/types/http/interceptors.d.ts +9 -0
  14. package/build/types/http/oAuth1Signature.d.ts +14 -0
  15. package/build/types/http/oauth1.d.ts +3 -0
  16. package/build/types/http/oauth2.d.ts +3 -0
  17. package/build/types/http/proxy.d.ts +3 -0
  18. package/build/types/http/types.d.ts +331 -0
  19. package/build/types/http/utils.d.ts +21 -0
  20. package/build/types/index.d.ts +9 -0
  21. package/build/types/mock.d.ts +43 -0
  22. package/build/types/mockType.d.ts +1511 -0
  23. package/build/types/parseStoredCredentials.d.ts +11 -0
  24. package/build/types/rql/index.d.ts +16 -0
  25. package/build/types/rql/parser.d.ts +1 -0
  26. package/build/types/rql/types.d.ts +168 -0
  27. package/build/types/services/auth/applications/index.d.ts +5 -0
  28. package/build/types/services/auth/applications/types.d.ts +190 -0
  29. package/build/types/services/auth/index.d.ts +3 -0
  30. package/build/types/services/auth/oauth1/index.d.ts +5 -0
  31. package/build/types/services/auth/oauth1/types.d.ts +63 -0
  32. package/build/types/services/auth/oauth2/index.d.ts +5 -0
  33. package/build/types/services/auth/oauth2/types.d.ts +52 -0
  34. package/build/types/services/auth/oidc/index.d.ts +5 -0
  35. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  36. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  37. package/build/types/services/auth/oidc/providers/index.d.ts +5 -0
  38. package/build/types/services/auth/oidc/providers/types.d.ts +144 -0
  39. package/build/types/services/auth/oidc/types.d.ts +40 -0
  40. package/build/types/services/auth/types.d.ts +39 -0
  41. package/build/types/services/auth/users/index.d.ts +5 -0
  42. package/build/types/services/auth/users/types.d.ts +121 -0
  43. package/build/types/services/configurations/general.d.ts +5 -0
  44. package/build/types/services/configurations/groups.d.ts +5 -0
  45. package/build/types/services/configurations/index.d.ts +10 -0
  46. package/build/types/services/configurations/patients.d.ts +5 -0
  47. package/build/types/services/configurations/staff.d.ts +5 -0
  48. package/build/types/services/configurations/types.d.ts +222 -0
  49. package/build/types/services/configurations/users.d.ts +5 -0
  50. package/build/types/services/data/comments.d.ts +5 -0
  51. package/build/types/services/data/documents.d.ts +5 -0
  52. package/build/types/services/data/index.d.ts +13 -0
  53. package/build/types/services/data/indexes.d.ts +5 -0
  54. package/build/types/services/data/infrastructure.d.ts +10 -0
  55. package/build/types/services/data/json-schema.d.ts +121 -0
  56. package/build/types/services/data/properties.d.ts +5 -0
  57. package/build/types/services/data/schemas.d.ts +5 -0
  58. package/build/types/services/data/statuses.d.ts +5 -0
  59. package/build/types/services/data/transitions.d.ts +5 -0
  60. package/build/types/services/data/types.d.ts +899 -0
  61. package/build/types/services/dispatchers/actions/index.d.ts +5 -0
  62. package/build/types/services/dispatchers/actions/types.d.ts +78 -0
  63. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -0
  64. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -0
  65. package/build/types/services/dispatchers/index.d.ts +7 -0
  66. package/build/types/services/dispatchers/types.d.ts +2 -0
  67. package/build/types/services/events/events.d.ts +5 -0
  68. package/build/types/services/events/health.d.ts +9 -0
  69. package/build/types/services/events/index.d.ts +6 -0
  70. package/build/types/services/events/subscriptions.d.ts +5 -0
  71. package/build/types/services/events/types.d.ts +90 -0
  72. package/build/types/services/files/files.d.ts +5 -0
  73. package/build/types/services/files/formHelpers.d.ts +3 -0
  74. package/build/types/services/files/index.d.ts +6 -0
  75. package/build/types/services/files/settings/index.d.ts +5 -0
  76. package/build/types/services/files/settings/types.d.ts +38 -0
  77. package/build/types/services/files/tokens.d.ts +5 -0
  78. package/build/types/services/files/types.d.ts +185 -0
  79. package/build/types/services/helpers.d.ts +7 -0
  80. package/build/types/services/http-client.d.ts +22 -0
  81. package/build/types/services/index.d.ts +15 -0
  82. package/build/types/services/localizations/countries.d.ts +5 -0
  83. package/build/types/services/localizations/health.d.ts +9 -0
  84. package/build/types/services/localizations/index.d.ts +4 -0
  85. package/build/types/services/localizations/languages.d.ts +5 -0
  86. package/build/types/services/localizations/localizations.d.ts +5 -0
  87. package/build/types/services/localizations/types.d.ts +145 -0
  88. package/build/types/services/logs/access/index.d.ts +5 -0
  89. package/build/types/services/logs/access/types.d.ts +41 -0
  90. package/build/types/services/logs/index.d.ts +3 -0
  91. package/build/types/services/logs/types.d.ts +4 -0
  92. package/build/types/services/mails/index.d.ts +3 -0
  93. package/build/types/services/mails/mails.d.ts +5 -0
  94. package/build/types/services/mails/types.d.ts +141 -0
  95. package/build/types/services/notifications/health.d.ts +9 -0
  96. package/build/types/services/notifications/index.d.ts +7 -0
  97. package/build/types/services/notifications/notifications.d.ts +5 -0
  98. package/build/types/services/notifications/settings.d.ts +5 -0
  99. package/build/types/services/notifications/types.d.ts +222 -0
  100. package/build/types/services/payments/appStore.d.ts +5 -0
  101. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/types/services/payments/health.d.ts +9 -0
  103. package/build/types/services/payments/index.d.ts +15 -0
  104. package/build/types/services/payments/orders.d.ts +5 -0
  105. package/build/types/services/payments/playStore.d.ts +5 -0
  106. package/build/types/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/types/services/payments/products.d.ts +5 -0
  109. package/build/types/services/payments/stripe.d.ts +5 -0
  110. package/build/types/services/payments/subscriptions.d.ts +5 -0
  111. package/build/types/services/payments/types.d.ts +1189 -0
  112. package/build/types/services/profiles/groups.d.ts +5 -0
  113. package/build/types/services/profiles/health.d.ts +9 -0
  114. package/build/types/services/profiles/index.d.ts +9 -0
  115. package/build/types/services/profiles/logs.d.ts +5 -0
  116. package/build/types/services/profiles/profiles.d.ts +5 -0
  117. package/build/types/services/profiles/types.d.ts +369 -0
  118. package/build/types/services/tasks/api/index.d.ts +5 -0
  119. package/build/types/services/tasks/api/types.d.ts +146 -0
  120. package/build/types/services/tasks/apiRequests/index.d.ts +5 -0
  121. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -0
  122. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -0
  123. package/build/types/services/tasks/apiRequests/types.d.ts +83 -0
  124. package/build/types/services/tasks/functions/index.d.ts +5 -0
  125. package/build/types/services/tasks/functions/types.d.ts +27 -0
  126. package/build/types/services/tasks/index.d.ts +15 -0
  127. package/build/types/services/tasks/logs/index.d.ts +5 -0
  128. package/build/types/services/tasks/logs/types.d.ts +28 -0
  129. package/build/types/services/tasks/schedules/index.d.ts +5 -0
  130. package/build/types/services/tasks/schedules/types.d.ts +88 -0
  131. package/build/types/services/tasks/tasks.d.ts +5 -0
  132. package/build/types/services/tasks/types.d.ts +107 -0
  133. package/build/types/services/templates/index.d.ts +3 -0
  134. package/build/types/services/templates/templates.d.ts +5 -0
  135. package/build/types/services/templates/types.d.ts +202 -0
  136. package/build/types/services/types.d.ts +77 -0
  137. package/build/types/services/users/activationRequests/index.d.ts +4 -0
  138. package/build/types/services/users/activationRequests/types.d.ts +70 -0
  139. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -0
  140. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -0
  141. package/build/types/services/users/globalRoles.d.ts +5 -0
  142. package/build/types/services/users/groupRoles.d.ts +5 -0
  143. package/build/types/services/users/health.d.ts +9 -0
  144. package/build/types/services/users/index.d.ts +16 -0
  145. package/build/types/services/users/settings/index.d.ts +4 -0
  146. package/build/types/services/users/settings/types.d.ts +47 -0
  147. package/build/types/services/users/types.d.ts +1055 -0
  148. package/build/types/services/users/users.d.ts +5 -0
  149. package/build/types/sha1.d.ts +11 -0
  150. package/build/types/types.d.ts +102 -0
  151. package/build/types/utils.d.ts +4 -0
  152. package/build/types/version.d.ts +1 -0
  153. package/package.json +57 -0
@@ -0,0 +1,1189 @@
1
+ import { RQLString } from '../../rql';
2
+ import { FindAllIterator } from '../../services/helpers';
3
+ import type { AffectedRecords, ObjectId, OptionsBase, OptionsWithRql, PagedResult } from '../types';
4
+ export interface ProductCreationSchema {
5
+ name?: string;
6
+ /**
7
+ * The prices property is a hashmap. The key should be a three-letter (lowercase) ISO currency code, e.g. eur, usd, ... see https://www.iso.org/iso-4217-currency-codes.html We expect that the eur currency is always provided as a key (the default key)
8
+ */
9
+ prices: Record<string, {
10
+ /**
11
+ * The price (amount) for the specified currency expressed in cents (whole numbers only)
12
+ */
13
+ amount?: number;
14
+ }>;
15
+ appStoreProductId?: string;
16
+ /**
17
+ * the task to be executed whenever an order is completed.
18
+ */
19
+ taskFunctionName?: string;
20
+ taskPriority?: number;
21
+ tags?: Array<string>;
22
+ schema?: {
23
+ properties?: Record<string, {
24
+ type?: 'string' | 'boolean' | 'number';
25
+ }>;
26
+ required?: Array<string>;
27
+ };
28
+ }
29
+ export declare type ProductSchema = ProductCreationSchema & {
30
+ id?: ObjectId;
31
+ creatorId?: ObjectId;
32
+ /**
33
+ * Price in cents. Will be completly replaced by the prices property in the future, this is only provided for backwards compactibility
34
+ */
35
+ price?: number;
36
+ /**
37
+ * Three-letter (lowercase) ISO currency code, e.g. usd, eur, ... https://www.iso.org/iso-4217-currency-codes.html Will be completly replaced by the prices property in the future, this is only provided for backwards compactibility
38
+ */
39
+ currency?: string;
40
+ };
41
+ export interface UpdateTagsSchema {
42
+ tags?: Array<string>;
43
+ }
44
+ export interface OrderSchema {
45
+ id?: ObjectId;
46
+ creatorId?: ObjectId;
47
+ targetUserId?: ObjectId;
48
+ status?: OrderSchemaStatus;
49
+ /**
50
+ * Three-letter (lowercase) ISO currency code, e.g. usd, eur, ... https://www.iso.org/iso-4217-currency-codes.html This an optional property, when it is not provided the backend will restore to using Product.currency and Product.price. When it is provided the backend will use the provided value as the key for getting the price from the Product.prices hashmap.
51
+ */
52
+ currency?: string;
53
+ product?: ProductSchema;
54
+ /**
55
+ * object containing properties as specified on the Product schema
56
+ */
57
+ data?: any;
58
+ /**
59
+ * An array of events that Stripe send for the order
60
+ */
61
+ events?: Array<OrderEventSchema>;
62
+ paymentProvider?: string;
63
+ paymentId?: string;
64
+ stripeClientSecret?: string;
65
+ tags?: Array<string>;
66
+ updateTimestamp?: Date;
67
+ creationTimestamp?: Date;
68
+ }
69
+ export interface OrderEventSchema {
70
+ type?: string;
71
+ /**
72
+ * The ID to retrieve the event by from Stripe API
73
+ */
74
+ eventIdStripe?: string;
75
+ /**
76
+ * The ID to retrieve the resource related to the event by from Stripe API
77
+ */
78
+ resourceIdStripe?: string;
79
+ resourceType?: string;
80
+ creationTimestamp?: Date;
81
+ }
82
+ export declare enum OrderSchemaStatus {
83
+ CREATED = "created",
84
+ FAILED = "failed",
85
+ CHARGE_CREATED = "charge_created",
86
+ TASK_STARTED = "task_started"
87
+ }
88
+ export interface OrderCreationSchema {
89
+ productId: ObjectId;
90
+ /**
91
+ * Three-letter (lowercase) ISO currency code, e.g. usd, eur, ... https://www.iso.org/iso-4217-currency-codes.html This an optional property, when it is not provided the backend will restore to using Product.currency and Product.price. When it is provided the backend will use the provided value as the key for getting the price from the Product.prices hashmap.
92
+ */
93
+ currency?: string;
94
+ tags?: Array<string>;
95
+ /**
96
+ * object containing properties as specified on the Product schema
97
+ */
98
+ data?: any;
99
+ }
100
+ export interface OrderUpdateSchema {
101
+ status?: string;
102
+ }
103
+ export interface SubscriptionEntitlement {
104
+ id?: ObjectId;
105
+ userId?: ObjectId;
106
+ source?: SubscriptionEntitlementSource;
107
+ sourceProductId?: ObjectId;
108
+ subscriptionGroup?: string;
109
+ subscriptionTier?: string;
110
+ status?: SubscriptionEntitlementStatus;
111
+ statusCategory?: SubscriptionEntitlementStatusCategory;
112
+ expireTimestamp?: Date;
113
+ newProductId?: ObjectId;
114
+ creationTimestamp?: Date;
115
+ }
116
+ export declare enum SubscriptionEntitlementSource {
117
+ APP_STORE = "appStore"
118
+ }
119
+ export declare enum SubscriptionEntitlementStatus {
120
+ USING_FREE_TRIAL = "using_free_trial",
121
+ USING_INTRODUCTORY_PRICING = "using_introductory_pricing",
122
+ ACTIVE_WITH_RENEWAL = "active_with_renewal",
123
+ ACTIVE_WITHOUT_RENEWAL = "active_without_renewal",
124
+ EXPIRED_VOLUNTARILY = "expired_voluntarily",
125
+ SWITCHING_PRODUCT = "switching_product",
126
+ SWITCHED_PRODUCT = "switched_product",
127
+ IN_GRACE_PERIOD = "in_grace_period",
128
+ IN_BILLING_RETRY = "in_billing_retry",
129
+ EXPIRED_FROM_BILLING = "expired_from_billing",
130
+ AWAITING_PRICE_CHANGE_CONFIRMATION = "awaiting_price_change_confirmation",
131
+ FAILED_TO_CONFIRM_PRICE_CHANGE = "failed_to_confirm_price_change",
132
+ REVOKED = "revoked",
133
+ REFUNDED = "refunded",
134
+ REFUNDED_FOR_ISSUE = "refunded_for_issue"
135
+ }
136
+ export declare enum SubscriptionEntitlementStatusCategory {
137
+ ACQUIRING = "acquiring",
138
+ ENGAGED = "engaged",
139
+ ACTIVE_BUT_LOSING = "active_but_losing",
140
+ INACTIVE_AND_LOSING = "inactive_and_losing",
141
+ LOST = "lost"
142
+ }
143
+ export interface SubscriptionEvent {
144
+ id?: ObjectId;
145
+ userId: ObjectId;
146
+ creationTimestamp?: Date;
147
+ source: SubscriptionEventSource;
148
+ sourceProductId: ObjectId;
149
+ subscriptionGroup: string;
150
+ subscriptionTier: string;
151
+ type?: SubscriptionEventType;
152
+ expireTimestamp?: Date;
153
+ }
154
+ export declare enum SubscriptionEventSource {
155
+ APP_STORE = "appStore"
156
+ }
157
+ export declare enum SubscriptionEventType {
158
+ STARTED = "started",
159
+ STARTED_WITH_FREE_TRIAL = "started_with_free_trial",
160
+ STARTED_WITH_INTRODUCTORY_PRICING = "started_with_introductory_pricing",
161
+ RENEWED = "renewed",
162
+ RENEWAL_DISABLED = "renewal_disabled",
163
+ RENEWAL_ENABLED = "renewal_enabled",
164
+ EXPIRED_VOLUNTARILY = "expired_voluntarily",
165
+ SWITCHING_PRODUCT = "switching_product",
166
+ SWITCHED_PRODUCT = "switched_product",
167
+ GRACE_PERIOD_STARTED = "grace_period_started",
168
+ BILLING_RETRY_STARTED = "billing_retry_started",
169
+ EXPIRED_FROM_BILLING = "expired_from_billing",
170
+ PRICE_CHANGE_CONFIRMATION_REQUESTED = "price_change_confirmation_requested",
171
+ FAILED_TO_CONFIRM_PRICE_CHANGE = "failed_to_confirm_price_change",
172
+ REVOKED = "revoked",
173
+ REFUNDED = "refunded",
174
+ REFUNDED_FOR_ISSUE = "refunded_for_issue"
175
+ }
176
+ export interface TransactionCompletionDataSchema {
177
+ /**
178
+ * Base 64 encoded App Store receipt
179
+ */
180
+ receiptData: string;
181
+ /**
182
+ * The id of the transition inside the receipt to complete
183
+ */
184
+ transactionId: string;
185
+ }
186
+ export declare type AppleReceiptExampleSchema = any;
187
+ export interface ReceiptVerificationDataSchema {
188
+ /**
189
+ * Base 64 encoded App Store receipt
190
+ */
191
+ receiptData: string;
192
+ }
193
+ export interface AppleNotification {
194
+ auto_renew_product_id?: string;
195
+ auto_renew_status?: string;
196
+ auto_renew_status_change_date_ms?: string;
197
+ environment?: string;
198
+ notification_type?: string;
199
+ password?: string;
200
+ unified_receipt?: {
201
+ environment?: string;
202
+ latest_receipt?: string;
203
+ latest_receipt_info?: Array<{
204
+ expires_date?: string;
205
+ expires_date_ms?: string;
206
+ expires_date_pst?: string;
207
+ is_in_intro_offer_period?: string;
208
+ is_trial_period?: string;
209
+ original_purchase_date?: string;
210
+ original_purchase_date_ms?: string;
211
+ original_purchase_date_pst?: string;
212
+ original_transaction_id?: string;
213
+ product_id?: string;
214
+ purchase_date?: string;
215
+ purchase_date_ms?: string;
216
+ purchase_date_pst?: string;
217
+ quantity?: string;
218
+ subscription_group_identifier?: string;
219
+ transaction_id?: string;
220
+ web_order_line_item_id?: string;
221
+ }>;
222
+ pending_renewal_info?: Array<{
223
+ auto_renew_product_id?: string;
224
+ auto_renew_status?: string;
225
+ expiration_intent?: string;
226
+ is_in_billing_retry_period?: string;
227
+ original_transaction_id?: string;
228
+ product_id?: string;
229
+ }>;
230
+ status?: number;
231
+ };
232
+ bid?: string;
233
+ bvrs?: string;
234
+ }
235
+ export interface AppStoreNotification {
236
+ id?: ObjectId;
237
+ data?: AppleNotification;
238
+ creationTimestamp?: Date;
239
+ updateTimestamp?: Date;
240
+ }
241
+ export interface AppStoreReceipt {
242
+ id?: ObjectId;
243
+ userId?: ObjectId;
244
+ transactionId?: string;
245
+ receiptResponse?: AppleReceiptExampleSchema;
246
+ creationTimestamp?: Date;
247
+ updateTimestamp?: Date;
248
+ }
249
+ export interface AppStoreSubscription {
250
+ id?: ObjectId;
251
+ userId: ObjectId;
252
+ productId: string;
253
+ bundleId: string;
254
+ originalPurchaseDate: Date;
255
+ originalTransactionId: string;
256
+ lastPurchaseDate: Date;
257
+ expiresDate: Date;
258
+ autoRenewStatus: boolean;
259
+ autoRenewStatusChange: Date;
260
+ latestReceipt: string;
261
+ lastTransactionId?: string;
262
+ state?: string;
263
+ reevaluateDate?: Date;
264
+ newProductId?: string;
265
+ }
266
+ export interface AppStoreSubscriptionProduct {
267
+ id?: ObjectId;
268
+ name?: string;
269
+ appStoreAppBundleId?: string;
270
+ appStoreProductId?: string;
271
+ subscriptionGroup?: string;
272
+ subscriptionTier?: string;
273
+ updateTimestamp?: Date;
274
+ creationTimestamp?: Date;
275
+ }
276
+ export interface AppStoreSubscriptionProductCreation {
277
+ name?: string;
278
+ appStoreAppBundleId?: string;
279
+ appStoreProductId?: string;
280
+ subscriptionGroup?: string;
281
+ subscriptionTier?: string;
282
+ }
283
+ export interface AppStoreSubscriptionProductUpdateSchema {
284
+ name?: string;
285
+ }
286
+ export interface StripeUser {
287
+ id?: ObjectId;
288
+ stripeId?: string;
289
+ paymentMethods?: Array<StripePaymentMethod>;
290
+ updateTimestamp?: Date;
291
+ creationTimestamp?: Date;
292
+ }
293
+ export interface StripePaymentMethod {
294
+ id?: ObjectId;
295
+ stripeId?: string;
296
+ brand?: string;
297
+ expirationYear?: number;
298
+ expirationMonth?: number;
299
+ last4Digits?: string;
300
+ tags?: Array<string>;
301
+ updateTimestamp?: Date;
302
+ creationTimestamp?: Date;
303
+ }
304
+ export interface StripePaymentMethodCreation {
305
+ stripeId: string;
306
+ tags?: Array<string>;
307
+ }
308
+ export interface PaymentIntentCreationSchema extends OrderCreationSchema {
309
+ setupPaymentMethodReuse?: PaymentIntentCreationSchemaSetupPaymentMethodReuse;
310
+ targetUserId?: ObjectId;
311
+ paymentMethodId?: ObjectId;
312
+ offSession?: boolean;
313
+ paymentMethodType?: PaymentIntentCreationSchemaPaymentMethodType;
314
+ }
315
+ export declare enum PaymentIntentCreationSchemaSetupPaymentMethodReuse {
316
+ OFF_SESSION = "offSession",
317
+ ON_SESSION = "onSession"
318
+ }
319
+ export declare enum PaymentIntentCreationSchemaPaymentMethodType {
320
+ CARD = "card",
321
+ BANCONTACT = "bancontact",
322
+ IDEAL = "ideal",
323
+ GIROPAY = "giropay"
324
+ }
325
+ export interface SetupIntentCreationSchema {
326
+ setupPaymentMethodReuse?: PaymentIntentCreationSchemaSetupPaymentMethodReuse;
327
+ }
328
+ export interface StripeSetupIntentSchema {
329
+ stripeClientSecret?: string;
330
+ }
331
+ export interface AppStoreSharedSecret {
332
+ id: ObjectId;
333
+ creationTimestamp: Date;
334
+ applicationId: ObjectId;
335
+ bundleId: string;
336
+ }
337
+ export interface AppStoreSharedSecretCreation {
338
+ applicationId: ObjectId;
339
+ bundleId: string;
340
+ secret: string;
341
+ }
342
+ export interface PaymentsAppStoreService {
343
+ /**
344
+ * @deprecated will be removed in v7. Please use `completeTransaction`
345
+ */
346
+ createTransaction(requestBody: TransactionCompletionDataSchema, options?: OptionsBase): Promise<AppleReceiptExampleSchema>;
347
+ /**
348
+ * Complete a transaction
349
+ *
350
+ * Permission | Scope | Effect
351
+ * - | - | -
352
+ * none | | Everyone can use this endpoint
353
+ * @param requestBody TransactionCompletionDataSchema
354
+ * @returns AppleReceiptExampleSchema
355
+ * A detailed description of the data can be found in the [official App Store documentation](https://developer.apple.com/documentation/appstorereceipts/responsebody).
356
+ * @throws {InvalidReceiptDataError}
357
+ * @throws {UnknownReceiptTransactionError}
358
+ * @throws {AppStoreTransactionAlreadyLinked}
359
+ * @throws {NoConfiguredAppStoreProduct}
360
+ */
361
+ completeTransaction(requestBody: TransactionCompletionDataSchema, options?: OptionsBase): Promise<AppleReceiptExampleSchema>;
362
+ /**
363
+ * Verify the Receipt of a Transaction
364
+ *
365
+ * Permission | Scope | Effect
366
+ * - | - | -
367
+ * none | | Everyone can use this endpoint
368
+ * @param requestBody ReceiptVerificationDataSchema
369
+ * @returns AppleReceiptExampleSchema
370
+ * A detailed description of the data can be found in the [official App Store documentation](https://developer.apple.com/documentation/appstorereceipts/responsebody).
371
+ * @throws {InvalidReceiptDataError}
372
+ */
373
+ verifyTransaction(requestBody: ReceiptVerificationDataSchema, options?: OptionsBase): Promise<AppleReceiptExampleSchema>;
374
+ /**
375
+ * Processes an App Store Server notification
376
+ * @param requestBody AppleNotification
377
+ * @returns true if the notification was successfully processed
378
+ */
379
+ processNotification(requestBody: AppleNotification, options?: OptionsBase): Promise<boolean>;
380
+ /**
381
+ * Get a list of notifications received from the App Store
382
+ *
383
+ * The raw notification as it was received from the App Store.
384
+ * A detailed description of the data structure can be found in the [official App Store documentation](https://developer.apple.com/documentation/appstoreservernotifications/responsebody).
385
+ *
386
+ * Permission | Scope | Effect
387
+ * - | - | -
388
+ * `VIEW_APP_STORE_NOTIFICATIONS` | `global` | **Required** for this endpoint
389
+ * @returns PagedResult<AppStoreNotification>
390
+ */
391
+ getNotifications(options?: OptionsWithRql): Promise<PagedResult<AppStoreNotification>>;
392
+ /**
393
+ * Get a list of receipts received and verified by the App Store
394
+ *
395
+ * The raw receipt as it was received after verification by the App Store.
396
+ * A detailed description of the data can be found in the [official App Store documentation](https://developer.apple.com/documentation/appstorereceipts/responsebody).
397
+ *
398
+ * Permission | Scope | Effect
399
+ * - | - | -
400
+ * `VIEW_APP_STORE_RECEIPTS` | `global` | **Required** for this endpoint
401
+ * @returns PagedResult<AppStoreReceipt>
402
+ */
403
+ getReceipts(options?: OptionsWithRql): Promise<PagedResult<AppStoreReceipt>>;
404
+ /**
405
+ * Get a list of shared secrets
406
+ *
407
+ * Permission | Scope | Effect
408
+ * - | - | -
409
+ * `VIEW_APP_STORE_SHARED_SECRETS` | `global` | **Required** for this endpoint
410
+ * @returns PagedResult<AppStoreSharedSecret>
411
+ */
412
+ getSharedSecrets(options?: OptionsWithRql): Promise<PagedResult<AppStoreSharedSecret>>;
413
+ /**
414
+ * Create a shared secret
415
+ *
416
+ * The App Store Shared Secret is used when an Application has to communicate
417
+ * with the App Store The shared secret allows decryption of sensitive data such
418
+ * as receipts and allows the verification of the Application Identifier
419
+ *
420
+ * Permission | Scope | Effect
421
+ * - | - | -
422
+ * `CREATE_APP_STORE_SHARED_SECRET` | `global` | **Required** for this endpoint
423
+ * @returns AppStoreSharedSecret
424
+ */
425
+ createSharedSecret(requestBody: AppStoreSharedSecretCreation, options?: OptionsBase): Promise<AppStoreSharedSecret>;
426
+ /**
427
+ * Delete an AppStore shared secret bassed on its id
428
+ *
429
+ * Permission | Scope | Effect
430
+ * - | - | -
431
+ * `DELETE_APP_STORE_SHARED_SECRET` | `global` | **Required** for this endpoint
432
+ * @returns AffectedRecords
433
+ */
434
+ removeSharedSecret(secretId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
435
+ }
436
+ export interface PaymentsAppStoreSubscriptionsService {
437
+ subscriptions: {
438
+ /**
439
+ * Get a list of App Store subscriptions
440
+ *
441
+ * Permission | Scope | Effect
442
+ * - | - | -
443
+ * none | | List App Store subscriptions related to you
444
+ * `VIEW_APP_STORE_SUBSCRIPTIONS` | `global` | List App Store subscriptions related to all users
445
+ * @returns PagedResult<AppStoreSubscription>
446
+ */
447
+ find(options?: OptionsWithRql): Promise<PagedResult<AppStoreSubscription>>;
448
+ /**
449
+ * Request a list of all App Store subscriptions
450
+ *
451
+ * Do not pass in an rql with limit operator!
452
+ *
453
+ * Permission | Scope | Effect
454
+ * - | - | -
455
+ * none | | List App Store subscriptions related to you
456
+ * `VIEW_APP_STORE_SUBSCRIPTIONS` | `global` | List App Store subscriptions related to all users
457
+ * @returns AppStoreSubscription[]
458
+ */
459
+ findAll(options?: OptionsWithRql): Promise<AppStoreSubscription[]>;
460
+ /**
461
+ * Request a list of all App Store subscriptions
462
+ *
463
+ * Permission | Scope | Effect
464
+ * - | - | -
465
+ * none | | List App Store subscriptions related to you
466
+ * `VIEW_APP_STORE_SUBSCRIPTIONS` | `global` | List App Store subscriptions related to all users
467
+ * @returns AppStoreSubscription[]
468
+ */
469
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<AppStoreSubscription>;
470
+ };
471
+ products: {
472
+ /**
473
+ * Get a list of configured App Store subscription products
474
+ *
475
+ * Permission | Scope | Effect
476
+ * - | - | -
477
+ * none | | Everyone can use this endpoint
478
+ * @returns PagedResult<AppStoreSubscriptionProduct>
479
+ */
480
+ find(options?: OptionsWithRql): Promise<PagedResult<AppStoreSubscriptionProduct>>;
481
+ /**
482
+ * Request a list of all App Store subscription products
483
+ *
484
+ * Do not pass in an rql with limit operator!
485
+ *
486
+ * Permission | Scope | Effect
487
+ * - | - | -
488
+ * none | | Everyone can use this endpoint
489
+ * @returns AppStoreSubscriptionProduct[]
490
+ */
491
+ findAll(options?: OptionsWithRql): Promise<AppStoreSubscriptionProduct[]>;
492
+ /**
493
+ * Request a list of all App Store subscription products
494
+ *
495
+ * Permission | Scope | Effect
496
+ * - | - | -
497
+ * none | | Everyone can use this endpoint
498
+ * @returns AppStoreSubscriptionProduct[]
499
+ */
500
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<AppStoreSubscriptionProduct>;
501
+ /**
502
+ * Create an App Store subscription product
503
+ *
504
+ * Permission | Scope | Effect
505
+ * - | - | -
506
+ * `CREATE_APP_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
507
+ * @param requestBody AppStoreSubscriptionProductCreation
508
+ * @returns AppStoreSubscriptionProduct
509
+ * @throws {ResourceAlreadyExistsError}
510
+ */
511
+ create(requestBody: AppStoreSubscriptionProductCreation, options?: OptionsBase): Promise<AppStoreSubscriptionProduct>;
512
+ /**
513
+ * Delete an App Store subscription product
514
+ *
515
+ * Permission | Scope | Effect
516
+ * - | - | -
517
+ * `DELETE_APP_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
518
+ * @param productId
519
+ * @returns AffectedRecords
520
+ * @throws {ResourceUnknownError}
521
+ */
522
+ remove(productId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
523
+ /**
524
+ * Update an App Store subscription product
525
+ *
526
+ * Permission | Scope | Effect
527
+ * - | - | -
528
+ * `UPDATE_APP_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
529
+ * @param productId
530
+ * @param requestBody AppStoreSubscriptionProductUpdateSchema
531
+ * @returns AffectedRecords
532
+ * @throws {ResourceUnknownError}
533
+ */
534
+ update(productId: ObjectId, requestBody: AppStoreSubscriptionProductUpdateSchema, options?: OptionsBase): Promise<AffectedRecords>;
535
+ };
536
+ }
537
+ export interface PaymentsOrdersService {
538
+ /**
539
+ * Get a list of orders
540
+ *
541
+ * Permission | Scope | Effect
542
+ * - | - | -
543
+ * none | | List orders created by you
544
+ * `VIEW_STRIPE_ORDERS` | `global` | List orders created by all users
545
+ * @param rql Add filters to the requested list.
546
+ * @returns PagedResult<OrderSchema>
547
+ */
548
+ find(options?: OptionsWithRql): Promise<PagedResult<OrderSchema>>;
549
+ /**
550
+ * Request a list of all orders
551
+ *
552
+ * Do not pass in an rql with limit operator!
553
+ *
554
+ * Permission | Scope | Effect
555
+ * - | - | -
556
+ * none | | List orders created by you
557
+ * `VIEW_STRIPE_ORDERS` | `global` | List orders created by all users
558
+ * @param rql Add filters to the requested list.
559
+ * @returns OrderSchema[]
560
+ */
561
+ findAll(options?: OptionsWithRql): Promise<OrderSchema[]>;
562
+ /**
563
+ * Request a list of all orders
564
+ *
565
+ * Permission | Scope | Effect
566
+ * - | - | -
567
+ * none | | List orders created by you
568
+ * `VIEW_STRIPE_ORDERS` | `global` | List orders created by all users
569
+ * @param rql Add filters to the requested list.
570
+ * @returns OrderSchema[]
571
+ */
572
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<OrderSchema>;
573
+ /**
574
+ * Find By Id
575
+ * @param id the Id to search for
576
+ * @param rql an optional rql string
577
+ * @returns the first element found
578
+ */
579
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<OrderSchema>;
580
+ /**
581
+ * Find First
582
+ * @param rql an optional rql string
583
+ * @returns the first element found
584
+ */
585
+ findFirst(options?: OptionsWithRql): Promise<OrderSchema>;
586
+ /**
587
+ * Create an order
588
+ * @param requestBody
589
+ * @returns OrderSchema
590
+ * @throws {ResourceAlreadyExistsError}
591
+ * @throws {InvalidCurrencyForProductPrice}
592
+ */
593
+ create(requestBody: OrderCreationSchema, options?: OptionsBase): Promise<OrderSchema>;
594
+ /**
595
+ * Update the status of an order
596
+ *
597
+ * Permission | Scope | Effect
598
+ * - | - | -
599
+ * `UPDATE_STRIPE_ORDERS` | `global` | **Required** for this endpoint
600
+ * @param orderId The order Id
601
+ * @param requestBody OrderUpdateSchema
602
+ * @returns AffectedRecords
603
+ * @throws {ResourceUnknownError}
604
+ */
605
+ update(orderId: ObjectId, requestBody: OrderUpdateSchema, options?: OptionsBase): Promise<AffectedRecords>;
606
+ /**
607
+ * Add Tags to an Order
608
+ *
609
+ * Permission | Scope | Effect
610
+ * - | - | -
611
+ * `UPDATE_STRIPE_ORDERS` | `global` | **Required** for this endpoint
612
+ * @param rql Add filters to the requested list, **required**.
613
+ * @param requestBody UpdateTagsSchema
614
+ * @returns AffectedRecords
615
+ */
616
+ addTagsToOrder(rql: RQLString, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
617
+ /**
618
+ * Remove Tags from an Order
619
+ *
620
+ * Permission | Scope | Effect
621
+ * - | - | -
622
+ * `UPDATE_STRIPE_ORDERS` | `global` | **Required** for this endpoint
623
+ * @param rql Add filters to the requested list, **required**.
624
+ * @param requestBody UpdateTagsSchema
625
+ * @returns AffectedRecords
626
+ */
627
+ removeTagsFromOrder(rql: RQLString, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
628
+ }
629
+ export interface PaymentsProductsService {
630
+ /**
631
+ * Create a product
632
+ *
633
+ * Permission | Scope | Effect
634
+ * - | - | -
635
+ * `CREATE_STRIPE_PRODUCTS` | `global` | **Required** for this endpoint
636
+ * @param requestBody
637
+ * @returns ProductSchema
638
+ */
639
+ create(requestBody: ProductCreationSchema, options?: OptionsBase): Promise<ProductSchema>;
640
+ /**
641
+ * Get a list of products
642
+ *
643
+ * Permission | Scope | Effect
644
+ * - | - | -
645
+ * none | | Everyone can use this endpoint
646
+ * @param rql Add filters to the requested list.
647
+ * @returns PagedResult<ProductSchema>
648
+ */
649
+ find(options?: OptionsWithRql): Promise<PagedResult<ProductSchema>>;
650
+ /**
651
+ * Request a list of all products
652
+ *
653
+ * Do not pass in an rql with limit operator!
654
+ *
655
+ * Permission | Scope | Effect
656
+ * - | - | -
657
+ * none | | Everyone can use this endpoint
658
+ * @param rql Add filters to the requested list.
659
+ * @returns ProductSchema[]
660
+ */
661
+ findAll(options?: OptionsWithRql): Promise<ProductSchema[]>;
662
+ /**
663
+ * Request a list of all products
664
+ *
665
+ * Permission | Scope | Effect
666
+ * - | - | -
667
+ * none | | Everyone can use this endpoint
668
+ * @param rql Add filters to the requested list.
669
+ * @returns ProductSchema[]
670
+ */
671
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<ProductSchema>;
672
+ /**
673
+ * Find By Id
674
+ * @param id the Id to search for
675
+ * @param rql an optional rql string
676
+ * @returns the first element found
677
+ */
678
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<ProductSchema>;
679
+ /**
680
+ * Find First
681
+ * @param rql an optional rql string
682
+ * @returns the first element found
683
+ */
684
+ findFirst(options?: OptionsWithRql): Promise<ProductSchema>;
685
+ /**
686
+ * Add Tags to a Product
687
+ *
688
+ * Permission | Scope | Effect
689
+ * - | - | -
690
+ * `UPDATE_STRIPE_PRODUCTS` | `global` | **Required** for this endpoint
691
+ * @param rql Add filters to the requested list, **required**.
692
+ * @param requestBody UpdateTagsSchema
693
+ * @returns AffectedRecords
694
+ */
695
+ addTagsToProduct(rql: RQLString, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
696
+ /**
697
+ * Remove tags from a Product
698
+ *
699
+ * Permission | Scope | Effect
700
+ * - | - | -
701
+ * `UPDATE_STRIPE_PRODUCTS` | `global` | **Required** for this endpoint
702
+ * @param rql Add filters to the requested list, **required**.
703
+ * @param requestBody UpdateTagsSchema
704
+ * @returns AffectedRecords
705
+ */
706
+ removeTagsFromProduct(rql: RQLString, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
707
+ /**
708
+ * Update a product
709
+ *
710
+ * Permission | Scope | Effect
711
+ * - | - | -
712
+ * `UPDATE_STRIPE_PRODUCTS` | `global` | **Required** for this endpoint
713
+ * @param productId ID of the Product
714
+ * @param requestBody ProductCreationSchema
715
+ * @returns AffectedRecords
716
+ * @throws {ResourceUnknownError}
717
+ */
718
+ update(orderId: ObjectId, requestBody: ProductCreationSchema, options?: OptionsBase): Promise<AffectedRecords>;
719
+ /**
720
+ * Delete a product
721
+ *
722
+ * Permission | Scope | Effect
723
+ * - | - | -
724
+ * `DELETE_STRIPE_PRODUCTS` | `global` | **Required** for this endpoint
725
+ * @param productId ID of the Product
726
+ * @returns AffectedRecords
727
+ * @throws {ResourceUnknownError}
728
+ */
729
+ remove(productId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
730
+ }
731
+ export interface PaymentsStripeService {
732
+ /**
733
+ * Get the saved Stripe data for a user
734
+ *
735
+ * Permission | Scope | Effect
736
+ * - | - | -
737
+ * none | | Get the saved Stripe data for your user
738
+ * `VIEW_STRIPE_USERS` | `global` | Get the saved Stripe data for all users
739
+ * @param userId
740
+ * @returns StripeUser
741
+ */
742
+ getUser(userId: ObjectId, options?: OptionsBase): Promise<StripeUser>;
743
+ /**
744
+ * Save a payment method to a Stripe user
745
+ *
746
+ * Permission | Scope | Effect
747
+ * - | - | -
748
+ * none | | Save a payment method for your user
749
+ * `UPDATE_STRIPE_USERS` | `global` | Save a payment method for any users
750
+ * @param userId
751
+ * @param requestBody StripePaymentMethodCreation
752
+ * @returns StripePaymentMethod
753
+ * @throws {StripePaymentMethodError}
754
+ * @throws {StripeRequestError}
755
+ */
756
+ savePaymentMethod(userId: ObjectId, requestBody: StripePaymentMethodCreation, options?: OptionsBase): Promise<StripePaymentMethod>;
757
+ /**
758
+ * Add tags to a payment method
759
+ *
760
+ * Permission | Scope | Effect
761
+ * - | - | -
762
+ * none | | Add a tag to a payment method for your user
763
+ * `UPDATE_STRIPE_USERS` | `global` | Add a tag to a payment method for any users
764
+ * @param userId
765
+ * @param paymentMethodId
766
+ * @param requestBody UpdateTagsSchema
767
+ * @returns AffectedRecords
768
+ * @throws {ResourceUnknownError}
769
+ */
770
+ addTagsToPaymentMethod(userId: ObjectId, paymentMethodId: ObjectId, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
771
+ /**
772
+ * Remove tags from a payment method
773
+ *
774
+ * Permission | Scope | Effect
775
+ * - | - | -
776
+ * none | | Remove tag(s) from a payment method for your user
777
+ * `UPDATE_STRIPE_USERS` | `global` | Remove tag(s) from a payment method for any users
778
+ * @param userId
779
+ * @param paymentMethodId
780
+ * @param requestBody UpdateTagsSchema
781
+ * @returns AffectedRecords
782
+ * @throws {ResourceUnknownError}
783
+ */
784
+ removeTagsToPaymentMethod(userId: ObjectId, paymentMethodId: ObjectId, requestBody: UpdateTagsSchema, options?: OptionsBase): Promise<AffectedRecords>;
785
+ /**
786
+ * Delete a payment method
787
+ *
788
+ * Permission | Scope | Effect
789
+ * - | - | -
790
+ * none | | Delete a payment method for your user
791
+ * `UPDATE_STRIPE_USERS` | `global` | Delete a payment method for any users
792
+ * @param userId
793
+ * @param paymentMethodId
794
+ * @returns AffectedRecords
795
+ * @throws {ResourceUnknownError}
796
+ */
797
+ removePaymentMethod(userId: ObjectId, paymentMethodId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
798
+ /**
799
+ * Create an order linked to a Stripe Payment Intent
800
+ *
801
+ * Permission | Scope | Effect
802
+ * - | - | -
803
+ * none | | Create an order linked to a Stripe Payment Intent for your user
804
+ * `CREATE_PAYMENT_INTENTS` | `global` | Create an order linked to a Stripe Payment Intent for any users
805
+ * @param requestBody PaymentIntentCreationSchema
806
+ * @returns OrderSchema
807
+ * @throws {ResourceAlreadyExistsError}
808
+ * @throws {IllegalArgumentError}
809
+ * @throws {StripePaymentMethodError}
810
+ * @throws {InvalidCurrencyForProductPrice}
811
+ * @throws {ResourceUnknownError}
812
+ */
813
+ createPaymentIntent(requestBody: PaymentIntentCreationSchema, options?: OptionsBase): Promise<OrderSchema>;
814
+ /**
815
+ * Create a Stripe Setup Intent for capturing payment details without initial payment
816
+ * @param requestBody SetupIntentCreationSchema
817
+ * @returns StripeSetupIntentSchema
818
+ * @throws {StripePaymentMethodError}
819
+ */
820
+ createSetupIntent(requestBody: SetupIntentCreationSchema, options?: OptionsBase): Promise<StripeSetupIntentSchema>;
821
+ /**
822
+ * Incoming events from Stripe's webhook
823
+ *
824
+ * Stripe docs for webhooks: https://stripe.com/docs/webhooks/setup#create-endpoint.
825
+ * Allowed events:
826
+ * - 'source.chargeable'
827
+ * - 'source.canceled'
828
+ * - 'source.failed'
829
+ * - 'charge.pending'
830
+ * - 'charge.failed'
831
+ * - 'charge.succeeded'
832
+ * - 'payment_intent.payment_failed'
833
+ * - 'payment_intent.succeeded'
834
+ * @returns any
835
+ * @throws {BadRequestError}
836
+ */
837
+ subscribeToEvents(options?: OptionsBase): Promise<any>;
838
+ }
839
+ export interface PaymentsSubscriptionsService {
840
+ entitlements: {
841
+ /**
842
+ * Get a list of subscription entitlements
843
+ *
844
+ * Permission | Scope | Effect
845
+ * - | - | -
846
+ * none | | List entitlements related to you
847
+ * `VIEW_SUBSCRIPTION_ENTITLEMENTS` | `global` | List entitlements related to all users
848
+ * @returns PagedResult<SubscriptionEntitlement>
849
+ */
850
+ find(options?: OptionsWithRql): Promise<PagedResult<SubscriptionEntitlement>>;
851
+ /**
852
+ * Request a list of all subscription entitlements
853
+ *
854
+ * Do not pass in an rql with limit operator!
855
+ *
856
+ * Permission | Scope | Effect
857
+ * - | - | -
858
+ * none | | List entitlements related to you
859
+ * `VIEW_SUBSCRIPTION_ENTITLEMENTS` | `global` | List entitlements related to all users
860
+ * @returns SubscriptionEntitlement[]
861
+ */
862
+ findAll(options?: OptionsWithRql): Promise<SubscriptionEntitlement[]>;
863
+ /**
864
+ * Request a list of all subscription entitlements
865
+ *
866
+ * Permission | Scope | Effect
867
+ * - | - | -
868
+ * none | | List entitlements related to you
869
+ * `VIEW_SUBSCRIPTION_ENTITLEMENTS` | `global` | List entitlements related to all users
870
+ * @returns SubscriptionEntitlement[]
871
+ */
872
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<SubscriptionEntitlement>;
873
+ };
874
+ events: {
875
+ /**
876
+ * Get a list of subscription events
877
+ *
878
+ * Permission | Scope | Effect
879
+ * - | - | -
880
+ * none | | List events related to you
881
+ * `VIEW_SUBSCRIPTION_EVENTS` | `global` | List events related to all users
882
+ * @returns PagedResult<SubscriptionEvent>
883
+ */
884
+ find(options?: OptionsWithRql): Promise<PagedResult<SubscriptionEvent>>;
885
+ /**
886
+ * Request a list of all subscription events
887
+ *
888
+ * Do not pass in an rql with limit operator!
889
+ *
890
+ * Permission | Scope | Effect
891
+ * - | - | -
892
+ * none | | List events related to you
893
+ * `VIEW_SUBSCRIPTION_EVENTS` | `global` | List events related to all users
894
+ * @returns SubscriptionEvent[]
895
+ */
896
+ findAll(options?: OptionsWithRql): Promise<SubscriptionEvent[]>;
897
+ /**
898
+ * Request a list of all subscription events
899
+ *
900
+ * Permission | Scope | Effect
901
+ * - | - | -
902
+ * none | | List events related to you
903
+ * `VIEW_SUBSCRIPTION_EVENTS` | `global` | List events related to all users
904
+ * @returns SubscriptionEvent[]
905
+ */
906
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<SubscriptionEvent>;
907
+ };
908
+ }
909
+ export interface PlayStoreReceiptSchema {
910
+ packageName: string;
911
+ subscriptionId: string;
912
+ purchaseToken: string;
913
+ }
914
+ export interface PlayStoreDeveloperNotificationMessageSchema {
915
+ message: {
916
+ attributes: Record<string, any>;
917
+ data: string;
918
+ messageId: string;
919
+ publishTime: Date;
920
+ };
921
+ subscription: string;
922
+ }
923
+ export interface PaymentsPlayStoreService {
924
+ /**
925
+ * Complete a purchase initiated froom an Android app
926
+ *
927
+ * Permission | Scope | Effect
928
+ * - | - | -
929
+ * none | | Everyone can use this endpoint
930
+ * @param requestBody PlayStoreReceiptSchema
931
+ * @returns any
932
+ * @throws {InvalidReceiptDataError}
933
+ * @throws {PlayStoreTransactionAlreadyLinked}
934
+ * @throws {NoConfiguredPlayStoreProduct}
935
+ */
936
+ complete(requestBody: PlayStoreReceiptSchema, options?: OptionsBase): Promise<any>;
937
+ /**
938
+ * Process a developer notification from Google Cloud PubSub
939
+ *
940
+ * Permission | Scope | Effect
941
+ * - | - | -
942
+ * none | | Everyone can use this endpoint
943
+ * @param requestBody PlayStoreDeveloperNotificationMessageSchema
944
+ * @returns any
945
+ * @throws {InvalidReceiptDataError}
946
+ * @throws {NoMatchingPlayStoreLinkedSubscription}
947
+ * @throws {NoConfiguredPlayStoreProduct}
948
+ */
949
+ processDeveloperNotification(requestBody: PlayStoreDeveloperNotificationMessageSchema, options?: OptionsBase): Promise<any>;
950
+ }
951
+ export interface PlayStorePurchaseRecord {
952
+ receipt: PlayStoreReceiptSchema;
953
+ userId: ObjectId;
954
+ id: ObjectId;
955
+ creationTimestamp: Date;
956
+ updateTimestamp: Date;
957
+ }
958
+ export interface PlayStoreDeveloperNotificationSchema {
959
+ version: string;
960
+ packageName: string;
961
+ eventTimeMillis: number;
962
+ subscriptionNotification: {
963
+ version: string;
964
+ notificationType: number;
965
+ purchaseToken: string;
966
+ subscriptionId: string;
967
+ };
968
+ }
969
+ export interface PlayStoreSubscriptionPurchaseSchema {
970
+ kind: string;
971
+ startTimeMillis: string;
972
+ expiryTimeMillis: string;
973
+ autoResumeTimeMillis?: string;
974
+ autoRenewing: boolean;
975
+ priceCurrencyCode: string;
976
+ priceAmountMicros: string;
977
+ introductoryPriceInfo: {
978
+ introductoryPriceCurrencyCode: string;
979
+ introductoryPriceAmountMicros: string;
980
+ introductoryPricePeriod: string;
981
+ introductoryPriceCycles: string;
982
+ };
983
+ countryCode: string;
984
+ developerPayload: string;
985
+ paymentState?: number;
986
+ cancelReason?: number;
987
+ userCancellationTimeMillis?: string;
988
+ cancelSurveyResult?: {
989
+ cancelSurveyReason?: number;
990
+ userInputCancelReason?: string;
991
+ };
992
+ orderId: string;
993
+ linkedPurchaseToken?: string;
994
+ purchaseType: number;
995
+ priceChange?: {
996
+ newPrice?: {
997
+ priceMicros?: string;
998
+ currency?: string;
999
+ };
1000
+ state: number;
1001
+ };
1002
+ profileName?: string;
1003
+ emailAddress?: string;
1004
+ givenName?: string;
1005
+ familyName?: string;
1006
+ profileId?: string;
1007
+ acknowledgementState: number;
1008
+ externalAccountId?: string;
1009
+ promotionType?: number;
1010
+ promotionCode?: string;
1011
+ obfuscatedExternalAccountId?: string;
1012
+ obfuscatedExternalProfileId?: string;
1013
+ }
1014
+ export interface PlayStoreSubscriptionPurchaseRecordSchema {
1015
+ receipt: PlayStoreReceiptSchema;
1016
+ purchaseInfo: PlayStoreSubscriptionPurchaseSchema;
1017
+ id: string;
1018
+ creationTimestamp: Date;
1019
+ updateTimestamp: Date;
1020
+ }
1021
+ export interface PlayStoreSubscriptionReceiptRecordSchema {
1022
+ receipt: PlayStoreReceiptSchema;
1023
+ userId: ObjectId;
1024
+ id: string;
1025
+ creationTimestamp: Date;
1026
+ updateTimestamp: Date;
1027
+ }
1028
+ export interface PaymentsPlayStoreHistoryService {
1029
+ /**
1030
+ * Get a list of recorded Play Store developer notifications received
1031
+ *
1032
+ * Permission | Scope | Effect
1033
+ * - | - | -
1034
+ * `VIEW_PLAY_STORE_NOTIFICATIONS` | `global` | **Required** for this endpoint
1035
+ * @returns PagedResult<PlayStoreDeveloperNotificationSchema>
1036
+ */
1037
+ notifications(options?: OptionsWithRql): Promise<PagedResult<PlayStoreDeveloperNotificationSchema>>;
1038
+ /**
1039
+ * Get a list of purchase information (SubscriptionPurchase) records fetched from the Play Store
1040
+ *
1041
+ * Permission | Scope | Effect
1042
+ * - | - | -
1043
+ * `VIEW_PLAY_STORE_PURCHASE_INFOS` | `global` | **Required** for this endpoint
1044
+ * @returns PagedResult<PlayStoreSubscriptionPurchaseRecordSchema>
1045
+ */
1046
+ purchaseInfos(options?: OptionsWithRql): Promise<PagedResult<PlayStoreSubscriptionPurchaseRecordSchema>>;
1047
+ /**
1048
+ * Get a list of the received Play Store purchase receipts
1049
+ *
1050
+ * Permission | Scope | Effect
1051
+ * - | - | -
1052
+ * `VIEW_PLAY_STORE_PURCHASE_RECEIPTS` | `global` | **Required** for this endpoint
1053
+ * @returns PagedResult<PlayStorePurchaseRecord>
1054
+ */
1055
+ purchaseReceipts(options?: OptionsWithRql): Promise<PagedResult<PlayStorePurchaseRecord>>;
1056
+ }
1057
+ export interface PlayStoreSubscription {
1058
+ expiryTimestamp: Date;
1059
+ autoRenewing: boolean;
1060
+ paymentState: number;
1061
+ purchaserId: ObjectId;
1062
+ receipt: PlayStoreReceiptSchema;
1063
+ id: ObjectId;
1064
+ creationTimestamp: Date;
1065
+ updateTimestamp: Date;
1066
+ lockId: ObjectId;
1067
+ lockTimestamp: Date;
1068
+ }
1069
+ export interface PlayStoreSubscriptionProduct {
1070
+ name: string;
1071
+ playStorePackageName: string;
1072
+ playStoreSubscriptionId: string;
1073
+ subscriptionGroup: string;
1074
+ subscriptionTier: string;
1075
+ id: ObjectId;
1076
+ updateTimestamp: Date;
1077
+ creationTimestamp: Date;
1078
+ }
1079
+ export interface PlayStoreSubscriptionProductCreation {
1080
+ name: string;
1081
+ playStorePackageName: string;
1082
+ playStoreSubscriptionId: string;
1083
+ subscriptionGroup: string;
1084
+ subscriptionTier: string;
1085
+ }
1086
+ export interface PlayStoreSubscriptionProductUpdateSchema {
1087
+ name: string;
1088
+ }
1089
+ export interface PaymentsPlayStoreSubscriptionsService {
1090
+ subscriptions: {
1091
+ /**
1092
+ * Get a list of Play Store subscriptions
1093
+ *
1094
+ * Permission | Scope | Effect
1095
+ * - | - | -
1096
+ * none | | List Play Store subscriptions related to you
1097
+ * `VIEW_PLAY_STORE_SUBSCRIPTIONS` | `global` | List Play Store subscriptions related to all users
1098
+ * @returns PagedResult<PlayStoreSubscription>
1099
+ */
1100
+ find(options?: OptionsWithRql): Promise<PagedResult<PlayStoreSubscription>>;
1101
+ /**
1102
+ * Request a list of all Play Store subscriptions
1103
+ *
1104
+ * Do not pass in an rql with limit operator!
1105
+ *
1106
+ * Permission | Scope | Effect
1107
+ * - | - | -
1108
+ * none | | List Play Store subscriptions related to you
1109
+ * `VIEW_PLAY_STORE_SUBSCRIPTIONS` | `global` | List Play Store subscriptions related to all users
1110
+ * @returns PlayStoreSubscription[]
1111
+ */
1112
+ findAll(options?: OptionsWithRql): Promise<PlayStoreSubscription[]>;
1113
+ /**
1114
+ * Request a list of all Play Store subscriptions
1115
+ *
1116
+ * Permission | Scope | Effect
1117
+ * - | - | -
1118
+ * none | | List App Store subscriptions related to you
1119
+ * `VIEW_PLAY_STORE_SUBSCRIPTIONS` | `global` | List Play Store subscriptions related to all users
1120
+ * @returns PlayStoreSubscription[]
1121
+ */
1122
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<PlayStoreSubscription>;
1123
+ };
1124
+ products: {
1125
+ /**
1126
+ * Get a list of configured Play Store subscription products
1127
+ *
1128
+ * Permission | Scope | Effect
1129
+ * - | - | -
1130
+ * none | | Everyone can use this endpoint
1131
+ * @returns PagedResult<PlayStoreSubscriptionProduct>
1132
+ */
1133
+ find(options?: OptionsWithRql): Promise<PagedResult<PlayStoreSubscriptionProduct>>;
1134
+ /**
1135
+ * Request a list of all Play Store subscription products
1136
+ *
1137
+ * Do not pass in an rql with limit operator!
1138
+ *
1139
+ * Permission | Scope | Effect
1140
+ * - | - | -
1141
+ * none | | Everyone can use this endpoint
1142
+ * @returns PlayStoreSubscriptionProduct[]
1143
+ */
1144
+ findAll(options?: OptionsWithRql): Promise<PlayStoreSubscriptionProduct[]>;
1145
+ /**
1146
+ * Request a list of all App Store subscription products
1147
+ *
1148
+ * Permission | Scope | Effect
1149
+ * - | - | -
1150
+ * none | | Everyone can use this endpoint
1151
+ * @returns PlayStoreSubscriptionProduct[]
1152
+ */
1153
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<PlayStoreSubscriptionProduct>;
1154
+ /**
1155
+ * Create an Play Store subscription product
1156
+ *
1157
+ * Permission | Scope | Effect
1158
+ * - | - | -
1159
+ * `CREATE_PLAY_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
1160
+ * @param requestBody PlayStoreSubscriptionProductCreation
1161
+ * @returns PlayStoreSubscriptionProduct
1162
+ * @throws {ResourceAlreadyExistsError}
1163
+ */
1164
+ create(requestBody: PlayStoreSubscriptionProductCreation, options?: OptionsBase): Promise<PlayStoreSubscriptionProduct>;
1165
+ /**
1166
+ * Delete an Play Store subscription product
1167
+ *
1168
+ * Permission | Scope | Effect
1169
+ * - | - | -
1170
+ * `DELETE_PLAY_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
1171
+ * @param productId
1172
+ * @returns AffectedRecords
1173
+ * @throws {ResourceUnknownError}
1174
+ */
1175
+ remove(productId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
1176
+ /**
1177
+ * Update an App Store subscription product
1178
+ *
1179
+ * Permission | Scope | Effect
1180
+ * - | - | -
1181
+ * `UPDATE_PLAY_STORE_SUBSCRIPTION_PRODUCT` | `global` | **Required** for this endpoint
1182
+ * @param productId
1183
+ * @param requestBody PlayStoreSubscriptionProductUpdateSchema
1184
+ * @returns AffectedRecords
1185
+ * @throws {ResourceUnknownError}
1186
+ */
1187
+ update(productId: ObjectId, requestBody: PlayStoreSubscriptionProductUpdateSchema, options?: OptionsBase): Promise<AffectedRecords>;
1188
+ };
1189
+ }