@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.
- package/dist/@types/client/SBClient.d.ts +3 -3
- package/dist/@types/client/SBInstance.d.ts +1 -0
- package/dist/@types/entities/common/ImageUploadRequest.d.ts +8 -0
- package/dist/@types/entities/common/ImageUploadRequest.d.ts.map +1 -0
- package/dist/@types/entities/organizations/SBOrganization.d.ts +2 -1
- package/dist/@types/entities/organizations/invitations/SBOrganizationInvitation.d.ts +16 -0
- package/dist/@types/entities/organizations/invitations/SBOrganizationInvitation.d.ts.map +1 -0
- package/dist/@types/entities/organizations/invitations/SBOrganizationInvitationStatus.d.ts +9 -0
- package/dist/@types/entities/organizations/invitations/SBOrganizationInvitationStatus.d.ts.map +1 -0
- package/dist/@types/entities/organizations/members/SBOrganizationMember.d.ts +17 -0
- package/dist/@types/entities/organizations/members/SBOrganizationMemberRole.d.ts +7 -0
- package/dist/@types/entities/organizations/members/SBOrganizationMemberRole.d.ts.map +1 -0
- package/dist/@types/entities/organizations/members/SBOrganizationMemberStatus.d.ts +7 -0
- package/dist/@types/entities/organizations/members/SBOrganizationMemberStatus.d.ts.map +1 -0
- package/dist/@types/entities/vendors/SBVendor.d.ts +3 -2
- package/dist/@types/index.d.ts +13 -4
- package/dist/@types/services/employees/SBEmployee.d.ts +13 -0
- package/dist/@types/services/employees/SBEmployee.d.ts.map +1 -0
- package/dist/@types/services/organizations/OrganizationCreateRequest.d.ts +6 -0
- package/dist/@types/services/organizations/OrganizationService.d.ts +13 -5
- package/dist/@types/services/organizations/invitations/OrganizationInvitationListRequest.d.ts +7 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationListRequest.d.ts.map +1 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationRequest.d.ts +9 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationRequest.d.ts.map +1 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationResponseRequest.d.ts +8 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationResponseRequest.d.ts.map +1 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationService.d.ts +23 -0
- package/dist/@types/services/organizations/invitations/OrganizationInvitationService.d.ts.map +1 -0
- package/dist/@types/services/organizations/members/OrganizationMemberService.d.ts +18 -0
- package/dist/@types/services/organizations/members/OrganizationMemberService.d.ts.map +1 -0
- package/dist/cjs/client/SBClient.cjs +6 -5
- package/dist/cjs/client/SBClient.cjs.map +1 -1
- package/dist/cjs/client/SBInstance.cjs +16 -13
- package/dist/cjs/client/SBInstance.cjs.map +1 -1
- package/dist/cjs/entities/organizations/invitations/SBOrganizationInvitationStatus.cjs +10 -0
- package/dist/cjs/entities/organizations/invitations/SBOrganizationInvitationStatus.cjs.map +1 -0
- package/dist/cjs/entities/organizations/members/SBOrganizationMemberRole.cjs +8 -0
- package/dist/cjs/entities/organizations/members/SBOrganizationMemberRole.cjs.map +1 -0
- package/dist/cjs/entities/organizations/members/SBOrganizationMemberStatus.cjs +8 -0
- package/dist/cjs/entities/organizations/members/SBOrganizationMemberStatus.cjs.map +1 -0
- package/dist/cjs/index.cjs +17 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/packages/sdk/package.json.cjs +1 -1
- package/dist/cjs/services/organizations/OrganizationService.cjs +17 -4
- package/dist/cjs/services/organizations/OrganizationService.cjs.map +1 -1
- package/dist/cjs/services/organizations/invitations/OrganizationInvitationService.cjs +38 -0
- package/dist/cjs/services/organizations/invitations/OrganizationInvitationService.cjs.map +1 -0
- package/dist/cjs/services/organizations/members/OrganizationMemberService.cjs +22 -0
- package/dist/cjs/services/organizations/members/OrganizationMemberService.cjs.map +1 -0
- package/dist/esm/client/SBClient.mjs +6 -5
- package/dist/esm/client/SBClient.mjs.map +1 -1
- package/dist/esm/client/SBInstance.mjs +16 -13
- package/dist/esm/client/SBInstance.mjs.map +1 -1
- package/dist/esm/entities/organizations/invitations/SBOrganizationInvitationStatus.mjs +10 -0
- package/dist/esm/entities/organizations/invitations/SBOrganizationInvitationStatus.mjs.map +1 -0
- package/dist/esm/entities/organizations/members/SBOrganizationMemberRole.mjs +8 -0
- package/dist/esm/entities/organizations/members/SBOrganizationMemberRole.mjs.map +1 -0
- package/dist/esm/entities/organizations/members/SBOrganizationMemberStatus.mjs +8 -0
- package/dist/esm/entities/organizations/members/SBOrganizationMemberStatus.mjs.map +1 -0
- package/dist/esm/index.mjs +5 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/packages/sdk/package.json.mjs +1 -1
- package/dist/esm/services/organizations/OrganizationService.mjs +17 -4
- package/dist/esm/services/organizations/OrganizationService.mjs.map +1 -1
- package/dist/esm/services/organizations/invitations/OrganizationInvitationService.mjs +36 -0
- package/dist/esm/services/organizations/invitations/OrganizationInvitationService.mjs.map +1 -0
- package/dist/esm/services/organizations/members/OrganizationMemberService.mjs +20 -0
- package/dist/esm/services/organizations/members/OrganizationMemberService.mjs.map +1 -0
- package/dist/umd/index.js +94 -23
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -4
- package/dist/@types/entities/api-logs/SBLog.d.ts +0 -19
- package/dist/@types/entities/api-logs/SBLog.d.ts.map +0 -1
- package/dist/@types/entities/organizations/SBOrganizationMember.d.ts +0 -9
- package/dist/@types/entities/organizations/SBOrganizationRole.d.ts +0 -7
- package/dist/@types/entities/organizations/SBOrganizationRole.d.ts.map +0 -1
- package/dist/@types/services/organizations/OrganizationMemberInviteRequest.d.ts +0 -9
- package/dist/@types/services/organizations/OrganizationMemberInviteRequest.d.ts.map +0 -1
- package/dist/cjs/entities/organizations/SBOrganizationRole.cjs +0 -8
- package/dist/cjs/entities/organizations/SBOrganizationRole.cjs.map +0 -1
- package/dist/esm/entities/organizations/SBOrganizationRole.mjs +0 -8
- package/dist/esm/entities/organizations/SBOrganizationRole.mjs.map +0 -1
- /package/dist/@types/entities/organizations/{SBOrganizationMember.d.ts.map → members/SBOrganizationMember.d.ts.map} +0 -0
- /package/dist/@types/services/organizations/{OrganizationMemberListRequest.d.ts → members/OrganizationMemberListRequest.d.ts} +0 -0
- /package/dist/@types/services/organizations/{OrganizationMemberListRequest.d.ts.map → members/OrganizationMemberListRequest.d.ts.map} +0 -0
|
@@ -13,11 +13,13 @@ import { FriendService } from '../services/friends/FriendService.js';
|
|
|
13
13
|
import { LocationService } from '../services/locations/LocationService.js';
|
|
14
14
|
import { MerchantService } from '../services/merchants/MerchantService.js';
|
|
15
15
|
import { OAuthService } from '../services/oauth/OAuthService.js';
|
|
16
|
+
import { OrganizationService } from '../services/organizations/OrganizationService.js';
|
|
16
17
|
import { SBClientOptions } from './SBClientOptions.js';
|
|
18
|
+
import { SBLogger } from './SBLogger.js';
|
|
17
19
|
import { PaymentMethodService } from '../services/payment-methods/PaymentMethodService.js';
|
|
18
20
|
import { ProductImageService } from '../services/product-images/ProductImageService.js';
|
|
19
21
|
import { ProductVariantService } from '../services/product-variants/ProductVariantService.js';
|
|
20
|
-
import {
|
|
22
|
+
import { ProductService } from '../services/products/ProductService.js';
|
|
21
23
|
import { PromoCodeService } from '../services/promo-codes/PromoCodeService.js';
|
|
22
24
|
import { ReceiptService } from '../services/receipts/ReceiptService.js';
|
|
23
25
|
import { ReviewService } from '../services/reviews/ReviewService.js';
|
|
@@ -28,9 +30,7 @@ import { CurrentUserService } from '../services/user/UserService.js';
|
|
|
28
30
|
import { UserService } from '../services/users/UserService.js';
|
|
29
31
|
import { SBCredentialProvider } from './SBCredentials.js';
|
|
30
32
|
import { ExploreService } from '../services/explore/ExploreService.js';
|
|
31
|
-
import { ProductService } from '../services/products/ProductService.js';
|
|
32
33
|
import { VendorService } from '../services/vendors/VendorService.js';
|
|
33
|
-
import { OrganizationService } from '../services/organizations/OrganizationService.js';
|
|
34
34
|
|
|
35
35
|
declare class SBClient {
|
|
36
36
|
logger: SBLogger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUploadRequest.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SBUser } from '../../users/SBUser.js';
|
|
2
|
+
import { SBOrganizationMemberRole } from '../members/SBOrganizationMemberRole.js';
|
|
3
|
+
|
|
4
|
+
interface SBOrganizationInvitation {
|
|
5
|
+
id: number;
|
|
6
|
+
role: SBOrganizationMemberRole;
|
|
7
|
+
email: string;
|
|
8
|
+
status: SBOrganizationInvitation;
|
|
9
|
+
invitedBy?: SBUser;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
cancelledAt?: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { SBOrganizationInvitation };
|
|
16
|
+
//# sourceMappingURL=SBOrganizationInvitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBOrganizationInvitation.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/@types/entities/organizations/invitations/SBOrganizationInvitationStatus.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBOrganizationInvitationStatus.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SBUser } from '../../users/SBUser.js';
|
|
2
|
+
import { SBOrganizationMemberRole } from './SBOrganizationMemberRole.js';
|
|
3
|
+
import { SBOrganizationMemberStatus } from './SBOrganizationMemberStatus.js';
|
|
4
|
+
|
|
5
|
+
interface SBOrganizationMember {
|
|
6
|
+
id: number;
|
|
7
|
+
role: SBOrganizationMemberRole;
|
|
8
|
+
user?: SBUser;
|
|
9
|
+
email: string;
|
|
10
|
+
status: SBOrganizationMemberStatus;
|
|
11
|
+
invitedAt: Date;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { SBOrganizationMember };
|
|
17
|
+
//# sourceMappingURL=SBOrganizationMember.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBOrganizationMemberRole.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBOrganizationMemberStatus.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SBAddress } from '../address/SBAddress.js';
|
|
2
1
|
import { SBEntity } from '../SBEntity.js';
|
|
2
|
+
import { SBAddress } from '../address/SBAddress.js';
|
|
3
|
+
import { ITimestamp } from '../../interfaces/ITimestamp.js';
|
|
3
4
|
|
|
4
|
-
interface SBVendor extends SBEntity {
|
|
5
|
+
interface SBVendor extends SBEntity, ITimestamp {
|
|
5
6
|
name: string;
|
|
6
7
|
address: SBAddress;
|
|
7
8
|
logo: string;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { SBUserAccount } from './entities/account/SBUserAccount.js';
|
|
|
19
19
|
export { SBAddress } from './entities/address/SBAddress.js';
|
|
20
20
|
export { SBBillingAddress } from './entities/address/SBBillingAddress.js';
|
|
21
21
|
export { SBCoordinate } from './entities/address/SBCoordinate.js';
|
|
22
|
+
export { ImageUploadRequest } from './entities/common/ImageUploadRequest.js';
|
|
22
23
|
export { SBApiLog } from './entities/api-logs/SBLog.js';
|
|
23
24
|
export { SBBank } from './entities/banks/SBBank.js';
|
|
24
25
|
export { SBBankAccount } from './entities/banks/SBBankAccount.js';
|
|
@@ -67,8 +68,11 @@ export { SBReceiptMetadata } from './entities/metadata/SBReceiptMetadata.js';
|
|
|
67
68
|
export { SBMetadata } from './entities/metadata/SBMetadata.js';
|
|
68
69
|
export { JwtToken } from './entities/oauth/JwtToken.js';
|
|
69
70
|
export { SBOrganization } from './entities/organizations/SBOrganization.js';
|
|
70
|
-
export { SBOrganizationMember } from './entities/organizations/SBOrganizationMember.js';
|
|
71
|
-
export {
|
|
71
|
+
export { SBOrganizationMember } from './entities/organizations/members/SBOrganizationMember.js';
|
|
72
|
+
export { SBOrganizationMemberRole } from './entities/organizations/members/SBOrganizationMemberRole.js';
|
|
73
|
+
export { SBOrganizationMemberStatus } from './entities/organizations/members/SBOrganizationMemberStatus.js';
|
|
74
|
+
export { SBOrganizationInvitation } from './entities/organizations/invitations/SBOrganizationInvitation.js';
|
|
75
|
+
export { SBOrganizationInvitationStatus } from './entities/organizations/invitations/SBOrganizationInvitationStatus.js';
|
|
72
76
|
export { SBPaymentMethod, SBPaymentMethodType } from './entities/payment-methods/SBPaymentMethod.js';
|
|
73
77
|
export { SBPaymentMethodCard } from './entities/payment-methods/SBPaymentMethodCard.js';
|
|
74
78
|
export { SBPaymentMethodSetup } from './entities/payment-methods/SBPaymentMethodSetup.js';
|
|
@@ -195,6 +199,7 @@ export { FeeCreateRequest } from './services/fees/FeeCreateRequest.js';
|
|
|
195
199
|
export { FeeService } from './services/fees/FeeService.js';
|
|
196
200
|
export { FeeUpdateRequest } from './services/fees/FeeUpdateRequest.js';
|
|
197
201
|
export { FeeUpsertRequest } from './services/fees/FeeUpsertRequest.js';
|
|
202
|
+
export { SBEmployee } from './services/employees/SBEmployee.js';
|
|
198
203
|
export { FriendService } from './services/friends/FriendService.js';
|
|
199
204
|
export { FriendListRequest } from './services/friends/FriendListRequest.js';
|
|
200
205
|
export { LocationBatchUpsertRequest } from './services/locations/LocationBatchUpsertRequest.js';
|
|
@@ -216,9 +221,13 @@ export { RefreshTokenRequest } from './services/oauth/RefreshTokenRequest.js';
|
|
|
216
221
|
export { OrganizationListRequest } from './services/organizations/OrganizationListRequest.js';
|
|
217
222
|
export { OrganizationCreateRequest } from './services/organizations/OrganizationCreateRequest.js';
|
|
218
223
|
export { OrganizationUpdateRequest } from './services/organizations/OrganizationUpdateRequest.js';
|
|
219
|
-
export { OrganizationMemberInviteRequest } from './services/organizations/OrganizationMemberInviteRequest.js';
|
|
220
224
|
export { OrganizationService } from './services/organizations/OrganizationService.js';
|
|
221
|
-
export { OrganizationMemberListRequest } from './services/organizations/OrganizationMemberListRequest.js';
|
|
225
|
+
export { OrganizationMemberListRequest } from './services/organizations/members/OrganizationMemberListRequest.js';
|
|
226
|
+
export { OrganizationMemberService } from './services/organizations/members/OrganizationMemberService.js';
|
|
227
|
+
export { OrganizationInvitationResponseRequest } from './services/organizations/invitations/OrganizationInvitationResponseRequest.js';
|
|
228
|
+
export { OrganizationInvitationService } from './services/organizations/invitations/OrganizationInvitationService.js';
|
|
229
|
+
export { OrganizationInvitationRequest } from './services/organizations/invitations/OrganizationInvitationRequest.js';
|
|
230
|
+
export { OrganizationInvitationListRequest } from './services/organizations/invitations/OrganizationInvitationListRequest.js';
|
|
222
231
|
export { PaymentMethodService } from './services/payment-methods/PaymentMethodService.js';
|
|
223
232
|
export { PaymentMethodListRequest } from './services/payment-methods/PaymentMethodListRequest.js';
|
|
224
233
|
export { PaymentMethodBankCreateRequest } from './services/payment-methods/PaymentMethodBankCreateRequest.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SBEntity } from '../../entities/SBEntity.js';
|
|
2
|
+
import { ITimestamp } from '../../interfaces/ITimestamp.js';
|
|
3
|
+
|
|
4
|
+
interface SBEmployee extends SBEntity, ITimestamp {
|
|
5
|
+
id: number;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
email: string;
|
|
9
|
+
birthdate?: Date;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { SBEmployee };
|
|
13
|
+
//# sourceMappingURL=SBEmployee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBEmployee.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { ImageUploadRequest } from '../../entities/common/ImageUploadRequest.js';
|
|
2
|
+
import { AddressRequest } from '../addresses/AddressRequest.js';
|
|
3
|
+
|
|
1
4
|
interface OrganizationCreateRequest {
|
|
2
5
|
name: string;
|
|
6
|
+
website: string;
|
|
7
|
+
address: AddressRequest;
|
|
8
|
+
logo?: ImageUploadRequest;
|
|
3
9
|
}
|
|
4
10
|
|
|
5
11
|
export type { OrganizationCreateRequest };
|
|
@@ -5,17 +5,23 @@ import { IDeletable } from '../../interfaces/IDeletable.js';
|
|
|
5
5
|
import { IUpdatable } from '../../interfaces/IUpdatable.js';
|
|
6
6
|
import { AxiosRequestConfig } from 'axios';
|
|
7
7
|
import { SBOrganization } from '../../entities/organizations/SBOrganization.js';
|
|
8
|
-
import { SBOrganizationMember } from '../../entities/organizations/SBOrganizationMember.js';
|
|
8
|
+
import { SBOrganizationMember } from '../../entities/organizations/members/SBOrganizationMember.js';
|
|
9
|
+
import { SBOrganizationInvitation } from '../../entities/organizations/invitations/SBOrganizationInvitation.js';
|
|
9
10
|
import { SBService } from '../SBService.js';
|
|
10
11
|
import { PaginatedResult } from '../../utilities/PaginatedResult.js';
|
|
11
12
|
import { OrganizationCreateRequest } from './OrganizationCreateRequest.js';
|
|
12
13
|
import { OrganizationUpdateRequest } from './OrganizationUpdateRequest.js';
|
|
13
14
|
import { OrganizationListRequest } from './OrganizationListRequest.js';
|
|
14
|
-
import { OrganizationMemberListRequest } from './OrganizationMemberListRequest.js';
|
|
15
|
-
import { OrganizationMemberInviteRequest } from './OrganizationMemberInviteRequest.js';
|
|
15
|
+
import { OrganizationMemberListRequest } from './members/OrganizationMemberListRequest.js';
|
|
16
16
|
import { IRetrievableById } from '../../interfaces/IRetrievable.js';
|
|
17
|
+
import { OrganizationMemberService } from './members/OrganizationMemberService.js';
|
|
18
|
+
import { OrganizationInvitationResponseRequest } from './invitations/OrganizationInvitationResponseRequest.js';
|
|
19
|
+
import { OrganizationInvitationService } from './invitations/OrganizationInvitationService.js';
|
|
20
|
+
import { OrganizationInvitationRequest } from './invitations/OrganizationInvitationRequest.js';
|
|
17
21
|
|
|
18
22
|
declare class OrganizationService extends SBService implements IRetrievableById<SBOrganization>, ICreatable<OrganizationCreateRequest, SBOrganization>, IUpdatable<OrganizationUpdateRequest, SBOrganization>, IDeletable<SBOrganization> {
|
|
23
|
+
readonly members: OrganizationMemberService;
|
|
24
|
+
readonly invitations: OrganizationInvitationService;
|
|
19
25
|
constructor(options?: SBServiceOptions);
|
|
20
26
|
getById(organizationId: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganization>;
|
|
21
27
|
list(request: OrganizationListRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<PaginatedResult<SBOrganization>>;
|
|
@@ -23,8 +29,10 @@ declare class OrganizationService extends SBService implements IRetrievableById<
|
|
|
23
29
|
delete(organizationId: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganization>;
|
|
24
30
|
update(organizationId: number, request: OrganizationUpdateRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganization>;
|
|
25
31
|
getMemberById(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationMember>;
|
|
26
|
-
listMembers(organizationId: number, request: OrganizationMemberListRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationMember
|
|
27
|
-
inviteMember(organizationId: number, request:
|
|
32
|
+
listMembers(organizationId: number, request: OrganizationMemberListRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<PaginatedResult<SBOrganizationMember>>;
|
|
33
|
+
inviteMember(organizationId: number, request: OrganizationInvitationRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
34
|
+
acceptInvitation(organizationId: number, id: number, request: OrganizationInvitationResponseRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
35
|
+
cancelInvitation(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
28
36
|
deleteMember(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationMember>;
|
|
29
37
|
}
|
|
30
38
|
|
package/dist/@types/services/organizations/invitations/OrganizationInvitationListRequest.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationInvitationListRequest.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SBOrganizationMemberRole } from '../../../entities/organizations/members/SBOrganizationMemberRole.js';
|
|
2
|
+
|
|
3
|
+
interface OrganizationInvitationRequest {
|
|
4
|
+
email: string;
|
|
5
|
+
role: SBOrganizationMemberRole;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type { OrganizationInvitationRequest };
|
|
9
|
+
//# sourceMappingURL=OrganizationInvitationRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationInvitationRequest.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationInvitationResponseRequest.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SBRequestOptions } from '../../../client/SBRequestOption.js';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { SBService } from '../../SBService.js';
|
|
4
|
+
import { SBServiceOptions } from '../../../client/SBServiceOptions.js';
|
|
5
|
+
import { INestedRetrievableById } from '../../../interfaces/IRetrievable.js';
|
|
6
|
+
import { SBOrganizationInvitation } from '../../../entities/organizations/invitations/SBOrganizationInvitation.js';
|
|
7
|
+
import { OrganizationInvitationResponseRequest } from './OrganizationInvitationResponseRequest.js';
|
|
8
|
+
import { OrganizationInvitationRequest } from './OrganizationInvitationRequest.js';
|
|
9
|
+
import { OrganizationInvitationListRequest } from './OrganizationInvitationListRequest.js';
|
|
10
|
+
|
|
11
|
+
declare class OrganizationInvitationService extends SBService implements INestedRetrievableById<SBOrganizationInvitation> {
|
|
12
|
+
constructor(options?: SBServiceOptions);
|
|
13
|
+
getById(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
14
|
+
list(organizationId: number, request: OrganizationInvitationListRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation[]>;
|
|
15
|
+
create(organizationId: number, request: OrganizationInvitationRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
16
|
+
delete(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
17
|
+
listPending(organizationId: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation[]>;
|
|
18
|
+
accept(organizationId: number, id: number, request: OrganizationInvitationResponseRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
19
|
+
refuse(organizationId: number, id: number, request: OrganizationInvitationResponseRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationInvitation>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { OrganizationInvitationService };
|
|
23
|
+
//# sourceMappingURL=OrganizationInvitationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationInvitationService.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SBRequestOptions } from '../../../client/SBRequestOption.js';
|
|
2
|
+
import { SBServiceOptions } from '../../../client/SBServiceOptions.js';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
import { SBService } from '../../SBService.js';
|
|
5
|
+
import { PaginatedResult } from '../../../utilities/PaginatedResult.js';
|
|
6
|
+
import { INestedRetrievableById } from '../../../interfaces/IRetrievable.js';
|
|
7
|
+
import { OrganizationMemberListRequest } from './OrganizationMemberListRequest.js';
|
|
8
|
+
import { SBOrganizationMember } from '../../../entities/organizations/members/SBOrganizationMember.js';
|
|
9
|
+
|
|
10
|
+
declare class OrganizationMemberService extends SBService implements INestedRetrievableById<SBOrganizationMember> {
|
|
11
|
+
constructor(options?: SBServiceOptions);
|
|
12
|
+
getById(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationMember>;
|
|
13
|
+
list(organizationId: number, request: OrganizationMemberListRequest, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<PaginatedResult<SBOrganizationMember>>;
|
|
14
|
+
delete(organizationId: number, id: number, options?: SBRequestOptions, config?: AxiosRequestConfig): Promise<SBOrganizationMember>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { OrganizationMemberService };
|
|
18
|
+
//# sourceMappingURL=OrganizationMemberService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationMemberService.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -17,6 +17,12 @@ var MerchantService = require('../services/merchants/MerchantService.cjs');
|
|
|
17
17
|
require('node-html-parser');
|
|
18
18
|
var OAuthService = require('../services/oauth/OAuthService.cjs');
|
|
19
19
|
var OrganizationService = require('../services/organizations/OrganizationService.cjs');
|
|
20
|
+
var SBServiceOptions = require('./SBServiceOptions.cjs');
|
|
21
|
+
require('axios');
|
|
22
|
+
var uuid = require('uuid');
|
|
23
|
+
var SBLogger = require('./SBLogger.cjs');
|
|
24
|
+
require('query-string');
|
|
25
|
+
require('./SBPermission.cjs');
|
|
20
26
|
var PaymentMethodService = require('../services/payment-methods/PaymentMethodService.cjs');
|
|
21
27
|
var ProductImageService = require('../services/product-images/ProductImageService.cjs');
|
|
22
28
|
var ProductVariantService = require('../services/product-variants/ProductVariantService.cjs');
|
|
@@ -29,13 +35,8 @@ var TaxService = require('../services/taxes/TaxService.cjs');
|
|
|
29
35
|
var TransactionService = require('../services/transactions/TransactionService.cjs');
|
|
30
36
|
var UserService = require('../services/user/UserService.cjs');
|
|
31
37
|
var UserService$1 = require('../services/users/UserService.cjs');
|
|
32
|
-
var uuid = require('uuid');
|
|
33
|
-
var SBLogger = require('./SBLogger.cjs');
|
|
34
|
-
var SBServiceOptions = require('./SBServiceOptions.cjs');
|
|
35
38
|
var constants = require('./constants.cjs');
|
|
36
39
|
var ExploreService = require('../services/explore/ExploreService.cjs');
|
|
37
|
-
require('axios');
|
|
38
|
-
require('query-string');
|
|
39
40
|
var VendorService = require('../services/vendors/VendorService.cjs');
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SBClient.cjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\nimport { SBVendor } from \"@/entities\";\nimport { VendorService } from \"@/services\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\tpublic vendors: VendorService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.vendors = new VendorService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService","vendors","VendorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAEG;AACH,MAAMA,cAAc,GAAoB;AACvCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,GAAG,EAAEC,iBAAO;AACZC,IAAAA,IAAI,EAAED,iBAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,iBAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,OAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAkCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,yCAAwB,EAAA;IAAAC,sBAAA,CAAA,IAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,kBAAA,EAAA,KAAA,CA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AEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC6E,KAAK,GAAG,IAAIC,qBAAU,CAAC;MAC3B,GAAG,IAAI,CAACnE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC+E,KAAK,GAAG,IAAIC,yBAAW,CAAC;MAC5B,GAAG,IAAI,CAACrE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAACiF,OAAO,GAAG,IAAIC,2BAAa,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;;;;"}
|
|
1
|
+
{"version":3,"file":"SBClient.cjs","sources":["../../../src/client/SBClient.ts"],"sourcesContent":["import { ApiLogService } from \"@/services/api-logs\";\nimport { BankAccountService } from \"@/services/bank-accounts\";\nimport { BankInstitutionService } from \"@/services/bank-institutions\";\nimport { BankTransactionService } from \"@/services/bank-transactions\";\nimport { BankService } from \"@/services/banks\";\nimport { BarcodeService } from \"@/services/barcode\";\nimport { CardService } from \"@/services/cards/CardService\";\nimport { CustomerService } from \"@/services/customers/CustomerService\";\nimport { DocumentService } from \"@/services/documents\";\nimport { DomainService } from \"@/services/domains\";\nimport { FeeService } from \"@/services/fees\";\nimport { FriendService } from \"@/services/friends/FriendService\";\nimport { LocationService } from \"@/services/locations\";\nimport { MerchantService } from \"@/services/merchants\";\nimport { OAuthService } from \"@/services/oauth\";\nimport { OrganizationService } from \"@/services/organizations\";\nimport { PaymentMethodService } from \"@/services/payment-methods\";\nimport { ProductImageService } from \"@/services/product-images\";\nimport { ProductVariantService } from \"@/services/product-variants\";\nimport { ProductService } from \"@/services/products\";\nimport { PromoCodeService } from \"@/services/promo-codes\";\nimport { ReceiptService } from \"@/services/receipts\";\nimport { ReviewService } from \"@/services/reviews\";\nimport { SettlementService } from \"@/services/settlements\";\nimport { TaxService } from \"@/services/taxes\";\nimport { TransactionService } from \"@/services/transactions\";\nimport { CurrentUserService } from \"@/services/user\";\nimport { UserService } from \"@/services/users\";\nimport { v4 } from \"uuid\";\nimport { SBClientOptions } from \"./SBClientOptions\";\nimport { SBCredentialProvider } from \"./SBCredentials\";\nimport { SBLogger } from \"./SBLogger\";\nimport { defaultAPIServiceOptions } from \"./SBServiceOptions\";\nimport { API_URL } from \"./constants\";\nimport { ExploreService } from \"../services/explore\";\nimport { SBVendor } from \"@/entities\";\nimport { VendorService } from \"@/services\";\n\n/**\n * Client for the Smartbills API.\n */\nconst defaultOptions: SBClientOptions = {\n\tendpoints: {\n\t\tapi: API_URL,\n\t\tauth: API_URL,\n\t},\n\tdebug: false,\n\tlogger: new SBLogger(false),\n\tsessionId: v4(),\n\tlocale: \"en\",\n};\n\nexport class SBClient {\n\tpublic logger: SBLogger;\n\tpublic options: SBClientOptions;\n\tpublic user: CurrentUserService;\n\tpublic logs: ApiLogService;\n\tpublic banks: BankService;\n\tpublic bankAccounts: BankAccountService;\n\tpublic promoCodes: PromoCodeService;\n\tpublic bankInstitutions: BankInstitutionService;\n\tpublic bankTransactions: BankTransactionService;\n\tpublic cards: CardService;\n\tpublic barcodes: BarcodeService;\n\tpublic customers: CustomerService;\n\tpublic documents: DocumentService;\n\tpublic domains: DomainService;\n\tpublic explore: ExploreService;\n\tpublic fees: FeeService;\n\tpublic reviews: ReviewService;\n\tpublic locations: LocationService;\n\tpublic merchants: MerchantService;\n\tpublic oauth: OAuthService;\n\tpublic organizations: OrganizationService;\n\tpublic productVariants: ProductVariantService;\n\tpublic productImages: ProductImageService;\n\tpublic products: ProductService;\n\tpublic receipts: ReceiptService;\n\tpublic transactions: TransactionService;\n\tpublic paymentMethods: PaymentMethodService;\n\tpublic settlements: SettlementService;\n\tpublic friends: FriendService;\n\tpublic taxes: TaxService;\n\tpublic users: UserService;\n\tpublic vendors: VendorService;\n\n\t/**\n\t * @constructor\n\t * Creates an instance of the Smartbills API client.\n\t */\n\tpublic constructor(options: SBClientOptions = defaultAPIServiceOptions) {\n\t\tthis.options = { ...defaultOptions, ...options };\n\t\tthis.logger = options.logger ?? new SBLogger(options.debug);\n\t\tthis.configureServices();\n\t\tthis.logger.log(options);\n\t}\n\n\tpublic async initialize() {\n\t\tif (this.options.credentials) {\n\t\t\tawait this.options.credentials?.getAccessToken(this.oauth);\n\t\t}\n\t}\n\n\tpublic get accessToken(): string {\n\t\treturn this.options?.credentials?.accessToken;\n\t}\n\n\tpublic get refreshToken(): string {\n\t\treturn this.options?.credentials?.refreshToken;\n\t}\n\n\tpublic set merchantId(merchantId: number) {\n\t\tthis.options.merchantId = merchantId;\n\t}\n\n\tpublic setCredentials(credentials: SBCredentialProvider) {\n\t\tthis.options.credentials = credentials;\n\t\tthis.configureServices();\n\t}\n\n\tpublic setLocale(locale: string) {\n\t\tthis.options.locale = locale;\n\t}\n\n\tprotected configureServices() {\n\t\tthis.oauth = new OAuthService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.auth,\n\t\t});\n\t\tthis.cards = new CardService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.user = new CurrentUserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.logs = new ApiLogService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.banks = new BankService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankAccounts = new BankAccountService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankInstitutions = new BankInstitutionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.bankTransactions = new BankTransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.barcodes = new BarcodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.customers = new CustomerService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.documents = new DocumentService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\t// this.domains = new DomainService({...this.options, logger:this.logger, url: this.options?.endpoints?.api});\n\t\tthis.promoCodes = new PromoCodeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.locations = new LocationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.friends = new FriendService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.reviews = new ReviewService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.merchants = new MerchantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.organizations = new OrganizationService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productVariants = new ProductVariantService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.products = new ProductService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.fees = new FeeService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.productImages = new ProductImageService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.explore = new ExploreService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\n\t\tthis.receipts = new ReceiptService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.transactions = new TransactionService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.paymentMethods = new PaymentMethodService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.settlements = new SettlementService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.taxes = new TaxService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.users = new UserService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t\tthis.vendors = new VendorService({\n\t\t\t...this.options,\n\t\t\tlogger: this.logger,\n\t\t\turl: this.options?.endpoints?.api,\n\t\t});\n\t}\n}\n"],"names":["defaultOptions","endpoints","api","API_URL","auth","debug","logger","SBLogger","sessionId","v4","locale","SBClient","constructor","options","defaultAPIServiceOptions","_defineProperty","configureServices","log","initialize","credentials","getAccessToken","oauth","accessToken","refreshToken","merchantId","setCredentials","setLocale","OAuthService","url","cards","CardService","user","CurrentUserService","logs","ApiLogService","banks","BankService","bankAccounts","BankAccountService","bankInstitutions","BankInstitutionService","bankTransactions","BankTransactionService","barcodes","BarcodeService","customers","CustomerService","documents","DocumentService","promoCodes","PromoCodeService","locations","LocationService","friends","FriendService","reviews","ReviewService","merchants","MerchantService","organizations","OrganizationService","productVariants","ProductVariantService","products","ProductService","fees","FeeService","productImages","ProductImageService","explore","ExploreService","receipts","ReceiptService","transactions","TransactionService","paymentMethods","PaymentMethodService","settlements","SettlementService","taxes","TaxService","users","UserService","vendors","VendorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAEG;AACH,MAAMA,cAAc,GAAoB;AACvCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,GAAG,EAAEC,iBAAO;AACZC,IAAAA,IAAI,EAAED,iBAAAA;GACN;AACDE,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,IAAIC,iBAAQ,CAAC,KAAK,CAAC;EAC3BC,SAAS,EAAEC,OAAE,EAAE;AACfC,EAAAA,MAAM,EAAE,IAAA;CACR,CAAA;MAEYC,QAAQ,CAAA;AAkCpB;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,UAA2BC,yCAAwB,EAAA;IAAAC,sBAAA,CAAA,IAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA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AAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC2E,WAAW,GAAG,IAAIC,mCAAiB,CAAC;MACxC,GAAG,IAAI,CAACjE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC6E,KAAK,GAAG,IAAIC,qBAAU,CAAC;MAC3B,GAAG,IAAI,CAACnE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAAC+E,KAAK,GAAG,IAAIC,yBAAW,CAAC;MAC5B,GAAG,IAAI,CAACrE,OAAO;MACfP,MAAM,EAAE,IAAI,CAACA,MAAM;AACnBsB,MAAAA,GAAG,EAAE,IAAI,CAACf,OAAO,EAAEZ,SAAS,EAAEC,GAAAA;AAC9B,KAAA,CAAC,CAAA;AACF,IAAA,IAAI,CAACiF,OAAO,GAAG,IAAIC,2BAAa,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;;;;"}
|
|
@@ -13,7 +13,9 @@ class SBInstance {
|
|
|
13
13
|
constructor(options = SBServiceOptions.defaultAPIServiceOptions) {
|
|
14
14
|
defineProperty.default(this, "axios", void 0);
|
|
15
15
|
defineProperty.default(this, "logger", void 0);
|
|
16
|
+
defineProperty.default(this, "options", void 0);
|
|
16
17
|
this.logger = options.logger ?? new SBLogger.SBLogger(options.debug);
|
|
18
|
+
this.options = options;
|
|
17
19
|
this.axios = axios.create({
|
|
18
20
|
baseURL: options.url,
|
|
19
21
|
headers: !isBrowser ? {
|
|
@@ -42,19 +44,20 @@ class SBInstance {
|
|
|
42
44
|
throw new SBException.SBApiException(error);
|
|
43
45
|
}
|
|
44
46
|
if (error.response && error.response?.status == 401) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
const tokenResponse = await axios.post("http://localhost:8000/connect/token", {
|
|
48
|
+
headers: {
|
|
49
|
+
"content-type": "application/x-www-form-urlencoded"
|
|
50
|
+
},
|
|
51
|
+
data: new URLSearchParams({
|
|
52
|
+
client_id: "smartbills-react-native",
|
|
53
|
+
grant_type: "refresh_token",
|
|
54
|
+
refresh_token: this.options.credentials.refreshToken
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
this.logger.log("token refreshed", tokenResponse.data.access_token);
|
|
58
|
+
this.options.credentials.accessToken = tokenResponse.data.access_token;
|
|
59
|
+
this.options.credentials.refreshToken = tokenResponse.data.refresh_token;
|
|
60
|
+
"bearer " + tokenResponse.data.access_token;
|
|
58
61
|
return await axios(error.config);
|
|
59
62
|
}
|
|
60
63
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SBInstance.cjs","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\
|
|
1
|
+
{"version":3,"file":"SBInstance.cjs","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":";;;;;;;;;;AAMA,MAAMA,SAAS,GAAG,OAAOC,MAAM,KAAK,WAAW,CAAA;MAElCC,UAAU,CAAA;AAKtBC,EAAAA,WAAAA,CAAmBC,UAA4BC,yCAAwB,EAAA;IAAAC,sBAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,sBAAA,CAAA,IAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACtE,IAAA,IAAI,CAACC,MAAM,GAAGH,OAAO,CAACG,MAAM,IAAI,IAAIC,iBAAQ,CAACJ,OAAO,CAACK,KAAK,CAAC,CAAA;IAC3D,IAAI,CAACL,OAAO,GAAGA,OAAO,CAAA;AACtB,IAAA,IAAI,CAACM,KAAK,GAAGA,KAAK,CAACC,MAAM,CAAC;MACzBC,OAAO,EAAER,OAAO,CAACS,GAAG;MACpBC,OAAO,EAAE,CAACd,SAAS,GAChB;QACA,YAAY,EAAE,kBAAkBe,gB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,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,0BAAc,CAACD,KAAK,CAAC,CAAA;AAChC,SAAC,MAAM;UACN,MAAM,IAAIW,uBAAW,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
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.SBOrganizationInvitationStatus = void 0;
|
|
4
|
+
(function (SBOrganizationInvitationStatus) {
|
|
5
|
+
SBOrganizationInvitationStatus["Accepted"] = "Accepted";
|
|
6
|
+
SBOrganizationInvitationStatus["Pending"] = "Pending";
|
|
7
|
+
SBOrganizationInvitationStatus["Refused"] = "Refused";
|
|
8
|
+
SBOrganizationInvitationStatus["Expired"] = "Expired";
|
|
9
|
+
})(exports.SBOrganizationInvitationStatus || (exports.SBOrganizationInvitationStatus = {}));
|
|
10
|
+
//# sourceMappingURL=SBOrganizationInvitationStatus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBOrganizationInvitationStatus.cjs","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":";;AAAYA,gDAKX;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,sCAA8B,KAA9BA,sCAA8B,GAKzC,EAAA,CAAA,CAAA;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.SBOrganizationMemberRole = void 0;
|
|
4
|
+
(function (SBOrganizationMemberRole) {
|
|
5
|
+
SBOrganizationMemberRole["Administrator"] = "Administrator";
|
|
6
|
+
SBOrganizationMemberRole["Employee"] = "Employee";
|
|
7
|
+
})(exports.SBOrganizationMemberRole || (exports.SBOrganizationMemberRole = {}));
|
|
8
|
+
//# sourceMappingURL=SBOrganizationMemberRole.cjs.map
|