@smartbills/sdk 0.0.2-alpha.28 → 0.0.2-alpha.30

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 (159) hide show
  1. package/dist/@types/client/SBClient.d.ts +2 -0
  2. package/dist/@types/entities/metadata/SBMetadata.d.ts +4 -0
  3. package/dist/@types/entities/metadata/SBMetadata.d.ts.map +1 -0
  4. package/dist/@types/entities/payment-methods/SBPaymentMethod.d.ts +14 -3
  5. package/dist/@types/entities/payment-methods/SBPaymentMethodBank.d.ts +10 -0
  6. package/dist/@types/entities/payment-methods/SBPaymentMethodBank.d.ts.map +1 -0
  7. package/dist/@types/entities/payment-methods/SBPaymentMethodCard.d.ts +19 -0
  8. package/dist/@types/entities/payment-methods/SBPaymentMethodCard.d.ts.map +1 -0
  9. package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprint.d.ts +7 -0
  10. package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprint.d.ts.map +1 -0
  11. package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprintProvider.d.ts +7 -0
  12. package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprintProvider.d.ts.map +1 -0
  13. package/dist/@types/entities/products/SBProduct.d.ts +5 -2
  14. package/dist/@types/entities/products/SBProductTranslation.d.ts +11 -0
  15. package/dist/@types/entities/products/SBProductTranslation.d.ts.map +1 -0
  16. package/dist/@types/entities/products/SBProductVendor.d.ts +7 -0
  17. package/dist/@types/entities/products/SBProductVendor.d.ts.map +1 -0
  18. package/dist/@types/entities/receipt-payments/SBReceiptPaymentCard.d.ts +9 -9
  19. package/dist/@types/entities/receipt-payments/SBReceiptPaymentMethodCard.d.ts +2 -2
  20. package/dist/@types/entities/taxes/SBTax.d.ts +10 -0
  21. package/dist/@types/entities/vendors/SBVendor.d.ts +12 -0
  22. package/dist/@types/entities/vendors/SBVendor.d.ts.map +1 -0
  23. package/dist/@types/index.d.ts +25 -11
  24. package/dist/@types/services/addresses/{AddressCreateRequest.d.ts → AddressRequest.d.ts} +3 -3
  25. package/dist/@types/services/addresses/AddressRequest.d.ts.map +1 -0
  26. package/dist/@types/services/addresses/BillingAddressRequest.d.ts +12 -0
  27. package/dist/@types/services/addresses/BillingAddressRequest.d.ts.map +1 -0
  28. package/dist/@types/services/cards/AttachCardRequest.d.ts +2 -2
  29. package/dist/@types/services/cards/CreateCardRequest.d.ts +2 -2
  30. package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionCreateRequest.d.ts +4 -4
  31. package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionUpdateRequest.d.ts +1 -3
  32. package/dist/@types/services/customers/CustomerCreateRequest.d.ts +11 -5
  33. package/dist/@types/services/customers/CustomerListRequest.d.ts +4 -1
  34. package/dist/@types/services/customers/CustomerService.d.ts +24 -7
  35. package/dist/@types/services/customersDataSources/CustomerDataSourceCreateRequest.d.ts +8 -0
  36. package/dist/@types/services/customersDataSources/CustomerDataSourceCreateRequest.d.ts.map +1 -0
  37. package/dist/@types/services/customersDataSources/CustomerDataSourceService.d.ts +15 -0
  38. package/dist/@types/services/customersDataSources/CustomerDataSourceService.d.ts.map +1 -0
  39. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodCreateRequest.d.ts +5 -0
  40. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodCreateRequest.d.ts.map +1 -0
  41. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodListRequest.d.ts +5 -0
  42. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodListRequest.d.ts.map +1 -0
  43. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodService.d.ts +25 -0
  44. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodService.d.ts.map +1 -0
  45. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodUpdateRequest.d.ts +5 -0
  46. package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodUpdateRequest.d.ts.map +1 -0
  47. package/dist/@types/services/fees/FeeCreateRequest.d.ts +2 -1
  48. package/dist/@types/services/fees/FeeService.d.ts +1 -1
  49. package/dist/@types/services/fees/FeeUpdateRequest.d.ts +2 -1
  50. package/dist/@types/services/locations/LocationCreateRequest.d.ts +3 -4
  51. package/dist/@types/services/locations/LocationService.d.ts +1 -1
  52. package/dist/@types/services/locations/LocationUpdateRequest.d.ts +3 -4
  53. package/dist/@types/services/merchants/MerchantCreateRequest.d.ts +2 -2
  54. package/dist/@types/services/merchants/MerchantUpdateRequest.d.ts +2 -2
  55. package/dist/@types/services/payment-methods/PaymentMethodBankCreateRequest.d.ts +7 -4
  56. package/dist/@types/services/payment-methods/PaymentMethodCardCreateRequest.d.ts +19 -0
  57. package/dist/@types/services/payment-methods/PaymentMethodCardCreateRequest.d.ts.map +1 -0
  58. package/dist/@types/services/payment-methods/PaymentMethodCreateRequest.d.ts +7 -2
  59. package/dist/@types/services/product-options/ProductOptionCreateRequest.d.ts +5 -0
  60. package/dist/@types/services/product-options/ProductOptionCreateRequest.d.ts.map +1 -0
  61. package/dist/@types/services/products/ProductCreateRequest.d.ts +7 -6
  62. package/dist/@types/services/products/ProductService.d.ts +1 -1
  63. package/dist/@types/services/products/ProductUpdateRequest.d.ts +3 -4
  64. package/dist/@types/services/promo-codes/PromoCodeCreateRequest.d.ts +1 -2
  65. package/dist/@types/services/promo-codes/PromoCodeService.d.ts +1 -1
  66. package/dist/@types/services/receiptTransactions/ReceiptTransactionCreateRequest.d.ts +45 -17
  67. package/dist/@types/services/receipts/ReceiptCreateRequest.d.ts +6 -6
  68. package/dist/@types/services/receipts/ReceiptReviewCreateRequest.d.ts +1 -3
  69. package/dist/@types/services/receipts/ReceiptReviewUpdateRequest.d.ts +1 -3
  70. package/dist/@types/services/receipts/ReceiptService.d.ts +2 -2
  71. package/dist/@types/services/receipts/ReceiptUpdateRequest.d.ts +3 -3
  72. package/dist/@types/services/reviews/ReviewCreateRequest.d.ts +1 -3
  73. package/dist/@types/services/reviews/ReviewUpdateRequest.d.ts +1 -3
  74. package/dist/@types/services/taxes/TaxCreateRequest.d.ts +2 -3
  75. package/dist/@types/services/taxes/TaxListRequest.d.ts +2 -0
  76. package/dist/@types/services/taxes/TaxService.d.ts +1 -0
  77. package/dist/@types/services/taxes/TaxUpdateRequest.d.ts +2 -4
  78. package/dist/@types/services/vendors/VendorCreateRequest.d.ts +11 -0
  79. package/dist/@types/services/vendors/VendorCreateRequest.d.ts.map +1 -0
  80. package/dist/@types/services/vendors/VendorListRequest.d.ts +7 -0
  81. package/dist/@types/services/vendors/VendorListRequest.d.ts.map +1 -0
  82. package/dist/@types/services/vendors/VendorService.d.ts +25 -0
  83. package/dist/@types/services/vendors/VendorService.d.ts.map +1 -0
  84. package/dist/@types/services/vendors/VendorUpdateRequest.d.ts +5 -0
  85. package/dist/@types/services/vendors/VendorUpdateRequest.d.ts.map +1 -0
  86. package/dist/cjs/client/SBClient.cjs +9 -0
  87. package/dist/cjs/client/SBClient.cjs.map +1 -1
  88. package/dist/cjs/entities/payment-methods/SBPaymentMethod.cjs +8 -0
  89. package/dist/cjs/entities/payment-methods/SBPaymentMethod.cjs.map +1 -0
  90. package/dist/cjs/entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs +8 -0
  91. package/dist/cjs/entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs.map +1 -0
  92. package/dist/cjs/index.cjs +16 -3
  93. package/dist/cjs/index.cjs.map +1 -1
  94. package/dist/cjs/packages/sdk/package.json.cjs +1 -1
  95. package/dist/cjs/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionService.cjs +8 -2
  96. package/dist/cjs/services/customerBalanceTransactions/CustomerBalanceTransactionService.cjs.map +1 -0
  97. package/dist/cjs/services/customers/CustomerService.cjs +43 -10
  98. package/dist/cjs/services/customers/CustomerService.cjs.map +1 -1
  99. package/dist/cjs/services/customersDataSources/CustomerDataSourceService.cjs +16 -0
  100. package/dist/cjs/services/customersDataSources/CustomerDataSourceService.cjs.map +1 -0
  101. package/dist/cjs/services/customersPaymentMethods/CustomerPaymentMethodService.cjs +34 -0
  102. package/dist/cjs/services/customersPaymentMethods/CustomerPaymentMethodService.cjs.map +1 -0
  103. package/dist/cjs/services/receipts/ReceiptService.cjs.map +1 -1
  104. package/dist/cjs/services/taxes/TaxService.cjs +3 -0
  105. package/dist/cjs/services/taxes/TaxService.cjs.map +1 -1
  106. package/dist/cjs/services/vendors/VendorService.cjs +28 -0
  107. package/dist/cjs/services/vendors/VendorService.cjs.map +1 -0
  108. package/dist/esm/client/SBClient.mjs +9 -0
  109. package/dist/esm/client/SBClient.mjs.map +1 -1
  110. package/dist/esm/entities/payment-methods/SBPaymentMethod.mjs +8 -0
  111. package/dist/esm/entities/payment-methods/SBPaymentMethod.mjs.map +1 -0
  112. package/dist/esm/entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs +8 -0
  113. package/dist/esm/entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs.map +1 -0
  114. package/dist/esm/index.mjs +6 -1
  115. package/dist/esm/index.mjs.map +1 -1
  116. package/dist/esm/packages/sdk/package.json.mjs +1 -1
  117. package/dist/esm/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionService.mjs +8 -2
  118. package/dist/esm/services/customerBalanceTransactions/CustomerBalanceTransactionService.mjs.map +1 -0
  119. package/dist/esm/services/customers/CustomerService.mjs +43 -10
  120. package/dist/esm/services/customers/CustomerService.mjs.map +1 -1
  121. package/dist/esm/services/customersDataSources/CustomerDataSourceService.mjs +14 -0
  122. package/dist/esm/services/customersDataSources/CustomerDataSourceService.mjs.map +1 -0
  123. package/dist/esm/services/customersPaymentMethods/CustomerPaymentMethodService.mjs +32 -0
  124. package/dist/esm/services/customersPaymentMethods/CustomerPaymentMethodService.mjs.map +1 -0
  125. package/dist/esm/services/receipts/ReceiptService.mjs.map +1 -1
  126. package/dist/esm/services/taxes/TaxService.mjs +3 -0
  127. package/dist/esm/services/taxes/TaxService.mjs.map +1 -1
  128. package/dist/esm/services/vendors/VendorService.mjs +26 -0
  129. package/dist/esm/services/vendors/VendorService.mjs.map +1 -0
  130. package/dist/umd/index.js +182 -68
  131. package/dist/umd/index.js.map +1 -1
  132. package/package.json +11 -2
  133. package/dist/@types/entities/common/SBLocale.d.ts +0 -11
  134. package/dist/@types/entities/common/SBLocale.d.ts.map +0 -1
  135. package/dist/@types/entities/common/SBLocalized.d.ts +0 -7
  136. package/dist/@types/entities/common/SBLocalized.d.ts.map +0 -1
  137. package/dist/@types/entities/payment-methods/SBBankPaymentMethod.d.ts +0 -12
  138. package/dist/@types/entities/payment-methods/SBBankPaymentMethod.d.ts.map +0 -1
  139. package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprint.d.ts +0 -7
  140. package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprint.d.ts.map +0 -1
  141. package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.d.ts +0 -7
  142. package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.d.ts.map +0 -1
  143. package/dist/@types/services/addresses/AddressCreateRequest.d.ts.map +0 -1
  144. package/dist/@types/services/addresses/AddressUpdateRequest.d.ts +0 -13
  145. package/dist/@types/services/addresses/AddressUpdateRequest.d.ts.map +0 -1
  146. package/dist/@types/services/addresses/BillingAddressCreateRequest.d.ts +0 -12
  147. package/dist/@types/services/addresses/BillingAddressCreateRequest.d.ts.map +0 -1
  148. package/dist/@types/services/addresses/BillingAddressUpdateRequest.d.ts +0 -12
  149. package/dist/@types/services/addresses/BillingAddressUpdateRequest.d.ts.map +0 -1
  150. package/dist/cjs/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.cjs +0 -8
  151. package/dist/cjs/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.cjs.map +0 -1
  152. package/dist/cjs/services/CustomerBalanceTransactions/CustomerBalanceTransactionService.cjs.map +0 -1
  153. package/dist/esm/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.mjs +0 -8
  154. package/dist/esm/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.mjs.map +0 -1
  155. package/dist/esm/services/CustomerBalanceTransactions/CustomerBalanceTransactionService.mjs.map +0 -1
  156. /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionCreateRequest.d.ts.map +0 -0
  157. /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionListRequest.d.ts +0 -0
  158. /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionListRequest.d.ts.map +0 -0
  159. /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionUpdateRequest.d.ts.map +0 -0
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var SBServiceOptions = require('../../client/SBServiceOptions.cjs');
4
+ var SBService = require('../SBService.cjs');
5
+
6
+ class VendorService extends SBService.SBService {
7
+ constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
+ super(options);
9
+ }
10
+ async list(request, options, config) {
11
+ return await super.listEntities("/v1/vendors", request, options, config);
12
+ }
13
+ async getById(id, options, config) {
14
+ return await super.getEntityById(`/v1/vendors/${id}`, options, config);
15
+ }
16
+ async delete(id, options, config) {
17
+ return await super.deleteEntity(`/v1/vendors/${id}`, options, config);
18
+ }
19
+ async create(request, options, config) {
20
+ return await super.createEntity("/v1/vendors", request, options, config);
21
+ }
22
+ async update(id, request, options, config) {
23
+ return await super.updateEntity(`/v1/vendors/${id}`, request, options, config);
24
+ }
25
+ }
26
+
27
+ exports.VendorService = VendorService;
28
+ //# sourceMappingURL=VendorService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VendorService.cjs","sources":["../../../../src/services/vendors/VendorService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\r\nimport {\r\n\tSBServiceOptions,\r\n\tdefaultAPIServiceOptions,\r\n} from \"@/client/SBServiceOptions\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { ICreatable, IRetrievableById } from \"@/interfaces\";\r\nimport { SBService } from \"@/services/SBService\";\r\nimport { PaginatedResult } from \"@/utilities/PaginatedResult\";\r\nimport { IDeletable } from \"@/interfaces/IDeletable\";\r\nimport { IListable } from \"@/interfaces/IListable\";\r\nimport { VendorCreateRequest } from \"./VendorCreateRequest\";\r\nimport { SBVendor } from \"@/entities/vendors\";\r\nimport { VendorListRequest } from \"./VendorListRequest\";\r\nimport { VendorUpdateRequest } from \"./VendorUpdateRequest\";\r\nexport class VendorService\r\n\textends SBService\r\n\timplements\r\n\t\tIRetrievableById<SBVendor>,\r\n\t\tICreatable<VendorCreateRequest, SBVendor>,\r\n\t\tIListable<VendorListRequest, SBVendor>,\r\n\t\tIDeletable<SBVendor>\r\n{\r\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\r\n\t\tsuper(options);\r\n\t}\r\n\r\n\tpublic async list(\r\n\t\trequest: VendorListRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<PaginatedResult<SBVendor>> {\r\n\t\treturn await super.listEntities(\r\n\t\t\t\"/v1/vendors\",\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic async getById(\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.getEntityById(`/v1/vendors/${id}`, options, config);\r\n\t}\r\n\tpublic async delete(\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.deleteEntity(`/v1/vendors/${id}`, options, config);\r\n\t}\r\n\tpublic async create(\r\n\t\trequest: VendorCreateRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig<VendorCreateRequest>,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t\"/v1/vendors\",\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\tpublic async update(\r\n\t\tid: number,\r\n\t\trequest: VendorUpdateRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig<VendorUpdateRequest>,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.updateEntity(\r\n\t\t\t`/v1/vendors/${id}`,\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n}\r\n"],"names":["VendorService","SBService","constructor","options","defaultAPIServiceOptions","list","request","config","listEntities","getById","id","getEntityById","delete","deleteEntity","create","createEntity","update","updateEntity"],"mappings":";;;;;AAeM,MAAOA,aACZ,SAAQC,mBAAS,CAAA;AAOjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AAEO,EAAA,MAAME,IAAIA,CAChBC,OAA0B,EAC1BH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,aAAa,EACbF,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,OAAOA,CACnBC,EAAU,EACVP,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACI,aAAa,CAAC,CAAA,YAAA,EAAeD,EAAE,CAAA,CAAE,EAAEP,OAAO,EAAEI,MAAM,CAAC,CAAA;AACvE,GAAA;AACO,EAAA,MAAMK,MAAMA,CAClBF,EAAU,EACVP,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAAC,CAAA,YAAA,EAAeH,EAAE,CAAA,CAAE,EAAEP,OAAO,EAAEI,MAAM,CAAC,CAAA;AACtE,GAAA;AACO,EAAA,MAAMO,MAAMA,CAClBR,OAA4B,EAC5BH,OAA0B,EAC1BI,MAAgD,EAAA;AAEhD,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,aAAa,EACbT,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;EACO,MAAMS,MAAMA,CAClBN,EAAU,EACVJ,OAA4B,EAC5BH,OAA0B,EAC1BI,MAAgD,EAAA;AAEhD,IAAA,OAAO,MAAM,KAAK,CAACU,YAAY,CAC9B,CAAeP,YAAAA,EAAAA,EAAE,CAAE,CAAA,EACnBJ,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -32,6 +32,9 @@ import { SBLogger } from './SBLogger.mjs';
32
32
  import { defaultAPIServiceOptions } from './SBServiceOptions.mjs';
33
33
  import { API_URL } from './constants.mjs';
34
34
  import { ExploreService } from '../services/explore/ExploreService.mjs';
35
+ import 'axios';
36
+ import 'query-string';
37
+ import { VendorService } from '../services/vendors/VendorService.mjs';
35
38
 
36
39
  /**
37
40
  * Client for the Smartbills API.
@@ -83,6 +86,7 @@ class SBClient {
83
86
  _defineProperty(this, "friends", void 0);
84
87
  _defineProperty(this, "taxes", void 0);
85
88
  _defineProperty(this, "users", void 0);
89
+ _defineProperty(this, "vendors", void 0);
86
90
  this.options = {
87
91
  ...defaultOptions,
88
92
  ...options
@@ -254,6 +258,11 @@ class SBClient {
254
258
  logger: this.logger,
255
259
  url: this.options?.endpoints?.api
256
260
  });
261
+ this.vendors = new VendorService({
262
+ ...this.options,
263
+ logger: this.logger,
264
+ url: this.options?.endpoints?.api
265
+ });
257
266
  }
258
267
  }
259
268
 
@@ -1 +1 @@
1
- {"version":3,"file":"SBClient.mjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA;;AAEG;AACH,MAAMA,cAAc,GAAoB;AACvCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,GAAG,EAAEC,OAAO;AACZC,IAAAA,IAAI,EAAED,OAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,QAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,EAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAiCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,wBAAwB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A,CAAC,CAAA;AACF,IAAA,IAAI,CAACyE,cAAc,GAAG,IAAIC,oBAAoB,CAAC;MAC9C,GAAG,IAAI,CAAC/D,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC2E,WAAW,GAAG,IAAIC,iBAAiB,CAAC;MACxC,GAAG,IAAI,CAACjE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC6E,KAAK,GAAG,IAAIC,UAAU,CAAC;MAC3B,GAAG,IAAI,CAACnE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC+E,KAAK,GAAG,IAAIC,WAAW,CAAC;MAC5B,GAAG,IAAI,CAACrE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACH,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"SBClient.mjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\nimport { SBVendor } from \"@/entities\";\nimport { VendorService } from \"@/services\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\tpublic vendors: VendorService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.vendors = new VendorService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService","vendors","VendorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAEG;AACH,MAAMA,cAAc,GAAoB;AACvCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,GAAG,EAAEC,OAAO;AACZC,IAAAA,IAAI,EAAED,OAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,QAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,EAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAkCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,wBAAwB,EAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,QAAA,EAAA,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aymentMethodType) {
3
+ SBPaymentMethodType["Bank"] = "BANKS";
4
+ SBPaymentMethodType["Card"] = "CARD";
5
+ })(SBPaymentMethodType || (SBPaymentMethodType = {}));
6
+
7
+ export { SBPaymentMethodType };
8
+ //# sourceMappingURL=SBPaymentMethod.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBPaymentMethod.mjs","sources":["../../../../src/entities/payment-methods/SBPaymentMethod.ts"],"sourcesContent":["import { SBEntity } from \"@/entities/SBEntity\";\nimport { SBBillingAddress } from \"@/entities/address/SBBillingAddress\";\nimport { SBPaymentMethodCard } from \"./SBPaymentMethodCard\";\nimport { SBPaymentMethodBank } from \"./SBPaymentMethodBank\";\n\nexport type SBPaymentMethod =\n\t| (SBEntity & {\n\t\t\tstripeId: string;\n\t\t\tbillingAddress: SBBillingAddress;\n\t\t\ttype: SBPaymentMethodType;\n\t\t\tname: string;\n\t\t\tdescription: string;\n\t })\n\t| {\n\t\t\ttype: SBPaymentMethodType.Card;\n\t\t\tcard: SBPaymentMethodCard;\n\t }\n\t| {\n\t\t\ttype: SBPaymentMethodType.Bank;\n\t\t\tbank: SBPaymentMethodBank;\n\t };\n\nexport enum SBPaymentMethodType {\n\tBank = \"BANKS\",\n\tCard = \"CARD\",\n}\n"],"names":["SBPaymentMethodType"],"mappings":"IAsBYA,oBAGX;AAHD,CAAA,UAAYA,mBAAmB,EAAA;AAC9BA,EAAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,OAAc,CAAA;AACdA,EAAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACd,CAAC,EAHWA,mBAAmB,KAAnBA,mBAAmB,GAG9B,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ var SBPaymentMethodFingerprintProvider;
2
+ (function (SBPaymentMethodFingerprintProvider) {
3
+ SBPaymentMethodFingerprintProvider["Stripe"] = "STRIPE";
4
+ SBPaymentMethodFingerprintProvider["Square"] = "SQUARE";
5
+ })(SBPaymentMethodFingerprintProvider || (SBPaymentMethodFingerprintProvider = {}));
6
+
7
+ export { SBPaymentMethodFingerprintProvider };
8
+ //# sourceMappingURL=SBPaymentMethodFingerprintProvider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBPaymentMethodFingerprintProvider.mjs","sources":["../../../../src/entities/payment-methods/SBPaymentMethodFingerprintProvider.ts"],"sourcesContent":["export enum SBPaymentMethodFingerprintProvider {\n\tStripe = \"STRIPE\",\n\tSquare = \"SQUARE\",\n}\n"],"names":["SBPaymentMethodFingerprintProvider"],"mappings":"IAAYA,mCAGX;AAHD,CAAA,UAAYA,kCAAkC,EAAA;AAC7CA,EAAAA,kCAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjBA,EAAAA,kCAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AAClB,CAAC,EAHWA,kCAAkC,KAAlCA,kCAAkC,GAG7C,EAAA,CAAA,CAAA;;;;"}
@@ -13,7 +13,8 @@ export { SBBarcodeType } from './entities/barcode/SBBarcodeType.mjs';
13
13
  export { SBCardType } from './entities/cards/SBCardType.mjs';
14
14
  export { SBFeeType } from './entities/fees/SBFeeType.mjs';
15
15
  export { SBOrganizationRole } from './entities/organizations/SBOrganizationRole.mjs';
16
- export { SBPaymentMethodCardFingerprintProvider } from './entities/payment-methods/SBPaymentMethodCardFingerprintProvider.mjs';
16
+ export { SBPaymentMethodType } from './entities/payment-methods/SBPaymentMethod.mjs';
17
+ export { SBPaymentMethodFingerprintProvider } from './entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs';
17
18
  export { SBReceiptType } from './entities/receipts/SBReceiptType.mjs';
18
19
  export { SBReceiptSource } from './entities/receipts/SBReceiptSource.mjs';
19
20
  export { SBTransactionType } from './entities/transactions/SBTransactionType.mjs';
@@ -32,6 +33,9 @@ export { BankTransactionService } from './services/bank-transactions/BankTransac
32
33
  export { BankService } from './services/banks/BankService.mjs';
33
34
  export { BarcodeService } from './services/barcode/BarcodeService.mjs';
34
35
  export { CardService } from './services/cards/CardService.mjs';
36
+ export { CustomerService } from './services/customers/CustomerService.mjs';
37
+ export { CustomerPaymentMethodService } from './services/customersPaymentMethods/CustomerPaymentMethodService.mjs';
38
+ export { CustomerDataSourceService } from './services/customersDataSources/CustomerDataSourceService.mjs';
35
39
  export { DiscountService } from './services/discounts/DiscountService.mjs';
36
40
  export { DocumentService } from './services/documents/DocumentService.mjs';
37
41
  export { DomainService } from './services/domains/DomainService.mjs';
@@ -57,4 +61,5 @@ export { TransactionService } from './services/transactions/TransactionService.m
57
61
  export { CurrentUserService } from './services/user/UserService.mjs';
58
62
  export { UserService } from './services/users/UserService.mjs';
59
63
  export { ExploreService } from './services/explore/ExploreService.mjs';
64
+ export { VendorService } from './services/vendors/VendorService.mjs';
60
65
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- var version = "0.0.2-alpha.27";
1
+ var version = "0.0.2-alpha.29";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.mjs.map
@@ -5,8 +5,8 @@ class CustomerBalanceTransactionService extends SBService {
5
5
  constructor(options = defaultAPIServiceOptions) {
6
6
  super(options);
7
7
  }
8
- async getById(customerId, id, options) {
9
- return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options);
8
+ async getById(customerId, id, options, config = {}) {
9
+ return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options, config);
10
10
  }
11
11
  async update(customerId, id, request, options, config = {}) {
12
12
  return await super.updateEntity(`/v1/customers/${customerId}/balance-transactions/${id}`, request, options, config);
@@ -17,6 +17,12 @@ class CustomerBalanceTransactionService extends SBService {
17
17
  async create(customerId, request, options, config = {}) {
18
18
  return await super.createEntity(`/v1/customers/${customerId}/balance-transactions`, request, options, config);
19
19
  }
20
+ async batchCreate(id, request, options, config) {
21
+ return await super.createEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
22
+ }
23
+ async batchUpdate(id, request, options, config) {
24
+ return await super.updateEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
25
+ }
20
26
  }
21
27
 
22
28
  export { CustomerBalanceTransactionService };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerBalanceTransactionService.mjs","sources":["../../../../src/services/customerBalanceTransactions/CustomerBalanceTransactionService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBCustomerBalanceTransaction } from \"@/entities/CustomerBalanceTransactions\";\nimport { SBService } from \"@/services/SBService\";\nimport { INestedCreatable } from \"@/interfaces/ICreatable\";\nimport { INestedListable } from \"@/interfaces/IListable\";\nimport { INestedUpdatable } from \"@/interfaces/IUpdatable\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { CustomerBalanceTransactionCreateRequest } from \"./CustomerBalanceTransactionCreateRequest\";\nimport { CustomerBalanceTransactionListRequest } from \"./CustomerBalanceTransactionListRequest\";\nimport { CustomerBalanceTransactionUpdateRequest } from \"./CustomerBalanceTransactionUpdateRequest\";\nimport { INestedRetrievableById } from \"@/interfaces\";\nimport { SBBatch } from \"@/entities\";\nexport class CustomerBalanceTransactionService\n\textends SBService\n\timplements\n\t\tINestedRetrievableById<SBCustomerBalanceTransaction>,\n\t\tINestedCreatable<\n\t\t\tCustomerBalanceTransactionCreateRequest,\n\t\t\tSBCustomerBalanceTransaction\n\t\t>,\n\t\tINestedUpdatable<\n\t\t\tCustomerBalanceTransactionUpdateRequest,\n\t\t\tSBCustomerBalanceTransaction\n\t\t>,\n\t\tINestedListable<\n\t\t\tCustomerBalanceTransactionListRequest,\n\t\t\tSBCustomerBalanceTransaction\n\t\t>\n{\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\tpublic async getById(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/customers/${customerId}/balance-transactions/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/customers/${customerId}/balance-transactions/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async list(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomerBalanceTransaction>> {\n\t\treturn await super.listEntities(\n\t\t\t`/v1/customers/${customerId}/balance-transactions`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async create(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/${customerId}/balance-transactions`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchCreate(\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionCreateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBatch<SBCustomerBalanceTransaction>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/${id}/balance-transactions/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async batchUpdate(\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionUpdateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBatch<SBCustomerBalanceTransaction>> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/customers/${id}/balance-transactions/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["CustomerBalanceTransactionService","SBService","constructor","options","defaultAPIServiceOptions","getById","customerId","id","config","getEntityById","update","request","updateEntity","list","listEntities","create","createEntity","batchCreate","batchUpdate"],"mappings":";;;AAiBM,MAAOA,iCACZ,SAAQC,SAAS,CAAA;AAgBjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AACO,EAAA,MAAME,OAAOA,CACnBC,UAAkB,EAClBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAC/B,CAAiBH,cAAAA,EAAAA,UAAU,CAAyBC,sBAAAA,EAAAA,EAAE,CAAE,CAAA,EACxDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,MAAMA,CAClBJ,UAAkB,EAClBC,EAAU,EACVI,OAAgD,EAChDR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,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mjs';
2
2
  import { defaultAPIServiceOptions } from '../../client/SBServiceOptions.mjs';
3
- import { CustomerBalanceTransactionService } from '../CustomerBalanceTransactions/CustomerBalanceTransactionService.mjs';
3
+ import { CustomerBalanceTransactionService } from '../customerBalanceTransactions/CustomerBalanceTransactionService.mjs';
4
4
  import { SBService } from '../SBService.mjs';
5
+ import { CustomerPaymentMethodService } from '../customersPaymentMethods/CustomerPaymentMethodService.mjs';
5
6
 
6
7
  class CustomerService extends SBService {
7
8
  constructor(options = defaultAPIServiceOptions) {
8
9
  super(options);
9
- _defineProperty(this, "balanceTransactionService", void 0);
10
- this.balanceTransactionService = new CustomerBalanceTransactionService(options);
10
+ _defineProperty(this, "balanceTransactions", void 0);
11
+ _defineProperty(this, "paymentMethods", void 0);
12
+ this.balanceTransactions = new CustomerBalanceTransactionService(options);
13
+ this.paymentMethods = new CustomerPaymentMethodService(options);
14
+ }
15
+ batch(request, options, config) {
16
+ throw new Error("Method not implemented.");
11
17
  }
12
18
  async getById(id, options) {
13
19
  return await super.getEntityById(`/v1/customers/${id}`, options);
@@ -24,19 +30,46 @@ class CustomerService extends SBService {
24
30
  async list(request, options, config = {}) {
25
31
  return await super.listEntities("/v1/customers", request, options, config);
26
32
  }
33
+ async retrievePaymentMethod(customerId, id, options, config = {}) {
34
+ return await this.paymentMethods.getById(customerId, id, options, config);
35
+ }
36
+ async createPaymentMethod(customerId, request, options, config = {}) {
37
+ return await this.paymentMethods.create(customerId, request, options, config);
38
+ }
39
+ async updatePaymentMethod(customerId, request, options, config = {}) {
40
+ return await this.paymentMethods.create(customerId, request, options, config);
41
+ }
42
+ async listPaymentMethods(customerId, request, options, config = {}) {
43
+ return await this.paymentMethods.get(customerId, request, options, config);
44
+ }
45
+ async deletePaymentMethod(customerId, id, options, config = {}) {
46
+ return await this.paymentMethods.delete(customerId, id, options, config);
47
+ }
48
+ async batchCreatePaymentMethod(customerId, request, options, config = {}) {
49
+ return await this.paymentMethods.batchCreate(customerId, request, options, config);
50
+ }
51
+ async batchUpdatePaymentMethod(customerId, request, options, config = {}) {
52
+ return await this.paymentMethods.batchUpdate(customerId, request, options, config);
53
+ }
27
54
  async createBalanceTransaction(customerId, request, options, config = {}) {
28
- return await this.balanceTransactionService.create(customerId, request);
55
+ return await this.balanceTransactions.create(customerId, request, options, config);
56
+ }
57
+ async listBalanceTransactions(customerId, request, options, config = {}) {
58
+ return await this.balanceTransactions.list(customerId, request, options, config);
29
59
  }
30
- async getBalanceTransaction(customerId, id, options, config = {}) {
31
- return await this.balanceTransactionService.getById(customerId, id);
60
+ async retrieveBalanceTransaction(customerId, id, options, config = {}) {
61
+ return await this.balanceTransactions.getById(customerId, id, options, config);
32
62
  }
33
63
  async updateBalanceTransaction(customerId, id, request, options, config = {}) {
34
- return await this.balanceTransactionService.update(customerId, id, request);
64
+ return await this.balanceTransactions.update(customerId, id, request, options, config);
35
65
  }
36
- async getBalanceTransactions(customerId, id, request, options, config = {}) {
37
- return await this.balanceTransactionService.list(customerId, id, request);
66
+ async getBalanceTransactions(customerId, request, options, config = {}) {
67
+ return await this.balanceTransactions.list(customerId, request, options, config);
68
+ }
69
+ async batchCreate(request, options, config) {
70
+ return await super.createEntity(`/v1/customers/batch`, request, options, config);
38
71
  }
39
- async batch(request, options, config) {
72
+ async batchUpdate(request, options, config) {
40
73
  return await super.createEntity(`/v1/customers/batch`, request, options, config);
41
74
  }
42
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerService.mjs","sources":["../../../../src/services/customers/CustomerService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { SBBatch } from \"@/entities/batches\";\nimport { IBatchable, IRetrievableById } from \"@/interfaces\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBCustomerBalanceTransaction } from \"@/entities/CustomerBalanceTransactions\";\nimport {\n\tCustomerBalanceTransactionCreateRequest,\n\tCustomerBalanceTransactionListRequest,\n\tCustomerBalanceTransactionUpdateRequest,\n} from \"@/services/CustomerBalanceTransactions\";\nimport { CustomerBalanceTransactionService } from \"@/services/CustomerBalanceTransactions/CustomerBalanceTransactionService\";\nimport { SBService } from \"@/services/SBService\";\nimport { SBCustomer } from \"@/entities/customers/SBCustomer\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { CustomerBatchUpsertRequest } from \"./CustomerBatchUpsertRequest\";\nimport { CustomerCreateRequest } from \"./CustomerCreateRequest\";\nimport { CustomerUpdateRequest } from \"./CustomerUpdateRequest\";\nimport { CustomerUpsertRequest } from \"./CustomerUpsertRequest\";\nimport { CustomerListRequest } from \"./CustomerListRequest\";\nexport class CustomerService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBCustomer>,\n\t\tICreatable<CustomerCreateRequest, SBCustomer>,\n\t\tIUpdatable<CustomerUpdateRequest, SBCustomer>,\n\t\tIBatchable<CustomerUpsertRequest, SBCustomer>,\n\t\tIDeletable<SBCustomer>\n{\n\tprivate balanceTransactionService: CustomerBalanceTransactionService;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.balanceTransactionService = new CustomerBalanceTransactionService(\n\t\t\toptions,\n\t\t);\n\t}\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t): Promise<SBCustomer> {\n\t\treturn await super.getEntityById(`/v1/customers/${id}`, options);\n\t}\n\n\tpublic async create(\n\t\trequest: CustomerCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/customers\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.deleteEntity(`/v1/customers/${id}`, options, config);\n\t}\n\n\tpublic async update(\n\t\tid: number,\n\t\trequest: CustomerUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/customers/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async list(\n\t\trequest: CustomerListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomer>> {\n\t\treturn await super.listEntities(\n\t\t\t\"/v1/customers\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createBalanceTransaction(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactionService.create(customerId, request);\n\t}\n\n\tpublic async getBalanceTransaction(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactionService.getById(customerId, id);\n\t}\n\n\tpublic async updateBalanceTransaction(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactionService.update(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\trequest,\n\t\t);\n\t}\n\n\tpublic async getBalanceTransactions(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomerBalanceTransaction>> {\n\t\treturn await this.balanceTransactionService.list(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\trequest,\n\t\t);\n\t}\n\n\tpublic async batch(\n\t\trequest: CustomerBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBatch<SBCustomer>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["CustomerService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","balanceTransactionService","CustomerBalanceTransactionService","getById","id","getEntityById","create","request","config","createEntity","delete","deleteEntity","update","updateEntity","list","listEntities","createBalanceTransaction","customerId","getBalanceTransaction","updateBalanceTransaction","getBalanceTransactions","batch"],"mappings":";;;;;AA0BM,MAAOA,eACZ,SAAQC,SAAS,CAAA;AASjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,eAAA,CAAA,IAAA,EAAA,2BAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,CAACC,yBAAyB,GAAG,IAAIC,iCAAiC,CACrEJ,OAAO,CACP,CAAA;AACF,GAAA;AACO,EAAA,MAAMK,OAAOA,CACnBC,EAAU,EACVN,OAA0B,EAAA;IAE1B,OAAO,MAAM,KAAK,CAACO,aAAa,CAAC,iBAAiBD,EAAE,CAAA,CAAE,EAAEN,OAAO,CAAC,CAAA;AACjE,GAAA;EAEO,MAAMQ,MAAMA,CAClBC,OAA8B,EAC9BT,OAA0B,EAC1BU,SAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,eAAe,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EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAACP,yBAAyB,CAACW,MAAM,CACjDK,UAAU,EACVb,EAAE,EACFG,OAAO,CACP,CAAA;AACF,GAAA;AAEO,EAAA,MAAMa,sBAAsBA,CAClCH,UAAkB,EAClBb,EAAU,EACVG,OAA8C,EAC9CT,OAA0B,EAC1BU,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAACP,yBAAyB,CAACa,IAAI,CAC/CG,UAAU,EACVb,EAAE,EACFG,OAAO,CACP,CAAA;AACF,GAAA;AAEO,EAAA,MAAMc,KAAKA,CACjBd,OAAmC,EACnCT,OAA0B,EAC1BU,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,CAAA,mBAAA,CAAqB,EACrBF,OAAO,EACPT,OAAO,EACPU,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"CustomerService.mjs","sources":["../../../../src/services/customers/CustomerService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { SBBatch } from \"@/entities/batches\";\nimport { IBatchable, IRetrievableById } from \"@/interfaces\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBCustomerBalanceTransaction } from \"@/entities/CustomerBalanceTransactions\";\nimport {\n\tCustomerBalanceTransactionCreateRequest,\n\tCustomerBalanceTransactionListRequest,\n\tCustomerBalanceTransactionUpdateRequest,\n} from \"@/services/customerBalanceTransactions\";\nimport { CustomerBalanceTransactionService } from \"@/services/customerBalanceTransactions/CustomerBalanceTransactionService\";\nimport { SBService } from \"@/services/SBService\";\nimport { SBCustomer } from \"@/entities/customers/SBCustomer\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { CustomerBatchUpsertRequest } from \"./CustomerBatchUpsertRequest\";\nimport { CustomerCreateRequest } from \"./CustomerCreateRequest\";\nimport { CustomerUpdateRequest } from \"./CustomerUpdateRequest\";\nimport { CustomerUpsertRequest } from \"./CustomerUpsertRequest\";\nimport { CustomerListRequest } from \"./CustomerListRequest\";\nimport { CustomerPaymentMethodService } from \"../customersPaymentMethods/CustomerPaymentMethodService\";\nimport {\n\tCustomerPaymentMethodCreateRequest,\n\tCustomerPaymentMethodListRequest,\n\tCustomerPaymentMethodUpdateRequest,\n} from \"../customersPaymentMethods\";\nimport { SBPaymentMethod } from \"@/entities\";\nimport { PaymentMethodCreateRequest } from \"../payment-methods\";\nimport { BatchUpsertRequest } from \"../BatchUpsertRequest\";\nexport class CustomerService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBCustomer>,\n\t\tICreatable<CustomerCreateRequest, SBCustomer>,\n\t\tIUpdatable<CustomerUpdateRequest, SBCustomer>,\n\t\tIBatchable<CustomerUpsertRequest, SBCustomer>,\n\t\tIDeletable<SBCustomer>\n{\n\tprivate balanceTransactions: CustomerBalanceTransactionService;\n\tprivate paymentMethods: CustomerPaymentMethodService;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.balanceTransactions = new CustomerBalanceTransactionService(\n\t\t\toptions,\n\t\t);\n\t\tthis.paymentMethods = new CustomerPaymentMethodService(options);\n\t}\n\tbatch(\n\t\trequest: BatchUpsertRequest<CustomerUpsertRequest>,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<BatchUpsertRequest<CustomerUpsertRequest>>,\n\t): Promise<SBBatch<SBCustomer>> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t): Promise<SBCustomer> {\n\t\treturn await super.getEntityById(`/v1/customers/${id}`, options);\n\t}\n\n\tpublic async create(\n\t\trequest: CustomerCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/customers\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.deleteEntity(`/v1/customers/${id}`, options, config);\n\t}\n\n\tpublic async update(\n\t\tid: number,\n\t\trequest: CustomerUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomer> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/customers/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async list(\n\t\trequest: CustomerListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomer>> {\n\t\treturn await super.listEntities(\n\t\t\t\"/v1/customers\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async retrievePaymentMethod(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await this.paymentMethods.getById(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async createPaymentMethod(\n\t\tcustomerId: number,\n\t\trequest: PaymentMethodCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await this.paymentMethods.create(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updatePaymentMethod(\n\t\tcustomerId: number,\n\t\trequest: PaymentMethodCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await this.paymentMethods.create(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async listPaymentMethods(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await this.paymentMethods.get(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deletePaymentMethod(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await this.paymentMethods.delete(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchCreatePaymentMethod(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodCreateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await this.paymentMethods.batchCreate(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async batchUpdatePaymentMethod(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodUpdateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await this.paymentMethods.batchUpdate(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async createBalanceTransaction(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactions.create(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listBalanceTransactions(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomerBalanceTransaction>> {\n\t\treturn await this.balanceTransactions.list(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async retrieveBalanceTransaction(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactions.getById(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updateBalanceTransaction(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\trequest: CustomerBalanceTransactionUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBCustomerBalanceTransaction> {\n\t\treturn await this.balanceTransactions.update(\n\t\t\tcustomerId,\n\t\t\tid,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async getBalanceTransactions(\n\t\tcustomerId: number,\n\t\trequest: CustomerBalanceTransactionListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBCustomerBalanceTransaction>> {\n\t\treturn await this.balanceTransactions.list(\n\t\t\tcustomerId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchCreate(\n\t\trequest: CustomerCreateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBatch<SBCustomer>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchUpdate(\n\t\trequest: CustomerBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBatch<SBCustomer>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["CustomerService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","balanceTransactions","CustomerBalanceTransactionService","paymentMethods","CustomerPaymentMethodService","batch","request","config","Error","getById","id","getEntityById","create","createEntity","delete","deleteEntity","update","updateEntity","list","listEntities","retrievePaymentMethod","customerId","createPaymentMethod","updatePaymentMethod","listPaymentMethods","get","deletePaymentMethod","batchCreatePaymentMethod","batchCreate","batchUpdatePaymentMethod","batchUpdate","createBalanceTransaction","listBalanceTransactions","retrieveBalanceTransaction","updateBalanceTransaction","getBalanceTransactions"],"mappings":";;;;;;AAmCM,MAAOA,eACZ,SAAQC,SAAS,CAAA;AAUjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,eAAA,CAAA,IAAA,EAAA,qBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,CAACC,mBAAmB,GAAG,IAAIC,iCAAiC,CAC/DJ,OAAO,CACP,CAAA;AACD,IAAA,IAA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1BS,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAACN,mBAAmB,CAACe,MAAM,CAC3CK,UAAU,EACVX,EAAE,EACFJ,OAAO,EACPR,OAAO,EACPS,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAM4B,sBAAsBA,CAClCd,UAAkB,EAClBf,OAA8C,EAC9CR,OAA0B,EAC1BS,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAACN,mBAAmB,CAACiB,IAAI,CACzCG,UAAU,EACVf,OAAO,EACPR,OAAO,EACPS,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMqB,WAAWA,CACvBtB,OAAgC,EAChCR,OAA0B,EAC1BS,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,CAAA,mBAAA,CAAqB,EACrBP,OAAO,EACPR,OAAO,EACPS,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMuB,WAAWA,CACvBxB,OAAmC,EACnCR,OAA0B,EAC1BS,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,CAAA,mBAAA,CAAqB,EACrBP,OAAO,EACPR,OAAO,EACPS,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -0,0 +1,14 @@
1
+ import { defaultAPIServiceOptions } from '../../client/SBServiceOptions.mjs';
2
+ import { SBService } from '../SBService.mjs';
3
+
4
+ class CustomerDataSourceService extends SBService {
5
+ constructor(options = defaultAPIServiceOptions) {
6
+ super(options);
7
+ }
8
+ async create(customerId, request, options, config = {}) {
9
+ return await super.createEntity(`/v1/customers/${customerId}/providers`, request, options, config);
10
+ }
11
+ }
12
+
13
+ export { CustomerDataSourceService };
14
+ //# sourceMappingURL=CustomerDataSourceService.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerDataSourceService.mjs","sources":["../../../../src/services/customersDataSources/CustomerDataSourceService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\r\nimport {\r\n\tSBServiceOptions,\r\n\tdefaultAPIServiceOptions,\r\n} from \"@/client/SBServiceOptions\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { SBService } from \"@/services/SBService\";\r\nimport { INestedCreatable } from \"@/interfaces/ICreatable\";\r\nimport { INestedUpdatable } from \"@/interfaces/IUpdatable\";\r\nimport { INestedRetrievable, INestedRetrievableById } from \"@/interfaces\";\r\nimport { SBPaymentMethod } from \"@/entities\";\r\nimport { CustomerDataSourceCreateRequest } from \"./CustomerDataSourceCreateRequest\";\r\nexport class CustomerDataSourceService\r\n\textends SBService\r\n\timplements\r\n\t\tINestedCreatable<CustomerDataSourceCreateRequest, SBPaymentMethod>\r\n{\r\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\r\n\t\tsuper(options);\r\n\t}\r\n\r\n\tpublic async create(\r\n\t\tcustomerId: number,\r\n\t\trequest: CustomerDataSourceCreateRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBPaymentMethod> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t`/v1/customers/${customerId}/providers`,\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n}\r\n"],"names":["CustomerDataSourceService","SBService","constructor","options","defaultAPIServiceOptions","create","customerId","request","config","createEntity"],"mappings":";;;AAYM,MAAOA,yBACZ,SAAQC,SAAS,CAAA;AAIjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AAEO,EAAA,MAAME,MAAMA,CAClBC,UAAkB,EAClBC,OAAwC,EACxCJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,CAAiBH,cAAAA,EAAAA,UAAU,CAAY,UAAA,CAAA,EACvCC,OAAO,EACPJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -0,0 +1,32 @@
1
+ import { defaultAPIServiceOptions } from '../../client/SBServiceOptions.mjs';
2
+ import { SBService } from '../SBService.mjs';
3
+
4
+ class CustomerPaymentMethodService extends SBService {
5
+ constructor(options = defaultAPIServiceOptions) {
6
+ super(options);
7
+ }
8
+ async getById(customerId, id, options, config = {}) {
9
+ return await super.getEntityById(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
10
+ }
11
+ async update(customerId, id, request, options, config = {}) {
12
+ return await super.updateEntity(`/v1/customers/${customerId}/payment-methods/${id}`, request, options, config);
13
+ }
14
+ async get(customerId, request, options, config = {}) {
15
+ return await super.getEntities(`/v1/customers/${customerId}/payment-methods`, request, options, config);
16
+ }
17
+ async create(customerId, request, options, config = {}) {
18
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods`, request, options, config);
19
+ }
20
+ async delete(customerId, id, options, config = {}) {
21
+ return await super.deleteEntity(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
22
+ }
23
+ async batchCreate(customerId, request, options, config = {}) {
24
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
25
+ }
26
+ async batchUpdate(customerId, request, options, config = {}) {
27
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
28
+ }
29
+ }
30
+
31
+ export { CustomerPaymentMethodService };
32
+ //# sourceMappingURL=CustomerPaymentMethodService.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerPaymentMethodService.mjs","sources":["../../../../src/services/customersPaymentMethods/CustomerPaymentMethodService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBService } from \"@/services/SBService\";\nimport { INestedCreatable } from \"@/interfaces/ICreatable\";\nimport { INestedUpdatable } from \"@/interfaces/IUpdatable\";\nimport { CustomerPaymentMethodCreateRequest } from \"./CustomerPaymentMethodCreateRequest\";\nimport { CustomerPaymentMethodListRequest } from \"./CustomerPaymentMethodListRequest\";\nimport { CustomerPaymentMethodUpdateRequest } from \"./CustomerPaymentMethodUpdateRequest\";\nimport { INestedRetrievable, INestedRetrievableById } from \"@/interfaces\";\nimport { SBPaymentMethod } from \"@/entities\";\nexport class CustomerPaymentMethodService\n\textends SBService\n\timplements\n\t\tINestedRetrievableById<SBPaymentMethod>,\n\t\tINestedCreatable<CustomerPaymentMethodCreateRequest, SBPaymentMethod>,\n\t\tINestedUpdatable<CustomerPaymentMethodUpdateRequest, SBPaymentMethod>,\n\t\tINestedRetrievable<CustomerPaymentMethodListRequest, SBPaymentMethod>\n{\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\tpublic async getById(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/customers/${customerId}/payment-methods/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\trequest: CustomerPaymentMethodUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/customers/${customerId}/payment-methods/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async get(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await super.getEntities(\n\t\t\t`/v1/customers/${customerId}/payment-methods`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async create(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/${customerId}/payment-methods`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async delete(\n\t\tcustomerId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/customers/${customerId}/payment-methods/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchCreate(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodCreateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/${customerId}/payment-methods/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async batchUpdate(\n\t\tcustomerId: number,\n\t\trequest: CustomerPaymentMethodUpdateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBPaymentMethod[]> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/customers/${customerId}/payment-methods/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["CustomerPaymentMethodService","SBService","constructor","options","defaultAPIServiceOptions","getById","customerId","id","config","getEntityById","update","request","updateEntity","get","getEntities","create","createEntity","delete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M,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMS,MAAMA,CAClBX,UAAkB,EAClBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACU,YAAY,CAC9B,CAAiBZ,cAAAA,EAAAA,UAAU,CAAoBC,iBAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMW,WAAWA,CACvBb,UAAkB,EAClBK,OAA6C,EAC7CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,CAAiBV,cAAAA,EAAAA,UAAU,CAAwB,sBAAA,CAAA,EACnDK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMY,WAAWA,CACvBd,UAAkB,EAClBK,OAA6C,EAC7CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,CAAiBV,cAAAA,EAAAA,UAAU,CAAwB,sBAAA,CAAA,EACnDK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReceiptService.mjs","sources":["../../../../src/services/receipts/ReceiptService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { IListable } from \"@/interfaces/IListable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\n\nimport { SBBatch } from \"@/entities\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBDocument } from \"@/entities/documents\";\nimport { SBReceipt } from \"@/entities/receipts\";\nimport { SBReceiptBatch } from \"@/entities/receipts/SBReceiptBatch\";\nimport {\n\tIBatchable,\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n} from \"@/interfaces\";\nimport mime from \"mime\";\nimport { SBService } from \"@/services/SBService\";\nimport { BarcodeCreateRequest } from \"@/services/barcode/BarcodeCreateRequest\";\nimport { ReceiptTransactionUpdateRequest } from \"@/services/receiptTransactions\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { DocumentUploadRequest } from \"../documents/DocumentUploadRequest\";\nimport { ReceiptTransactionCreateRequest } from \"../receiptTransactions/ReceiptTransactionCreateRequest\";\nimport { BankTransactionAssociateRequest } from \"./BankTransactionAssociateRequest\";\nimport { ReceiptBatchUpsertRequest } from \"./ReceiptBatchUpsertRequest\";\nimport { ReceiptBulkJobCreateRequest } from \"./ReceiptBulkJobCreateRequest\";\nimport { ReceiptCreateRequest } from \"./ReceiptCreateRequest\";\nimport { ReceiptListRequest } from \"./ReceiptListRequest\";\nimport { ReceiptReviewCreateRequest } from \"./ReceiptReviewCreateRequest\";\nimport { ReceiptUpdateRequest } from \"./ReceiptUpdateRequest\";\nimport { ReceiptUpsertRequest } from \"./ReceiptUpsertRequest\";\n\nexport class ReceiptService\n\textends SBService\n\timplements\n\t\tIListable<ReceiptListRequest, SBReceipt>,\n\t\tIRetrievableById<SBReceipt>,\n\t\tIDeletable<SBReceipt>,\n\t\tICreatable<ReceiptCreateRequest, SBReceipt>,\n\t\tIUpdatable<ReceiptUpdateRequest, SBReceipt>,\n\t\tIBatchable<ReceiptUpsertRequest, SBReceipt>\n{\n\tprivate reviewService: ReviewService;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.reviewService = new ReviewService(options);\n\t}\n\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.getEntityById(`/v1/receipts/${id}`, options, config);\n\t}\n\tpublic async list(\n\t\trequest: ReceiptListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<PaginatedResult<SBReceipt>> {\n\t\treturn await super.listEntities(\n\t\t\t\"/v1/receipts\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async create(\n\t\trequest: ReceiptCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<ReceiptCreateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/receipts\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\tid: number,\n\t\treceipt: ReceiptUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn this.updateEntity(\n\t\t\t`/v1/receipts/${id}`,\n\t\t\treceipt,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(`/v1/receipts/${id}`, options, config);\n\t}\n\n\tpublic async associateBankTransaction(\n\t\tid: number,\n\t\trequest: BankTransactionAssociateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<BankTransactionAssociateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/bank-transaction`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async deleteBankTransactionAssociation(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/receipts/${id}/bank-transaction`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async createBarcode(\n\t\tid: number,\n\t\trequest: BarcodeCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<BarcodeCreateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/barcode`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async deleteBarcode(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/receipts/${id}/barcode`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createReview(\n\t\tid: number,\n\t\trequest: ReceiptReviewCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/review`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async addTransaction(\n\t\tid: number,\n\t\trequest: ReceiptTransactionCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/transactions`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updateTransaction(\n\t\tid: number,\n\t\ttransactionId: number,\n\t\trequest: ReceiptTransactionUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/transactions/${transactionId}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createBulkJob(\n\t\trequest: ReceiptBulkJobCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceiptBatch> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async uploadToBulkJob(\n\t\tid: number,\n\t\trequest: ReceiptBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/batch/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async completeBulkJob(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/receipts/batch/${id}/complete`,\n\t\t\tnull,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async batch(\n\t\trequest: ReceiptBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<any>,\n\t): Promise<SBBatch<SBReceipt>> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/receipts/batch\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async uploadDocument(\n\t\tid: number,\n\t\trequest: DocumentUploadRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<FormData>,\n\t): Promise<SBDocument> {\n\t\tconst formData = new FormData();\n\t\trequest.documents.forEach(({ name, uri }) => {\n\t\t\tformData.append(\"files\", {\n\t\t\t\tname: name,\n\t\t\t\turi: uri,\n\t\t\t\ttype: mime.getType(uri),\n\t\t\t} as any);\n\t\t});\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/documents`,\n\t\t\tformData,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["ReceiptService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","reviewService","ReviewService","getById","id","config","getEntityById","list","request","listEntities","create","createEntity","update","receipt","updateEntity","delete","deleteEntity","associateBankTransaction","deleteBankTransactionAssociation","createBarcode","deleteBarcode","createReview","addTransaction","updateTransaction","transactionId","createBulkJob","uploadToBulkJob","completeBulkJob","batch","uploadDocument","formData","FormData","documents","forEach","name","uri","append","type","mime","getType"],"mappings":";;;;;;AAoCM,MAAOA,cACZ,SAAQC,SAAS,CAAA;AAUjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,eAAA,CAAA,IAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,CAACC,aAAa,GAAG,IAAIC,aAAa,CAACJ,OAAO,CAAC,CAAA;AAChD,GAAA;AAEO,EAAA,MAAMK,OAAOA,CACnBC,EAAU,EACVN,OAA0B,EAC1BO,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAAC,CAAA,aAAA,EAAgBF,EAAE,CAAA,CAAE,EAAEN,OAAO,EAAEO,MAAM,CAAC,CAAA;AACxE,GAAA;AACO,EAAA,MAAME,IAAIA,CAChBC,OAA2B,EAC3BV,OAA0B,EAC1BO,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,cAAc,EACdD,OAAO,EACPV,OAAO,EACPO,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMK,MAAMA,CAClBF,OAA6B,EAC7BV,OAA0B,EAC1BO,MAAiD,EAAA;AAEjD,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,cAAc,EACdH,OAAO,EACPV,OAAO,EACPO,MAAM,CACN,CAAA;AACF,GAAA;EAEO,MAA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../../src/services/receipts/ReceiptService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { IListable } from \"@/interfaces/IListable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\n\nimport { SBBatch } from \"@/entities\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBDocument } from \"@/entities/documents\";\nimport { SBReceipt } from \"@/entities/receipts\";\nimport { SBReceiptBatch } from \"@/entities/receipts/SBReceiptBatch\";\nimport {\n\tIBatchable,\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n} from \"@/interfaces\";\nimport mime from \"mime\";\nimport { SBService } from \"@/services/SBService\";\nimport { BarcodeCreateRequest } from \"@/services/barcode/BarcodeCreateRequest\";\nimport { ReceiptTransactionUpdateRequest } from \"@/services/receiptTransactions\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { DocumentUploadRequest } from \"../documents/DocumentUploadRequest\";\nimport { ReceiptPaymentCreateRequest } from \"../receiptTransactions/ReceiptTransactionCreateRequest\";\nimport { BankTransactionAssociateRequest } from \"./BankTransactionAssociateRequest\";\nimport { ReceiptBatchUpsertRequest } from \"./ReceiptBatchUpsertRequest\";\nimport { ReceiptBulkJobCreateRequest } from \"./ReceiptBulkJobCreateRequest\";\nimport { ReceiptCreateRequest } from \"./ReceiptCreateRequest\";\nimport { ReceiptListRequest } from \"./ReceiptListRequest\";\nimport { ReceiptReviewCreateRequest } from \"./ReceiptReviewCreateRequest\";\nimport { ReceiptUpdateRequest } from \"./ReceiptUpdateRequest\";\nimport { ReceiptUpsertRequest } from \"./ReceiptUpsertRequest\";\n\nexport class ReceiptService\n\textends SBService\n\timplements\n\t\tIListable<ReceiptListRequest, SBReceipt>,\n\t\tIRetrievableById<SBReceipt>,\n\t\tIDeletable<SBReceipt>,\n\t\tICreatable<ReceiptCreateRequest, SBReceipt>,\n\t\tIUpdatable<ReceiptUpdateRequest, SBReceipt>,\n\t\tIBatchable<ReceiptUpsertRequest, SBReceipt>\n{\n\tprivate reviewService: ReviewService;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.reviewService = new ReviewService(options);\n\t}\n\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.getEntityById(`/v1/receipts/${id}`, options, config);\n\t}\n\tpublic async list(\n\t\trequest: ReceiptListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<PaginatedResult<SBReceipt>> {\n\t\treturn await super.listEntities(\n\t\t\t\"/v1/receipts\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async create(\n\t\trequest: ReceiptCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<ReceiptCreateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/receipts\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\tid: number,\n\t\treceipt: ReceiptUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn this.updateEntity(\n\t\t\t`/v1/receipts/${id}`,\n\t\t\treceipt,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(`/v1/receipts/${id}`, options, config);\n\t}\n\n\tpublic async associateBankTransaction(\n\t\tid: number,\n\t\trequest: BankTransactionAssociateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<BankTransactionAssociateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/bank-transaction`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async deleteBankTransactionAssociation(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/receipts/${id}/bank-transaction`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async createBarcode(\n\t\tid: number,\n\t\trequest: BarcodeCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<BarcodeCreateRequest>,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/barcode`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async deleteBarcode(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/receipts/${id}/barcode`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createReview(\n\t\tid: number,\n\t\trequest: ReceiptReviewCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/review`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async addTransaction(\n\t\tid: number,\n\t\trequest: ReceiptPaymentCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/transactions`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updateTransaction(\n\t\tid: number,\n\t\ttransactionId: number,\n\t\trequest: ReceiptTransactionUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/transactions/${transactionId}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createBulkJob(\n\t\trequest: ReceiptBulkJobCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceiptBatch> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async uploadToBulkJob(\n\t\tid: number,\n\t\trequest: ReceiptBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/batch/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async completeBulkJob(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBReceipt> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/receipts/batch/${id}/complete`,\n\t\t\tnull,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async batch(\n\t\trequest: ReceiptBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<any>,\n\t): Promise<SBBatch<SBReceipt>> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/receipts/batch\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async uploadDocument(\n\t\tid: number,\n\t\trequest: DocumentUploadRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<FormData>,\n\t): Promise<SBDocument> {\n\t\tconst formData = new FormData();\n\t\trequest.documents.forEach(({ name, uri }) => {\n\t\t\tformData.append(\"files\", {\n\t\t\t\tname: name,\n\t\t\t\turi: uri,\n\t\t\t\ttype: mime.getType(uri),\n\t\t\t} as any);\n\t\t});\n\t\treturn await super.createEntity(\n\t\t\t`/v1/receipts/${id}/documents`,\n\t\t\tformData,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["ReceiptService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","reviewService","ReviewService","getById","id","config","getEntityById","list","request","listEntities","create","createEntity","update","receipt","updateEntity","delete","deleteEntity","associateBankTransaction","deleteBankTransactionAssociation","createBarcode","deleteBarcode","createReview","addTransaction","updateTransaction","transactionId","createBulkJob","uploadToBulkJob","completeBulkJob","batch","uploadDocument","formData","FormData","documents","forEach","name","uri","append","type","mime","getType"],"mappings":";;;;;;AAoCM,MAAOA,cACZ,SAAQC,SAAS,CAAA;AAUjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,eAAA,CAAA,IAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,CAACC,aAAa,GAAG,IAAIC,aAAa,CAACJ,OAAO,CAAC,CAAA;AAChD,GAAA;AAEO,EAAA,MAAMK,OAAOA,CACnBC,EAAU,EACVN,OAA0B,EAC1BO,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAAC,CAAA,aAAA,EAAgBF,EAAE,CAAA,CAAE,EAAEN,OAAO,EAAEO,MAAM,CAAC,CAAA;AACxE,GAAA;AACO,EAAA,MAAME,IAAIA,CAChBC,OAA2B,EAC3BV,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AAAA,GAAG,EAAEA,GAAG;AACRE,QAAAA,IAAI,EAAEC,IAAI,CAACC,OAAO,CAACJ,GAAG,CAAA;AACf,OAAA,CAAC,CAAA;AACV,KAAC,CAAC,CAAA;AACF,IAAA,OAAO,MAAM,KAAK,CAACxB,YAAY,CAC9B,CAAgBP,aAAAA,EAAAA,EAAE,CAAY,UAAA,CAAA,EAC9B0B,QAAQ,EACRhC,OAAO,EACPO,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -19,6 +19,9 @@ class TaxService extends SBService {
19
19
  async batch(request, options, config) {
20
20
  return await super.createEntity(`/v1/taxes/batch`, request, options, config);
21
21
  }
22
+ async batchCreate(request, options, config = {}) {
23
+ return await super.createEntity(`/v1/taxes/batch`, request, options, config);
24
+ }
22
25
  }
23
26
 
24
27
  export { TaxService };
@@ -1 +1 @@
1
- {"version":3,"file":"TaxService.mjs","sources":["../../../../src/services/taxes/TaxService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport { SBBatch } from \"@/entities\";\nimport { IListable } from \"@/interfaces/IListable\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBTax } from \"@/entities/taxes\";\nimport {\n\tIBatchable,\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n\tIUpdatable,\n} from \"@/interfaces\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { SBService } from \"../SBService\";\nimport { TaxBatchUpsertRequest } from \"./TaxBatchUpsertRequest\";\nimport { TaxCreateRequest } from \"./TaxCreateRequest\";\nimport { TaxListRequest } from \"./TaxListRequest\";\nimport { TaxUpdateRequest } from \"./TaxUpdateRequest\";\nimport { TaxUpsertRequest } from \"./TaxUpsertRequest\";\n\nexport class TaxService\n\textends SBService\n\timplements\n\t\tIListable<TaxListRequest, SBTax>,\n\t\tIRetrievableById<SBTax>,\n\t\tICreatable<TaxCreateRequest, SBTax>,\n\t\tIUpdatable<TaxUpdateRequest, SBTax>,\n\t\tIBatchable<TaxUpsertRequest, SBTax>,\n\t\tIDeletable<SBTax>\n{\n\tpublic async create(\n\t\trequest: TaxCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxCreateRequest>,\n\t): Promise<SBTax> {\n\t\treturn await super.createEntity(`/v1/taxes`, request, options, config);\n\t}\n\tpublic async update(\n\t\tid: string | number,\n\t\trequest: TaxUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxUpdateRequest>,\n\t): Promise<SBTax> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/taxes/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async list(\n\t\trequest: TaxListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<PaginatedResult<SBTax>> {\n\t\treturn await super.listEntities(\"/v1/taxes\", request, options, config);\n\t}\n\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBTax> {\n\t\treturn await super.getEntityById(`/v1/taxes/${id}`, options, config);\n\t}\n\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBTax> {\n\t\treturn await super.deleteEntity(`/v1/taxes/${id}`, options, config);\n\t}\n\tpublic async batch(\n\t\trequest: TaxBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxBatchUpsertRequest>,\n\t): Promise<SBBatch<SBTax>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/taxes/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["TaxService","SBService","create","request","options","config","createEntity","update","id","updateEntity","list","listEntities","getById","getEntityById","delete","deleteEntity","batch"],"mappings":";;AAoBM,MAAOA,UACZ,S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H,OAAO,EACPC,OAAO,EACPC,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"TaxService.mjs","sources":["../../../../src/services/taxes/TaxService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport { SBBatch } from \"@/entities\";\nimport { IListable } from \"@/interfaces/IListable\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBTax } from \"@/entities/taxes\";\nimport {\n\tIBatchable,\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n\tIUpdatable,\n} from \"@/interfaces\";\nimport { PaginatedResult } from \"@/utilities\";\nimport { SBService } from \"../SBService\";\nimport { TaxBatchUpsertRequest } from \"./TaxBatchUpsertRequest\";\nimport { TaxCreateRequest } from \"./TaxCreateRequest\";\nimport { TaxListRequest } from \"./TaxListRequest\";\nimport { TaxUpdateRequest } from \"./TaxUpdateRequest\";\nimport { TaxUpsertRequest } from \"./TaxUpsertRequest\";\n\nexport class TaxService\n\textends SBService\n\timplements\n\t\tIListable<TaxListRequest, SBTax>,\n\t\tIRetrievableById<SBTax>,\n\t\tICreatable<TaxCreateRequest, SBTax>,\n\t\tIUpdatable<TaxUpdateRequest, SBTax>,\n\t\tIBatchable<TaxUpsertRequest, SBTax>,\n\t\tIDeletable<SBTax>\n{\n\tpublic async create(\n\t\trequest: TaxCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxCreateRequest>,\n\t): Promise<SBTax> {\n\t\treturn await super.createEntity(`/v1/taxes`, request, options, config);\n\t}\n\tpublic async update(\n\t\tid: string | number,\n\t\trequest: TaxUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxUpdateRequest>,\n\t): Promise<SBTax> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/taxes/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async list(\n\t\trequest: TaxListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<PaginatedResult<SBTax>> {\n\t\treturn await super.listEntities(\"/v1/taxes\", request, options, config);\n\t}\n\n\tpublic async getById(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBTax> {\n\t\treturn await super.getEntityById(`/v1/taxes/${id}`, options, config);\n\t}\n\n\tpublic async delete(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBTax> {\n\t\treturn await super.deleteEntity(`/v1/taxes/${id}`, options, config);\n\t}\n\tpublic async batch(\n\t\trequest: TaxBatchUpsertRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<TaxBatchUpsertRequest>,\n\t): Promise<SBBatch<SBTax>> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/taxes/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchCreate(\n\t\trequest: TaxCreateRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBTax[]> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/taxes/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["TaxService","SBService","create","request","options","config","createEntity","update","id","updateEntity","list","listEntities","getById","getEntityById","delete","deleteEntity","batch","batchCreate"],"mappings":";;AAoBM,MAAOA,UACZ,SAAQC,SAAS,CAAA;AASV,EAAA,MAAMC,MAAMA,CAClBC,OAAyB,EACzBC,OAA0B,EAC1BC,MAA6C,EAAA;AAE7C,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAAC,CAAA,SAAA,CAAW,EAAEH,OAAO,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAAA;AACvE,GAAA;EACO,MAAME,MAAM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