@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
@@ -34,6 +34,9 @@ var SBLogger = require('./SBLogger.cjs');
34
34
  var SBServiceOptions = require('./SBServiceOptions.cjs');
35
35
  var constants = require('./constants.cjs');
36
36
  var ExploreService = require('../services/explore/ExploreService.cjs');
37
+ require('axios');
38
+ require('query-string');
39
+ var VendorService = require('../services/vendors/VendorService.cjs');
37
40
 
38
41
  /**
39
42
  * Client for the Smartbills API.
@@ -85,6 +88,7 @@ class SBClient {
85
88
  defineProperty.default(this, "friends", void 0);
86
89
  defineProperty.default(this, "taxes", void 0);
87
90
  defineProperty.default(this, "users", void 0);
91
+ defineProperty.default(this, "vendors", void 0);
88
92
  this.options = {
89
93
  ...defaultOptions,
90
94
  ...options
@@ -256,6 +260,11 @@ class SBClient {
256
260
  logger: this.logger,
257
261
  url: this.options?.endpoints?.api
258
262
  });
263
+ this.vendors = new VendorService.VendorService({
264
+ ...this.options,
265
+ logger: this.logger,
266
+ url: this.options?.endpoints?.api
267
+ });
259
268
  }
260
269
  }
261
270
 
@@ -1 +1 @@
1
- {"version":3,"file":"SBClient.cjs","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,iBAAO;AACZC,IAAAA,IAAI,EAAED,iBAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,iBAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,OAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAiCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,yCAAwB,EAAA;IAAAC,sBAAA,CAAA,IAAA,EAAA,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AAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAACyE,cAAc,GAAG,IAAIC,yCAAoB,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,mCAAiB,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,qBAAU,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,yBAAW,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.cjs","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,iBAAO;AACZC,IAAAA,IAAI,EAAED,iBAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,iBAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,OAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAkCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,yCAAwB,EAAA;IAAAC,sBAAA,CAA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CAAC,CAAA;AACH,GAAA;AACA;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ exports.SBPaymentMethodType = void 0;
4
+ (function (SBPaymentMethodType) {
5
+ SBPaymentMethodType["Bank"] = "BANKS";
6
+ SBPaymentMethodType["Card"] = "CARD";
7
+ })(exports.SBPaymentMethodType || (exports.SBPaymentMethodType = {}));
8
+ //# sourceMappingURL=SBPaymentMethod.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBPaymentMethod.cjs","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":";;AAsBYA,qCAGX;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,2BAAmB,KAAnBA,2BAAmB,GAG9B,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ exports.SBPaymentMethodFingerprintProvider = void 0;
4
+ (function (SBPaymentMethodFingerprintProvider) {
5
+ SBPaymentMethodFingerprintProvider["Stripe"] = "STRIPE";
6
+ SBPaymentMethodFingerprintProvider["Square"] = "SQUARE";
7
+ })(exports.SBPaymentMethodFingerprintProvider || (exports.SBPaymentMethodFingerprintProvider = {}));
8
+ //# sourceMappingURL=SBPaymentMethodFingerprintProvider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBPaymentMethodFingerprintProvider.cjs","sources":["../../../../src/entities/payment-methods/SBPaymentMethodFingerprintProvider.ts"],"sourcesContent":["export enum SBPaymentMethodFingerprintProvider {\n\tStripe = \"STRIPE\",\n\tSquare = \"SQUARE\",\n}\n"],"names":["SBPaymentMethodFingerprintProvider"],"mappings":";;AAAYA,oDAGX;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,0CAAkC,KAAlCA,0CAAkC,GAG7C,EAAA,CAAA,CAAA;;"}
@@ -15,7 +15,8 @@ var SBBarcodeType = require('./entities/barcode/SBBarcodeType.cjs');
15
15
  var SBCardType = require('./entities/cards/SBCardType.cjs');
16
16
  var SBFeeType = require('./entities/fees/SBFeeType.cjs');
17
17
  var SBOrganizationRole = require('./entities/organizations/SBOrganizationRole.cjs');
18
- var SBPaymentMethodCardFingerprintProvider = require('./entities/payment-methods/SBPaymentMethodCardFingerprintProvider.cjs');
18
+ var SBPaymentMethod = require('./entities/payment-methods/SBPaymentMethod.cjs');
19
+ var SBPaymentMethodFingerprintProvider = require('./entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs');
19
20
  var SBReceiptType = require('./entities/receipts/SBReceiptType.cjs');
20
21
  var SBReceiptSource = require('./entities/receipts/SBReceiptSource.cjs');
21
22
  var SBTransactionType = require('./entities/transactions/SBTransactionType.cjs');
@@ -34,6 +35,9 @@ var BankTransactionService = require('./services/bank-transactions/BankTransacti
34
35
  var BankService = require('./services/banks/BankService.cjs');
35
36
  var BarcodeService = require('./services/barcode/BarcodeService.cjs');
36
37
  var CardService = require('./services/cards/CardService.cjs');
38
+ var CustomerService = require('./services/customers/CustomerService.cjs');
39
+ var CustomerPaymentMethodService = require('./services/customersPaymentMethods/CustomerPaymentMethodService.cjs');
40
+ var CustomerDataSourceService = require('./services/customersDataSources/CustomerDataSourceService.cjs');
37
41
  var DiscountService = require('./services/discounts/DiscountService.cjs');
38
42
  var DocumentService = require('./services/documents/DocumentService.cjs');
39
43
  var DomainService = require('./services/domains/DomainService.cjs');
@@ -59,6 +63,7 @@ var TransactionService = require('./services/transactions/TransactionService.cjs
59
63
  var UserService = require('./services/user/UserService.cjs');
60
64
  var UserService$1 = require('./services/users/UserService.cjs');
61
65
  var ExploreService = require('./services/explore/ExploreService.cjs');
66
+ var VendorService = require('./services/vendors/VendorService.cjs');
62
67
 
63
68
 
64
69
 
@@ -104,9 +109,13 @@ Object.defineProperty(exports, "SBOrganizationRole", {
104
109
  enumerable: true,
105
110
  get: function () { return SBOrganizationRole.SBOrganizationRole; }
106
111
  });
107
- Object.defineProperty(exports, "SBPaymentMethodCardFingerprintProvider", {
112
+ Object.defineProperty(exports, "SBPaymentMethodType", {
108
113
  enumerable: true,
109
- get: function () { return SBPaymentMethodCardFingerprintProvider.SBPaymentMethodCardFingerprintProvider; }
114
+ get: function () { return SBPaymentMethod.SBPaymentMethodType; }
115
+ });
116
+ Object.defineProperty(exports, "SBPaymentMethodFingerprintProvider", {
117
+ enumerable: true,
118
+ get: function () { return SBPaymentMethodFingerprintProvider.SBPaymentMethodFingerprintProvider; }
110
119
  });
111
120
  exports.SBReceiptType = SBReceiptType.SBReceiptType;
112
121
  Object.defineProperty(exports, "SBReceiptSource", {
@@ -153,6 +162,9 @@ exports.BankTransactionService = BankTransactionService.BankTransactionService;
153
162
  exports.BankService = BankService.BankService;
154
163
  exports.BarcodeService = BarcodeService.BarcodeService;
155
164
  exports.CardService = CardService.CardService;
165
+ exports.CustomerService = CustomerService.CustomerService;
166
+ exports.CustomerPaymentMethodService = CustomerPaymentMethodService.CustomerPaymentMethodService;
167
+ exports.CustomerDataSourceService = CustomerDataSourceService.CustomerDataSourceService;
156
168
  exports.DiscountService = DiscountService.DiscountService;
157
169
  exports.DocumentService = DocumentService.DocumentService;
158
170
  exports.DomainService = DomainService.DomainService;
@@ -178,4 +190,5 @@ exports.TransactionService = TransactionService.TransactionService;
178
190
  exports.CurrentUserService = UserService.CurrentUserService;
179
191
  exports.UserService = UserService$1.UserService;
180
192
  exports.ExploreService = ExploreService.ExploreService;
193
+ exports.VendorService = VendorService.VendorService;
181
194
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.0.2-alpha.27";
3
+ var version = "0.0.2-alpha.29";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.map
@@ -7,8 +7,8 @@ class CustomerBalanceTransactionService extends SBService.SBService {
7
7
  constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
8
  super(options);
9
9
  }
10
- async getById(customerId, id, options) {
11
- return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options);
10
+ async getById(customerId, id, options, config = {}) {
11
+ return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options, config);
12
12
  }
13
13
  async update(customerId, id, request, options, config = {}) {
14
14
  return await super.updateEntity(`/v1/customers/${customerId}/balance-transactions/${id}`, request, options, config);
@@ -19,6 +19,12 @@ class CustomerBalanceTransactionService extends SBService.SBService {
19
19
  async create(customerId, request, options, config = {}) {
20
20
  return await super.createEntity(`/v1/customers/${customerId}/balance-transactions`, request, options, config);
21
21
  }
22
+ async batchCreate(id, request, options, config) {
23
+ return await super.createEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
24
+ }
25
+ async batchUpdate(id, request, options, config) {
26
+ return await super.updateEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
27
+ }
22
28
  }
23
29
 
24
30
  exports.CustomerBalanceTransactionService = CustomerBalanceTransactionService;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerBalanceTransactionService.cjs","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,mBAAS,CAAA;AAgBjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,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,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CACvBX,EAAU,EACVI,OAAkD,EAClDR,OAA0B,EAC1BK,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,CAAiBL,cAAAA,EAAAA,EAAE,CAA6B,2BAAA,CAAA,EAChDI,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -2,14 +2,20 @@
2
2
 
3
3
  var defineProperty = require('../../node_modules/@babel/runtime/helpers/esm/defineProperty.cjs');
4
4
  var SBServiceOptions = require('../../client/SBServiceOptions.cjs');
5
- var CustomerBalanceTransactionService = require('../CustomerBalanceTransactions/CustomerBalanceTransactionService.cjs');
5
+ var CustomerBalanceTransactionService = require('../customerBalanceTransactions/CustomerBalanceTransactionService.cjs');
6
6
  var SBService = require('../SBService.cjs');
7
+ var CustomerPaymentMethodService = require('../customersPaymentMethods/CustomerPaymentMethodService.cjs');
7
8
 
8
9
  class CustomerService extends SBService.SBService {
9
10
  constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
10
11
  super(options);
11
- defineProperty.default(this, "balanceTransactionService", void 0);
12
- this.balanceTransactionService = new CustomerBalanceTransactionService.CustomerBalanceTransactionService(options);
12
+ defineProperty.default(this, "balanceTransactions", void 0);
13
+ defineProperty.default(this, "paymentMethods", void 0);
14
+ this.balanceTransactions = new CustomerBalanceTransactionService.CustomerBalanceTransactionService(options);
15
+ this.paymentMethods = new CustomerPaymentMethodService.CustomerPaymentMethodService(options);
16
+ }
17
+ batch(request, options, config) {
18
+ throw new Error("Method not implemented.");
13
19
  }
14
20
  async getById(id, options) {
15
21
  return await super.getEntityById(`/v1/customers/${id}`, options);
@@ -26,19 +32,46 @@ class CustomerService extends SBService.SBService {
26
32
  async list(request, options, config = {}) {
27
33
  return await super.listEntities("/v1/customers", request, options, config);
28
34
  }
35
+ async retrievePaymentMethod(customerId, id, options, config = {}) {
36
+ return await this.paymentMethods.getById(customerId, id, options, config);
37
+ }
38
+ async createPaymentMethod(customerId, request, options, config = {}) {
39
+ return await this.paymentMethods.create(customerId, request, options, config);
40
+ }
41
+ async updatePaymentMethod(customerId, request, options, config = {}) {
42
+ return await this.paymentMethods.create(customerId, request, options, config);
43
+ }
44
+ async listPaymentMethods(customerId, request, options, config = {}) {
45
+ return await this.paymentMethods.get(customerId, request, options, config);
46
+ }
47
+ async deletePaymentMethod(customerId, id, options, config = {}) {
48
+ return await this.paymentMethods.delete(customerId, id, options, config);
49
+ }
50
+ async batchCreatePaymentMethod(customerId, request, options, config = {}) {
51
+ return await this.paymentMethods.batchCreate(customerId, request, options, config);
52
+ }
53
+ async batchUpdatePaymentMethod(customerId, request, options, config = {}) {
54
+ return await this.paymentMethods.batchUpdate(customerId, request, options, config);
55
+ }
29
56
  async createBalanceTransaction(customerId, request, options, config = {}) {
30
- return await this.balanceTransactionService.create(customerId, request);
57
+ return await this.balanceTransactions.create(customerId, request, options, config);
58
+ }
59
+ async listBalanceTransactions(customerId, request, options, config = {}) {
60
+ return await this.balanceTransactions.list(customerId, request, options, config);
31
61
  }
32
- async getBalanceTransaction(customerId, id, options, config = {}) {
33
- return await this.balanceTransactionService.getById(customerId, id);
62
+ async retrieveBalanceTransaction(customerId, id, options, config = {}) {
63
+ return await this.balanceTransactions.getById(customerId, id, options, config);
34
64
  }
35
65
  async updateBalanceTransaction(customerId, id, request, options, config = {}) {
36
- return await this.balanceTransactionService.update(customerId, id, request);
66
+ return await this.balanceTransactions.update(customerId, id, request, options, config);
37
67
  }
38
- async getBalanceTransactions(customerId, id, request, options, config = {}) {
39
- return await this.balanceTransactionService.list(customerId, id, request);
68
+ async getBalanceTransactions(customerId, request, options, config = {}) {
69
+ return await this.balanceTransactions.list(customerId, request, options, config);
70
+ }
71
+ async batchCreate(request, options, config) {
72
+ return await super.createEntity(`/v1/customers/batch`, request, options, config);
40
73
  }
41
- async batch(request, options, config) {
74
+ async batchUpdate(request, options, config) {
42
75
  return await super.createEntity(`/v1/customers/batch`, request, options, config);
43
76
  }
44
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerService.cjs","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,mBAAS,CAAA;AASjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,sBAAA,CAAA,IAAA,EAAA,2BAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IA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AAyB,CAACK,MAAM,CAACW,UAAU,EAAEV,OAAO,CAAC,CAAA;AACxE,GAAA;AAEO,EAAA,MAAMW,qBAAqBA,CACjCD,UAAkB,EAClBb,EAAU,EACVN,OAA0B,EAC1BU,MAAA,GAA6B,EAAE,EAAA;IAE/B,OAAO,MAAM,IAAI,CAACP,yBAAyB,CAACE,OAAO,CAACc,UAAU,EAAEb,EAAE,CAAC,CAAA;AACpE,GAAA;AAEO,EAAA,MAAMe,wBAAwBA,CACpCF,UAAkB,EAClBb,EAAU,EACVG,OAAgD,EAChDT,OAA0B,EAC1BU,MAAA,GAA6B,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.cjs","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","getBalanceTrans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,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var SBServiceOptions = require('../../client/SBServiceOptions.cjs');
4
+ var SBService = require('../SBService.cjs');
5
+
6
+ class CustomerDataSourceService extends SBService.SBService {
7
+ constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
+ super(options);
9
+ }
10
+ async create(customerId, request, options, config = {}) {
11
+ return await super.createEntity(`/v1/customers/${customerId}/providers`, request, options, config);
12
+ }
13
+ }
14
+
15
+ exports.CustomerDataSourceService = CustomerDataSourceService;
16
+ //# sourceMappingURL=CustomerDataSourceService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerDataSourceService.cjs","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,mBAAS,CAAA;AAIjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,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,34 @@
1
+ 'use strict';
2
+
3
+ var SBServiceOptions = require('../../client/SBServiceOptions.cjs');
4
+ var SBService = require('../SBService.cjs');
5
+
6
+ class CustomerPaymentMethodService extends SBService.SBService {
7
+ constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
+ super(options);
9
+ }
10
+ async getById(customerId, id, options, config = {}) {
11
+ return await super.getEntityById(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
12
+ }
13
+ async update(customerId, id, request, options, config = {}) {
14
+ return await super.updateEntity(`/v1/customers/${customerId}/payment-methods/${id}`, request, options, config);
15
+ }
16
+ async get(customerId, request, options, config = {}) {
17
+ return await super.getEntities(`/v1/customers/${customerId}/payment-methods`, request, options, config);
18
+ }
19
+ async create(customerId, request, options, config = {}) {
20
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods`, request, options, config);
21
+ }
22
+ async delete(customerId, id, options, config = {}) {
23
+ return await super.deleteEntity(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
24
+ }
25
+ async batchCreate(customerId, request, options, config = {}) {
26
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
27
+ }
28
+ async batchUpdate(customerId, request, options, config = {}) {
29
+ return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
30
+ }
31
+ }
32
+
33
+ exports.CustomerPaymentMethodService = CustomerPaymentMethodService;
34
+ //# sourceMappingURL=CustomerPaymentMethodService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomerPaymentMethodService.cjs","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","deleteEntity","batchCreate","batchUpdate"],"mappings":";;;;;AAcM,MAAOA,4BACZ,SAAQC,mBAAS,CAAA;AAOjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,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,CAAoBC,iBAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,MAAMA,CAClBJ,UAAkB,EAClBC,EAAU,EACVI,OAA2C,EAC3CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,iBAAiBN,UAAU,CAAA,iBAAA,EAAoBC,EAAE,CAAA,CAAE,EACnDI,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMK,GAAGA,CAC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AA,CAAA,EACnDK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReceiptService.cjs","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,mBAAS,CAAA;AAUjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,sBAAA,CAAA,IAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACf,IAAA,IAAI,CAACC,aAAa,GAAG,IAAIC,2BAAa,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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AI;AAAEC,MAAAA,GAAAA;AAAK,KAAA,KAAI;AAC3CL,MAAAA,QAAQ,CAACM,MAAM,CAAC,OAAO,EAAE;AACxBF,QAAAA,IAAI,EAAEA,IAAI;AACVC,QAAAA,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;;;;"}
1
+ {"version":3,"file":"ReceiptService.cjs","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 { 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,mBAAS,CAAA;AAUjBC,EAAAA,W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,MAAgC,EAAA;AAEhC,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,oBAAoB,EACpBH,OAAO,EACPV,OAAO,EACPO,MAAM,CACN,CAAA;AACF,GAAA;EAEO,MAAMwB,cAAcA,CAC1BzB,EAAU,EACVI,OAA8B,EAC9BV,OAA0B,EAC1BO,MAAqC,EAAA;AAErC,IAAA,MAAMyB,QAAQ,GAAG,IAAIC,QAAQ,EAAE,CAAA;AAC/BvB,IAAAA,OAAO,CAACwB,SAAS,CAACC,OAAO,CAAC,CAAC;MAAEC,IAAI;AAAEC,MAAAA,GAAAA;AAAK,KAAA,KAAI;AAC3CL,MAAAA,QAAQ,CAACM,MAAM,CAAC,OAAO,EAAE;AACxBF,QAAAA,IAAI,EAAEA,IAAI;AACVC,QAAAA,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;;;;"}
@@ -21,6 +21,9 @@ class TaxService extends SBService.SBService {
21
21
  async batch(request, options, config) {
22
22
  return await super.createEntity(`/v1/taxes/batch`, request, options, config);
23
23
  }
24
+ async batchCreate(request, options, config = {}) {
25
+ return await super.createEntity(`/v1/taxes/batch`, request, options, config);
26
+ }
24
27
  }
25
28
 
26
29
  exports.TaxService = TaxService;
@@ -1 +1 @@
1
- {"version":3,"file":"TaxService.cjs","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,SAAQC,mBAAS,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,MAAMA,CAClBC,EAAmB,EACnBL,OAAyB,EACzBC,OAA0B,EAC1BC,MAA6C,EAAA;AAE7C,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,CAAaD,UAAAA,EAAAA,EAAE,CAAE,CAAA,EACjBL,OAAO,EACPC,OAAO,EACPC,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMK,IAAIA,CAChBP,OAAuB,EACvBC,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAAC,WAAW,EAAER,OAAO,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAAA;AACvE,GAAA;AAEO,EAAA,MAAMO,OAAOA,CACnBJ,EAAU,EACVJ,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACQ,aAAa,CAAC,CAAA,UAAA,EAAaL,EAAE,CAAA,CAAE,EAAEJ,OAAO,EAAEC,MAAM,CAAC,CAAA;AACrE,GAAA;AAEO,EAAA,MAAMS,MAAMA,CAClBN,EAAU,EACVJ,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACU,YAAY,CAAC,CAAA,UAAA,EAAaP,EAAE,CAAA,CAAE,EAAEJ,OAAO,EAAEC,MAAM,CAAC,CAAA;AACpE,GAAA;AACO,EAAA,MAAMW,KAAKA,CACjBb,OAA8B,EAC9BC,OAA0B,EAC1BC,MAAkD,EAAA;AAElD,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,CAAA,eAAA,CAAiB,EACjBH,OAAO,EACPC,OAAO,EACPC,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"TaxService.cjs","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,mBAAS,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,MAAMA,CAClBC,EAAmB,EACnBL,OAAyB,EACzBC,OAA0B,EAC1BC,MAA6C,EAAA;AAE7C,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,CAAaD,UAAAA,EAAAA,EAAE,CAAE,CAAA,EACjBL,OAAO,EACPC,OAAO,EACPC,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMK,IAAIA,CAChBP,OAAuB,EACvBC,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAAC,WAAW,EAAER,OAAO,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAAA;AACvE,GAAA;AAEO,EAAA,MAAMO,OAAOA,CACnBJ,EAAU,EACVJ,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACQ,aAAa,CAAC,CAAA,UAAA,EAAaL,EAAE,CAAA,CAAE,EAAEJ,OAAO,EAAEC,MAAM,CAAC,CAAA;AACrE,GAAA;AAEO,EAAA,MAAMS,MAAMA,CAClBN,EAAU,EACVJ,OAA0B,EAC1BC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAA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