@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.
- package/dist/@types/client/SBClient.d.ts +2 -0
- package/dist/@types/entities/metadata/SBMetadata.d.ts +4 -0
- package/dist/@types/entities/metadata/SBMetadata.d.ts.map +1 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethod.d.ts +14 -3
- package/dist/@types/entities/payment-methods/SBPaymentMethodBank.d.ts +10 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodBank.d.ts.map +1 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodCard.d.ts +19 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodCard.d.ts.map +1 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprint.d.ts +7 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprint.d.ts.map +1 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprintProvider.d.ts +7 -0
- package/dist/@types/entities/payment-methods/SBPaymentMethodFingerprintProvider.d.ts.map +1 -0
- package/dist/@types/entities/products/SBProduct.d.ts +5 -2
- package/dist/@types/entities/products/SBProductTranslation.d.ts +11 -0
- package/dist/@types/entities/products/SBProductTranslation.d.ts.map +1 -0
- package/dist/@types/entities/products/SBProductVendor.d.ts +7 -0
- package/dist/@types/entities/products/SBProductVendor.d.ts.map +1 -0
- package/dist/@types/entities/receipt-payments/SBReceiptPaymentCard.d.ts +9 -9
- package/dist/@types/entities/receipt-payments/SBReceiptPaymentMethodCard.d.ts +2 -2
- package/dist/@types/entities/taxes/SBTax.d.ts +10 -0
- package/dist/@types/entities/vendors/SBVendor.d.ts +12 -0
- package/dist/@types/entities/vendors/SBVendor.d.ts.map +1 -0
- package/dist/@types/index.d.ts +25 -11
- package/dist/@types/services/addresses/{AddressCreateRequest.d.ts → AddressRequest.d.ts} +3 -3
- package/dist/@types/services/addresses/AddressRequest.d.ts.map +1 -0
- package/dist/@types/services/addresses/BillingAddressRequest.d.ts +12 -0
- package/dist/@types/services/addresses/BillingAddressRequest.d.ts.map +1 -0
- package/dist/@types/services/cards/AttachCardRequest.d.ts +2 -2
- package/dist/@types/services/cards/CreateCardRequest.d.ts +2 -2
- package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionCreateRequest.d.ts +4 -4
- package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionUpdateRequest.d.ts +1 -3
- package/dist/@types/services/customers/CustomerCreateRequest.d.ts +11 -5
- package/dist/@types/services/customers/CustomerListRequest.d.ts +4 -1
- package/dist/@types/services/customers/CustomerService.d.ts +24 -7
- package/dist/@types/services/customersDataSources/CustomerDataSourceCreateRequest.d.ts +8 -0
- package/dist/@types/services/customersDataSources/CustomerDataSourceCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/customersDataSources/CustomerDataSourceService.d.ts +15 -0
- package/dist/@types/services/customersDataSources/CustomerDataSourceService.d.ts.map +1 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodCreateRequest.d.ts +5 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodListRequest.d.ts +5 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodListRequest.d.ts.map +1 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodService.d.ts +25 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodService.d.ts.map +1 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodUpdateRequest.d.ts +5 -0
- package/dist/@types/services/customersPaymentMethods/CustomerPaymentMethodUpdateRequest.d.ts.map +1 -0
- package/dist/@types/services/fees/FeeCreateRequest.d.ts +2 -1
- package/dist/@types/services/fees/FeeService.d.ts +1 -1
- package/dist/@types/services/fees/FeeUpdateRequest.d.ts +2 -1
- package/dist/@types/services/locations/LocationCreateRequest.d.ts +3 -4
- package/dist/@types/services/locations/LocationService.d.ts +1 -1
- package/dist/@types/services/locations/LocationUpdateRequest.d.ts +3 -4
- package/dist/@types/services/merchants/MerchantCreateRequest.d.ts +2 -2
- package/dist/@types/services/merchants/MerchantUpdateRequest.d.ts +2 -2
- package/dist/@types/services/payment-methods/PaymentMethodBankCreateRequest.d.ts +7 -4
- package/dist/@types/services/payment-methods/PaymentMethodCardCreateRequest.d.ts +19 -0
- package/dist/@types/services/payment-methods/PaymentMethodCardCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/payment-methods/PaymentMethodCreateRequest.d.ts +7 -2
- package/dist/@types/services/product-options/ProductOptionCreateRequest.d.ts +5 -0
- package/dist/@types/services/product-options/ProductOptionCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/products/ProductCreateRequest.d.ts +7 -6
- package/dist/@types/services/products/ProductService.d.ts +1 -1
- package/dist/@types/services/products/ProductUpdateRequest.d.ts +3 -4
- package/dist/@types/services/promo-codes/PromoCodeCreateRequest.d.ts +1 -2
- package/dist/@types/services/promo-codes/PromoCodeService.d.ts +1 -1
- package/dist/@types/services/receiptTransactions/ReceiptTransactionCreateRequest.d.ts +45 -17
- package/dist/@types/services/receipts/ReceiptCreateRequest.d.ts +6 -6
- package/dist/@types/services/receipts/ReceiptReviewCreateRequest.d.ts +1 -3
- package/dist/@types/services/receipts/ReceiptReviewUpdateRequest.d.ts +1 -3
- package/dist/@types/services/receipts/ReceiptService.d.ts +2 -2
- package/dist/@types/services/receipts/ReceiptUpdateRequest.d.ts +3 -3
- package/dist/@types/services/reviews/ReviewCreateRequest.d.ts +1 -3
- package/dist/@types/services/reviews/ReviewUpdateRequest.d.ts +1 -3
- package/dist/@types/services/taxes/TaxCreateRequest.d.ts +2 -3
- package/dist/@types/services/taxes/TaxListRequest.d.ts +2 -0
- package/dist/@types/services/taxes/TaxService.d.ts +1 -0
- package/dist/@types/services/taxes/TaxUpdateRequest.d.ts +2 -4
- package/dist/@types/services/vendors/VendorCreateRequest.d.ts +11 -0
- package/dist/@types/services/vendors/VendorCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/vendors/VendorListRequest.d.ts +7 -0
- package/dist/@types/services/vendors/VendorListRequest.d.ts.map +1 -0
- package/dist/@types/services/vendors/VendorService.d.ts +25 -0
- package/dist/@types/services/vendors/VendorService.d.ts.map +1 -0
- package/dist/@types/services/vendors/VendorUpdateRequest.d.ts +5 -0
- package/dist/@types/services/vendors/VendorUpdateRequest.d.ts.map +1 -0
- package/dist/cjs/client/SBClient.cjs +9 -0
- package/dist/cjs/client/SBClient.cjs.map +1 -1
- package/dist/cjs/entities/payment-methods/SBPaymentMethod.cjs +8 -0
- package/dist/cjs/entities/payment-methods/SBPaymentMethod.cjs.map +1 -0
- package/dist/cjs/entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs +8 -0
- package/dist/cjs/entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs.map +1 -0
- package/dist/cjs/index.cjs +16 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/packages/sdk/package.json.cjs +1 -1
- package/dist/cjs/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionService.cjs +8 -2
- package/dist/cjs/services/customerBalanceTransactions/CustomerBalanceTransactionService.cjs.map +1 -0
- package/dist/cjs/services/customers/CustomerService.cjs +43 -10
- package/dist/cjs/services/customers/CustomerService.cjs.map +1 -1
- package/dist/cjs/services/customersDataSources/CustomerDataSourceService.cjs +16 -0
- package/dist/cjs/services/customersDataSources/CustomerDataSourceService.cjs.map +1 -0
- package/dist/cjs/services/customersPaymentMethods/CustomerPaymentMethodService.cjs +34 -0
- package/dist/cjs/services/customersPaymentMethods/CustomerPaymentMethodService.cjs.map +1 -0
- package/dist/cjs/services/receipts/ReceiptService.cjs.map +1 -1
- package/dist/cjs/services/taxes/TaxService.cjs +3 -0
- package/dist/cjs/services/taxes/TaxService.cjs.map +1 -1
- package/dist/cjs/services/vendors/VendorService.cjs +28 -0
- package/dist/cjs/services/vendors/VendorService.cjs.map +1 -0
- package/dist/esm/client/SBClient.mjs +9 -0
- package/dist/esm/client/SBClient.mjs.map +1 -1
- package/dist/esm/entities/payment-methods/SBPaymentMethod.mjs +8 -0
- package/dist/esm/entities/payment-methods/SBPaymentMethod.mjs.map +1 -0
- package/dist/esm/entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs +8 -0
- package/dist/esm/entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs.map +1 -0
- package/dist/esm/index.mjs +6 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/packages/sdk/package.json.mjs +1 -1
- package/dist/esm/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionService.mjs +8 -2
- package/dist/esm/services/customerBalanceTransactions/CustomerBalanceTransactionService.mjs.map +1 -0
- package/dist/esm/services/customers/CustomerService.mjs +43 -10
- package/dist/esm/services/customers/CustomerService.mjs.map +1 -1
- package/dist/esm/services/customersDataSources/CustomerDataSourceService.mjs +14 -0
- package/dist/esm/services/customersDataSources/CustomerDataSourceService.mjs.map +1 -0
- package/dist/esm/services/customersPaymentMethods/CustomerPaymentMethodService.mjs +32 -0
- package/dist/esm/services/customersPaymentMethods/CustomerPaymentMethodService.mjs.map +1 -0
- package/dist/esm/services/receipts/ReceiptService.mjs.map +1 -1
- package/dist/esm/services/taxes/TaxService.mjs +3 -0
- package/dist/esm/services/taxes/TaxService.mjs.map +1 -1
- package/dist/esm/services/vendors/VendorService.mjs +26 -0
- package/dist/esm/services/vendors/VendorService.mjs.map +1 -0
- package/dist/umd/index.js +182 -68
- package/dist/umd/index.js.map +1 -1
- package/package.json +11 -2
- package/dist/@types/entities/common/SBLocale.d.ts +0 -11
- package/dist/@types/entities/common/SBLocale.d.ts.map +0 -1
- package/dist/@types/entities/common/SBLocalized.d.ts +0 -7
- package/dist/@types/entities/common/SBLocalized.d.ts.map +0 -1
- package/dist/@types/entities/payment-methods/SBBankPaymentMethod.d.ts +0 -12
- package/dist/@types/entities/payment-methods/SBBankPaymentMethod.d.ts.map +0 -1
- package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprint.d.ts +0 -7
- package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprint.d.ts.map +0 -1
- package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.d.ts +0 -7
- package/dist/@types/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.d.ts.map +0 -1
- package/dist/@types/services/addresses/AddressCreateRequest.d.ts.map +0 -1
- package/dist/@types/services/addresses/AddressUpdateRequest.d.ts +0 -13
- package/dist/@types/services/addresses/AddressUpdateRequest.d.ts.map +0 -1
- package/dist/@types/services/addresses/BillingAddressCreateRequest.d.ts +0 -12
- package/dist/@types/services/addresses/BillingAddressCreateRequest.d.ts.map +0 -1
- package/dist/@types/services/addresses/BillingAddressUpdateRequest.d.ts +0 -12
- package/dist/@types/services/addresses/BillingAddressUpdateRequest.d.ts.map +0 -1
- package/dist/cjs/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.cjs +0 -8
- package/dist/cjs/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.cjs.map +0 -1
- package/dist/cjs/services/CustomerBalanceTransactions/CustomerBalanceTransactionService.cjs.map +0 -1
- package/dist/esm/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.mjs +0 -8
- package/dist/esm/entities/payment-methods/SBPaymentMethodCardFingerprintProvider.mjs.map +0 -1
- package/dist/esm/services/CustomerBalanceTransactions/CustomerBalanceTransactionService.mjs.map +0 -1
- /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionCreateRequest.d.ts.map +0 -0
- /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionListRequest.d.ts +0 -0
- /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionListRequest.d.ts.map +0 -0
- /package/dist/@types/services/{CustomerBalanceTransactions → customerBalanceTransactions}/CustomerBalanceTransactionUpdateRequest.d.ts.map +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defaultAPIServiceOptions } from '../../client/SBServiceOptions.mjs';
|
|
2
|
+
import { SBService } from '../SBService.mjs';
|
|
3
|
+
|
|
4
|
+
class VendorService extends SBService {
|
|
5
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
6
|
+
super(options);
|
|
7
|
+
}
|
|
8
|
+
async list(request, options, config) {
|
|
9
|
+
return await super.listEntities("/v1/vendors", request, options, config);
|
|
10
|
+
}
|
|
11
|
+
async getById(id, options, config) {
|
|
12
|
+
return await super.getEntityById(`/v1/vendors/${id}`, options, config);
|
|
13
|
+
}
|
|
14
|
+
async delete(id, options, config) {
|
|
15
|
+
return await super.deleteEntity(`/v1/vendors/${id}`, options, config);
|
|
16
|
+
}
|
|
17
|
+
async create(request, options, config) {
|
|
18
|
+
return await super.createEntity("/v1/vendors", request, options, config);
|
|
19
|
+
}
|
|
20
|
+
async update(id, request, options, config) {
|
|
21
|
+
return await super.updateEntity(`/v1/vendors/${id}`, request, options, config);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { VendorService };
|
|
26
|
+
//# sourceMappingURL=VendorService.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VendorService.mjs","sources":["../../../../src/services/vendors/VendorService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\r\nimport {\r\n\tSBServiceOptions,\r\n\tdefaultAPIServiceOptions,\r\n} from \"@/client/SBServiceOptions\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { ICreatable, IRetrievableById } from \"@/interfaces\";\r\nimport { SBService } from \"@/services/SBService\";\r\nimport { PaginatedResult } from \"@/utilities/PaginatedResult\";\r\nimport { IDeletable } from \"@/interfaces/IDeletable\";\r\nimport { IListable } from \"@/interfaces/IListable\";\r\nimport { VendorCreateRequest } from \"./VendorCreateRequest\";\r\nimport { SBVendor } from \"@/entities/vendors\";\r\nimport { VendorListRequest } from \"./VendorListRequest\";\r\nimport { VendorUpdateRequest } from \"./VendorUpdateRequest\";\r\nexport class VendorService\r\n\textends SBService\r\n\timplements\r\n\t\tIRetrievableById<SBVendor>,\r\n\t\tICreatable<VendorCreateRequest, SBVendor>,\r\n\t\tIListable<VendorListRequest, SBVendor>,\r\n\t\tIDeletable<SBVendor>\r\n{\r\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\r\n\t\tsuper(options);\r\n\t}\r\n\r\n\tpublic async list(\r\n\t\trequest: VendorListRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<PaginatedResult<SBVendor>> {\r\n\t\treturn await super.listEntities(\r\n\t\t\t\"/v1/vendors\",\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic async getById(\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.getEntityById(`/v1/vendors/${id}`, options, config);\r\n\t}\r\n\tpublic async delete(\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.deleteEntity(`/v1/vendors/${id}`, options, config);\r\n\t}\r\n\tpublic async create(\r\n\t\trequest: VendorCreateRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig<VendorCreateRequest>,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t\"/v1/vendors\",\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\tpublic async update(\r\n\t\tid: number,\r\n\t\trequest: VendorUpdateRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig?: AxiosRequestConfig<VendorUpdateRequest>,\r\n\t): Promise<SBVendor> {\r\n\t\treturn await super.updateEntity(\r\n\t\t\t`/v1/vendors/${id}`,\r\n\t\t\trequest,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n}\r\n"],"names":["VendorService","SBService","constructor","options","defaultAPIServiceOptions","list","request","config","listEntities","getById","id","getEntityById","delete","deleteEntity","create","createEntity","update","updateEntity"],"mappings":";;;AAeM,MAAOA,aACZ,SAAQC,SAAS,CAAA;AAOjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AAEO,EAAA,MAAME,IAAIA,CAChBC,OAA0B,EAC1BH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,aAAa,EACbF,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,OAAOA,CACnBC,EAAU,EACVP,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACI,aAAa,CAAC,CAAA,YAAA,EAAeD,EAAE,CAAA,CAAE,EAAEP,OAAO,EAAEI,MAAM,CAAC,CAAA;AACvE,GAAA;AACO,EAAA,MAAMK,MAAMA,CAClBF,EAAU,EACVP,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAAC,CAAA,YAAA,EAAeH,EAAE,CAAA,CAAE,EAAEP,OAAO,EAAEI,MAAM,CAAC,CAAA;AACtE,GAAA;AACO,EAAA,MAAMO,MAAMA,CAClBR,OAA4B,EAC5BH,OAA0B,EAC1BI,MAAgD,EAAA;AAEhD,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,aAAa,EACbT,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;EACO,MAAMS,MAAMA,CAClBN,EAAU,EACVJ,OAA4B,EAC5BH,OAA0B,EAC1BI,MAAgD,EAAA;AAEhD,IAAA,OAAO,MAAM,KAAK,CAACU,YAAY,CAC9B,CAAeP,YAAAA,EAAAA,EAAE,CAAE,CAAA,EACnBJ,OAAO,EACPH,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
|
package/dist/umd/index.js
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
var version$1 = "0.0.2-alpha.
|
|
99
|
+
var version$1 = "0.0.2-alpha.29";
|
|
100
100
|
|
|
101
101
|
const isBrowser = typeof window !== "undefined";
|
|
102
102
|
class SBInstance {
|
|
@@ -364,8 +364,8 @@
|
|
|
364
364
|
constructor(options = defaultAPIServiceOptions) {
|
|
365
365
|
super(options);
|
|
366
366
|
}
|
|
367
|
-
async getById(customerId, id, options) {
|
|
368
|
-
return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options);
|
|
367
|
+
async getById(customerId, id, options, config = {}) {
|
|
368
|
+
return await super.getEntityById(`/v1/customers/${customerId}/balance-transactions/${id}`, options, config);
|
|
369
369
|
}
|
|
370
370
|
async update(customerId, id, request, options, config = {}) {
|
|
371
371
|
return await super.updateEntity(`/v1/customers/${customerId}/balance-transactions/${id}`, request, options, config);
|
|
@@ -376,13 +376,51 @@
|
|
|
376
376
|
async create(customerId, request, options, config = {}) {
|
|
377
377
|
return await super.createEntity(`/v1/customers/${customerId}/balance-transactions`, request, options, config);
|
|
378
378
|
}
|
|
379
|
+
async batchCreate(id, request, options, config) {
|
|
380
|
+
return await super.createEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
|
|
381
|
+
}
|
|
382
|
+
async batchUpdate(id, request, options, config) {
|
|
383
|
+
return await super.updateEntity(`/v1/customers/${id}/balance-transactions/batch`, request, options, config);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
class CustomerPaymentMethodService extends SBService {
|
|
388
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
389
|
+
super(options);
|
|
390
|
+
}
|
|
391
|
+
async getById(customerId, id, options, config = {}) {
|
|
392
|
+
return await super.getEntityById(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
|
|
393
|
+
}
|
|
394
|
+
async update(customerId, id, request, options, config = {}) {
|
|
395
|
+
return await super.updateEntity(`/v1/customers/${customerId}/payment-methods/${id}`, request, options, config);
|
|
396
|
+
}
|
|
397
|
+
async get(customerId, request, options, config = {}) {
|
|
398
|
+
return await super.getEntities(`/v1/customers/${customerId}/payment-methods`, request, options, config);
|
|
399
|
+
}
|
|
400
|
+
async create(customerId, request, options, config = {}) {
|
|
401
|
+
return await super.createEntity(`/v1/customers/${customerId}/payment-methods`, request, options, config);
|
|
402
|
+
}
|
|
403
|
+
async delete(customerId, id, options, config = {}) {
|
|
404
|
+
return await super.deleteEntity(`/v1/customers/${customerId}/payment-methods/${id}`, options, config);
|
|
405
|
+
}
|
|
406
|
+
async batchCreate(customerId, request, options, config = {}) {
|
|
407
|
+
return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
|
|
408
|
+
}
|
|
409
|
+
async batchUpdate(customerId, request, options, config = {}) {
|
|
410
|
+
return await super.createEntity(`/v1/customers/${customerId}/payment-methods/batch`, request, options, config);
|
|
411
|
+
}
|
|
379
412
|
}
|
|
380
413
|
|
|
381
414
|
class CustomerService extends SBService {
|
|
382
415
|
constructor(options = defaultAPIServiceOptions) {
|
|
383
416
|
super(options);
|
|
384
|
-
_defineProperty(this, "
|
|
385
|
-
this
|
|
417
|
+
_defineProperty(this, "balanceTransactions", void 0);
|
|
418
|
+
_defineProperty(this, "paymentMethods", void 0);
|
|
419
|
+
this.balanceTransactions = new CustomerBalanceTransactionService(options);
|
|
420
|
+
this.paymentMethods = new CustomerPaymentMethodService(options);
|
|
421
|
+
}
|
|
422
|
+
batch(request, options, config) {
|
|
423
|
+
throw new Error("Method not implemented.");
|
|
386
424
|
}
|
|
387
425
|
async getById(id, options) {
|
|
388
426
|
return await super.getEntityById(`/v1/customers/${id}`, options);
|
|
@@ -399,19 +437,46 @@
|
|
|
399
437
|
async list(request, options, config = {}) {
|
|
400
438
|
return await super.listEntities("/v1/customers", request, options, config);
|
|
401
439
|
}
|
|
440
|
+
async retrievePaymentMethod(customerId, id, options, config = {}) {
|
|
441
|
+
return await this.paymentMethods.getById(customerId, id, options, config);
|
|
442
|
+
}
|
|
443
|
+
async createPaymentMethod(customerId, request, options, config = {}) {
|
|
444
|
+
return await this.paymentMethods.create(customerId, request, options, config);
|
|
445
|
+
}
|
|
446
|
+
async updatePaymentMethod(customerId, request, options, config = {}) {
|
|
447
|
+
return await this.paymentMethods.create(customerId, request, options, config);
|
|
448
|
+
}
|
|
449
|
+
async listPaymentMethods(customerId, request, options, config = {}) {
|
|
450
|
+
return await this.paymentMethods.get(customerId, request, options, config);
|
|
451
|
+
}
|
|
452
|
+
async deletePaymentMethod(customerId, id, options, config = {}) {
|
|
453
|
+
return await this.paymentMethods.delete(customerId, id, options, config);
|
|
454
|
+
}
|
|
455
|
+
async batchCreatePaymentMethod(customerId, request, options, config = {}) {
|
|
456
|
+
return await this.paymentMethods.batchCreate(customerId, request, options, config);
|
|
457
|
+
}
|
|
458
|
+
async batchUpdatePaymentMethod(customerId, request, options, config = {}) {
|
|
459
|
+
return await this.paymentMethods.batchUpdate(customerId, request, options, config);
|
|
460
|
+
}
|
|
402
461
|
async createBalanceTransaction(customerId, request, options, config = {}) {
|
|
403
|
-
return await this.
|
|
462
|
+
return await this.balanceTransactions.create(customerId, request, options, config);
|
|
404
463
|
}
|
|
405
|
-
async
|
|
406
|
-
return await this.
|
|
464
|
+
async listBalanceTransactions(customerId, request, options, config = {}) {
|
|
465
|
+
return await this.balanceTransactions.list(customerId, request, options, config);
|
|
466
|
+
}
|
|
467
|
+
async retrieveBalanceTransaction(customerId, id, options, config = {}) {
|
|
468
|
+
return await this.balanceTransactions.getById(customerId, id, options, config);
|
|
407
469
|
}
|
|
408
470
|
async updateBalanceTransaction(customerId, id, request, options, config = {}) {
|
|
409
|
-
return await this.
|
|
471
|
+
return await this.balanceTransactions.update(customerId, id, request, options, config);
|
|
410
472
|
}
|
|
411
|
-
async getBalanceTransactions(customerId,
|
|
412
|
-
return await this.
|
|
473
|
+
async getBalanceTransactions(customerId, request, options, config = {}) {
|
|
474
|
+
return await this.balanceTransactions.list(customerId, request, options, config);
|
|
413
475
|
}
|
|
414
|
-
async
|
|
476
|
+
async batchCreate(request, options, config) {
|
|
477
|
+
return await super.createEntity(`/v1/customers/batch`, request, options, config);
|
|
478
|
+
}
|
|
479
|
+
async batchUpdate(request, options, config) {
|
|
415
480
|
return await super.createEntity(`/v1/customers/batch`, request, options, config);
|
|
416
481
|
}
|
|
417
482
|
}
|
|
@@ -5920,6 +5985,9 @@
|
|
|
5920
5985
|
async batch(request, options, config) {
|
|
5921
5986
|
return await super.createEntity(`/v1/taxes/batch`, request, options, config);
|
|
5922
5987
|
}
|
|
5988
|
+
async batchCreate(request, options, config = {}) {
|
|
5989
|
+
return await super.createEntity(`/v1/taxes/batch`, request, options, config);
|
|
5990
|
+
}
|
|
5923
5991
|
}
|
|
5924
5992
|
|
|
5925
5993
|
class TransactionService extends SBService {
|
|
@@ -5949,6 +6017,87 @@
|
|
|
5949
6017
|
}
|
|
5950
6018
|
}
|
|
5951
6019
|
|
|
6020
|
+
class CustomerDataSourceService extends SBService {
|
|
6021
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
6022
|
+
super(options);
|
|
6023
|
+
}
|
|
6024
|
+
async create(customerId, request, options, config = {}) {
|
|
6025
|
+
return await super.createEntity(`/v1/customers/${customerId}/providers`, request, options, config);
|
|
6026
|
+
}
|
|
6027
|
+
}
|
|
6028
|
+
|
|
6029
|
+
class DiscountService extends SBService {
|
|
6030
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
6031
|
+
super(options);
|
|
6032
|
+
}
|
|
6033
|
+
async list(request, options, config) {
|
|
6034
|
+
return await super.listEntities("/v1/discounts", request, options, config);
|
|
6035
|
+
}
|
|
6036
|
+
async getById(id, options, config) {
|
|
6037
|
+
return await super.getEntityById(`/v1/discounts/${id}`, options, config);
|
|
6038
|
+
}
|
|
6039
|
+
async delete(id, options, config) {
|
|
6040
|
+
return await super.deleteEntity(`/v1/discounts/${id}`, options, config);
|
|
6041
|
+
}
|
|
6042
|
+
async create(request, options, config) {
|
|
6043
|
+
return await super.createEntity(`/v1/discounts`, request, options, config);
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
|
|
6047
|
+
class DomainService extends SBService {
|
|
6048
|
+
async list(request, options, config) {
|
|
6049
|
+
return await super.listEntities("/v1/domains", request, options, config);
|
|
6050
|
+
}
|
|
6051
|
+
async delete(id, options, config) {
|
|
6052
|
+
return super.deleteEntity(`/v1/domains/${id}`, options, config);
|
|
6053
|
+
}
|
|
6054
|
+
async getById(id, options, config) {
|
|
6055
|
+
return super.getEntityById(`/v1/domains/${id}`, options, config);
|
|
6056
|
+
}
|
|
6057
|
+
async create(request, options, config) {
|
|
6058
|
+
return await super.createEntity(`/v1/domains`, request, options, config);
|
|
6059
|
+
}
|
|
6060
|
+
}
|
|
6061
|
+
|
|
6062
|
+
class PriceService extends SBService {
|
|
6063
|
+
async list(request, options, config) {
|
|
6064
|
+
return await super.listEntities(`/v1/prices`, request, options, config);
|
|
6065
|
+
}
|
|
6066
|
+
async getById(id, options, config) {
|
|
6067
|
+
return await super.getEntityById(`/v1/prices/${id}`, options, config);
|
|
6068
|
+
}
|
|
6069
|
+
async delete(id, options, config) {
|
|
6070
|
+
return await super.deleteEntity(`/v1/prices/${id}`, options, config);
|
|
6071
|
+
}
|
|
6072
|
+
async create(request, options, config) {
|
|
6073
|
+
return await super.createEntity(`/v1/prices`, request, options, config);
|
|
6074
|
+
}
|
|
6075
|
+
async update(id, request, options, config) {
|
|
6076
|
+
return await super.updateEntity(`/v1/prices/${id}`, request, options, config);
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
6079
|
+
|
|
6080
|
+
class VendorService extends SBService {
|
|
6081
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
6082
|
+
super(options);
|
|
6083
|
+
}
|
|
6084
|
+
async list(request, options, config) {
|
|
6085
|
+
return await super.listEntities("/v1/vendors", request, options, config);
|
|
6086
|
+
}
|
|
6087
|
+
async getById(id, options, config) {
|
|
6088
|
+
return await super.getEntityById(`/v1/vendors/${id}`, options, config);
|
|
6089
|
+
}
|
|
6090
|
+
async delete(id, options, config) {
|
|
6091
|
+
return await super.deleteEntity(`/v1/vendors/${id}`, options, config);
|
|
6092
|
+
}
|
|
6093
|
+
async create(request, options, config) {
|
|
6094
|
+
return await super.createEntity("/v1/vendors", request, options, config);
|
|
6095
|
+
}
|
|
6096
|
+
async update(id, request, options, config) {
|
|
6097
|
+
return await super.updateEntity(`/v1/vendors/${id}`, request, options, config);
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
|
|
5952
6101
|
/**
|
|
5953
6102
|
* Client for the Smartbills API.
|
|
5954
6103
|
*/
|
|
@@ -5999,6 +6148,7 @@
|
|
|
5999
6148
|
_defineProperty(this, "friends", void 0);
|
|
6000
6149
|
_defineProperty(this, "taxes", void 0);
|
|
6001
6150
|
_defineProperty(this, "users", void 0);
|
|
6151
|
+
_defineProperty(this, "vendors", void 0);
|
|
6002
6152
|
this.options = {
|
|
6003
6153
|
...defaultOptions,
|
|
6004
6154
|
...options
|
|
@@ -6170,6 +6320,11 @@
|
|
|
6170
6320
|
logger: this.logger,
|
|
6171
6321
|
url: this.options?.endpoints?.api
|
|
6172
6322
|
});
|
|
6323
|
+
this.vendors = new VendorService({
|
|
6324
|
+
...this.options,
|
|
6325
|
+
logger: this.logger,
|
|
6326
|
+
url: this.options?.endpoints?.api
|
|
6327
|
+
});
|
|
6173
6328
|
}
|
|
6174
6329
|
}
|
|
6175
6330
|
|
|
@@ -6351,11 +6506,17 @@
|
|
|
6351
6506
|
SBOrganizationRole["Employee"] = "employee";
|
|
6352
6507
|
})(exports.SBOrganizationRole || (exports.SBOrganizationRole = {}));
|
|
6353
6508
|
|
|
6354
|
-
exports.
|
|
6355
|
-
(function (
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
})(exports.
|
|
6509
|
+
exports.SBPaymentMethodType = void 0;
|
|
6510
|
+
(function (SBPaymentMethodType) {
|
|
6511
|
+
SBPaymentMethodType["Bank"] = "BANKS";
|
|
6512
|
+
SBPaymentMethodType["Card"] = "CARD";
|
|
6513
|
+
})(exports.SBPaymentMethodType || (exports.SBPaymentMethodType = {}));
|
|
6514
|
+
|
|
6515
|
+
exports.SBPaymentMethodFingerprintProvider = void 0;
|
|
6516
|
+
(function (SBPaymentMethodFingerprintProvider) {
|
|
6517
|
+
SBPaymentMethodFingerprintProvider["Stripe"] = "STRIPE";
|
|
6518
|
+
SBPaymentMethodFingerprintProvider["Square"] = "SQUARE";
|
|
6519
|
+
})(exports.SBPaymentMethodFingerprintProvider || (exports.SBPaymentMethodFingerprintProvider = {}));
|
|
6359
6520
|
|
|
6360
6521
|
const SBReceiptType = {
|
|
6361
6522
|
bankTransaction: 0,
|
|
@@ -6452,57 +6613,6 @@
|
|
|
6452
6613
|
SBReceiptPaymentExternalType["Other"] = "Other";
|
|
6453
6614
|
})(exports.SBReceiptPaymentExternalType || (exports.SBReceiptPaymentExternalType = {}));
|
|
6454
6615
|
|
|
6455
|
-
class DiscountService extends SBService {
|
|
6456
|
-
constructor(options = defaultAPIServiceOptions) {
|
|
6457
|
-
super(options);
|
|
6458
|
-
}
|
|
6459
|
-
async list(request, options, config) {
|
|
6460
|
-
return await super.listEntities("/v1/discounts", request, options, config);
|
|
6461
|
-
}
|
|
6462
|
-
async getById(id, options, config) {
|
|
6463
|
-
return await super.getEntityById(`/v1/discounts/${id}`, options, config);
|
|
6464
|
-
}
|
|
6465
|
-
async delete(id, options, config) {
|
|
6466
|
-
return await super.deleteEntity(`/v1/discounts/${id}`, options, config);
|
|
6467
|
-
}
|
|
6468
|
-
async create(request, options, config) {
|
|
6469
|
-
return await super.createEntity(`/v1/discounts`, request, options, config);
|
|
6470
|
-
}
|
|
6471
|
-
}
|
|
6472
|
-
|
|
6473
|
-
class DomainService extends SBService {
|
|
6474
|
-
async list(request, options, config) {
|
|
6475
|
-
return await super.listEntities("/v1/domains", request, options, config);
|
|
6476
|
-
}
|
|
6477
|
-
async delete(id, options, config) {
|
|
6478
|
-
return super.deleteEntity(`/v1/domains/${id}`, options, config);
|
|
6479
|
-
}
|
|
6480
|
-
async getById(id, options, config) {
|
|
6481
|
-
return super.getEntityById(`/v1/domains/${id}`, options, config);
|
|
6482
|
-
}
|
|
6483
|
-
async create(request, options, config) {
|
|
6484
|
-
return await super.createEntity(`/v1/domains`, request, options, config);
|
|
6485
|
-
}
|
|
6486
|
-
}
|
|
6487
|
-
|
|
6488
|
-
class PriceService extends SBService {
|
|
6489
|
-
async list(request, options, config) {
|
|
6490
|
-
return await super.listEntities(`/v1/prices`, request, options, config);
|
|
6491
|
-
}
|
|
6492
|
-
async getById(id, options, config) {
|
|
6493
|
-
return await super.getEntityById(`/v1/prices/${id}`, options, config);
|
|
6494
|
-
}
|
|
6495
|
-
async delete(id, options, config) {
|
|
6496
|
-
return await super.deleteEntity(`/v1/prices/${id}`, options, config);
|
|
6497
|
-
}
|
|
6498
|
-
async create(request, options, config) {
|
|
6499
|
-
return await super.createEntity(`/v1/prices`, request, options, config);
|
|
6500
|
-
}
|
|
6501
|
-
async update(id, request, options, config) {
|
|
6502
|
-
return await super.updateEntity(`/v1/prices/${id}`, request, options, config);
|
|
6503
|
-
}
|
|
6504
|
-
}
|
|
6505
|
-
|
|
6506
6616
|
exports.AccessTokenResponse = AccessTokenResponse;
|
|
6507
6617
|
exports.ApiLogService = ApiLogService;
|
|
6508
6618
|
exports.AuthorizationCodeResponse = AuthorizationCodeResponse;
|
|
@@ -6513,6 +6623,9 @@
|
|
|
6513
6623
|
exports.BarcodeService = BarcodeService;
|
|
6514
6624
|
exports.CardService = CardService;
|
|
6515
6625
|
exports.CurrentUserService = CurrentUserService;
|
|
6626
|
+
exports.CustomerDataSourceService = CustomerDataSourceService;
|
|
6627
|
+
exports.CustomerPaymentMethodService = CustomerPaymentMethodService;
|
|
6628
|
+
exports.CustomerService = CustomerService;
|
|
6516
6629
|
exports.DiscountService = DiscountService;
|
|
6517
6630
|
exports.DocumentService = DocumentService;
|
|
6518
6631
|
exports.DomainService = DomainService;
|
|
@@ -6545,6 +6658,7 @@
|
|
|
6545
6658
|
exports.TaxService = TaxService;
|
|
6546
6659
|
exports.TransactionService = TransactionService;
|
|
6547
6660
|
exports.UserService = UserService;
|
|
6661
|
+
exports.VendorService = VendorService;
|
|
6548
6662
|
exports.defaultAPIServiceOptions = defaultAPIServiceOptions;
|
|
6549
6663
|
exports.defaultAuthServiceoptions = defaultAuthServiceoptions;
|
|
6550
6664
|
|