@smartbills/sdk 0.0.2-alpha.45 → 0.0.2-alpha.46
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/businesses/brands/SBBusinessBrand.d.ts +11 -0
- package/dist/@types/entities/businesses/brands/SBBusinessBrand.d.ts.map +1 -0
- package/dist/@types/index.d.ts +2 -0
- package/dist/@types/services/businesses/brands/BrandCreateRequest.d.ts +16 -0
- package/dist/@types/services/businesses/brands/BrandCreateRequest.d.ts.map +1 -0
- package/dist/@types/services/businesses/brands/BrandService.d.ts +31 -0
- package/dist/@types/services/businesses/brands/BrandService.d.ts.map +1 -0
- package/dist/@types/services/vendors/VendorConnectRequest.d.ts +11 -0
- package/dist/@types/services/vendors/VendorConnectResponse.d.ts +1 -1
- package/dist/@types/services/vendors/VendorService.d.ts +2 -0
- package/dist/cjs/client/SBClient.cjs +3 -1
- package/dist/cjs/client/SBClient.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/packages/sdk/package.json.cjs +1 -1
- package/dist/cjs/services/businesses/BusinessService.cjs.map +1 -1
- package/dist/cjs/services/businesses/brands/BrandService.cjs +33 -0
- package/dist/cjs/services/businesses/brands/BrandService.cjs.map +1 -0
- package/dist/cjs/services/vendors/VendorService.cjs +6 -0
- package/dist/cjs/services/vendors/VendorService.cjs.map +1 -1
- package/dist/esm/client/SBClient.mjs +3 -1
- package/dist/esm/client/SBClient.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/packages/sdk/package.json.mjs +1 -1
- package/dist/esm/services/businesses/BusinessService.mjs.map +1 -1
- package/dist/esm/services/businesses/brands/BrandService.mjs +31 -0
- package/dist/esm/services/businesses/brands/BrandService.mjs.map +1 -0
- package/dist/esm/services/vendors/VendorService.mjs +6 -0
- package/dist/esm/services/vendors/VendorService.mjs.map +1 -1
- package/dist/umd/index.js +36 -2
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusinessService.mjs","sources":["../../../../src/services/businesses/BusinessService.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 { SBBusiness } from \"@/entities/businesses/SBBusiness\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { BusinessCreateRequest } from \"./BusinessCreateRequest\";\nimport { BusinessListRequest } from \"./BusinessListRequest\";\nimport { BusinessUpdateRequest } from \"./BusinessUpdateRequest\";\nimport { IRetrievableById } from \"@/interfaces\";\nimport { SBList } from \"@/entities/base\";\nimport { CustomerPaymentMethodService, CustomerService } from \"./customers\";\nimport { FeeService } from \"./fees\";\nimport { LocationService } from \"./locations\";\nimport {\n\tProductImageService,\n\tProductModifierService,\n\tProductOptionService,\n\tProductService,\n\tProductVariantService,\n} from \"./products\";\nimport { PromoCodeService } from \"./promo-codes\";\nimport { BusinessReviewService } from \"./reviews\";\nimport { TaxService } from \"./taxes\";\nimport { BusinessVendorService } from \"./vendors\";\nimport { CustomerBalanceTransactionService } from \"./customers/balance-transactions/CustomerBalanceTransactionService\";\nimport { SBTeamMember } from \"@/entities\";\nimport {\n\tTeamMemberInvitationService,\n\tTeamMemberListRequest,\n\tTeamMemberService,\n} from \"./team\";\nimport { DepartmentService } from \"./departments\";\nimport { BusinessInvitationRequest } from \"./BusinessInvitationRequest\";\n\nexport class BusinessService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBBusiness>,\n\t\tICreatable<BusinessCreateRequest, SBBusiness>,\n\t\tIUpdatable<BusinessUpdateRequest, SBBusiness>,\n\t\tIDeletable<SBBusiness>\n{\n\tpublic readonly departments: DepartmentService;\n\tpublic readonly teamMembers: TeamMemberService;\n\tpublic readonly locations: LocationService;\n\tpublic readonly customers: CustomerService;\n\tpublic readonly customerPaymentMethods: CustomerPaymentMethodService;\n\tpublic readonly customerBalanceTransactions: CustomerBalanceTransactionService;\n\tpublic readonly fees: FeeService;\n\tpublic readonly taxes: TaxService;\n\tpublic readonly reviews: BusinessReviewService;\n\tpublic readonly products: ProductService;\n\tpublic readonly productVariants: ProductVariantService;\n\tpublic readonly productOptions: ProductOptionService;\n\tpublic readonly productModifiers: ProductModifierService;\n\tpublic readonly productImages: ProductImageService;\n\tpublic readonly promoCodes: PromoCodeService;\n\tpublic readonly vendors: BusinessVendorService;\n\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.teamMembers = new TeamMemberService(options);\n\t\tthis.locations = new LocationService(options);\n\t\tthis.customers = new CustomerService(options);\n\t\tthis.customerPaymentMethods = new CustomerPaymentMethodService(options);\n\t\tthis.customerBalanceTransactions =\n\t\t\tnew CustomerBalanceTransactionService(options);\n\t\tthis.fees = new FeeService(options);\n\t\tthis.taxes = new TaxService(options);\n\t\tthis.vendors = new BusinessVendorService(options);\n\t\tthis.reviews = new BusinessReviewService(options);\n\t\tthis.products = new ProductService(options);\n\t\tthis.productVariants = new ProductVariantService(options);\n\t\tthis.productOptions = new ProductOptionService(options);\n\t\tthis.productModifiers = new ProductModifierService(options);\n\t\tthis.productImages = new ProductImageService(options);\n\t\tthis.promoCodes = new PromoCodeService(options);\n\t\tthis.departments = new DepartmentService(options);\n\t}\n\n\tpublic async getByIdAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.getEntityById(`/v1/businesses/${id}`, options, config);\n\t}\n\n\tpublic async listAsync(\n\t\trequest?: BusinessListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBBusiness>> {\n\t\treturn this.listEntities(\n\t\t\t\"/v1/businesses\",\n\t\t\trequest || { page: 1, pageSize: 25 },\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async search(\n\t\trequest: BusinessListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBBusiness>> {\n\t\treturn this.listEntities(\n\t\t\t\"/v1/businesses/search\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createAsync(\n\t\trequest: BusinessCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.createEntity(\"/v1/businesses\", request, options, config);\n\t}\n\n\tpublic async updateAsync(\n\t\tid: number,\n\t\trequest: BusinessUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.updateEntity(\n\t\t\t`/v1/businesses/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.deleteEntity(`/v1/businesses/${id}`, options, config);\n\t}\n\n\tpublic async count(\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<number> {\n\t\treturn this.getEntityById(\"/v1/businesses/count\", options, config);\n\t}\n\n\tpublic async getMemberById(\n\t\tbusinessId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBTeamMember> {\n\t\treturn await this.teamMembers.getByIdAsync(\n\t\t\tbusinessId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listMembers(\n\t\tbusinessId: number,\n\t\trequest: TeamMemberListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBList<SBTeamMember>> {\n\t\treturn await this.teamMembers.listAsync(\n\t\t\tbusinessId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteMember(\n\t\tbusinessId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBTeamMember> {\n\t\treturn await this.teamMembers.deleteAsync(\n\t\t\tbusinessId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchInviteMemberAsync(\n\t\tbusinessId: number,\n\t\trequest: BusinessInvitationRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<any> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/business/${businessId}/invitations/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["BusinessService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","teamMembers","TeamMemberService","locations","LocationService","customers","CustomerService","customerPaymentMethods","CustomerPaymentMethodService","customerBalanceTransactions","CustomerBalanceTransactionService","fees","FeeService","taxes","TaxService","vendors","BusinessVendorService","reviews","BusinessReviewService","products","ProductService","productVariants","ProductVariantService","productOptions","ProductOptionService","productModifiers","ProductModifierService","productImages","ProductImageService","promoCodes","PromoCodeService","departments","DepartmentService","getByIdAsync","id","config","getEntityById","listAsync","request","listEntities","page","pageSize","search","createAsync","createEntity","updateAsync","updateEntity","deleteAsync","deleteEntity","count","getMemberById","businessId","listMembers","deleteMember","batchInviteMemberAsync"],"mappings":";;;;;;;;;;;;;;;;;;;;AAw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AU,EACVpC,OAA0B,EAC1BqC,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAAClC,WAAW,CAACgC,YAAY,CACzCkB,UAAU,EACVjB,EAAE,EACFpC,OAAO,EACPqC,MAAM,CACN;AACF;AAEO,EAAA,MAAMiB,WAAWA,CACvBD,UAAkB,EAClBb,OAA8B,EAC9BxC,OAA0B,EAC1BqC,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAAClC,WAAW,CAACoC,SAAS,CACtCc,UAAU,EACVb,OAAO,EACPxC,OAAO,EACPqC,MAAM,CACN;AACF;AAEO,EAAA,MAAMkB,YAAYA,CACxBF,UAAkB,EAClBjB,EAAU,EACVpC,OAA0B,EAC1BqC,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAAClC,WAAW,CAAC8C,WAAW,CACxCI,UAAU,EACVjB,EAAE,EACFpC,OAAO,EACPqC,MAAM,CACN;AACF;EAEO,MAAMmB,sBAAsBA,CAClCH,UAAkB,EAClBb,OAAoC,EACpCxC,OAA0B,EAC1BqC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,IAAI,CAACS,YAAY,CAC7B,CAAgBO,aAAAA,EAAAA,UAAU,CAAoB,kBAAA,CAAA,EAC9Cb,OAAO,EACPxC,OAAO,EACPqC,MAAM,CACN;AACF;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"BusinessService.mjs","sources":["../../../../src/services/businesses/BusinessService.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 { SBBusiness } from \"@/entities/businesses/SBBusiness\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { BusinessCreateRequest } from \"./BusinessCreateRequest\";\nimport { BusinessListRequest } from \"./BusinessListRequest\";\nimport { BusinessUpdateRequest } from \"./BusinessUpdateRequest\";\nimport { IRetrievableById } from \"@/interfaces\";\nimport { SBList } from \"@/entities/base\";\nimport { CustomerPaymentMethodService, CustomerService } from \"./customers\";\nimport { FeeService } from \"./fees\";\nimport { LocationService } from \"./locations\";\nimport {\n\tProductImageService,\n\tProductModifierService,\n\tProductOptionService,\n\tProductService,\n\tProductVariantService,\n} from \"./products\";\nimport { PromoCodeService } from \"./promo-codes\";\nimport { BusinessReviewService } from \"./reviews\";\nimport { TaxService } from \"./taxes\";\nimport { BusinessVendorService } from \"./vendors\";\nimport { CustomerBalanceTransactionService } from \"./customers/balance-transactions/CustomerBalanceTransactionService\";\nimport { SBTeamMember } from \"@/entities\";\nimport {\n\tTeamMemberInvitationService,\n\tTeamMemberListRequest,\n\tTeamMemberService,\n} from \"./team\";\nimport { DepartmentService } from \"./departments\";\nimport { BusinessInvitationRequest } from \"./BusinessInvitationRequest\";\nimport { BrandService } from \"./brands\";\n\nexport class BusinessService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBBusiness>,\n\t\tICreatable<BusinessCreateRequest, SBBusiness>,\n\t\tIUpdatable<BusinessUpdateRequest, SBBusiness>,\n\t\tIDeletable<SBBusiness>\n{\n\tpublic readonly departments: DepartmentService;\n\tpublic readonly teamMembers: TeamMemberService;\n\tpublic readonly locations: LocationService;\n\tpublic readonly customers: CustomerService;\n\tpublic readonly customerPaymentMethods: CustomerPaymentMethodService;\n\tpublic readonly customerBalanceTransactions: CustomerBalanceTransactionService;\n\tpublic readonly fees: FeeService;\n\tpublic readonly taxes: TaxService;\n\tpublic readonly reviews: BusinessReviewService;\n\tpublic readonly products: ProductService;\n\tpublic readonly productVariants: ProductVariantService;\n\tpublic readonly productOptions: ProductOptionService;\n\tpublic readonly productModifiers: ProductModifierService;\n\tpublic readonly productImages: ProductImageService;\n\tpublic readonly promoCodes: PromoCodeService;\n\tpublic readonly vendors: BusinessVendorService;\n\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.teamMembers = new TeamMemberService(options);\n\t\tthis.locations = new LocationService(options);\n\t\tthis.customers = new CustomerService(options);\n\t\tthis.customerPaymentMethods = new CustomerPaymentMethodService(options);\n\t\tthis.customerBalanceTransactions =\n\t\t\tnew CustomerBalanceTransactionService(options);\n\t\tthis.fees = new FeeService(options);\n\t\tthis.taxes = new TaxService(options);\n\t\tthis.vendors = new BusinessVendorService(options);\n\t\tthis.reviews = new BusinessReviewService(options);\n\t\tthis.products = new ProductService(options);\n\t\tthis.productVariants = new ProductVariantService(options);\n\t\tthis.productOptions = new ProductOptionService(options);\n\t\tthis.productModifiers = new ProductModifierService(options);\n\t\tthis.productImages = new ProductImageService(options);\n\t\tthis.promoCodes = new PromoCodeService(options);\n\t\tthis.departments = new DepartmentService(options);\n\t}\n\n\tpublic async getByIdAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.getEntityById(`/v1/businesses/${id}`, options, config);\n\t}\n\n\tpublic async listAsync(\n\t\trequest?: BusinessListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBBusiness>> {\n\t\treturn this.listEntities(\n\t\t\t\"/v1/businesses\",\n\t\t\trequest || { page: 1, pageSize: 25 },\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async search(\n\t\trequest: BusinessListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBBusiness>> {\n\t\treturn this.listEntities(\n\t\t\t\"/v1/businesses/search\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createAsync(\n\t\trequest: BusinessCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.createEntity(\"/v1/businesses\", request, options, config);\n\t}\n\n\tpublic async updateAsync(\n\t\tid: number,\n\t\trequest: BusinessUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.updateEntity(\n\t\t\t`/v1/businesses/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBBusiness> {\n\t\treturn this.deleteEntity(`/v1/businesses/${id}`, options, config);\n\t}\n\n\tpublic async count(\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<number> {\n\t\treturn this.getEntityById(\"/v1/businesses/count\", options, config);\n\t}\n\n\tpublic async getMemberById(\n\t\tbusinessId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBTeamMember> {\n\t\treturn await this.teamMembers.getByIdAsync(\n\t\t\tbusinessId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listMembers(\n\t\tbusinessId: number,\n\t\trequest: TeamMemberListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBList<SBTeamMember>> {\n\t\treturn await this.teamMembers.listAsync(\n\t\t\tbusinessId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteMember(\n\t\tbusinessId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBTeamMember> {\n\t\treturn await this.teamMembers.deleteAsync(\n\t\t\tbusinessId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async batchInviteMemberAsync(\n\t\tbusinessId: number,\n\t\trequest: BusinessInvitationRequest[],\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<any> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/business/${businessId}/invitations/batch`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["BusinessService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","teamMembers","TeamMemberService","locations","LocationService","customers","CustomerService","customerPaymentMethods","CustomerPaymentMethodService","customerBalanceTransactions","CustomerBalanceTransactionService","fees","FeeService","taxes","TaxService","vendors","BusinessVendorService","reviews","BusinessReviewService","products","ProductService","productVariants","ProductVariantService","productOptions","ProductOptionService","productModifiers","ProductModifierService","productImages","ProductImageService","promoCodes","PromoCodeService","departments","DepartmentService","getByIdAsync","id","config","getEntityById","listAsync","request","listEntities","page","pageSize","search","createAsync","createEntity","updateAsync","updateEntity","deleteAsync","deleteEntity","count","getMemberById","businessId","listMembers","deleteMember","batchInviteMemberAsync"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCM,MAAOA,eACZ,SAAQC,SAAS,CAAA;AAwBjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC;IAACE,eAAA,CAAA,IAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,wBAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,e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UAAkB,EAClBjB,EAAU,EACVpC,OAA0B,EAC1BqC,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAAClC,WAAW,CAAC8C,WAAW,CACxCI,UAAU,EACVjB,EAAE,EACFpC,OAAO,EACPqC,MAAM,CACN;AACF;EAEO,MAAMmB,sBAAsBA,CAClCH,UAAkB,EAClBb,OAAoC,EACpCxC,OAA0B,EAC1BqC,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,IAAI,CAACS,YAAY,CAC7B,CAAgBO,aAAAA,EAAAA,UAAU,CAAoB,kBAAA,CAAA,EAC9Cb,OAAO,EACPxC,OAAO,EACPqC,MAAM,CACN;AACF;AACA;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defaultAPIServiceOptions } from '../../../client/SBServiceOptions.mjs';
|
|
2
|
+
import { SBService } from '../../SBService.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Service for managing vendors in the Smartbills system
|
|
6
|
+
* Provides functionality for CRUD operations on vendors
|
|
7
|
+
* @implements INestedCreatable<VendorCreateRequest, SBBusinessBrand> - Allows creating new vendors
|
|
8
|
+
*/
|
|
9
|
+
class BrandService extends SBService {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new instance of the brand service
|
|
12
|
+
* @param options - Service configuration options
|
|
13
|
+
*/
|
|
14
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
15
|
+
super(options);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new vendor
|
|
19
|
+
* @param businessId - The business ID
|
|
20
|
+
* @param request - Vendor creation request data
|
|
21
|
+
* @param options - Request options
|
|
22
|
+
* @param config - Axios request configuration
|
|
23
|
+
* @returns Promise that resolves with the created vendor
|
|
24
|
+
*/
|
|
25
|
+
async createAsync(businessId, request, options, config) {
|
|
26
|
+
return await super.createEntity(`/v1/businesses/${businessId}/brand`, request, options, config);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { BrandService };
|
|
31
|
+
//# sourceMappingURL=BrandService.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandService.mjs","sources":["../../../../../src/services/businesses/brands/BrandService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { INestedCreatable } from \"@/interfaces\";\nimport { SBService } from \"@/services/SBService\";\nimport { SBBusinessBrand } from \"@/entities/businesses/brands\";\n/**\n * Service for managing vendors in the Smartbills system\n * Provides functionality for CRUD operations on vendors\n * @implements INestedCreatable<VendorCreateRequest, SBBusinessBrand> - Allows creating new vendors\n */\nexport class BrandService\n\textends SBService\n\timplements INestedCreatable<FormData, SBBusinessBrand>\n{\n\t/**\n\t * Creates a new instance of the brand service\n\t * @param options - Service configuration options\n\t */\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\n\t/**\n\t * Creates a new vendor\n\t * @param businessId - The business ID\n\t * @param request - Vendor creation request data\n\t * @param options - Request options\n\t * @param config - Axios request configuration\n\t * @returns Promise that resolves with the created vendor\n\t */\n\tpublic async createAsync(\n\t\tbusinessId: number,\n\t\trequest: FormData,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<FormData>,\n\t): Promise<SBBusinessBrand> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/businesses/${businessId}/brand`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["BrandService","SBService","constructor","options","defaultAPIServiceOptions","createAsync","businessId","request","config","createEntity"],"mappings":";;;AASA;;;;AAIG;AACG,MAAOA,YACZ,SAAQC,SAAS,CAAA;AAGjB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC;AACf;AAEA;;;;;;;AAOG;EACI,MAAME,WAAWA,CACvBC,UAAkB,EAClBC,OAAiB,EACjBJ,OAA0B,EAC1BK,MAAqC,EAAA;AAErC,IAAA,OAAO,MAAM,KAAK,CAACC,YAAY,CAC9B,CAAkBH,eAAAA,EAAAA,UAAU,CAAQ,MAAA,CAAA,EACpCC,OAAO,EACPJ,OAAO,EACPK,MAAM,CACN;AACF;AACA;;;;"}
|
|
@@ -29,6 +29,12 @@ class VendorService extends SBService {
|
|
|
29
29
|
async connectAsync(request, options, config) {
|
|
30
30
|
return await this.createEntity(`/v1/me/vendors/connect`, request, options, config);
|
|
31
31
|
}
|
|
32
|
+
async disconnectAsync(vendorId, options, config) {
|
|
33
|
+
return await super.deleteEntity(`/v1/me/vendors/${vendorId}/disconnect`, options, config);
|
|
34
|
+
}
|
|
35
|
+
async getConnectionByIdAsync(id, options, config) {
|
|
36
|
+
return await super.getEntityById(`/v1/me/vendors/${id}`, options, config);
|
|
37
|
+
}
|
|
32
38
|
async manualRefresh(id, options, config) {
|
|
33
39
|
return await this.getEntityById(`/v1/me/vendors/${id}/refresh`, options, config);
|
|
34
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VendorService.mjs","sources":["../../../../src/services/vendors/VendorService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBService } from \"../SBService\";\nimport { SBVendor } from \"@/entities/vendors/SBVendor\";\nimport {\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n\tIListable,\n\tIUpdatable,\n} from \"@/interfaces\";\nimport { SBList } from \"@/entities/base\";\n\nimport { ListRequest } from \"@/services/ListRequest\";\nimport { VendorUpdateRequest } from \"./VendorUpdateRequest\";\nimport { VendorCreateRequest } from \"./VendorCreateRequest\";\nimport { VendorConnectRequest } from \"./VendorConnectRequest\";\nimport { VendorConnectResponse } from \"./VendorConnectResponse\";\nimport { VendorListRequest } from \"./VendorListRequest\";\n\nexport class VendorService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBVendor>,\n\t\tICreatable<VendorCreateRequest, SBVendor>,\n\t\tIDeletable<SBVendor>,\n\t\tIListable<ListRequest, SBVendor>,\n\t\tIUpdatable<VendorUpdateRequest, SBVendor>\n{\n\tconstructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\n\tpublic async getByIdAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listAsync(\n\t\trequest?: VendorListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBVendor>> {\n\t\treturn await this.listEntities(\n\t\t\t`/v1/me/vendors`,\n\t\t\trequest || { page: 1, pageSize: 25 },\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createAsync(\n\t\trequest: VendorCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorCreateRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/me/vendors`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updateAsync(\n\t\tid: number,\n\t\trequest: VendorUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorUpdateRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.updateEntity(\n\t\t\t`/v1/me/vendors/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await this.deleteEntity(`/v1/me/vendors/${id}`, options, config);\n\t}\n\n\tpublic async getLinkToken(\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<VendorConnectResponse> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/connect`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async connectAsync(\n\t\trequest: VendorConnectRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorConnectRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/me/vendors/connect`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async manualRefresh(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<void> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/${id}/refresh`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["VendorService","SBService","constructor","options","defaultAPIServiceOptions","getByIdAsync","id","config","getEntityById","listAsync","request","listEntities","page","pageSize","createAsync","createEntity","updateAsync","updateEntity","deleteAsync","deleteEntity","getLinkToken","connectAsync","manualRefresh"],"mappings":";;;AAwBM,MAAOA,aACZ,SAAQC,SAAS,CAAA;AAQjBC,EAAAA,WAAAA,CAAYC,UAA4BC,wBAAwB,EAAA;IAC/D,KAAK,CAACD,OAAO,CAAC;AACf;AAEO,EAAA,MAAME,YAAYA,CACxBC,EAAU,EACVH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,IAAI,CAACC,aAAa,CAC9B,CAAA,eAAA,EAAkBF,EAAE,CAAA,CAA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L,OAAO,EACPP,OAAO,EACPI,MAAM,CACN;AACF;AAEO,EAAA,MAAMe,aAAaA,
|
|
1
|
+
{"version":3,"file":"VendorService.mjs","sources":["../../../../src/services/vendors/VendorService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBService } from \"../SBService\";\nimport { SBVendor } from \"@/entities/vendors/SBVendor\";\nimport {\n\tICreatable,\n\tIDeletable,\n\tIRetrievableById,\n\tIListable,\n\tIUpdatable,\n} from \"@/interfaces\";\nimport { SBList } from \"@/entities/base\";\n\nimport { ListRequest } from \"@/services/ListRequest\";\nimport { VendorUpdateRequest } from \"./VendorUpdateRequest\";\nimport { VendorCreateRequest } from \"./VendorCreateRequest\";\nimport { VendorConnectRequest } from \"./VendorConnectRequest\";\nimport { VendorConnectResponse } from \"./VendorConnectResponse\";\nimport { VendorListRequest } from \"./VendorListRequest\";\n\nexport class VendorService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBVendor>,\n\t\tICreatable<VendorCreateRequest, SBVendor>,\n\t\tIDeletable<SBVendor>,\n\t\tIListable<ListRequest, SBVendor>,\n\t\tIUpdatable<VendorUpdateRequest, SBVendor>\n{\n\tconstructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\n\tpublic async getByIdAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listAsync(\n\t\trequest?: VendorListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBList<SBVendor>> {\n\t\treturn await this.listEntities(\n\t\t\t`/v1/me/vendors`,\n\t\t\trequest || { page: 1, pageSize: 25 },\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async createAsync(\n\t\trequest: VendorCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorCreateRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/me/vendors`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async updateAsync(\n\t\tid: number,\n\t\trequest: VendorUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorUpdateRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.updateEntity(\n\t\t\t`/v1/me/vendors/${id}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await this.deleteEntity(`/v1/me/vendors/${id}`, options, config);\n\t}\n\n\tpublic async getLinkToken(\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<VendorConnectResponse> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/connect`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async connectAsync(\n\t\trequest: VendorConnectRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig<VendorConnectRequest>,\n\t): Promise<SBVendor> {\n\t\treturn await this.createEntity(\n\t\t\t`/v1/me/vendors/connect`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async disconnectAsync(\n\t\tvendorId: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/me/vendors/${vendorId}/disconnect`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async getConnectionByIdAsync(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<SBVendor> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/me/vendors/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async manualRefresh(\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig?: AxiosRequestConfig,\n\t): Promise<void> {\n\t\treturn await this.getEntityById(\n\t\t\t`/v1/me/vendors/${id}/refresh`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["VendorService","SBService","constructor","options","defaultAPIServiceOptions","getByIdAsync","id","config","getEntityById","listAsync","request","listEntities","page","pageSize","createAsync","createEntity","updateAsync","updateEntity","deleteAsync","deleteEntity","getLinkToken","connectAsync","disconnectAsync","vendorId","getConnectionByIdAsync","manualRefresh"],"mappings":";;;AAwBM,MAAOA,aACZ,SAAQC,SAAS,CAAA;AAQjBC,EAAAA,WAAAA,CAAYC,UAA4BC,wBAAwB,EAAA;IAC/D,KAAK,CAACD,OAAO,CAAC;AACf;AAEO,EAAA,MAAME,YAAYA,CACxBC,EAAU,EACVH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,IAAI,CAACC,aAAa,CAC9B,CAAA,eAAA,EAAkBF,EAAE,CAAA,CAAE,EACtBH,OAAO,EACPI,MAAM,CACN;AACF;AAEO,EAAA,MAAME,SAASA,CACrBC,OAA2B,EAC3BP,OAA0B,EAC1BI,MAA2B,EAAA;IAE3B,OAAO,MAAM,IAAI,CAACI,YAAY,CAC7B,CAAgB,cAAA,CAAA,EAChBD,OAAO,IAAI;AAAEE,MAAAA,IAAI,EAAE,CAAC;AAAEC,MAAAA,QAAQ,EAAE;AAAE,KAAE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AAMiB,sBAAsBA,CAClClB,EAAU,EACVH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAC/B,CAAA,eAAA,EAAkBF,EAAE,CAAA,CAAE,EACtBH,OAAO,EACPI,MAAM,CACN;AACF;AAEO,EAAA,MAAMkB,aAAaA,CACzBnB,EAAU,EACVH,OAA0B,EAC1BI,MAA2B,EAAA;AAE3B,IAAA,OAAO,MAAM,IAAI,CAACC,aAAa,CAC9B,CAAA,eAAA,EAAkBF,EAAE,CAAA,QAAA,CAAU,EAC9BH,OAAO,EACPI,MAAM,CACN;AACF;AACA;;;;"}
|
package/dist/umd/index.js
CHANGED
|
@@ -7475,6 +7475,32 @@
|
|
|
7475
7475
|
}
|
|
7476
7476
|
}
|
|
7477
7477
|
|
|
7478
|
+
/**
|
|
7479
|
+
* Service for managing vendors in the Smartbills system
|
|
7480
|
+
* Provides functionality for CRUD operations on vendors
|
|
7481
|
+
* @implements INestedCreatable<VendorCreateRequest, SBBusinessBrand> - Allows creating new vendors
|
|
7482
|
+
*/
|
|
7483
|
+
class BrandService extends SBService {
|
|
7484
|
+
/**
|
|
7485
|
+
* Creates a new instance of the brand service
|
|
7486
|
+
* @param options - Service configuration options
|
|
7487
|
+
*/
|
|
7488
|
+
constructor(options = defaultAPIServiceOptions) {
|
|
7489
|
+
super(options);
|
|
7490
|
+
}
|
|
7491
|
+
/**
|
|
7492
|
+
* Creates a new vendor
|
|
7493
|
+
* @param businessId - The business ID
|
|
7494
|
+
* @param request - Vendor creation request data
|
|
7495
|
+
* @param options - Request options
|
|
7496
|
+
* @param config - Axios request configuration
|
|
7497
|
+
* @returns Promise that resolves with the created vendor
|
|
7498
|
+
*/
|
|
7499
|
+
async createAsync(businessId, request, options, config) {
|
|
7500
|
+
return await super.createEntity(`/v1/businesses/${businessId}/brand`, request, options, config);
|
|
7501
|
+
}
|
|
7502
|
+
}
|
|
7503
|
+
|
|
7478
7504
|
class PriceService extends SBService {
|
|
7479
7505
|
async listAsync(request, options, config) {
|
|
7480
7506
|
return await super.listEntities(`/v1/prices`, request, options, config);
|
|
@@ -8517,6 +8543,12 @@
|
|
|
8517
8543
|
async connectAsync(request, options, config) {
|
|
8518
8544
|
return await this.createEntity(`/v1/me/vendors/connect`, request, options, config);
|
|
8519
8545
|
}
|
|
8546
|
+
async disconnectAsync(vendorId, options, config) {
|
|
8547
|
+
return await super.deleteEntity(`/v1/me/vendors/${vendorId}/disconnect`, options, config);
|
|
8548
|
+
}
|
|
8549
|
+
async getConnectionByIdAsync(id, options, config) {
|
|
8550
|
+
return await super.getEntityById(`/v1/me/vendors/${id}`, options, config);
|
|
8551
|
+
}
|
|
8520
8552
|
async manualRefresh(id, options, config) {
|
|
8521
8553
|
return await this.getEntityById(`/v1/me/vendors/${id}/refresh`, options, config);
|
|
8522
8554
|
}
|
|
@@ -8827,6 +8859,7 @@
|
|
|
8827
8859
|
_defineProperty(this, "explore", void 0);
|
|
8828
8860
|
_defineProperty(this, "invoices", void 0);
|
|
8829
8861
|
_defineProperty(this, "businesses", void 0);
|
|
8862
|
+
_defineProperty(this, "brands", void 0);
|
|
8830
8863
|
_defineProperty(this, "notifications", void 0);
|
|
8831
8864
|
_defineProperty(this, "oauth", void 0);
|
|
8832
8865
|
_defineProperty(this, "loyaltyPrograms", void 0);
|
|
@@ -8934,7 +8967,7 @@
|
|
|
8934
8967
|
logger: this.logger,
|
|
8935
8968
|
url: this.options?.endpoints?.api
|
|
8936
8969
|
});
|
|
8937
|
-
this.
|
|
8970
|
+
this.brands = new BrandService({
|
|
8938
8971
|
...this.options,
|
|
8939
8972
|
logger: this.logger,
|
|
8940
8973
|
url: this.options?.endpoints?.api
|
|
@@ -9105,7 +9138,7 @@
|
|
|
9105
9138
|
}
|
|
9106
9139
|
}
|
|
9107
9140
|
|
|
9108
|
-
var version = "0.0.2-alpha.
|
|
9141
|
+
var version = "0.0.2-alpha.45";
|
|
9109
9142
|
|
|
9110
9143
|
const isBrowser = typeof window !== "undefined";
|
|
9111
9144
|
class SBInstance {
|
|
@@ -9405,6 +9438,7 @@
|
|
|
9405
9438
|
exports.BankInstitutionService = BankInstitutionService;
|
|
9406
9439
|
exports.BankService = BankService;
|
|
9407
9440
|
exports.BankTransactionService = BankTransactionService;
|
|
9441
|
+
exports.BrandService = BrandService;
|
|
9408
9442
|
exports.BusinessReviewService = BusinessReviewService;
|
|
9409
9443
|
exports.BusinessService = BusinessService;
|
|
9410
9444
|
exports.BusinessVendorService = BusinessVendorService;
|