@sylphx/sdk 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +111 -4
  2. package/dist/access.d.ts +112 -17
  3. package/dist/access.js +101 -7
  4. package/dist/access.js.map +1 -1
  5. package/dist/ai.d.ts +1 -2
  6. package/dist/ai.js +2 -3
  7. package/dist/ai.js.map +1 -1
  8. package/dist/artifacts.d.ts +1 -1
  9. package/dist/artifacts.js +2 -2
  10. package/dist/assets.d.ts +447 -0
  11. package/dist/assets.js +266 -0
  12. package/dist/assets.js.map +1 -0
  13. package/dist/auth/client.d.ts +239 -0
  14. package/dist/auth/client.js +337 -0
  15. package/dist/auth/client.js.map +1 -0
  16. package/dist/auth/verify.d.ts +38 -3
  17. package/dist/auth/verify.js +58 -8
  18. package/dist/auth/verify.js.map +1 -1
  19. package/dist/auth.d.ts +455 -7
  20. package/dist/auth.js +416 -5
  21. package/dist/auth.js.map +1 -1
  22. package/dist/billing.d.ts +13 -13
  23. package/dist/billing.js +5 -5
  24. package/dist/broker.d.ts +5 -4
  25. package/dist/broker.js +3 -3
  26. package/dist/broker.js.map +1 -1
  27. package/dist/build.d.ts +4 -4
  28. package/dist/build.js +3 -3
  29. package/dist/common.d.ts +1 -1
  30. package/dist/common.js +1 -1
  31. package/dist/config/flags.d.ts +140 -0
  32. package/dist/config/flags.js +462 -0
  33. package/dist/config/flags.js.map +1 -0
  34. package/dist/config.d.ts +380 -15
  35. package/dist/config.js +283 -5
  36. package/dist/config.js.map +1 -1
  37. package/dist/connections.d.ts +6 -6
  38. package/dist/connections.js +3 -3
  39. package/dist/data.d.ts +560 -7
  40. package/dist/data.js +510 -4
  41. package/dist/data.js.map +1 -1
  42. package/dist/entitlement.d.ts +10 -8
  43. package/dist/entitlement.js +3 -4
  44. package/dist/entitlement.js.map +1 -1
  45. package/dist/events/realtime.d.ts +69 -0
  46. package/dist/events/realtime.js +107 -0
  47. package/dist/events/realtime.js.map +1 -0
  48. package/dist/events/webhooks.d.ts +40 -0
  49. package/dist/events/webhooks.js +110 -0
  50. package/dist/events/webhooks.js.map +1 -0
  51. package/dist/events.d.ts +369 -22
  52. package/dist/events.js +311 -8
  53. package/dist/events.js.map +1 -1
  54. package/dist/hosting.d.ts +13 -14
  55. package/dist/hosting.js +3 -4
  56. package/dist/hosting.js.map +1 -1
  57. package/dist/ids.d.ts +837 -0
  58. package/dist/ids.js +287 -0
  59. package/dist/ids.js.map +1 -0
  60. package/dist/index.d.ts +12 -1
  61. package/dist/index.js +16 -2
  62. package/dist/index.js.map +1 -1
  63. package/dist/keys.d.ts +2 -2
  64. package/dist/keys.js +3 -3
  65. package/dist/localization.d.ts +663 -0
  66. package/dist/localization.js +491 -0
  67. package/dist/localization.js.map +1 -0
  68. package/dist/methods.js +1719 -124
  69. package/dist/methods.js.map +1 -1
  70. package/dist/money.d.ts +1406 -0
  71. package/dist/money.js +1090 -0
  72. package/dist/money.js.map +1 -0
  73. package/dist/network.d.ts +4 -5
  74. package/dist/network.js +3 -4
  75. package/dist/network.js.map +1 -1
  76. package/dist/notify.d.ts +321 -124
  77. package/dist/notify.js +223 -73
  78. package/dist/notify.js.map +1 -1
  79. package/dist/observability.d.ts +184 -7
  80. package/dist/observability.js +156 -8
  81. package/dist/observability.js.map +1 -1
  82. package/dist/release.d.ts +14 -15
  83. package/dist/release.js +3 -4
  84. package/dist/release.js.map +1 -1
  85. package/dist/runners.d.ts +2 -3
  86. package/dist/runners.js +3 -4
  87. package/dist/runners.js.map +1 -1
  88. package/dist/runtime.d.ts +5 -1
  89. package/dist/runtime.js +7 -3
  90. package/dist/runtime.js.map +1 -1
  91. package/dist/sandboxes.d.ts +64 -20
  92. package/dist/sandboxes.js +9 -4
  93. package/dist/sandboxes.js.map +1 -1
  94. package/dist/secrets.d.ts +6 -6
  95. package/dist/secrets.js +4 -4
  96. package/dist/workflows.d.ts +850 -12
  97. package/dist/workflows.js +672 -3
  98. package/dist/workflows.js.map +1 -1
  99. package/package.json +1 -1
package/dist/money.js ADDED
@@ -0,0 +1,1090 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@c8aac0afaf7591d0d5efa1ba6a8540d723d41a97ce7ad5d68601380ef3ab4783. Do not edit.
2
+ // `sylphx.money.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.money.v1.AppStoreConnection': [
7
+ ['bundleIds', 'bundle_ids'],
8
+ ['issuerId', 'issuer_id'],
9
+ ['keyId', 'key_id'],
10
+ ['privateKey', 'private_key'],
11
+ ['appAppleId', 'app_apple_id'],
12
+ ['accountTokenPrefix', 'account_token_prefix'],
13
+ ],
14
+ 'sylphx.money.v1.CancelCustomerSubscriptionRequest': [
15
+ ['atPeriodEnd', 'at_period_end'],
16
+ ['refundLastPayment', 'refund_last_payment'],
17
+ ],
18
+ 'sylphx.money.v1.Catalog': [
19
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
20
+ ['spec', 'spec', 'sylphx.money.v1.CatalogSpec'],
21
+ ['status', 'status', 'sylphx.money.v1.CatalogStatus'],
22
+ ],
23
+ 'sylphx.money.v1.CatalogSpec': [
24
+ ['features', 'features', 'sylphx.money.v1.Feature'],
25
+ ['products', 'products', 'sylphx.money.v1.Product'],
26
+ ['clientGrantTtl', 'client_grant_ttl'],
27
+ ['refundClawBack', 'refund_claw_back'],
28
+ ],
29
+ 'sylphx.money.v1.CatalogStatus': [
30
+ ['observedGeneration', 'observed_generation'],
31
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
32
+ ['syncTime', 'sync_time'],
33
+ ['processorPriceIds', 'processor_price_ids', undefined, 'map'],
34
+ ],
35
+ 'sylphx.money.v1.ChangeCustomerSubscriptionPlanRequest': [
36
+ ['prorationBehavior', 'proration_behavior'],
37
+ ['validateOnly', 'validate_only'],
38
+ ],
39
+ 'sylphx.money.v1.CheckEntitlementRequest': [
40
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
41
+ ],
42
+ 'sylphx.money.v1.CheckEntitlementResponse': [
43
+ ['entitlementGrant', 'entitlement_grant'],
44
+ ['expireTime', 'expire_time'],
45
+ ],
46
+ 'sylphx.money.v1.CheckoutSession': [
47
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
48
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
49
+ ['lineItems', 'line_items', 'sylphx.money.v1.LineItem'],
50
+ ['successUrl', 'success_url'],
51
+ ['cancelUrl', 'cancel_url'],
52
+ ['currencyCode', 'currency_code'],
53
+ ['metadata', 'metadata', undefined, 'map'],
54
+ ['allowPromotionCodes', 'allow_promotion_codes'],
55
+ ['expireTime', 'expire_time'],
56
+ ['processorSessionId', 'processor_session_id'],
57
+ ],
58
+ 'sylphx.money.v1.ConnectMerchantAccountRequest': [
59
+ ['merchantAccountId', 'merchant_account_id'],
60
+ ['returnUrl', 'return_url'],
61
+ ['restrictedKey', 'restricted_key'],
62
+ ],
63
+ 'sylphx.money.v1.ConnectMerchantAccountResponse': [
64
+ ['authorizeUrl', 'authorize_url'],
65
+ ['expireTime', 'expire_time'],
66
+ ['merchantAccount', 'merchant_account', 'sylphx.money.v1.MerchantAccount'],
67
+ ],
68
+ 'sylphx.money.v1.CreateCheckoutSessionRequest': [
69
+ ['checkoutSession', 'checkout_session', 'sylphx.money.v1.CheckoutSession'],
70
+ ['checkoutSessionId', 'checkout_session_id'],
71
+ ],
72
+ 'sylphx.money.v1.CreatePortalSessionRequest': [
73
+ ['portalSession', 'portal_session', 'sylphx.money.v1.PortalSession'],
74
+ ['portalSessionId', 'portal_session_id'],
75
+ ],
76
+ 'sylphx.money.v1.CreateStoreConnectionRequest': [
77
+ ['storeConnectionId', 'store_connection_id'],
78
+ ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
79
+ ['validateOnly', 'validate_only'],
80
+ ],
81
+ 'sylphx.money.v1.CustomerSubscription': [
82
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
83
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
84
+ ['processorSubscriptionId', 'processor_subscription_id'],
85
+ ['items', 'items', 'sylphx.money.v1.LineItem'],
86
+ ['currentPeriodEndTime', 'current_period_end_time'],
87
+ ['cancelAtPeriodEnd', 'cancel_at_period_end'],
88
+ ['trialEndTime', 'trial_end_time'],
89
+ ['metadata', 'metadata', undefined, 'json'],
90
+ ],
91
+ 'sylphx.money.v1.DeleteStoreConnectionRequest': [],
92
+ 'sylphx.money.v1.DisconnectMerchantAccountRequest': [],
93
+ 'sylphx.money.v1.EntitlementGrant': [
94
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
95
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
96
+ ['expireTime', 'expire_time'],
97
+ ],
98
+ 'sylphx.money.v1.Feature': [
99
+ ['displayName', 'display_name'],
100
+ ],
101
+ 'sylphx.money.v1.GenerateLicenceKeyRequest': [
102
+ ['licenceKeyId', 'licence_key_id'],
103
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
104
+ ],
105
+ 'sylphx.money.v1.GetCatalogRequest': [],
106
+ 'sylphx.money.v1.GetCheckoutSessionRequest': [],
107
+ 'sylphx.money.v1.GetCustomerSubscriptionRequest': [],
108
+ 'sylphx.money.v1.GetEntitlementGrantRequest': [],
109
+ 'sylphx.money.v1.GetLicenceKeyRequest': [],
110
+ 'sylphx.money.v1.GetMerchantAccountRequest': [],
111
+ 'sylphx.money.v1.GetPortalSessionRequest': [],
112
+ 'sylphx.money.v1.GetStoreConnectionRequest': [],
113
+ 'sylphx.money.v1.GetStorePurchaseRequest': [],
114
+ 'sylphx.money.v1.GooglePlayConnection': [
115
+ ['packageNames', 'package_names'],
116
+ ['serviceAccountJson', 'service_account_json'],
117
+ ['notificationAudience', 'notification_audience'],
118
+ ['notificationServiceAccount', 'notification_service_account'],
119
+ ],
120
+ 'sylphx.money.v1.ImportLicenceKeyRequest': [
121
+ ['licenceKeyId', 'licence_key_id'],
122
+ ['privateKeyPkcs8', 'private_key_pkcs8'],
123
+ ['expectedPublicKey', 'expected_public_key'],
124
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
125
+ ],
126
+ 'sylphx.money.v1.LicenceKey': [
127
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
128
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
129
+ ['status', 'status', 'sylphx.money.v1.LicenceKeyStatus'],
130
+ ],
131
+ 'sylphx.money.v1.LicenceKeySpec': [],
132
+ 'sylphx.money.v1.LicenceKeyStatus': [
133
+ ['observedGeneration', 'observed_generation'],
134
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
135
+ ['publicKey', 'public_key'],
136
+ ['retireTime', 'retire_time'],
137
+ ],
138
+ 'sylphx.money.v1.LicencePolicy': [
139
+ ['tokenProduct', 'token_product'],
140
+ ['term', 'term', 'sylphx.money.v1.LicenceTerm'],
141
+ ],
142
+ 'sylphx.money.v1.LicenceTerm': [],
143
+ 'sylphx.money.v1.LicenceToken': [
144
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
145
+ ['tokenProduct', 'token_product'],
146
+ ['issueTime', 'issue_time'],
147
+ ['expireTime', 'expire_time'],
148
+ ],
149
+ 'sylphx.money.v1.LineItem': [],
150
+ 'sylphx.money.v1.ListCustomerSubscriptionsRequest': [
151
+ ['pageSize', 'page_size'],
152
+ ['pageToken', 'page_token'],
153
+ ],
154
+ 'sylphx.money.v1.ListCustomerSubscriptionsResponse': [
155
+ ['customerSubscriptions', 'customer_subscriptions', 'sylphx.money.v1.CustomerSubscription'],
156
+ ['nextPageToken', 'next_page_token'],
157
+ ],
158
+ 'sylphx.money.v1.ListEntitlementGrantsRequest': [
159
+ ['pageSize', 'page_size'],
160
+ ['pageToken', 'page_token'],
161
+ ],
162
+ 'sylphx.money.v1.ListEntitlementGrantsResponse': [
163
+ ['entitlementGrants', 'entitlement_grants', 'sylphx.money.v1.EntitlementGrant'],
164
+ ['nextPageToken', 'next_page_token'],
165
+ ],
166
+ 'sylphx.money.v1.ListLicenceKeysRequest': [
167
+ ['pageSize', 'page_size'],
168
+ ['pageToken', 'page_token'],
169
+ ],
170
+ 'sylphx.money.v1.ListLicenceKeysResponse': [
171
+ ['licenceKeys', 'licence_keys', 'sylphx.money.v1.LicenceKey'],
172
+ ['nextPageToken', 'next_page_token'],
173
+ ],
174
+ 'sylphx.money.v1.ListLicenceTokensRequest': [
175
+ ['pageSize', 'page_size'],
176
+ ['pageToken', 'page_token'],
177
+ ],
178
+ 'sylphx.money.v1.ListLicenceTokensResponse': [
179
+ ['licenceTokens', 'licence_tokens', 'sylphx.money.v1.LicenceToken'],
180
+ ['nextPageToken', 'next_page_token'],
181
+ ],
182
+ 'sylphx.money.v1.ListMerchantAccountsRequest': [
183
+ ['pageSize', 'page_size'],
184
+ ['pageToken', 'page_token'],
185
+ ],
186
+ 'sylphx.money.v1.ListMerchantAccountsResponse': [
187
+ ['merchantAccounts', 'merchant_accounts', 'sylphx.money.v1.MerchantAccount'],
188
+ ['nextPageToken', 'next_page_token'],
189
+ ],
190
+ 'sylphx.money.v1.ListStoreConnectionsRequest': [
191
+ ['pageSize', 'page_size'],
192
+ ['pageToken', 'page_token'],
193
+ ],
194
+ 'sylphx.money.v1.ListStoreConnectionsResponse': [
195
+ ['storeConnections', 'store_connections', 'sylphx.money.v1.StoreConnection'],
196
+ ['nextPageToken', 'next_page_token'],
197
+ ],
198
+ 'sylphx.money.v1.ListStorePurchasesRequest': [
199
+ ['pageSize', 'page_size'],
200
+ ['pageToken', 'page_token'],
201
+ ],
202
+ 'sylphx.money.v1.ListStorePurchasesResponse': [
203
+ ['storePurchases', 'store_purchases', 'sylphx.money.v1.StorePurchase'],
204
+ ['nextPageToken', 'next_page_token'],
205
+ ],
206
+ 'sylphx.money.v1.MerchantAccount': [
207
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
208
+ ['accountId', 'account_id'],
209
+ ['chargesEnabled', 'charges_enabled'],
210
+ ['payoutsEnabled', 'payouts_enabled'],
211
+ ['businessName', 'business_name'],
212
+ ['regionCode', 'region_code'],
213
+ ['defaultCurrencyCode', 'default_currency_code'],
214
+ ['refreshTime', 'refresh_time'],
215
+ ],
216
+ 'sylphx.money.v1.PortalSession': [
217
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
218
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
219
+ ['returnUrl', 'return_url'],
220
+ ],
221
+ 'sylphx.money.v1.Price': [
222
+ ['recurringInterval', 'recurring_interval'],
223
+ ['recurringIntervalCount', 'recurring_interval_count'],
224
+ ['unitAmounts', 'unit_amounts', undefined, 'map'],
225
+ ['taxBehavior', 'tax_behavior'],
226
+ ['trialDays', 'trial_days'],
227
+ ['defaultCurrency', 'default_currency'],
228
+ ],
229
+ 'sylphx.money.v1.Product': [
230
+ ['displayName', 'display_name'],
231
+ ['features', 'features', undefined, 'map'],
232
+ ['prices', 'prices', 'sylphx.money.v1.Price'],
233
+ ['storeProductIds', 'store_product_ids', undefined, 'map'],
234
+ ['grants', 'grants', undefined, 'map'],
235
+ ['licence', 'licence', 'sylphx.money.v1.LicencePolicy'],
236
+ ],
237
+ 'sylphx.money.v1.RefreshMerchantAccountRequest': [],
238
+ 'sylphx.money.v1.ResumeCustomerSubscriptionRequest': [],
239
+ 'sylphx.money.v1.RetireLicenceKeyRequest': [],
240
+ 'sylphx.money.v1.StoreConnection': [
241
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
242
+ ['spec', 'spec', 'sylphx.money.v1.StoreConnectionSpec'],
243
+ ['status', 'status', 'sylphx.money.v1.StoreConnectionStatus'],
244
+ ],
245
+ 'sylphx.money.v1.StoreConnectionSpec': [
246
+ ['appStore', 'app_store', 'sylphx.money.v1.AppStoreConnection'],
247
+ ['googlePlay', 'google_play', 'sylphx.money.v1.GooglePlayConnection'],
248
+ ['allowSandbox', 'allow_sandbox'],
249
+ ['requireAccountToken', 'require_account_token'],
250
+ ],
251
+ 'sylphx.money.v1.StoreConnectionStatus': [
252
+ ['observedGeneration', 'observed_generation'],
253
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
254
+ ['credentialSet', 'credential_set'],
255
+ ['notificationUrl', 'notification_url'],
256
+ ['serviceAccountEmail', 'service_account_email'],
257
+ ],
258
+ 'sylphx.money.v1.StorePurchase': [
259
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
260
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
261
+ ['productId', 'product_id'],
262
+ ['bundleOrPackage', 'bundle_or_package'],
263
+ ['transactionId', 'transaction_id'],
264
+ ['originalTransactionId', 'original_transaction_id'],
265
+ ['purchaseTime', 'purchase_time'],
266
+ ['revokeTime', 'revoke_time'],
267
+ ['currencyCode', 'currency_code'],
268
+ ['customerSubscription', 'customer_subscription'],
269
+ ['clawBack', 'claw_back'],
270
+ ],
271
+ 'sylphx.money.v1.Subject': [
272
+ ['endUser', 'end_user'],
273
+ ['customerOrganization', 'customer_organization'],
274
+ ],
275
+ 'sylphx.money.v1.SyncCatalogRequest': [],
276
+ 'sylphx.money.v1.UpdateCatalogRequest': [
277
+ ['catalog', 'catalog', 'sylphx.money.v1.Catalog'],
278
+ ['updateMask', 'update_mask'],
279
+ ['allowMissing', 'allow_missing'],
280
+ ['validateOnly', 'validate_only'],
281
+ ],
282
+ 'sylphx.money.v1.UpdateCustomerSubscriptionQuantityRequest': [
283
+ ['prorationBehavior', 'proration_behavior'],
284
+ ],
285
+ 'sylphx.money.v1.UpdateStoreConnectionRequest': [
286
+ ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
287
+ ['updateMask', 'update_mask'],
288
+ ['allowMissing', 'allow_missing'],
289
+ ['validateOnly', 'validate_only'],
290
+ ],
291
+ 'sylphx.money.v1.VerifyStorePurchaseRequest': [
292
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
293
+ ['signedTransaction', 'signed_transaction'],
294
+ ['purchaseToken', 'purchase_token'],
295
+ ['productId', 'product_id'],
296
+ ['packageName', 'package_name'],
297
+ ['transactionId', 'transaction_id'],
298
+ ['bundleId', 'bundle_id'],
299
+ ],
300
+ 'sylphx.money.v1.VerifyStorePurchaseResponse': [
301
+ ['storePurchase', 'store_purchase', 'sylphx.money.v1.StorePurchase'],
302
+ ['grantToken', 'grant_token'],
303
+ ['alreadyVerified', 'already_verified'],
304
+ ['customerSubscription', 'customer_subscription', 'sylphx.money.v1.CustomerSubscription'],
305
+ ],
306
+ });
307
+ /**
308
+ * MoneyService is Sylphx Money's customer payments: an app sells to its own
309
+ * users through the stores and processors Money integrates once, and asks one
310
+ * question on its request path, "does this subject have this feature"
311
+ * (docs/services/money/customer-payments.md).
312
+ *
313
+ * Namespace of Sylphx Money on `Sylphx`.
314
+ */
315
+ export class MoneyApi {
316
+ /** The `price_catalogs` collection. */
317
+ priceCatalogs;
318
+ /** The `store_connections` collection. */
319
+ storeConnections;
320
+ /** The `store_purchases` collection. */
321
+ storePurchases;
322
+ /** The `customer_subscriptions` collection. */
323
+ customerSubscriptions;
324
+ /** The `entitlement_grants` collection. */
325
+ entitlementGrants;
326
+ /** The `merchant_accounts` collection. */
327
+ merchantAccounts;
328
+ /** The `checkout_sessions` collection. */
329
+ checkoutSessions;
330
+ /** The `portal_sessions` collection. */
331
+ portalSessions;
332
+ /** The `licence_keys` collection. */
333
+ licenceKeys;
334
+ /** The `licence_tokens` collection. */
335
+ licenceTokens;
336
+ constructor(client) {
337
+ this.priceCatalogs = new PriceCatalogsCollection(client);
338
+ this.storeConnections = new StoreConnectionsCollection(client);
339
+ this.storePurchases = new StorePurchasesCollection(client);
340
+ this.customerSubscriptions = new CustomerSubscriptionsCollection(client);
341
+ this.entitlementGrants = new EntitlementGrantsCollection(client);
342
+ this.merchantAccounts = new MerchantAccountsCollection(client);
343
+ this.checkoutSessions = new CheckoutSessionsCollection(client);
344
+ this.portalSessions = new PortalSessionsCollection(client);
345
+ this.licenceKeys = new LicenceKeysCollection(client);
346
+ this.licenceTokens = new LicenceTokensCollection(client);
347
+ }
348
+ }
349
+ /** `price_catalogs` of Sylphx Money: Resource type `money.sylphx.com/PriceCatalog`. */
350
+ export class PriceCatalogsCollection {
351
+ client;
352
+ constructor(client) {
353
+ this.client = client;
354
+ }
355
+ /**
356
+ * Gets the environment's catalog.
357
+ *
358
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}` · permission `billing:read` · effect `read`
359
+ *
360
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
361
+ */
362
+ async get(request) {
363
+ return this.client.call({
364
+ method: 'GET',
365
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'name')}`,
366
+ responseType: 'sylphx.money.v1.Catalog',
367
+ mutation: false,
368
+ });
369
+ }
370
+ /**
371
+ * Updates the environment's catalog: its features and products, whole.
372
+ *
373
+ * `PATCH /v1/{catalog.name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}` · permission `billing:write` · effect `write`
374
+ *
375
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
376
+ */
377
+ async update(request) {
378
+ return this.client.call({
379
+ method: 'PATCH',
380
+ path: `/v1/${runtime.pathParam(request.catalog?.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'catalog.name')}`,
381
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
382
+ body: request.catalog ?? {},
383
+ bodyType: 'sylphx.money.v1.Catalog',
384
+ responseType: 'sylphx.money.v1.Catalog',
385
+ mutation: true,
386
+ });
387
+ }
388
+ /**
389
+ * Pushes the catalog to the merchant account's processor now: products and
390
+ * prices by lookup key; an amount change makes a new price.
391
+ *
392
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}:sync` · permission `billing:write` · effect `write`
393
+ *
394
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
395
+ */
396
+ async sync(request) {
397
+ return this.client.call({
398
+ method: 'POST',
399
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'name')}:sync`,
400
+ body: runtime.omit(request, ['name']),
401
+ bodyType: 'sylphx.money.v1.SyncCatalogRequest',
402
+ responseType: 'sylphx.money.v1.Catalog',
403
+ mutation: true,
404
+ });
405
+ }
406
+ }
407
+ /** `store_connections` of Sylphx Money: Resource type `money.sylphx.com/StoreConnection`. */
408
+ export class StoreConnectionsCollection {
409
+ client;
410
+ constructor(client) {
411
+ this.client = client;
412
+ }
413
+ /**
414
+ * Gets a store connection.
415
+ *
416
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:read` · effect `read`
417
+ *
418
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
419
+ */
420
+ async get(request) {
421
+ return this.client.call({
422
+ method: 'GET',
423
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'name')}`,
424
+ responseType: 'sylphx.money.v1.StoreConnection',
425
+ mutation: false,
426
+ });
427
+ }
428
+ /**
429
+ * Lists store connections.
430
+ *
431
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/store_connections` · permission `billing:read` · effect `read`
432
+ *
433
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
434
+ */
435
+ async list(request) {
436
+ return this.client.call({
437
+ method: 'GET',
438
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_connections`,
439
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
440
+ responseType: 'sylphx.money.v1.ListStoreConnectionsResponse',
441
+ mutation: false,
442
+ });
443
+ }
444
+ /** Every item of every page of `list`. */
445
+ async *listAll(request) {
446
+ let next = request;
447
+ for (;;) {
448
+ const page = await this.list(next);
449
+ yield* page.storeConnections ?? [];
450
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
451
+ return;
452
+ next = { ...request, pageToken: page.nextPageToken };
453
+ }
454
+ }
455
+ /**
456
+ * Creates a store connection; its credential is sealed and never returned.
457
+ *
458
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_connections` · permission `billing:write` · effect `write`
459
+ *
460
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
461
+ */
462
+ async create(request) {
463
+ return this.client.call({
464
+ method: 'POST',
465
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_connections`,
466
+ query: { store_connection_id: request.storeConnectionId, validate_only: request.validateOnly },
467
+ body: request.storeConnection ?? {},
468
+ bodyType: 'sylphx.money.v1.StoreConnection',
469
+ responseType: 'sylphx.money.v1.StoreConnection',
470
+ mutation: true,
471
+ });
472
+ }
473
+ /**
474
+ * Updates a store connection; a new credential replaces the stored one.
475
+ *
476
+ * `PATCH /v1/{store_connection.name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:write` · effect `write`
477
+ *
478
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
479
+ */
480
+ async update(request) {
481
+ return this.client.call({
482
+ method: 'PATCH',
483
+ path: `/v1/${runtime.pathParam(request.storeConnection?.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'store_connection.name')}`,
484
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
485
+ body: request.storeConnection ?? {},
486
+ bodyType: 'sylphx.money.v1.StoreConnection',
487
+ responseType: 'sylphx.money.v1.StoreConnection',
488
+ mutation: true,
489
+ });
490
+ }
491
+ /**
492
+ * Deletes a store connection and its sealed credential.
493
+ *
494
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:write` · effect `destructive`
495
+ *
496
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
497
+ */
498
+ async delete(request) {
499
+ return this.client.call({
500
+ method: 'DELETE',
501
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'name')}`,
502
+ query: { etag: request.etag },
503
+ mutation: true,
504
+ });
505
+ }
506
+ }
507
+ /** `store_purchases` of Sylphx Money: Resource type `money.sylphx.com/StorePurchase`. */
508
+ export class StorePurchasesCollection {
509
+ client;
510
+ constructor(client) {
511
+ this.client = client;
512
+ }
513
+ /**
514
+ * Verifies a store purchase with the store, binds it to the subject, and
515
+ * returns its record and a signed grant. Re-verifying returns the same
516
+ * record and grant. Called from the app's server with a secret key that
517
+ * holds `billing:write`; a publishable key cannot call it.
518
+ *
519
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases:verify` · permission `billing:write` · effect `write`
520
+ *
521
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_IN_USE`, `UNAVAILABLE`.
522
+ */
523
+ async verify(request) {
524
+ return this.client.call({
525
+ method: 'POST',
526
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_purchases:verify`,
527
+ body: runtime.omit(request, ['parent']),
528
+ bodyType: 'sylphx.money.v1.VerifyStorePurchaseRequest',
529
+ responseType: 'sylphx.money.v1.VerifyStorePurchaseResponse',
530
+ mutation: true,
531
+ });
532
+ }
533
+ /**
534
+ * Gets a store purchase.
535
+ *
536
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/store_purchases/*}` · permission `billing:read` · effect `read`
537
+ *
538
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
539
+ */
540
+ async get(request) {
541
+ return this.client.call({
542
+ method: 'GET',
543
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_purchases/*', 'name')}`,
544
+ responseType: 'sylphx.money.v1.StorePurchase',
545
+ mutation: false,
546
+ });
547
+ }
548
+ /**
549
+ * Lists store purchases, newest first.
550
+ *
551
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases` · permission `billing:read` · effect `read`
552
+ *
553
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
554
+ */
555
+ async list(request) {
556
+ return this.client.call({
557
+ method: 'GET',
558
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_purchases`,
559
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
560
+ responseType: 'sylphx.money.v1.ListStorePurchasesResponse',
561
+ mutation: false,
562
+ });
563
+ }
564
+ /** Every item of every page of `list`. */
565
+ async *listAll(request) {
566
+ let next = request;
567
+ for (;;) {
568
+ const page = await this.list(next);
569
+ yield* page.storePurchases ?? [];
570
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
571
+ return;
572
+ next = { ...request, pageToken: page.nextPageToken };
573
+ }
574
+ }
575
+ }
576
+ /** `customer_subscriptions` of Sylphx Money: Resource type `money.sylphx.com/CustomerSubscription`. */
577
+ export class CustomerSubscriptionsCollection {
578
+ client;
579
+ constructor(client) {
580
+ this.client = client;
581
+ }
582
+ /**
583
+ * Gets a customer subscription.
584
+ *
585
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}` · permission `billing:read` · effect `read`
586
+ *
587
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
588
+ */
589
+ async get(request) {
590
+ return this.client.call({
591
+ method: 'GET',
592
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}`,
593
+ responseType: 'sylphx.money.v1.CustomerSubscription',
594
+ mutation: false,
595
+ });
596
+ }
597
+ /**
598
+ * Lists customer subscriptions, newest first.
599
+ *
600
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/customer_subscriptions` · permission `billing:read` · effect `read`
601
+ *
602
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
603
+ */
604
+ async list(request) {
605
+ return this.client.call({
606
+ method: 'GET',
607
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/customer_subscriptions`,
608
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
609
+ responseType: 'sylphx.money.v1.ListCustomerSubscriptionsResponse',
610
+ mutation: false,
611
+ });
612
+ }
613
+ /** Every item of every page of `list`. */
614
+ async *listAll(request) {
615
+ let next = request;
616
+ for (;;) {
617
+ const page = await this.list(next);
618
+ yield* page.customerSubscriptions ?? [];
619
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
620
+ return;
621
+ next = { ...request, pageToken: page.nextPageToken };
622
+ }
623
+ }
624
+ /**
625
+ * Cancels a web subscription, now or at the period end, and optionally
626
+ * refunds its last payment (for example a statutory cancellation window).
627
+ *
628
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:cancel` · permission `billing:write` · effect `destructive`
629
+ *
630
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
631
+ */
632
+ async cancel(request) {
633
+ return this.client.call({
634
+ method: 'POST',
635
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:cancel`,
636
+ body: runtime.omit(request, ['name']),
637
+ bodyType: 'sylphx.money.v1.CancelCustomerSubscriptionRequest',
638
+ responseType: 'sylphx.money.v1.CustomerSubscription',
639
+ mutation: true,
640
+ });
641
+ }
642
+ /**
643
+ * Resumes a web subscription set to cancel at its period end.
644
+ *
645
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:resume` · permission `billing:write` · effect `write`
646
+ *
647
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
648
+ */
649
+ async resume(request) {
650
+ return this.client.call({
651
+ method: 'POST',
652
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:resume`,
653
+ body: runtime.omit(request, ['name']),
654
+ bodyType: 'sylphx.money.v1.ResumeCustomerSubscriptionRequest',
655
+ responseType: 'sylphx.money.v1.CustomerSubscription',
656
+ mutation: true,
657
+ });
658
+ }
659
+ /**
660
+ * Changes the seat quantity of a web subscription, now, and syncs the
661
+ * processor's subscription item to it. A retry with the same
662
+ * `Idempotency-Key` (required) and the same request changes nothing twice.
663
+ *
664
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:updateQuantity` · permission `billing:write` · effect `write`
665
+ *
666
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
667
+ */
668
+ async updateQuantity(request) {
669
+ return this.client.call({
670
+ method: 'POST',
671
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:updateQuantity`,
672
+ body: runtime.omit(request, ['name']),
673
+ bodyType: 'sylphx.money.v1.UpdateCustomerSubscriptionQuantityRequest',
674
+ responseType: 'sylphx.money.v1.CustomerSubscription',
675
+ mutation: true,
676
+ });
677
+ }
678
+ /**
679
+ * Move a web subscription onto another recurring catalog plan.
680
+ *
681
+ * Stripe changes the subscription's one item and bills the difference as
682
+ * `proration_behavior` says; Money reads the subscription back and replaces
683
+ * its entitlements from it. Needs an `Idempotency-Key` unless `validate_only`.
684
+ * A store subscription is refused (`store_managed`): the store owns it.
685
+ *
686
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:changePlan` · permission `billing:write` · effect `write`
687
+ *
688
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
689
+ */
690
+ async changePlan(request) {
691
+ return this.client.call({
692
+ method: 'POST',
693
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:changePlan`,
694
+ body: runtime.omit(request, ['name']),
695
+ bodyType: 'sylphx.money.v1.ChangeCustomerSubscriptionPlanRequest',
696
+ responseType: 'sylphx.money.v1.CustomerSubscription',
697
+ mutation: true,
698
+ });
699
+ }
700
+ }
701
+ /** `entitlement_grants` of Sylphx Money: Resource type `money.sylphx.com/EntitlementGrant`. */
702
+ export class EntitlementGrantsCollection {
703
+ client;
704
+ constructor(client) {
705
+ this.client = client;
706
+ }
707
+ /**
708
+ * Gets an entitlement grant.
709
+ *
710
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/entitlement_grants/*}` · permission `billing:read` · effect `read`
711
+ *
712
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
713
+ */
714
+ async get(request) {
715
+ return this.client.call({
716
+ method: 'GET',
717
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entitlement_grants/*', 'name')}`,
718
+ responseType: 'sylphx.money.v1.EntitlementGrant',
719
+ mutation: false,
720
+ });
721
+ }
722
+ /**
723
+ * Lists entitlement grants.
724
+ *
725
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants` · permission `billing:read` · effect `read`
726
+ *
727
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
728
+ */
729
+ async list(request) {
730
+ return this.client.call({
731
+ method: 'GET',
732
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entitlement_grants`,
733
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
734
+ responseType: 'sylphx.money.v1.ListEntitlementGrantsResponse',
735
+ mutation: false,
736
+ });
737
+ }
738
+ /** Every item of every page of `list`. */
739
+ async *listAll(request) {
740
+ let next = request;
741
+ for (;;) {
742
+ const page = await this.list(next);
743
+ yield* page.entitlementGrants ?? [];
744
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
745
+ return;
746
+ next = { ...request, pageToken: page.nextPageToken };
747
+ }
748
+ }
749
+ /**
750
+ * Answers whether a subject holds a feature now, and how much of it.
751
+ *
752
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants:check` · permission `billing:read` · effect `read`
753
+ *
754
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
755
+ */
756
+ async check(request) {
757
+ return this.client.call({
758
+ method: 'POST',
759
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entitlement_grants:check`,
760
+ body: runtime.omit(request, ['parent']),
761
+ bodyType: 'sylphx.money.v1.CheckEntitlementRequest',
762
+ responseType: 'sylphx.money.v1.CheckEntitlementResponse',
763
+ mutation: true,
764
+ });
765
+ }
766
+ }
767
+ /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
768
+ export class MerchantAccountsCollection {
769
+ client;
770
+ constructor(client) {
771
+ this.client = client;
772
+ }
773
+ /**
774
+ * Gets a merchant account.
775
+ *
776
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
777
+ *
778
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
779
+ */
780
+ async get(request) {
781
+ return this.client.call({
782
+ method: 'GET',
783
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}`,
784
+ responseType: 'sylphx.money.v1.MerchantAccount',
785
+ mutation: false,
786
+ });
787
+ }
788
+ /**
789
+ * Lists merchant accounts.
790
+ *
791
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
792
+ *
793
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
794
+ */
795
+ async list(request) {
796
+ return this.client.call({
797
+ method: 'GET',
798
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts`,
799
+ query: { page_size: request.pageSize, page_token: request.pageToken },
800
+ responseType: 'sylphx.money.v1.ListMerchantAccountsResponse',
801
+ mutation: false,
802
+ });
803
+ }
804
+ /** Every item of every page of `list`. */
805
+ async *listAll(request) {
806
+ let next = request;
807
+ for (;;) {
808
+ const page = await this.list(next);
809
+ yield* page.merchantAccounts ?? [];
810
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
811
+ return;
812
+ next = { ...request, pageToken: page.nextPageToken };
813
+ }
814
+ }
815
+ /**
816
+ * Starts connecting a Stripe account: returns the processor's authorisation
817
+ * URL for an org owner to open, which the processor's redirect completes.
818
+ * With a restricted key in the request the account connects at once
819
+ * instead, and the connected merchant account comes back in the response.
820
+ *
821
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
822
+ *
823
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
824
+ */
825
+ async connect(request) {
826
+ return this.client.call({
827
+ method: 'POST',
828
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts:connect`,
829
+ body: runtime.omit(request, ['parent']),
830
+ bodyType: 'sylphx.money.v1.ConnectMerchantAccountRequest',
831
+ responseType: 'sylphx.money.v1.ConnectMerchantAccountResponse',
832
+ mutation: true,
833
+ });
834
+ }
835
+ /**
836
+ * Reads the connected account back from the processor.
837
+ *
838
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
839
+ *
840
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
841
+ */
842
+ async refresh(request) {
843
+ return this.client.call({
844
+ method: 'POST',
845
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:refresh`,
846
+ body: runtime.omit(request, ['name']),
847
+ bodyType: 'sylphx.money.v1.RefreshMerchantAccountRequest',
848
+ responseType: 'sylphx.money.v1.MerchantAccount',
849
+ mutation: true,
850
+ });
851
+ }
852
+ /**
853
+ * Disconnects the account: Sylphx loses access; checkout is refused.
854
+ *
855
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
856
+ *
857
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
858
+ */
859
+ async disconnect(request) {
860
+ return this.client.call({
861
+ method: 'POST',
862
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:disconnect`,
863
+ body: runtime.omit(request, ['name']),
864
+ bodyType: 'sylphx.money.v1.DisconnectMerchantAccountRequest',
865
+ responseType: 'sylphx.money.v1.MerchantAccount',
866
+ mutation: true,
867
+ });
868
+ }
869
+ }
870
+ /** `checkout_sessions` of Sylphx Money: Resource type `money.sylphx.com/CheckoutSession`. */
871
+ export class CheckoutSessionsCollection {
872
+ client;
873
+ constructor(client) {
874
+ this.client = client;
875
+ }
876
+ /**
877
+ * Creates a hosted checkout for a subject.
878
+ *
879
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/checkout_sessions` · permission `billing:write` · effect `write`
880
+ *
881
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
882
+ */
883
+ async create(request) {
884
+ return this.client.call({
885
+ method: 'POST',
886
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/checkout_sessions`,
887
+ query: { checkout_session_id: request.checkoutSessionId },
888
+ body: request.checkoutSession ?? {},
889
+ bodyType: 'sylphx.money.v1.CheckoutSession',
890
+ responseType: 'sylphx.money.v1.CheckoutSession',
891
+ mutation: true,
892
+ });
893
+ }
894
+ /**
895
+ * Gets a checkout session.
896
+ *
897
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/checkout_sessions/*}` · permission `billing:read` · effect `read`
898
+ *
899
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
900
+ */
901
+ async get(request) {
902
+ return this.client.call({
903
+ method: 'GET',
904
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/checkout_sessions/*', 'name')}`,
905
+ responseType: 'sylphx.money.v1.CheckoutSession',
906
+ mutation: false,
907
+ });
908
+ }
909
+ }
910
+ /** `portal_sessions` of Sylphx Money: Resource type `money.sylphx.com/PortalSession`. */
911
+ export class PortalSessionsCollection {
912
+ client;
913
+ constructor(client) {
914
+ this.client = client;
915
+ }
916
+ /**
917
+ * Creates a customer portal session for a subject.
918
+ *
919
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/portal_sessions` · permission `billing:write` · effect `write`
920
+ *
921
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
922
+ */
923
+ async create(request) {
924
+ return this.client.call({
925
+ method: 'POST',
926
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/portal_sessions`,
927
+ query: { portal_session_id: request.portalSessionId },
928
+ body: request.portalSession ?? {},
929
+ bodyType: 'sylphx.money.v1.PortalSession',
930
+ responseType: 'sylphx.money.v1.PortalSession',
931
+ mutation: true,
932
+ });
933
+ }
934
+ /**
935
+ * Gets a portal session.
936
+ *
937
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/portal_sessions/*}` · permission `billing:read` · effect `read`
938
+ *
939
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
940
+ */
941
+ async get(request) {
942
+ return this.client.call({
943
+ method: 'GET',
944
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/portal_sessions/*', 'name')}`,
945
+ responseType: 'sylphx.money.v1.PortalSession',
946
+ mutation: false,
947
+ });
948
+ }
949
+ }
950
+ /** `licence_keys` of Sylphx Money: Resource type `money.sylphx.com/LicenceKey`. */
951
+ export class LicenceKeysCollection {
952
+ client;
953
+ constructor(client) {
954
+ this.client = client;
955
+ }
956
+ /**
957
+ * Generates a licence key: Money creates the Ed25519 key, seals it, and never
958
+ * returns the private half. Needs the approval-class scope, which the developer
959
+ * role does not hold.
960
+ *
961
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys:generate` · permission `billing:licence_keys.approve` · effect `write`
962
+ *
963
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
964
+ */
965
+ async generate(request) {
966
+ return this.client.call({
967
+ method: 'POST',
968
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys:generate`,
969
+ body: runtime.omit(request, ['parent']),
970
+ bodyType: 'sylphx.money.v1.GenerateLicenceKeyRequest',
971
+ responseType: 'sylphx.money.v1.LicenceKey',
972
+ mutation: true,
973
+ });
974
+ }
975
+ /**
976
+ * Imports an existing Ed25519 key (PKCS8), for a key already pinned in shipped
977
+ * clients. Refused unless the expected public key is the imported key's public
978
+ * half.
979
+ *
980
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys:import` · permission `billing:licence_keys.approve` · effect `write`
981
+ *
982
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
983
+ */
984
+ async import(request) {
985
+ return this.client.call({
986
+ method: 'POST',
987
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys:import`,
988
+ body: runtime.omit(request, ['parent']),
989
+ bodyType: 'sylphx.money.v1.ImportLicenceKeyRequest',
990
+ responseType: 'sylphx.money.v1.LicenceKey',
991
+ mutation: true,
992
+ });
993
+ }
994
+ /**
995
+ * Retires a licence key: it stops signing new terms and stays exported for
996
+ * verification.
997
+ *
998
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/licence_keys/*}:retire` · permission `billing:licence_keys.approve` · effect `write`
999
+ *
1000
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1001
+ */
1002
+ async retire(request) {
1003
+ return this.client.call({
1004
+ method: 'POST',
1005
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/licence_keys/*', 'name')}:retire`,
1006
+ body: runtime.omit(request, ['name']),
1007
+ bodyType: 'sylphx.money.v1.RetireLicenceKeyRequest',
1008
+ responseType: 'sylphx.money.v1.LicenceKey',
1009
+ mutation: true,
1010
+ });
1011
+ }
1012
+ /**
1013
+ * Gets a licence key (its public half, never the private).
1014
+ *
1015
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/licence_keys/*}` · permission `billing:read` · effect `read`
1016
+ *
1017
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1018
+ */
1019
+ async get(request) {
1020
+ return this.client.call({
1021
+ method: 'GET',
1022
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/licence_keys/*', 'name')}`,
1023
+ responseType: 'sylphx.money.v1.LicenceKey',
1024
+ mutation: false,
1025
+ });
1026
+ }
1027
+ /**
1028
+ * Lists licence keys, newest first.
1029
+ *
1030
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys` · permission `billing:read` · effect `read`
1031
+ *
1032
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `PAGE_TOKEN_MISMATCH`.
1033
+ */
1034
+ async list(request) {
1035
+ return this.client.call({
1036
+ method: 'GET',
1037
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys`,
1038
+ query: { page_size: request.pageSize, page_token: request.pageToken },
1039
+ responseType: 'sylphx.money.v1.ListLicenceKeysResponse',
1040
+ mutation: false,
1041
+ });
1042
+ }
1043
+ /** Every item of every page of `list`. */
1044
+ async *listAll(request) {
1045
+ let next = request;
1046
+ for (;;) {
1047
+ const page = await this.list(next);
1048
+ yield* page.licenceKeys ?? [];
1049
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1050
+ return;
1051
+ next = { ...request, pageToken: page.nextPageToken };
1052
+ }
1053
+ }
1054
+ }
1055
+ /** `licence_tokens` of Sylphx Money: Resource type `money.sylphx.com/LicenceToken`. */
1056
+ export class LicenceTokensCollection {
1057
+ client;
1058
+ constructor(client) {
1059
+ this.client = client;
1060
+ }
1061
+ /**
1062
+ * Lists a subject's unexpired offline licence tokens of paid orders, for
1063
+ * support. Re-derived from the frozen terms: the same bytes as at purchase.
1064
+ *
1065
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_tokens` · permission `billing:read` · effect `read`
1066
+ *
1067
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1068
+ */
1069
+ async list(request) {
1070
+ return this.client.call({
1071
+ method: 'GET',
1072
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_tokens`,
1073
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1074
+ responseType: 'sylphx.money.v1.ListLicenceTokensResponse',
1075
+ mutation: false,
1076
+ });
1077
+ }
1078
+ /** Every item of every page of `list`. */
1079
+ async *listAll(request) {
1080
+ let next = request;
1081
+ for (;;) {
1082
+ const page = await this.list(next);
1083
+ yield* page.licenceTokens ?? [];
1084
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1085
+ return;
1086
+ next = { ...request, pageToken: page.nextPageToken };
1087
+ }
1088
+ }
1089
+ }
1090
+ //# sourceMappingURL=money.js.map