@sylphx/sdk 0.32.5 → 0.32.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/money.js CHANGED
@@ -3,6 +3,9 @@
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
5
5
  runtime.registerSchemas({
6
+ 'sylphx.money.v1.AdvanceTestClockRequest': [
7
+ ['frozenTime', 'frozen_time'],
8
+ ],
6
9
  'sylphx.money.v1.AppStoreConnection': [
7
10
  ['bundleIds', 'bundle_ids'],
8
11
  ['issuerId', 'issuer_id'],
@@ -11,6 +14,38 @@ runtime.registerSchemas({
11
14
  ['appAppleId', 'app_apple_id'],
12
15
  ['accountTokenPrefix', 'account_token_prefix'],
13
16
  ],
17
+ 'sylphx.money.v1.BankReceipt': [
18
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
19
+ ['checkoutSession', 'checkout_session'],
20
+ ['bankTransactionId', 'bank_transaction_id'],
21
+ ['amountMinor', 'amount_minor'],
22
+ ['currencyCode', 'currency_code'],
23
+ ['receivedTime', 'received_time'],
24
+ ['payerEvidence', 'payer_evidence'],
25
+ ['holdReason', 'hold_reason'],
26
+ ['entries', 'entries', 'sylphx.money.v1.BankReceiptEntry'],
27
+ ],
28
+ 'sylphx.money.v1.BankReceiptEntry': [
29
+ ['createTime', 'create_time'],
30
+ ['externalReference', 'external_reference'],
31
+ ],
32
+ 'sylphx.money.v1.BankTransferAccount': [
33
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
34
+ ['accountHolder', 'account_holder'],
35
+ ['bankName', 'bank_name'],
36
+ ['bankCode', 'bank_code'],
37
+ ['accountNumber', 'account_number'],
38
+ ['fpsId', 'fps_id'],
39
+ ['fpsQrPayload', 'fps_qr_payload'],
40
+ ['currencyCode', 'currency_code'],
41
+ ['regionCode', 'region_code'],
42
+ ['qrProfile', 'qr_profile'],
43
+ ],
44
+ 'sylphx.money.v1.BankTransferInstructions': [
45
+ ['account', 'account', 'sylphx.money.v1.BankTransferAccount'],
46
+ ['qrPayload', 'qr_payload'],
47
+ ['qrSvg', 'qr_svg'],
48
+ ],
14
49
  'sylphx.money.v1.BatchIngestUsageEventsRequest': [
15
50
  ['usageEvents', 'usage_events', 'sylphx.money.v1.IngestedUsageEvent'],
16
51
  ],
@@ -108,6 +143,8 @@ runtime.registerSchemas({
108
143
  ['amountTotal', 'amount_total'],
109
144
  ['paymentStatus', 'payment_status'],
110
145
  ['processorPaymentId', 'processor_payment_id'],
146
+ ['paymentMethod', 'payment_method'],
147
+ ['bankTransfer', 'bank_transfer', 'sylphx.money.v1.BankTransferInstructions'],
111
148
  ],
112
149
  'sylphx.money.v1.ClientVerifyStorePurchaseRequest': [
113
150
  ['subject', 'subject', 'sylphx.money.v1.Subject'],
@@ -152,6 +189,10 @@ runtime.registerSchemas({
152
189
  ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
153
190
  ['validateOnly', 'validate_only'],
154
191
  ],
192
+ 'sylphx.money.v1.CreateTestClockRequest': [
193
+ ['testClock', 'test_clock', 'sylphx.money.v1.TestClock'],
194
+ ['testClockId', 'test_clock_id'],
195
+ ],
155
196
  'sylphx.money.v1.CreateUsageEventRequest': [
156
197
  ['usageEvent', 'usage_event', 'sylphx.money.v1.UsageEvent'],
157
198
  ],
@@ -207,6 +248,8 @@ runtime.registerSchemas({
207
248
  ['licenceKeyId', 'licence_key_id'],
208
249
  ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
209
250
  ],
251
+ 'sylphx.money.v1.GetBankReceiptRequest': [],
252
+ 'sylphx.money.v1.GetBankTransferAccountRequest': [],
210
253
  'sylphx.money.v1.GetCatalogRequest': [],
211
254
  'sylphx.money.v1.GetCheckoutPolicyRequest': [],
212
255
  'sylphx.money.v1.GetCheckoutSessionRequest': [],
@@ -226,6 +269,7 @@ runtime.registerSchemas({
226
269
  ],
227
270
  'sylphx.money.v1.GetStoreConnectionRequest': [],
228
271
  'sylphx.money.v1.GetStorePurchaseRequest': [],
272
+ 'sylphx.money.v1.GetTestClockRequest': [],
229
273
  'sylphx.money.v1.GetUsageInvoiceRequest': [],
230
274
  'sylphx.money.v1.GetUsageMeterRequest': [],
231
275
  'sylphx.money.v1.GetUsageReservationRequest': [],
@@ -276,6 +320,14 @@ runtime.registerSchemas({
276
320
  ['expireTime', 'expire_time'],
277
321
  ],
278
322
  'sylphx.money.v1.LineItem': [],
323
+ 'sylphx.money.v1.ListBankReceiptsRequest': [
324
+ ['pageSize', 'page_size'],
325
+ ['pageToken', 'page_token'],
326
+ ],
327
+ 'sylphx.money.v1.ListBankReceiptsResponse': [
328
+ ['bankReceipts', 'bank_receipts', 'sylphx.money.v1.BankReceipt'],
329
+ ['nextPageToken', 'next_page_token'],
330
+ ],
279
331
  'sylphx.money.v1.ListCreditGrantsRequest': [
280
332
  ['pageSize', 'page_size'],
281
333
  ['pageToken', 'page_token'],
@@ -470,6 +522,14 @@ runtime.registerSchemas({
470
522
  ['grants', 'grants', undefined, 'map'],
471
523
  ['licence', 'licence', 'sylphx.money.v1.LicencePolicy'],
472
524
  ],
525
+ 'sylphx.money.v1.RecordBankReceiptRequest': [
526
+ ['checkoutSession', 'checkout_session'],
527
+ ['bankTransactionId', 'bank_transaction_id'],
528
+ ['amountMinor', 'amount_minor'],
529
+ ['currencyCode', 'currency_code'],
530
+ ['receivedTime', 'received_time'],
531
+ ['payerEvidence', 'payer_evidence'],
532
+ ],
473
533
  'sylphx.money.v1.RefreshMerchantAccountRequest': [],
474
534
  'sylphx.money.v1.Refund': [
475
535
  ['checkoutSession', 'checkout_session'],
@@ -486,6 +546,7 @@ runtime.registerSchemas({
486
546
  ],
487
547
  'sylphx.money.v1.ReleaseUsageInvoiceCollectionRequest': [],
488
548
  'sylphx.money.v1.ReleaseUsageReservationRequest': [],
549
+ 'sylphx.money.v1.ResolveBankReceiptRequest': [],
489
550
  'sylphx.money.v1.ResumeCustomerSubscriptionRequest': [],
490
551
  'sylphx.money.v1.RetireLicenceKeyRequest': [],
491
552
  'sylphx.money.v1.RetryProcessorEventRequest': [],
@@ -535,6 +596,9 @@ runtime.registerSchemas({
535
596
  ['unconvertedCount', 'unconverted_count'],
536
597
  ['bookedVolume', 'booked_volume', 'sylphx.money.v1.BookedVolumeLine'],
537
598
  ],
599
+ 'sylphx.money.v1.ReverseBankReceiptRequest': [
600
+ ['externalReference', 'external_reference'],
601
+ ],
538
602
  'sylphx.money.v1.RunRevenueSourceRequest': [
539
603
  ['startDay', 'start_day'],
540
604
  ['endDay', 'end_day'],
@@ -621,9 +685,20 @@ runtime.registerSchemas({
621
685
  ['sourceUrl', 'source_url'],
622
686
  ['effectiveTime', 'effective_time'],
623
687
  ],
688
+ 'sylphx.money.v1.TestClock': [
689
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
690
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
691
+ ['frozenTime', 'frozen_time'],
692
+ ['processorClockId', 'processor_clock_id'],
693
+ ],
624
694
  'sylphx.money.v1.UnconvertedAmount': [
625
695
  ['currencyCode', 'currency_code'],
626
696
  ],
697
+ 'sylphx.money.v1.UpdateBankTransferAccountRequest': [
698
+ ['bankTransferAccount', 'bank_transfer_account', 'sylphx.money.v1.BankTransferAccount'],
699
+ ['updateMask', 'update_mask'],
700
+ ['allowMissing', 'allow_missing'],
701
+ ],
627
702
  'sylphx.money.v1.UpdateCatalogRequest': [
628
703
  ['catalog', 'catalog', 'sylphx.money.v1.Catalog'],
629
704
  ['updateMask', 'update_mask'],
@@ -765,6 +840,10 @@ runtime.registerSchemas({
765
840
  * Namespace of Sylphx Money on `Sylphx`.
766
841
  */
767
842
  export class MoneyApi {
843
+ /** The `bank_transfer_accounts` collection. */
844
+ bankTransferAccounts;
845
+ /** The `bank_receipts` collection. */
846
+ bankReceipts;
768
847
  /** The `processor_events` collection. */
769
848
  processorEvents;
770
849
  /** The `merchant_accounts` collection. */
@@ -781,6 +860,8 @@ export class MoneyApi {
781
860
  customerSubscriptions;
782
861
  /** The `entitlement_grants` collection. */
783
862
  entitlementGrants;
863
+ /** The `test_clocks` collection. */
864
+ testClocks;
784
865
  /** The `checkout_sessions` collection. */
785
866
  checkoutSessions;
786
867
  /** The `tax_threshold_statuses` collection. */
@@ -816,6 +897,8 @@ export class MoneyApi {
816
897
  /** The `exchange_rates` collection. */
817
898
  exchangeRates;
818
899
  constructor(client) {
900
+ this.bankTransferAccounts = new BankTransferAccountsCollection(client);
901
+ this.bankReceipts = new BankReceiptsCollection(client);
819
902
  this.processorEvents = new ProcessorEventsCollection(client);
820
903
  this.merchantAccounts = new MerchantAccountsCollection(client);
821
904
  this.priceCatalogs = new PriceCatalogsCollection(client);
@@ -824,6 +907,7 @@ export class MoneyApi {
824
907
  this.storePurchases = new StorePurchasesCollection(client);
825
908
  this.customerSubscriptions = new CustomerSubscriptionsCollection(client);
826
909
  this.entitlementGrants = new EntitlementGrantsCollection(client);
910
+ this.testClocks = new TestClocksCollection(client);
827
911
  this.checkoutSessions = new CheckoutSessionsCollection(client);
828
912
  this.taxThresholdStatuses = new TaxThresholdStatusesCollection(client);
829
913
  this.portalSessions = new PortalSessionsCollection(client);
@@ -843,6 +927,146 @@ export class MoneyApi {
843
927
  this.exchangeRates = new ExchangeRatesCollection(client);
844
928
  }
845
929
  }
930
+ /** `bank_transfer_accounts` of Sylphx Money: Resource type `money.sylphx.com/BankTransferAccount`. */
931
+ export class BankTransferAccountsCollection {
932
+ client;
933
+ constructor(client) {
934
+ this.client = client;
935
+ }
936
+ /**
937
+ * GetBankTransferAccount through the project-scoped bank transfer API.
938
+ *
939
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/bank_transfer_accounts/*}` · permission `billing:read` · effect `read`
940
+ *
941
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
942
+ */
943
+ async get(request) {
944
+ return this.client.call({
945
+ method: 'GET',
946
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/bank_transfer_accounts/*', 'name')}`,
947
+ responseType: 'sylphx.money.v1.BankTransferAccount',
948
+ mutation: false,
949
+ });
950
+ }
951
+ /**
952
+ * UpdateBankTransferAccount through the project-scoped bank transfer API.
953
+ *
954
+ * `PATCH /v1/{bank_transfer_account.name=orgs/*\/projects/*\/envs/*\/bank_transfer_accounts/*}` · permission `billing:bank_accounts:write` · effect `write`
955
+ *
956
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
957
+ */
958
+ async update(request) {
959
+ return this.client.call({
960
+ method: 'PATCH',
961
+ path: `/v1/${runtime.pathParam(request.bankTransferAccount?.name, 'orgs/*/projects/*/envs/*/bank_transfer_accounts/*', 'bank_transfer_account.name')}`,
962
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing },
963
+ body: request.bankTransferAccount ?? {},
964
+ bodyType: 'sylphx.money.v1.BankTransferAccount',
965
+ responseType: 'sylphx.money.v1.BankTransferAccount',
966
+ mutation: true,
967
+ });
968
+ }
969
+ }
970
+ /** `bank_receipts` of Sylphx Money: Resource type `money.sylphx.com/BankReceipt`. */
971
+ export class BankReceiptsCollection {
972
+ client;
973
+ constructor(client) {
974
+ this.client = client;
975
+ }
976
+ /**
977
+ * GetBankReceipt through the project-scoped bank transfer API.
978
+ *
979
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/bank_receipts/*}` · permission `billing:bank_receipts:read` · effect `read`
980
+ *
981
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
982
+ */
983
+ async get(request) {
984
+ return this.client.call({
985
+ method: 'GET',
986
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/bank_receipts/*', 'name')}`,
987
+ responseType: 'sylphx.money.v1.BankReceipt',
988
+ mutation: false,
989
+ });
990
+ }
991
+ /**
992
+ * Lists incoming bank evidence, including receipts held for review.
993
+ *
994
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/bank_receipts` · permission `billing:bank_receipts:read` · effect `read`
995
+ *
996
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
997
+ */
998
+ async list(request) {
999
+ return this.client.call({
1000
+ method: 'GET',
1001
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/bank_receipts`,
1002
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1003
+ responseType: 'sylphx.money.v1.ListBankReceiptsResponse',
1004
+ mutation: false,
1005
+ });
1006
+ }
1007
+ /** Every item of every page of `list`. */
1008
+ async *listAll(request) {
1009
+ let next = request;
1010
+ for (;;) {
1011
+ const page = await this.list(next);
1012
+ yield* page.bankReceipts ?? [];
1013
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1014
+ return;
1015
+ next = { ...request, pageToken: page.nextPageToken };
1016
+ }
1017
+ }
1018
+ /**
1019
+ * RecordBankReceipt through the project-scoped bank transfer API.
1020
+ *
1021
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/bank_receipts:record` · permission `billing:bank_receipts:write` · effect `write`
1022
+ *
1023
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
1024
+ */
1025
+ async record(request) {
1026
+ return this.client.call({
1027
+ method: 'POST',
1028
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/bank_receipts:record`,
1029
+ body: runtime.omit(request, ['parent']),
1030
+ bodyType: 'sylphx.money.v1.RecordBankReceiptRequest',
1031
+ responseType: 'sylphx.money.v1.BankReceipt',
1032
+ mutation: true,
1033
+ });
1034
+ }
1035
+ /**
1036
+ * ResolveBankReceipt through the project-scoped bank transfer API.
1037
+ *
1038
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/bank_receipts/*}:resolve` · permission `billing:bank_receipts:write` · effect `write`
1039
+ *
1040
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
1041
+ */
1042
+ async resolve(request) {
1043
+ return this.client.call({
1044
+ method: 'POST',
1045
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/bank_receipts/*', 'name')}:resolve`,
1046
+ body: runtime.omit(request, ['name']),
1047
+ bodyType: 'sylphx.money.v1.ResolveBankReceiptRequest',
1048
+ responseType: 'sylphx.money.v1.BankReceipt',
1049
+ mutation: true,
1050
+ });
1051
+ }
1052
+ /**
1053
+ * ReverseBankReceipt through the project-scoped bank transfer API.
1054
+ *
1055
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/bank_receipts/*}:reverse` · permission `billing:bank_receipts:write` · effect `write`
1056
+ *
1057
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `INVALID_STATE`, `ETAG_MISMATCH`, `UNAVAILABLE`.
1058
+ */
1059
+ async reverse(request) {
1060
+ return this.client.call({
1061
+ method: 'POST',
1062
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/bank_receipts/*', 'name')}:reverse`,
1063
+ body: runtime.omit(request, ['name']),
1064
+ bodyType: 'sylphx.money.v1.ReverseBankReceiptRequest',
1065
+ responseType: 'sylphx.money.v1.BankReceipt',
1066
+ mutation: true,
1067
+ });
1068
+ }
1069
+ }
846
1070
  /** `processor_events` of Sylphx Money: Resource type `money.sylphx.com/ProcessorEvent`. */
847
1071
  export class ProcessorEventsCollection {
848
1072
  client;
@@ -1586,6 +1810,66 @@ export class EntitlementGrantsCollection {
1586
1810
  });
1587
1811
  }
1588
1812
  }
1813
+ /** `test_clocks` of Sylphx Money: Resource type `money.sylphx.com/TestClock`. */
1814
+ export class TestClocksCollection {
1815
+ client;
1816
+ constructor(client) {
1817
+ this.client = client;
1818
+ }
1819
+ /**
1820
+ * Creates a test-only Stripe simulation before the subject's first checkout.
1821
+ * No catalogue, payment, subscription, or entitlement is changed.
1822
+ *
1823
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/test_clocks` · permission `billing:write` · effect `write`
1824
+ *
1825
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `UNAVAILABLE`.
1826
+ */
1827
+ async create(request) {
1828
+ return this.client.call({
1829
+ method: 'POST',
1830
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/test_clocks`,
1831
+ query: { test_clock_id: request.testClockId },
1832
+ body: request.testClock ?? {},
1833
+ bodyType: 'sylphx.money.v1.TestClock',
1834
+ responseType: 'sylphx.money.v1.TestClock',
1835
+ mutation: true,
1836
+ });
1837
+ }
1838
+ /**
1839
+ * Reads the owned test clock back from Stripe. Live keys are refused.
1840
+ *
1841
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/test_clocks/*}` · permission `billing:read` · effect `read`
1842
+ *
1843
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1844
+ */
1845
+ async get(request) {
1846
+ return this.client.call({
1847
+ method: 'GET',
1848
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/test_clocks/*', 'name')}`,
1849
+ responseType: 'sylphx.money.v1.TestClock',
1850
+ mutation: false,
1851
+ });
1852
+ }
1853
+ /**
1854
+ * Advances Stripe time, never entitlements. Stripe processes asynchronously;
1855
+ * poll GetTestClock until ready, then observe the genuine webhook's effects.
1856
+ * Time only moves forward, within Stripe's subscription-interval bound.
1857
+ *
1858
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/test_clocks/*}:advance` · permission `billing:write` · effect `write`
1859
+ *
1860
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1861
+ */
1862
+ async advance(request) {
1863
+ return this.client.call({
1864
+ method: 'POST',
1865
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/test_clocks/*', 'name')}:advance`,
1866
+ body: runtime.omit(request, ['name']),
1867
+ bodyType: 'sylphx.money.v1.AdvanceTestClockRequest',
1868
+ responseType: 'sylphx.money.v1.TestClock',
1869
+ mutation: true,
1870
+ });
1871
+ }
1872
+ }
1589
1873
  /** `checkout_sessions` of Sylphx Money: Resource type `money.sylphx.com/CheckoutSession`. */
1590
1874
  export class CheckoutSessionsCollection {
1591
1875
  client;