@extrahorizon/javascript-sdk 8.10.0-dev-159-0e9a0f1 → 8.10.0-dev-161-c1dd6ca

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