@smartbills/sdk 0.0.2-alpha.32 → 0.0.2-alpha.36

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 (85) hide show
  1. package/dist/@types/client/SBClient.d.ts +3 -3
  2. package/dist/@types/client/SBInstance.d.ts +1 -0
  3. package/dist/@types/entities/common/ImageUploadRequest.d.ts +8 -0
  4. package/dist/@types/entities/common/ImageUploadRequest.d.ts.map +1 -0
  5. package/dist/@types/entities/organizations/SBOrganization.d.ts +2 -1
  6. package/dist/@types/entities/organizations/invitations/SBOrganizationInvitation.d.ts +16 -0
  7. package/dist/@types/entities/organizations/invitations/SBOrganizationInvitation.d.ts.map +1 -0
  8. package/dist/@types/entities/organizations/invitations/SBOrganizationInvitationStatus.d.ts +9 -0
  9. package/dist/@types/entities/organizations/invitations/SBOrganizationInvitationStatus.d.ts.map +1 -0
  10. package/dist/@types/entities/organizations/members/SBOrganizationMember.d.ts +17 -0
  11. package/dist/@types/entities/organizations/members/SBOrganizationMemberRole.d.ts +7 -0
  12. package/dist/@types/entities/organizations/members/SBOrganizationMemberRole.d.ts.map +1 -0
  13. package/dist/@types/entities/organizations/members/SBOrganizationMemberStatus.d.ts +7 -0
  14. package/dist/@types/entities/organizations/members/SBOrganizationMemberStatus.d.ts.map +1 -0
  15. package/dist/@types/entities/vendors/SBVendor.d.ts +3 -2
  16. package/dist/@types/index.d.ts +13 -4
  17. package/dist/@types/services/employees/SBEmployee.d.ts +13 -0
  18. package/dist/@types/services/employees/SBEmployee.d.ts.map +1 -0
  19. package/dist/@types/services/organizations/OrganizationCreateRequest.d.ts +6 -0
  20. package/dist/@types/services/organizations/OrganizationService.d.ts +13 -5
  21. package/dist/@types/services/organizations/invitations/OrganizationInvitationListRequest.d.ts +7 -0
  22. package/dist/@types/services/organizations/invitations/OrganizationInvitationListRequest.d.ts.map +1 -0
  23. package/dist/@types/services/organizations/invitations/OrganizationInvitationRequest.d.ts +9 -0
  24. package/dist/@types/services/organizations/invitations/OrganizationInvitationRequest.d.ts.map +1 -0
  25. package/dist/@types/services/organizations/invitations/OrganizationInvitationResponseRequest.d.ts +8 -0
  26. package/dist/@types/services/organizations/invitations/OrganizationInvitationResponseRequest.d.ts.map +1 -0
  27. package/dist/@types/services/organizations/invitations/OrganizationInvitationService.d.ts +23 -0
  28. package/dist/@types/services/organizations/invitations/OrganizationInvitationService.d.ts.map +1 -0
  29. package/dist/@types/services/organizations/members/OrganizationMemberService.d.ts +18 -0
  30. package/dist/@types/services/organizations/members/OrganizationMemberService.d.ts.map +1 -0
  31. package/dist/cjs/client/SBClient.cjs +6 -5
  32. package/dist/cjs/client/SBClient.cjs.map +1 -1
  33. package/dist/cjs/client/SBInstance.cjs +16 -13
  34. package/dist/cjs/client/SBInstance.cjs.map +1 -1
  35. package/dist/cjs/entities/organizations/invitations/SBOrganizationInvitationStatus.cjs +10 -0
  36. package/dist/cjs/entities/organizations/invitations/SBOrganizationInvitationStatus.cjs.map +1 -0
  37. package/dist/cjs/entities/organizations/members/SBOrganizationMemberRole.cjs +8 -0
  38. package/dist/cjs/entities/organizations/members/SBOrganizationMemberRole.cjs.map +1 -0
  39. package/dist/cjs/entities/organizations/members/SBOrganizationMemberStatus.cjs +8 -0
  40. package/dist/cjs/entities/organizations/members/SBOrganizationMemberStatus.cjs.map +1 -0
  41. package/dist/cjs/index.cjs +17 -3
  42. package/dist/cjs/index.cjs.map +1 -1
  43. package/dist/cjs/packages/sdk/package.json.cjs +1 -1
  44. package/dist/cjs/services/organizations/OrganizationService.cjs +17 -4
  45. package/dist/cjs/services/organizations/OrganizationService.cjs.map +1 -1
  46. package/dist/cjs/services/organizations/invitations/OrganizationInvitationService.cjs +38 -0
  47. package/dist/cjs/services/organizations/invitations/OrganizationInvitationService.cjs.map +1 -0
  48. package/dist/cjs/services/organizations/members/OrganizationMemberService.cjs +22 -0
  49. package/dist/cjs/services/organizations/members/OrganizationMemberService.cjs.map +1 -0
  50. package/dist/esm/client/SBClient.mjs +6 -5
  51. package/dist/esm/client/SBClient.mjs.map +1 -1
  52. package/dist/esm/client/SBInstance.mjs +16 -13
  53. package/dist/esm/client/SBInstance.mjs.map +1 -1
  54. package/dist/esm/entities/organizations/invitations/SBOrganizationInvitationStatus.mjs +10 -0
  55. package/dist/esm/entities/organizations/invitations/SBOrganizationInvitationStatus.mjs.map +1 -0
  56. package/dist/esm/entities/organizations/members/SBOrganizationMemberRole.mjs +8 -0
  57. package/dist/esm/entities/organizations/members/SBOrganizationMemberRole.mjs.map +1 -0
  58. package/dist/esm/entities/organizations/members/SBOrganizationMemberStatus.mjs +8 -0
  59. package/dist/esm/entities/organizations/members/SBOrganizationMemberStatus.mjs.map +1 -0
  60. package/dist/esm/index.mjs +5 -1
  61. package/dist/esm/index.mjs.map +1 -1
  62. package/dist/esm/packages/sdk/package.json.mjs +1 -1
  63. package/dist/esm/services/organizations/OrganizationService.mjs +17 -4
  64. package/dist/esm/services/organizations/OrganizationService.mjs.map +1 -1
  65. package/dist/esm/services/organizations/invitations/OrganizationInvitationService.mjs +36 -0
  66. package/dist/esm/services/organizations/invitations/OrganizationInvitationService.mjs.map +1 -0
  67. package/dist/esm/services/organizations/members/OrganizationMemberService.mjs +20 -0
  68. package/dist/esm/services/organizations/members/OrganizationMemberService.mjs.map +1 -0
  69. package/dist/umd/index.js +94 -23
  70. package/dist/umd/index.js.map +1 -1
  71. package/package.json +3 -4
  72. package/dist/@types/entities/api-logs/SBLog.d.ts +0 -19
  73. package/dist/@types/entities/api-logs/SBLog.d.ts.map +0 -1
  74. package/dist/@types/entities/organizations/SBOrganizationMember.d.ts +0 -9
  75. package/dist/@types/entities/organizations/SBOrganizationRole.d.ts +0 -7
  76. package/dist/@types/entities/organizations/SBOrganizationRole.d.ts.map +0 -1
  77. package/dist/@types/services/organizations/OrganizationMemberInviteRequest.d.ts +0 -9
  78. package/dist/@types/services/organizations/OrganizationMemberInviteRequest.d.ts.map +0 -1
  79. package/dist/cjs/entities/organizations/SBOrganizationRole.cjs +0 -8
  80. package/dist/cjs/entities/organizations/SBOrganizationRole.cjs.map +0 -1
  81. package/dist/esm/entities/organizations/SBOrganizationRole.mjs +0 -8
  82. package/dist/esm/entities/organizations/SBOrganizationRole.mjs.map +0 -1
  83. /package/dist/@types/entities/organizations/{SBOrganizationMember.d.ts.map → members/SBOrganizationMember.d.ts.map} +0 -0
  84. /package/dist/@types/services/organizations/{OrganizationMemberListRequest.d.ts → members/OrganizationMemberListRequest.d.ts} +0 -0
  85. /package/dist/@types/services/organizations/{OrganizationMemberListRequest.d.ts.map → members/OrganizationMemberListRequest.d.ts.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBOrganizationMemberRole.cjs","sources":["../../../../../src/entities/organizations/members/SBOrganizationMemberRole.ts"],"sourcesContent":["export enum SBOrganizationMemberRole {\n\tAdministrator = \"Administrator\",\n\tEmployee = \"Employee\",\n}\n"],"names":["SBOrganizationMemberRole"],"mappings":";;AAAYA,0CAGX;AAHD,CAAA,UAAYA,wBAAwB,EAAA;AACnCA,EAAAA,wBAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AAC/BA,EAAAA,wBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACtB,CAAC,EAHWA,gCAAwB,KAAxBA,gCAAwB,GAGnC,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ exports.SBOrganizationMemberStatus = void 0;
4
+ (function (SBOrganizationMemberStatus) {
5
+ SBOrganizationMemberStatus["Active"] = "Active";
6
+ SBOrganizationMemberStatus["Inactive"] = "Inactive";
7
+ })(exports.SBOrganizationMemberStatus || (exports.SBOrganizationMemberStatus = {}));
8
+ //# sourceMappingURL=SBOrganizationMemberStatus.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBOrganizationMemberStatus.cjs","sources":["../../../../../src/entities/organizations/members/SBOrganizationMemberStatus.ts"],"sourcesContent":["export enum SBOrganizationMemberStatus {\r\n\tActive = \"Active\",\r\n\tInactive = \"Inactive\",\r\n}\r\n"],"names":["SBOrganizationMemberStatus"],"mappings":";;AAAYA,4CAGX;AAHD,CAAA,UAAYA,0BAA0B,EAAA;AACrCA,EAAAA,0BAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjBA,EAAAA,0BAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACtB,CAAC,EAHWA,kCAA0B,KAA1BA,kCAA0B,GAGrC,EAAA,CAAA,CAAA;;"}
@@ -14,7 +14,9 @@ var SBBankState = require('./entities/banks/SBBankState.cjs');
14
14
  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
- var SBOrganizationRole = require('./entities/organizations/SBOrganizationRole.cjs');
17
+ var SBOrganizationMemberRole = require('./entities/organizations/members/SBOrganizationMemberRole.cjs');
18
+ var SBOrganizationMemberStatus = require('./entities/organizations/members/SBOrganizationMemberStatus.cjs');
19
+ var SBOrganizationInvitationStatus = require('./entities/organizations/invitations/SBOrganizationInvitationStatus.cjs');
18
20
  var SBPaymentMethod = require('./entities/payment-methods/SBPaymentMethod.cjs');
19
21
  var SBPaymentMethodFingerprintProvider = require('./entities/payment-methods/SBPaymentMethodFingerprintProvider.cjs');
20
22
  var SBReceiptType = require('./entities/receipts/SBReceiptType.cjs');
@@ -49,6 +51,8 @@ var AccessTokenResponse = require('./services/oauth/AccessTokenResponse.cjs');
49
51
  var AuthorizationCodeResponse = require('./services/oauth/AuthorizationCodeResponse.cjs');
50
52
  var OAuthService = require('./services/oauth/OAuthService.cjs');
51
53
  var OrganizationService = require('./services/organizations/OrganizationService.cjs');
54
+ var OrganizationMemberService = require('./services/organizations/members/OrganizationMemberService.cjs');
55
+ var OrganizationInvitationService = require('./services/organizations/invitations/OrganizationInvitationService.cjs');
52
56
  var PaymentMethodService = require('./services/payment-methods/PaymentMethodService.cjs');
53
57
  var PriceService = require('./services/prices/PriceService.cjs');
54
58
  var ProductImageService = require('./services/product-images/ProductImageService.cjs');
@@ -105,9 +109,17 @@ Object.defineProperty(exports, "SBFeeType", {
105
109
  enumerable: true,
106
110
  get: function () { return SBFeeType.SBFeeType; }
107
111
  });
108
- Object.defineProperty(exports, "SBOrganizationRole", {
112
+ Object.defineProperty(exports, "SBOrganizationMemberRole", {
109
113
  enumerable: true,
110
- get: function () { return SBOrganizationRole.SBOrganizationRole; }
114
+ get: function () { return SBOrganizationMemberRole.SBOrganizationMemberRole; }
115
+ });
116
+ Object.defineProperty(exports, "SBOrganizationMemberStatus", {
117
+ enumerable: true,
118
+ get: function () { return SBOrganizationMemberStatus.SBOrganizationMemberStatus; }
119
+ });
120
+ Object.defineProperty(exports, "SBOrganizationInvitationStatus", {
121
+ enumerable: true,
122
+ get: function () { return SBOrganizationInvitationStatus.SBOrganizationInvitationStatus; }
111
123
  });
112
124
  Object.defineProperty(exports, "SBPaymentMethodType", {
113
125
  enumerable: true,
@@ -176,6 +188,8 @@ exports.AccessTokenResponse = AccessTokenResponse.AccessTokenResponse;
176
188
  exports.AuthorizationCodeResponse = AuthorizationCodeResponse.AuthorizationCodeResponse;
177
189
  exports.OAuthService = OAuthService.OAuthService;
178
190
  exports.OrganizationService = OrganizationService.OrganizationService;
191
+ exports.OrganizationMemberService = OrganizationMemberService.OrganizationMemberService;
192
+ exports.OrganizationInvitationService = OrganizationInvitationService.OrganizationInvitationService;
179
193
  exports.PaymentMethodService = PaymentMethodService.PaymentMethodService;
180
194
  exports.PriceService = PriceService.PriceService;
181
195
  exports.ProductImageService = ProductImageService.ProductImageService;
@@ -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.31";
3
+ var version = "0.0.2-alpha.32";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.map
@@ -1,11 +1,18 @@
1
1
  'use strict';
2
2
 
3
+ var defineProperty = require('../../node_modules/@babel/runtime/helpers/esm/defineProperty.cjs');
3
4
  var SBServiceOptions = require('../../client/SBServiceOptions.cjs');
4
5
  var SBService = require('../SBService.cjs');
6
+ var OrganizationMemberService = require('./members/OrganizationMemberService.cjs');
7
+ var OrganizationInvitationService = require('./invitations/OrganizationInvitationService.cjs');
5
8
 
6
9
  class OrganizationService extends SBService.SBService {
7
10
  constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
11
  super(options);
12
+ defineProperty.default(this, "members", void 0);
13
+ defineProperty.default(this, "invitations", void 0);
14
+ this.members = new OrganizationMemberService.OrganizationMemberService(options);
15
+ this.invitations = new OrganizationInvitationService.OrganizationInvitationService(options);
9
16
  }
10
17
  async getById(organizationId, options, config = {}) {
11
18
  return await super.getEntityById(`/v1/organizations/${organizationId}`, options, config);
@@ -23,16 +30,22 @@ class OrganizationService extends SBService.SBService {
23
30
  return await super.updateEntity(`/v1/organizations/${organizationId}`, request, options, config);
24
31
  }
25
32
  async getMemberById(organizationId, id, options, config = {}) {
26
- return await super.getEntityById(`/v1/organizations/${organizationId}/members/${id}`, options, config);
33
+ return await this.members.getById(organizationId, id, options, config);
27
34
  }
28
35
  async listMembers(organizationId, request, options, config = {}) {
29
- return await super.getEntities(`/v1/organizations/${organizationId}/members`, request, options, config);
36
+ return await this.members.list(organizationId, request, options, config);
30
37
  }
31
38
  async inviteMember(organizationId, request, options, config = {}) {
32
- return await super.createEntity(`/v1/organizations/${organizationId}/members/invite`, request, options, config);
39
+ return await this.invitations.create(organizationId, request, options, config);
40
+ }
41
+ async acceptInvitation(organizationId, id, request, options, config = {}) {
42
+ return await this.invitations.accept(organizationId, id, request, options, config);
43
+ }
44
+ async cancelInvitation(organizationId, id, options, config = {}) {
45
+ return await this.invitations.delete(organizationId, id, options, config);
33
46
  }
34
47
  async deleteMember(organizationId, id, options, config = {}) {
35
- return await super.deleteEntity(`/v1/organizations/${organizationId}/members/${id}`, options, config);
48
+ return await this.members.delete(organizationId, id, options, config);
36
49
  }
37
50
  }
38
51
 
@@ -1 +1 @@
1
- {"version":3,"file":"OrganizationService.cjs","sources":["../../../../src/services/organizations/OrganizationService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { AxiosRequestConfig } from \"axios\";\nimport { SBOrganizationMember } from \"@/entities/organizations\";\nimport { SBOrganization } from \"@/entities/organizations/SBOrganization\";\nimport { SBService } from \"@/services/SBService\";\nimport { PaginatedResult } from \"@/utilities/PaginatedResult\";\nimport { OrganizationCreateRequest } from \"./OrganizationCreateRequest\";\nimport { OrganizationUpdateRequest } from \"./OrganizationUpdateRequest\";\nimport { OrganizationListRequest } from \"./OrganizationListRequest\";\nimport { OrganizationMemberListRequest } from \"./OrganizationMemberListRequest\";\nimport { OrganizationMemberInviteRequest } from \"./OrganizationMemberInviteRequest\";\nimport { IRetrievableById } from \"@/interfaces\";\nexport class OrganizationService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBOrganization>,\n\t\tICreatable<OrganizationCreateRequest, SBOrganization>,\n\t\tIUpdatable<OrganizationUpdateRequest, SBOrganization>,\n\t\tIDeletable<SBOrganization>\n{\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t}\n\tpublic async getById(\n\t\torganizationId: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async list(\n\t\trequest: OrganizationListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBOrganization>> {\n\t\treturn await super.listEntities(\n\t\t\t`/v1/organizations`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async create(\n\t\trequest: OrganizationCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/organizations\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async delete(\n\t\torganizationId: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\torganizationId: number,\n\t\trequest: OrganizationUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async getMemberById(\n\t\torganizationId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/organizations/${organizationId}/members/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async listMembers(\n\t\torganizationId: number,\n\t\trequest: OrganizationMemberListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember[]> {\n\t\treturn await super.getEntities(\n\t\t\t`/v1/organizations/${organizationId}/members`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async inviteMember(\n\t\torganizationId: number,\n\t\trequest: OrganizationMemberInviteRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember> {\n\t\treturn await super.createEntity(\n\t\t\t`/v1/organizations/${organizationId}/members/invite`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async deleteMember(\n\t\torganizationId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/organizations/${organizationId}/members/${id}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n"],"names":["OrganizationService","SBService","constructor","options","defaultAPIServiceOptions","getById","organizationId","config","getEntityById","list","request","listEntities","create","createEntity","delete","deleteEntity","update","updateEntity","getMemberById","id","listMembers","getEntities","inviteMember","deleteMember"],"mappings":";;;;;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AAA,MAAMW,aAAaA,CACzBZ,cAAsB,EACtBa,EAAU,EACVhB,OAA0B,EAC1BI,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAC/B,CAAqBF,kBAAAA,EAAAA,cAAc,CAAYa,SAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDhB,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMa,WAAWA,CACvBd,cAAsB,EACtBI,OAAsC,EACtCP,OAA0B,EAC1BI,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACc,WAAW,CAC7B,CAAqBf,kBAAAA,EAAAA,cAAc,CAAU,QAAA,CAAA,EAC7CI,OAAO,EACPP,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMe,YAAYA,CACxBhB,cAAsB,EACtBI,OAAwC,EACxCP,OAA0B,EAC1BI,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,CAAqBP,kBAAAA,EAAAA,cAAc,CAAiB,eAAA,CAAA,EACpDI,OAAO,EACPP,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMgB,YAAYA,CACxBjB,cAAsB,EACtBa,EAAU,EACVhB,OAA0B,EAC1BI,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,CAAqBT,kBAAAA,EAAAA,cAAc,CAAYa,SAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDhB,OAAO,EACPI,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"OrganizationService.cjs","sources":["../../../../src/services/organizations/OrganizationService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\nimport {\n\tSBServiceOptions,\n\tdefaultAPIServiceOptions,\n} from \"@/client/SBServiceOptions\";\nimport { ICreatable } from \"@/interfaces/ICreatable\";\nimport { IDeletable } from \"@/interfaces/IDeletable\";\nimport { IUpdatable } from \"@/interfaces/IUpdatable\";\nimport { AxiosRequestConfig } from \"axios\";\nimport {\n\tSBOrganizationInvitation,\n\tSBOrganizationMember,\n} from \"@/entities/organizations\";\nimport { SBOrganization } from \"@/entities/organizations/SBOrganization\";\nimport { SBService } from \"@/services/SBService\";\nimport { PaginatedResult } from \"@/utilities/PaginatedResult\";\nimport { OrganizationCreateRequest } from \"./OrganizationCreateRequest\";\nimport { OrganizationUpdateRequest } from \"./OrganizationUpdateRequest\";\nimport { OrganizationListRequest } from \"./OrganizationListRequest\";\nimport { OrganizationMemberListRequest } from \"./members/OrganizationMemberListRequest\";\nimport { IRetrievableById } from \"@/interfaces\";\nimport { OrganizationMemberService } from \"./members/OrganizationMemberService\";\nimport {\n\tOrganizationInvitationRequest,\n\tOrganizationInvitationResponseRequest,\n\tOrganizationInvitationService,\n} from \"./invitations\";\nexport class OrganizationService\n\textends SBService\n\timplements\n\t\tIRetrievableById<SBOrganization>,\n\t\tICreatable<OrganizationCreateRequest, SBOrganization>,\n\t\tIUpdatable<OrganizationUpdateRequest, SBOrganization>,\n\t\tIDeletable<SBOrganization>\n{\n\tpublic readonly members: OrganizationMemberService;\n\tpublic readonly invitations: OrganizationInvitationService;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tsuper(options);\n\t\tthis.members = new OrganizationMemberService(options);\n\t\tthis.invitations = new OrganizationInvitationService(options);\n\t}\n\tpublic async getById(\n\t\torganizationId: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.getEntityById(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\tpublic async list(\n\t\trequest: OrganizationListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBOrganization>> {\n\t\treturn await super.listEntities(\n\t\t\t`/v1/organizations`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async create(\n\t\trequest: OrganizationCreateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.createEntity(\n\t\t\t\"/v1/organizations\",\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async delete(\n\t\torganizationId: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.deleteEntity(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async update(\n\t\torganizationId: number,\n\t\trequest: OrganizationUpdateRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganization> {\n\t\treturn await super.updateEntity(\n\t\t\t`/v1/organizations/${organizationId}`,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async getMemberById(\n\t\torganizationId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember> {\n\t\treturn await this.members.getById(organizationId, id, options, config);\n\t}\n\n\tpublic async listMembers(\n\t\torganizationId: number,\n\t\trequest: OrganizationMemberListRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<PaginatedResult<SBOrganizationMember>> {\n\t\treturn await this.members.list(\n\t\t\torganizationId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async inviteMember(\n\t\torganizationId: number,\n\t\trequest: OrganizationInvitationRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationInvitation> {\n\t\treturn await this.invitations.create(\n\t\t\torganizationId,\n\t\t\trequest,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async acceptInvitation(\n\t\torganizationId: number,\n\t\tid: number,\n\t\trequest: OrganizationInvitationResponseRequest,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationInvitation> {\n\t\treturn await this.invitations.accept(\n\t\t\torganizationId,\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 cancelInvitation(\n\t\torganizationId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationInvitation> {\n\t\treturn await this.invitations.delete(\n\t\t\torganizationId,\n\t\t\tid,\n\t\t\toptions,\n\t\t\tconfig,\n\t\t);\n\t}\n\n\tpublic async deleteMember(\n\t\torganizationId: number,\n\t\tid: number,\n\t\toptions?: SBRequestOptions,\n\t\tconfig: AxiosRequestConfig = {},\n\t): Promise<SBOrganizationMember> {\n\t\treturn await this.members.delete(organizationId, id, options, config);\n\t}\n}\n"],"names":["OrganizationService","SBService","constructor","options","defaultAPIServiceOptions","_defineProperty","members","OrganizationMemberService","invitations","OrganizationInvitationService","getById","organizationId","config","getEntityById","list","request","listEntities","create","createEntity","delete","deleteEntity","update","updateEntity","getMemberById","id","listMembers","inviteMember","acceptInvitation","accept","cancelInvitation","deleteMember"],"mappings":";;;;;;;;AA2BM,MAAOA,mBACZ,SAAQC,mBAAS,CAAA;AASjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;IAACE,sBAAA,CAAA,IAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;I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c,EACda,EAAE,EACFrB,OAAO,EACPS,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMkB,YAAYA,CACxBnB,cAAsB,EACtBa,EAAU,EACVrB,OAA0B,EAC1BS,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,IAAI,CAACN,OAAO,CAACa,MAAM,CAACR,cAAc,EAAEa,EAAE,EAAErB,OAAO,EAAES,MAAM,CAAC,CAAA;AACtE,GAAA;AACA;;;;"}
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ var SBService = require('../../SBService.cjs');
4
+ require('../../../client/SBClient.cjs');
5
+ require('axios');
6
+ require('uuid');
7
+ var SBServiceOptions = require('../../../client/SBServiceOptions.cjs');
8
+ require('../../../client/SBPermission.cjs');
9
+
10
+ class OrganizationInvitationService extends SBService.SBService {
11
+ constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
12
+ super(options);
13
+ }
14
+ async getById(organizationId, id, options, config = {}) {
15
+ return await super.getEntityById(`/v1/organizations/${organizationId}/invitations/${id}`, options, config);
16
+ }
17
+ async list(organizationId, request, options, config = {}) {
18
+ return await super.getEntities(`/v1/organizations/${organizationId}/invitations`, request, options, config);
19
+ }
20
+ async create(organizationId, request, options, config = {}) {
21
+ return await super.createEntity(`/v1/organizations/${organizationId}/invitations`, request, options, config);
22
+ }
23
+ async delete(organizationId, id, options, config = {}) {
24
+ return await super.deleteEntity(`/v1/organizations/${organizationId}/invitations/${id}`, options, config);
25
+ }
26
+ async listPending(organizationId, options, config = {}) {
27
+ return await super.getEntities(`/v1/organizations/${organizationId}/invitations/pending`, null, options, config);
28
+ }
29
+ async accept(organizationId, id, request, options, config = {}) {
30
+ return await super.createEntity(`/v1/organizations/${organizationId}/invitations/${id}/accept`, request, options, config);
31
+ }
32
+ async refuse(organizationId, id, request, options, config = {}) {
33
+ return await super.createEntity(`/v1/organizations/${organizationId}/invitations/${id}/refuse`, request, options, config);
34
+ }
35
+ }
36
+
37
+ exports.OrganizationInvitationService = OrganizationInvitationService;
38
+ //# sourceMappingURL=OrganizationInvitationService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrganizationInvitationService.cjs","sources":["../../../../../src/services/organizations/invitations/OrganizationInvitationService.ts"],"sourcesContent":["import { SBRequestOptions } from \"@/client/SBRequestOption\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { SBService } from \"@/services/SBService\";\r\nimport { INestedRetrievableById } from \"@/interfaces\";\r\nimport { defaultAPIServiceOptions, SBServiceOptions } from \"@/client\";\r\nimport { SBOrganizationInvitation } from \"@/entities\";\r\nimport { OrganizationInvitationResponseRequest } from \"./OrganizationInvitationResponseRequest\";\r\nimport { OrganizationInvitationRequest } from \"./OrganizationInvitationRequest\";\r\nimport { OrganizationInvitationListRequest } from \"./OrganizationInvitationListRequest\";\r\n\r\nexport class OrganizationInvitationService\r\n\textends SBService\r\n\timplements INestedRetrievableById<SBOrganizationInvitation>\r\n{\r\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\r\n\t\tsuper(options);\r\n\t}\r\n\r\n\tpublic async getById(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation> {\r\n\t\treturn await super.getEntityById(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations/${id}`,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic async list(\r\n\t\torganizationId: number,\r\n\t\trequest: OrganizationInvitationListRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation[]> {\r\n\t\treturn await super.getEntities(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations`,\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 create(\r\n\t\torganizationId: number,\r\n\t\trequest: OrganizationInvitationRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations`,\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 delete(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation> {\r\n\t\treturn await super.deleteEntity(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations/${id}`,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic async listPending(\r\n\t\torganizationId: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation[]> {\r\n\t\treturn await super.getEntities(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations/pending`,\r\n\t\t\tnull,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\tpublic async accept(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\trequest: OrganizationInvitationResponseRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations/${id}/accept`,\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 refuse(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\trequest: OrganizationInvitationResponseRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationInvitation> {\r\n\t\treturn await super.createEntity(\r\n\t\t\t`/v1/organizations/${organizationId}/invitations/${id}/refuse`,\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":["OrganizationInvitationService","SBService","constructor","options","defaultAPIServiceOptions","getById","organizationId","id","config","getEntityById","list","request","getEntities","create","createEntity","delete","deleteEntity","listPending","accept","refuse"],"mappings":";;;;;;;;;AAUM,MAAOA,6BACZ,SAAQC,mBAAS,CAAA;AAGjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AAEO,EAAA,MAAME,OAAOA,CACnBC,cAAsB,EACtBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAC/B,CAAqBH,kBAAAA,EAAAA,cAAc,CAAgBC,aAAAA,EAAAA,EAAE,CAAE,CAAA,EACvDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,IAAIA,CAChBJ,cAAsB,EACtBK,OAA0C,EAC1CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACI,WAAW,CAC7B,CAAqBN,kBAAAA,EAAAA,cAAc,CAAc,YAAA,CAAA,EACjDK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMK,MAAMA,CAClBP,cAAsB,EACtBK,OAAsC,EACtCR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,CAAqBR,kBAAAA,EAAAA,cAAc,CAAc,YAAA,CAAA,EACjDK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMO,MAAMA,CAClBT,cAAsB,EACtBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACQ,YAAY,CAC9B,CAAqBV,kBAAAA,EAAAA,cAAc,CAAgBC,aAAAA,EAAAA,EAAE,CAAE,CAAA,EACvDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;EAEO,MAAMS,WAAWA,CACvBX,cAAsB,EACtBH,OAA0B,EAC1BK,SAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACI,WAAW,CAC7B,CAAqBN,kBAAAA,EAAAA,cAAc,CAAsB,oBAAA,CAAA,EACzD,IAAI,EACJH,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACO,EAAA,MAAMU,MAAMA,CAClBZ,cAAsB,EACtBC,EAAU,EACVI,OAA8C,EAC9CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,qBAAqBR,cAAc,CAAA,aAAA,EAAgBC,EAAE,CAAA,OAAA,CAAS,EAC9DI,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMW,MAAMA,CAClBb,cAAsB,EACtBC,EAAU,EACVI,OAA8C,EAC9CR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,qBAAqBR,cAAc,CAAA,aAAA,EAAgBC,EAAE,CAAA,OAAA,CAAS,EAC9DI,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var SBServiceOptions = require('../../../client/SBServiceOptions.cjs');
4
+ var SBService = require('../../SBService.cjs');
5
+
6
+ class OrganizationMemberService extends SBService.SBService {
7
+ constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
8
+ super(options);
9
+ }
10
+ async getById(organizationId, id, options, config = {}) {
11
+ return await super.getEntityById(`/v1/organizations/${organizationId}/members/${id}`, options, config);
12
+ }
13
+ async list(organizationId, request, options, config = {}) {
14
+ return await super.listEntities(`/v1/organizations/${organizationId}/members`, request, options, config);
15
+ }
16
+ async delete(organizationId, id, options, config = {}) {
17
+ return await super.deleteEntity(`/v1/organizations/${organizationId}/members/${id}`, options, config);
18
+ }
19
+ }
20
+
21
+ exports.OrganizationMemberService = OrganizationMemberService;
22
+ //# sourceMappingURL=OrganizationMemberService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrganizationMemberService.cjs","sources":["../../../../../src/services/organizations/members/OrganizationMemberService.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 { SBOrganizationMember } from \"@/entities/organizations\";\r\nimport { SBService } from \"@/services/SBService\";\r\nimport { INestedRetrievableById } from \"@/interfaces\";\r\nimport { OrganizationMemberListRequest } from \"./OrganizationMemberListRequest\";\r\nimport { PaginatedResult } from \"@/utilities\";\r\nexport class OrganizationMemberService\r\n\textends SBService\r\n\timplements INestedRetrievableById<SBOrganizationMember>\r\n{\r\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\r\n\t\tsuper(options);\r\n\t}\r\n\r\n\tpublic async getById(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationMember> {\r\n\t\treturn await super.getEntityById(\r\n\t\t\t`/v1/organizations/${organizationId}/members/${id}`,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic async list(\r\n\t\torganizationId: number,\r\n\t\trequest: OrganizationMemberListRequest,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<PaginatedResult<SBOrganizationMember>> {\r\n\t\treturn await super.listEntities(\r\n\t\t\t`/v1/organizations/${organizationId}/members`,\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 delete(\r\n\t\torganizationId: number,\r\n\t\tid: number,\r\n\t\toptions?: SBRequestOptions,\r\n\t\tconfig: AxiosRequestConfig = {},\r\n\t): Promise<SBOrganizationMember> {\r\n\t\treturn await super.deleteEntity(\r\n\t\t\t`/v1/organizations/${organizationId}/members/${id}`,\r\n\t\t\toptions,\r\n\t\t\tconfig,\r\n\t\t);\r\n\t}\r\n}\r\n"],"names":["OrganizationMemberService","SBService","constructor","options","defaultAPIServiceOptions","getById","organizationId","id","config","getEntityById","list","request","listEntities","delete","deleteEntity"],"mappings":";;;;;AAWM,MAAOA,yBACZ,SAAQC,mBAAS,CAAA;AAGjBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IACtE,KAAK,CAACD,OAAO,CAAC,CAAA;AACf,GAAA;AAEO,EAAA,MAAME,OAAOA,CACnBC,cAAsB,EACtBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACC,aAAa,CAC/B,CAAqBH,kBAAAA,EAAAA,cAAc,CAAYC,SAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAME,IAAIA,CAChBJ,cAAsB,EACtBK,OAAsC,EACtCR,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACI,YAAY,CAC9B,CAAqBN,kBAAAA,EAAAA,cAAc,CAAU,QAAA,CAAA,EAC7CK,OAAO,EACPR,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AAEO,EAAA,MAAMK,MAAMA,CAClBP,cAAsB,EACtBC,EAAU,EACVJ,OAA0B,EAC1BK,MAAA,GAA6B,EAAE,EAAA;AAE/B,IAAA,OAAO,MAAM,KAAK,CAACM,YAAY,CAC9B,CAAqBR,kBAAAA,EAAAA,cAAc,CAAYC,SAAAA,EAAAA,EAAE,CAAE,CAAA,EACnDJ,OAAO,EACPK,MAAM,CACN,CAAA;AACF,GAAA;AACA;;;;"}
@@ -15,6 +15,12 @@ import { MerchantService } from '../services/merchants/MerchantService.mjs';
15
15
  import 'node-html-parser';
16
16
  import { OAuthService } from '../services/oauth/OAuthService.mjs';
17
17
  import { OrganizationService } from '../services/organizations/OrganizationService.mjs';
18
+ import { defaultAPIServiceOptions } from './SBServiceOptions.mjs';
19
+ import 'axios';
20
+ import { v4 } from 'uuid';
21
+ import { SBLogger } from './SBLogger.mjs';
22
+ import 'query-string';
23
+ import './SBPermission.mjs';
18
24
  import { PaymentMethodService } from '../services/payment-methods/PaymentMethodService.mjs';
19
25
  import { ProductImageService } from '../services/product-images/ProductImageService.mjs';
20
26
  import { ProductVariantService } from '../services/product-variants/ProductVariantService.mjs';
@@ -27,13 +33,8 @@ import { TaxService } from '../services/taxes/TaxService.mjs';
27
33
  import { TransactionService } from '../services/transactions/TransactionService.mjs';
28
34
  import { CurrentUserService } from '../services/user/UserService.mjs';
29
35
  import { UserService } from '../services/users/UserService.mjs';
30
- import { v4 } from 'uuid';
31
- import { SBLogger } from './SBLogger.mjs';
32
- import { defaultAPIServiceOptions } from './SBServiceOptions.mjs';
33
36
  import { API_URL } from './constants.mjs';
34
37
  import { ExploreService } from '../services/explore/ExploreService.mjs';
35
- import 'axios';
36
- import 'query-string';
37
38
  import { VendorService } from '../services/vendors/VendorService.mjs';
38
39
 
39
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SBClient.mjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\nimport { SBVendor } from \"@/entities\";\nimport { VendorService } from \"@/services\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\tpublic vendors: VendorService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.vendors = new VendorService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService","vendors","VendorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAEG;AACH,MAAMA,cAAc,GAAoB;AACvCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,GAAG,EAAEC,OAAO;AACZC,IAAAA,IAAI,EAAED,OAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAI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GAAG,IAAI,CAACvE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACH,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"SBClient.mjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\nimport { SBVendor } from \"@/entities\";\nimport { VendorService } from \"@/services\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\tpublic vendors: VendorService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.vendors = new VendorService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService","vendors","VendorService"],"mappings":";;;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AAW,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;AACF,IAAA,IAAI,CAACiF,OAAO,GAAG,IAAIC,aAAa,CAAC;MAChC,GAAG,IAAI,CAACvE,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;;;;"}
@@ -11,7 +11,9 @@ class SBInstance {
11
11
  constructor(options = defaultAPIServiceOptions) {
12
12
  _defineProperty(this, "axios", void 0);
13
13
  _defineProperty(this, "logger", void 0);
14
+ _defineProperty(this, "options", void 0);
14
15
  this.logger = options.logger ?? new SBLogger(options.debug);
16
+ this.options = options;
15
17
  this.axios = axios.create({
16
18
  baseURL: options.url,
17
19
  headers: !isBrowser ? {
@@ -40,19 +42,20 @@ class SBInstance {
40
42
  throw new SBApiException(error);
41
43
  }
42
44
  if (error.response && error.response?.status == 401) {
43
- // this.logger.log(options)
44
- // var tokenResponse = await this.axios("http://localhost:8000/connect/token", {
45
- // method: 'POST',
46
- // headers: { 'content-type': 'application/x-www-form-urlencoded' },
47
- // data: qs.stringify({
48
- // client_id: "smartbills-react-native",
49
- // grant_type: "refresh_token",
50
- // refresh_token: "E2E6765AAB0FA4B11DBB6BE3593E7835D66A892EE0BDAAA099800E142EFFAAA2",
51
- // }),
52
- // });
53
- // this.logger.log("token refreshed", tokenResponse.data.access_token);
54
- // options.credentials.accessToken = tokenResponse.data.access_token;
55
- // options.credentials.refreshToken = tokenResponse.data.refresh_token;
45
+ const tokenResponse = await axios.post("http://localhost:8000/connect/token", {
46
+ headers: {
47
+ "content-type": "application/x-www-form-urlencoded"
48
+ },
49
+ data: new URLSearchParams({
50
+ client_id: "smartbills-react-native",
51
+ grant_type: "refresh_token",
52
+ refresh_token: this.options.credentials.refreshToken
53
+ })
54
+ });
55
+ this.logger.log("token refreshed", tokenResponse.data.access_token);
56
+ this.options.credentials.accessToken = tokenResponse.data.access_token;
57
+ this.options.credentials.refreshToken = tokenResponse.data.refresh_token;
58
+ "bearer " + tokenResponse.data.access_token;
56
59
  return await axios(error.config);
57
60
  }
58
61
  throw error;
@@ -1 +1 @@
1
- {"version":3,"file":"SBInstance.mjs","sources":["../../../src/client/SBInstance.ts"],"sourcesContent":["import axios, { AxiosError, AxiosInstance } from \"axios\";\nimport { v4 } from \"uuid\";\nimport { SBApiException, SBException } from \"./SBException\";\nimport { SBLogger } from \"./SBLogger\";\nimport { SBServiceOptions, defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { version } from \"../../package.json\";\nconst isBrowser = typeof window !== \"undefined\";\n\nexport class SBInstance {\n\tpublic readonly axios: AxiosInstance;\n\tprivate logger: SBLogger;\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.axios = axios.create({\n\t\t\tbaseURL: options.url,\n\t\t\theaders: !isBrowser\n\t\t\t\t? {\n\t\t\t\t\t\t\"User-Agent\": `Smartbills JS v${version}`,\n\t\t\t\t\t}\n\t\t\t\t: {},\n\t\t});\n\t\tthis.axios.defaults.headers[\"Accept-Language\"] = options.locale;\n\t\tthis.axios.defaults.headers[\"Session-Id\"] = options?.sessionId;\n\n\t\tif (options.credentials)\n\t\t\tthis.axios.interceptors.request.use((config) => {\n\t\t\t\tconfig.headers[\"Authorization\"] =\n\t\t\t\t\t\"bearer \" + options?.credentials?.accessToken;\n\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"Request\",\n\t\t\t\t\tconfig.method,\n\t\t\t\t\tconfig.url,\n\t\t\t\t\tconfig.data,\n\t\t\t\t);\n\t\t\t\treturn config;\n\t\t\t});\n\n\t\tconst addRequestId = (data, headers) => {\n\t\t\theaders[\"Request-Id\"] = v4();\n\t\t\treturn data;\n\t\t};\n\n\t\tthis.axios.defaults.transformRequest = [addRequestId].concat(\n\t\t\tthis.axios.defaults.transformRequest,\n\t\t);\n\t\tthis.axios.interceptors.response.use(\n\t\t\t(response) => {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"response\",\n\t\t\t\t\tresponse.config.method,\n\t\t\t\t\tresponse.config.url,\n\t\t\t\t\tresponse?.status,\n\t\t\t\t\tresponse?.data,\n\t\t\t\t);\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\tasync (error: AxiosError<any>) => {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"REQUEST FAILED\",\n\t\t\t\t\terror.config.headers[\"Request-Id\"],\n\t\t\t\t);\n\n\t\t\t\ttry {\n\t\t\t\t\tif (error?.response && error?.response?.status == 409) {\n\t\t\t\t\t\tthrow new SBApiException(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response && error.response?.status == 401) {\n\t\t\t\t\t\t// this.logger.log(options)\n\t\t\t\t\t\t// var tokenResponse = await this.axios(\"http://localhost:8000/connect/token\", {\n\t\t\t\t\t\t// \tmethod: 'POST',\n\t\t\t\t\t\t// \theaders: { 'content-type': 'application/x-www-form-urlencoded' },\n\t\t\t\t\t\t// \tdata: qs.stringify({\n\t\t\t\t\t\t// \t\tclient_id: \"smartbills-react-native\",\n\t\t\t\t\t\t// \t\tgrant_type: \"refresh_token\",\n\t\t\t\t\t\t// \t\trefresh_token: \"E2E6765AAB0FA4B11DBB6BE3593E7835D66A892EE0BDAAA099800E142EFFAAA2\",\n\t\t\t\t\t\t// \t}),\n\n\t\t\t\t\t\t// });\n\t\t\t\t\t\t// this.logger.log(\"token refreshed\", tokenResponse.data.access_token);\n\t\t\t\t\t\t// options.credentials.accessToken = tokenResponse.data.access_token;\n\t\t\t\t\t\t// options.credentials.refreshToken = tokenResponse.data.refresh_token;\n\t\t\t\t\t\treturn await axios(error.config);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\t\t\tthrow new SBApiException(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SBException(error.code, error.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n}\n"],"names":["isBrowser","window","SBInstance","constructor","options","defaultAPIServiceOptions","_defineProperty","logger","SBLogger","debug","axios","create","baseURL","url","headers","version","defaults","locale","sessionId","credentials","interceptors","request","use","config","accessToken","log","method","data","addRequestId","v4","transformRequest","concat","response","status","error","SBApiException","isAxiosError","SBException","code","message"],"mappings":";;;;;;;;AAMA,MAAMA,SAAS,GAAG,OAAOC,MAAM,KAAK,WAAW,CAAA;MAElCC,UAAU,CAAA;AAGtBC,EAAAA,WAAAA,CAAmBC,UAA4BC,wBAAwB,EAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACtE,IAAA,IAAI,CAACC,MAAM,GAAGH,OAAO,CAACG,MAAM,IAAI,IAAIC,QAAQ,CAACJ,OAAO,CAACK,KAAK,CAAC,CAAA;AAC3D,IAAA,IAAI,CAACC,KAAK,GAAGA,KAAK,CAACC,MAAM,CAAC;MACzBC,OAAO,EAAER,OAAO,CAACS,GAAG;MACpBC,OAAO,EAAE,CAACd,SAAS,GAChB;QACA,YAAY,EAAE,kBAAkBe,OAAO,CAAA,CAAA;AACvC,OAAA,GACA,EAAE;AACL,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACF,OAAO,CAAC,iBAAiB,CAAC,GAAGV,OAAO,CAACa,MAAM,CAAA;AAC/D,IAAA,IAAI,CAACP,KAAK,CAACM,QAAQ,CAACF,OAAO,CAAC,YAAY,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C,CAClC,CAAA;MAED,IAAI;QACH,IAAIoB,KAAK,EAAEF,QAAQ,IAAIE,KAAK,EAAEF,QAAQ,EAAEC,MAAM,IAAI,GAAG,EAAE;AACtD,UAAA,MAAM,IAAIE,cAAc,CAACD,KAAK,CAAC,CAAA;AAChC,SAAA;QAEA,IAAIA,KAAK,CAACF,QAAQ,IAAIE,KAAK,CAACF,QAAQ,EAAEC,MAAM,IAAI,GAAG,EAAE;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA,UAAA,OAAO,MAAMvB,KAAK,CAACwB,KAAK,CAACX,MAAM,CAAC,CAAA;AACjC,SAAA;AACA,QAAA,MAAMW,KAAK,CAAA;OACX,CAAC,OAAOA,KAAK,EAAE;AACf,QAAA,IAAIxB,KAAK,CAAC0B,YAAY,CAACF,KAAK,CAAC,EAAE;AAC9B,UAAA,MAAM,IAAIC,cAAc,CAACD,KAAK,CAAC,CAAA;AAChC,SAAC,MAAM;UACN,MAAM,IAAIG,WAAW,CAACH,KAAK,CAACI,IAAI,EAAEJ,KAAK,CAACK,OAAO,CAAC,CAAA;AACjD,SAAA;AACD,OAAA;AACD,KAAC,CACD,CAAA;AACF,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"SBInstance.mjs","sources":["../../../src/client/SBInstance.ts"],"sourcesContent":["import axios, { AxiosError, AxiosInstance } from \"axios\";\nimport { v4 } from \"uuid\";\nimport { SBApiException, SBException } from \"./SBException\";\nimport { SBLogger } from \"./SBLogger\";\nimport { SBServiceOptions, defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { version } from \"../../package.json\";\nconst isBrowser = typeof window !== \"undefined\";\n\nexport class SBInstance {\n\tpublic readonly axios: AxiosInstance;\n\tprivate logger: SBLogger;\n\tprivate options: SBServiceOptions;\n\n\tpublic constructor(options: SBServiceOptions = defaultAPIServiceOptions) {\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.options = options;\n\t\tthis.axios = axios.create({\n\t\t\tbaseURL: options.url,\n\t\t\theaders: !isBrowser\n\t\t\t\t? {\n\t\t\t\t\t\t\"User-Agent\": `Smartbills JS v${version}`,\n\t\t\t\t\t}\n\t\t\t\t: {},\n\t\t});\n\t\tthis.axios.defaults.headers[\"Accept-Language\"] = options.locale;\n\t\tthis.axios.defaults.headers[\"Session-Id\"] = options?.sessionId;\n\n\t\tif (options.credentials)\n\t\t\tthis.axios.interceptors.request.use((config) => {\n\t\t\t\tconfig.headers[\"Authorization\"] =\n\t\t\t\t\t\"bearer \" + options?.credentials?.accessToken;\n\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"Request\",\n\t\t\t\t\tconfig.method,\n\t\t\t\t\tconfig.url,\n\t\t\t\t\tconfig.data,\n\t\t\t\t);\n\t\t\t\treturn config;\n\t\t\t});\n\n\t\tconst addRequestId = (data, headers) => {\n\t\t\theaders[\"Request-Id\"] = v4();\n\t\t\treturn data;\n\t\t};\n\n\t\tthis.axios.defaults.transformRequest = [addRequestId].concat(\n\t\t\tthis.axios.defaults.transformRequest,\n\t\t);\n\t\tthis.axios.interceptors.response.use(\n\t\t\t(response) => {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"response\",\n\t\t\t\t\tresponse.config.method,\n\t\t\t\t\tresponse.config.url,\n\t\t\t\t\tresponse?.status,\n\t\t\t\t\tresponse?.data,\n\t\t\t\t);\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\tasync (error: AxiosError<any>) => {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t\"REQUEST FAILED\",\n\t\t\t\t\terror.config.headers[\"Request-Id\"],\n\t\t\t\t);\n\n\t\t\t\ttry {\n\t\t\t\t\tif (error?.response && error?.response?.status == 409) {\n\t\t\t\t\t\tthrow new SBApiException(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response && error.response?.status == 401) {\n\t\t\t\t\t\tconst tokenResponse = await axios.post(\n\t\t\t\t\t\t\t\"http://localhost:8000/connect/token\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t\t\"content-type\":\n\t\t\t\t\t\t\t\t\t\t\"application/x-www-form-urlencoded\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdata: new URLSearchParams({\n\t\t\t\t\t\t\t\t\tclient_id: \"smartbills-react-native\",\n\t\t\t\t\t\t\t\t\tgrant_type: \"refresh_token\",\n\t\t\t\t\t\t\t\t\trefresh_token:\n\t\t\t\t\t\t\t\t\t\tthis.options.credentials.refreshToken,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tthis.logger.log(\n\t\t\t\t\t\t\t\"token refreshed\",\n\t\t\t\t\t\t\ttokenResponse.data.access_token,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.options.credentials.accessToken =\n\t\t\t\t\t\t\ttokenResponse.data.access_token;\n\t\t\t\t\t\tthis.options.credentials.refreshToken =\n\t\t\t\t\t\t\ttokenResponse.data.refresh_token;\n\n\t\t\t\t\t\t\"bearer \" + tokenResponse.data.access_token;\n\t\t\t\t\t\treturn await axios(error.config);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\t\t\tthrow new SBApiException(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SBException(error.code, error.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n}\n"],"names":["isBrowser","window","SBInstance","constructor","options","defaultAPIServiceOptions","_defineProperty","logger","SBLogger","debug","axios","create","baseURL","url","headers","version","defaults","locale","sessionId","credentials","interceptors","request","use","config","accessToken","log","method","data","addRequestId","v4","transformRequest","concat","response","status","error","SBApiException","tokenResponse","post","URLSearchParams","client_id","grant_type","refresh_token","refreshToken","access_token","isAxiosError","SBException","code","message"],"mappings":";;;;;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AAqC,EACrC;AACCvB,YAAAA,OAAO,EAAE;AACR,cAAA,cAAc,EACb,mCAAA;aACD;YACDa,IAAI,EAAE,IAAIW,eAAe,CAAC;AACzBC,cAAAA,SAAS,EAAE,yBAAyB;AACpCC,cAAAA,UAAU,EAAE,eAAe;AAC3BC,cAAAA,aAAa,EACZ,IAAI,CAACrC,OAAO,CAACe,WAAW,CAACuB,YAAAA;aAC1B,CAAA;AACD,WAAA,CACD,CAAA;AAED,UAAA,IAAI,CAACnC,MAAM,CAACkB,GAAG,CACd,iBAAiB,EACjBW,aAAa,CAACT,IAAI,CAACgB,YAAY,CAC/B,CAAA;UACD,IAAI,CAACvC,OAAO,CAACe,WAAW,CAACK,WAAW,GACnCY,aAAa,CAACT,IAAI,CAACgB,YAAY,CAAA;UAChC,IAAI,CAACvC,OAAO,CAACe,WAAW,CAACuB,YAAY,GACpCN,aAAa,CAACT,IAAI,CAACc,aAAa,CAAA;AAEjC,UAAA,SAAS,GAAGL,aAAa,CAACT,IAAI,CAACgB,YAAY,CAAA;AAC3C,UAAA,OAAO,MAAMjC,KAAK,CAACwB,KAAK,CAACX,MAAM,CAAC,CAAA;AACjC,SAAA;AACA,QAAA,MAAMW,KAAK,CAAA;OACX,CAAC,OAAOA,KAAK,EAAE;AACf,QAAA,IAAIxB,KAAK,CAACkC,YAAY,CAACV,KAAK,CAAC,EAAE;AAC9B,UAAA,MAAM,IAAIC,cAAc,CAACD,KAAK,CAAC,CAAA;AAChC,SAAC,MAAM;UACN,MAAM,IAAIW,WAAW,CAACX,KAAK,CAACY,IAAI,EAAEZ,KAAK,CAACa,OAAO,CAAC,CAAA;AACjD,SAAA;AACD,OAAA;AACD,KAAC,CACD,CAAA;AACF,GAAA;AACA;;;;"}
@@ -0,0 +1,10 @@
1
+ var SBOrganizationInvitationStatus;
2
+ (function (SBOrganizationInvitationStatus) {
3
+ SBOrganizationInvitationStatus["Accepted"] = "Accepted";
4
+ SBOrganizationInvitationStatus["Pending"] = "Pending";
5
+ SBOrganizationInvitationStatus["Refused"] = "Refused";
6
+ SBOrganizationInvitationStatus["Expired"] = "Expired";
7
+ })(SBOrganizationInvitationStatus || (SBOrganizationInvitationStatus = {}));
8
+
9
+ export { SBOrganizationInvitationStatus };
10
+ //# sourceMappingURL=SBOrganizationInvitationStatus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBOrganizationInvitationStatus.mjs","sources":["../../../../../src/entities/organizations/invitations/SBOrganizationInvitationStatus.ts"],"sourcesContent":["export enum SBOrganizationInvitationStatus {\r\n\tAccepted = \"Accepted\",\r\n\tPending = \"Pending\",\r\n\tRefused = \"Refused\",\r\n\tExpired = \"Expired\",\r\n}\r\n"],"names":["SBOrganizationInvitationStatus"],"mappings":"IAAYA,+BAKX;AALD,CAAA,UAAYA,8BAA8B,EAAA;AACzCA,EAAAA,8BAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrBA,EAAAA,8BAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,8BAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,8BAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACpB,CAAC,EALWA,8BAA8B,KAA9BA,8BAA8B,GAKzC,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ var SBOrganizationMemberRole;
2
+ (function (SBOrganizationMemberRole) {
3
+ SBOrganizationMemberRole["Administrator"] = "Administrator";
4
+ SBOrganizationMemberRole["Employee"] = "Employee";
5
+ })(SBOrganizationMemberRole || (SBOrganizationMemberRole = {}));
6
+
7
+ export { SBOrganizationMemberRole };
8
+ //# sourceMappingURL=SBOrganizationMemberRole.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBOrganizationMemberRole.mjs","sources":["../../../../../src/entities/organizations/members/SBOrganizationMemberRole.ts"],"sourcesContent":["export enum SBOrganizationMemberRole {\n\tAdministrator = \"Administrator\",\n\tEmployee = \"Employee\",\n}\n"],"names":["SBOrganizationMemberRole"],"mappings":"IAAYA,yBAGX;AAHD,CAAA,UAAYA,wBAAwB,EAAA;AACnCA,EAAAA,wBAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AAC/BA,EAAAA,wBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACtB,CAAC,EAHWA,wBAAwB,KAAxBA,wBAAwB,GAGnC,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ var SBOrganizationMemberStatus;
2
+ (function (SBOrganizationMemberStatus) {
3
+ SBOrganizationMemberStatus["Active"] = "Active";
4
+ SBOrganizationMemberStatus["Inactive"] = "Inactive";
5
+ })(SBOrganizationMemberStatus || (SBOrganizationMemberStatus = {}));
6
+
7
+ export { SBOrganizationMemberStatus };
8
+ //# sourceMappingURL=SBOrganizationMemberStatus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SBOrganizationMemberStatus.mjs","sources":["../../../../../src/entities/organizations/members/SBOrganizationMemberStatus.ts"],"sourcesContent":["export enum SBOrganizationMemberStatus {\r\n\tActive = \"Active\",\r\n\tInactive = \"Inactive\",\r\n}\r\n"],"names":["SBOrganizationMemberStatus"],"mappings":"IAAYA,2BAGX;AAHD,CAAA,UAAYA,0BAA0B,EAAA;AACrCA,EAAAA,0BAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjBA,EAAAA,0BAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACtB,CAAC,EAHWA,0BAA0B,KAA1BA,0BAA0B,GAGrC,EAAA,CAAA,CAAA;;;;"}
@@ -12,7 +12,9 @@ export { SBBankStateEnum } from './entities/banks/SBBankState.mjs';
12
12
  export { SBBarcodeType } from './entities/barcode/SBBarcodeType.mjs';
13
13
  export { SBCardType } from './entities/cards/SBCardType.mjs';
14
14
  export { SBFeeType } from './entities/fees/SBFeeType.mjs';
15
- export { SBOrganizationRole } from './entities/organizations/SBOrganizationRole.mjs';
15
+ export { SBOrganizationMemberRole } from './entities/organizations/members/SBOrganizationMemberRole.mjs';
16
+ export { SBOrganizationMemberStatus } from './entities/organizations/members/SBOrganizationMemberStatus.mjs';
17
+ export { SBOrganizationInvitationStatus } from './entities/organizations/invitations/SBOrganizationInvitationStatus.mjs';
16
18
  export { SBPaymentMethodType } from './entities/payment-methods/SBPaymentMethod.mjs';
17
19
  export { SBPaymentMethodFingerprintProvider } from './entities/payment-methods/SBPaymentMethodFingerprintProvider.mjs';
18
20
  export { SBReceiptType } from './entities/receipts/SBReceiptType.mjs';
@@ -47,6 +49,8 @@ export { AccessTokenResponse } from './services/oauth/AccessTokenResponse.mjs';
47
49
  export { AuthorizationCodeResponse } from './services/oauth/AuthorizationCodeResponse.mjs';
48
50
  export { OAuthService } from './services/oauth/OAuthService.mjs';
49
51
  export { OrganizationService } from './services/organizations/OrganizationService.mjs';
52
+ export { OrganizationMemberService } from './services/organizations/members/OrganizationMemberService.mjs';
53
+ export { OrganizationInvitationService } from './services/organizations/invitations/OrganizationInvitationService.mjs';
50
54
  export { PaymentMethodService } from './services/payment-methods/PaymentMethodService.mjs';
51
55
  export { PriceService } from './services/prices/PriceService.mjs';
52
56
  export { ProductImageService } from './services/product-images/ProductImageService.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- var version = "0.0.2-alpha.31";
1
+ var version = "0.0.2-alpha.32";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.mjs.map
@@ -1,9 +1,16 @@
1
+ import _defineProperty from '../../node_modules/@babel/runtime/helpers/esm/defineProperty.mjs';
1
2
  import { defaultAPIServiceOptions } from '../../client/SBServiceOptions.mjs';
2
3
  import { SBService } from '../SBService.mjs';
4
+ import { OrganizationMemberService } from './members/OrganizationMemberService.mjs';
5
+ import { OrganizationInvitationService } from './invitations/OrganizationInvitationService.mjs';
3
6
 
4
7
  class OrganizationService extends SBService {
5
8
  constructor(options = defaultAPIServiceOptions) {
6
9
  super(options);
10
+ _defineProperty(this, "members", void 0);
11
+ _defineProperty(this, "invitations", void 0);
12
+ this.members = new OrganizationMemberService(options);
13
+ this.invitations = new OrganizationInvitationService(options);
7
14
  }
8
15
  async getById(organizationId, options, config = {}) {
9
16
  return await super.getEntityById(`/v1/organizations/${organizationId}`, options, config);
@@ -21,16 +28,22 @@ class OrganizationService extends SBService {
21
28
  return await super.updateEntity(`/v1/organizations/${organizationId}`, request, options, config);
22
29
  }
23
30
  async getMemberById(organizationId, id, options, config = {}) {
24
- return await super.getEntityById(`/v1/organizations/${organizationId}/members/${id}`, options, config);
31
+ return await this.members.getById(organizationId, id, options, config);
25
32
  }
26
33
  async listMembers(organizationId, request, options, config = {}) {
27
- return await super.getEntities(`/v1/organizations/${organizationId}/members`, request, options, config);
34
+ return await this.members.list(organizationId, request, options, config);
28
35
  }
29
36
  async inviteMember(organizationId, request, options, config = {}) {
30
- return await super.createEntity(`/v1/organizations/${organizationId}/members/invite`, request, options, config);
37
+ return await this.invitations.create(organizationId, request, options, config);
38
+ }
39
+ async acceptInvitation(organizationId, id, request, options, config = {}) {
40
+ return await this.invitations.accept(organizationId, id, request, options, config);
41
+ }
42
+ async cancelInvitation(organizationId, id, options, config = {}) {
43
+ return await this.invitations.delete(organizationId, id, options, config);
31
44
  }
32
45
  async deleteMember(organizationId, id, options, config = {}) {
33
- return await super.deleteEntity(`/v1/organizations/${organizationId}/members/${id}`, options, config);
46
+ return await this.members.delete(organizationId, id, options, config);
34
47
  }
35
48
  }
36
49