@longvansoftware/service-js-client 1.16.3 → 1.16.4
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/src/graphql/campaign/mutations.d.ts +1 -0
- package/dist/src/graphql/campaign/mutations.js +34 -0
- package/dist/src/graphql/campaign/queries.d.ts +9 -0
- package/dist/src/graphql/campaign/queries.js +427 -0
- package/dist/src/graphql/cashbook/queries.d.ts +2 -0
- package/dist/src/graphql/cashbook/queries.js +99 -0
- package/dist/src/graphql/fragments/product.d.ts +38 -0
- package/dist/src/graphql/fragments/product.js +196 -0
- package/dist/src/graphql/paymentV2/mutations.d.ts +5 -0
- package/dist/src/graphql/paymentV2/mutations.js +120 -0
- package/dist/src/graphql/paymentV2/queries.d.ts +9 -0
- package/dist/src/graphql/paymentV2/queries.js +257 -0
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +14 -1
- package/dist/src/graphql/store/mutations.d.ts +1 -0
- package/dist/src/graphql/store/mutations.js +29 -0
- package/dist/src/graphql/store/queries.d.ts +1 -0
- package/dist/src/graphql/store/queries.js +29 -0
- package/dist/src/lib/accounting/index.d.ts +5 -0
- package/dist/src/lib/accounting/index.js +32 -0
- package/dist/src/lib/campaign/index.d.ts +20 -0
- package/dist/src/lib/campaign/index.js +218 -0
- package/dist/src/lib/cashbook/index.d.ts +6 -0
- package/dist/src/lib/cashbook/index.js +56 -0
- package/dist/src/lib/comhub/index.d.ts +6 -0
- package/dist/src/lib/comhub/index.js +50 -0
- package/dist/src/lib/deepLinkVietQr/index.d.ts +7 -0
- package/dist/src/lib/deepLinkVietQr/index.js +58 -0
- package/dist/src/lib/fileService/index.d.ts +34 -0
- package/dist/src/lib/fileService/index.js +80 -0
- package/dist/src/lib/getImage/index.d.ts +4 -0
- package/dist/src/lib/getImage/index.js +10 -0
- package/dist/src/lib/image/index.d.ts +7 -0
- package/dist/src/lib/image/index.js +49 -0
- package/dist/src/lib/omnigateway/index.d.ts +7 -0
- package/dist/src/lib/omnigateway/index.js +58 -0
- package/dist/src/lib/paymentV2/index.d.ts +18 -0
- package/dist/src/lib/paymentV2/index.js +245 -0
- package/dist/src/lib/portal/index.d.ts +23 -0
- package/dist/src/lib/portal/index.js +255 -0
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +16 -0
- package/dist/src/lib/shareZalo/index.d.ts +5 -0
- package/dist/src/lib/shareZalo/index.js +32 -0
- package/dist/src/lib/store/index.d.ts +30 -0
- package/dist/src/lib/store/index.js +74 -0
- package/dist/src/lib/token/index.d.ts +5 -0
- package/dist/src/lib/token/index.js +32 -0
- package/dist/src/lib/upload/index.d.ts +5 -0
- package/dist/src/lib/upload/index.js +35 -0
- package/dist/src/lib/warehouseV2/index.d.ts +13 -0
- package/dist/src/lib/warehouseV2/index.js +54 -0
- package/dist/src/lib/zca/index.d.ts +12 -0
- package/dist/src/lib/zca/index.js +41 -0
- package/dist/src/types/campaign.d.ts +14 -0
- package/dist/src/types/campaign.js +2 -0
- package/dist/src/types/common.d.ts +264 -0
- package/dist/src/types/common.js +35 -0
- package/dist/src/types/invoice.d.ts +13 -0
- package/dist/src/types/invoice.js +2 -0
- package/dist/src/types/portal.d.ts +7 -0
- package/dist/src/types/portal.js +2 -0
- package/dist/src/types/store.d.ts +158 -0
- package/dist/src/types/store.js +3 -0
- package/dist/src/utils/errorHandler.d.ts +64 -0
- package/dist/src/utils/errorHandler.js +197 -0
- package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
- package/dist/src/utils/validatePhoneNumber.js +20 -0
- package/package.json +1 -1
- package/dist/src/lib/service.d.ts +0 -14
- package/dist/src/lib/service.js +0 -101
- package/dist/src/utils/build-field-string.d.ts +0 -1
- package/dist/src/utils/build-field-string.js +0 -16
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
/**
|
3
|
+
* Service class for managing store-related operations.
|
4
|
+
*/
|
5
|
+
export declare class StoreService extends Service {
|
6
|
+
/**
|
7
|
+
* Constructs a new StoreService instance.
|
8
|
+
* @param endpoint - The endpoint URL for the service.
|
9
|
+
* @param orgId - The organization ID.
|
10
|
+
* @param storeId - The store ID.
|
11
|
+
*/
|
12
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
13
|
+
setToken(token: string): void;
|
14
|
+
/**
|
15
|
+
* Creates a store channel.
|
16
|
+
*
|
17
|
+
* @param storeChannelData - The data for creating the store channel.
|
18
|
+
* @returns A promise that resolves to the created store channel response.
|
19
|
+
* @throws If an error occurs while creating the store channel.
|
20
|
+
*/
|
21
|
+
createStoreChannel(storeChannelData: any): Promise<any>;
|
22
|
+
/**
|
23
|
+
* Gets available store channels for an employee.
|
24
|
+
*
|
25
|
+
* @param empId - The employee ID.
|
26
|
+
* @returns A promise that resolves to the available store channels.
|
27
|
+
* @throws If an error occurs while fetching the store channels.
|
28
|
+
*/
|
29
|
+
getAvailableStoreChannels(empId: string): Promise<any>;
|
30
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.StoreService = void 0;
|
13
|
+
// src/lib/store/index.ts
|
14
|
+
const serviceSDK_1 = require("../serviceSDK");
|
15
|
+
/**
|
16
|
+
* Service class for managing store-related operations.
|
17
|
+
*/
|
18
|
+
class StoreService extends serviceSDK_1.Service {
|
19
|
+
/**
|
20
|
+
* Constructs a new StoreService instance.
|
21
|
+
* @param endpoint - The endpoint URL for the service.
|
22
|
+
* @param orgId - The organization ID.
|
23
|
+
* @param storeId - The store ID.
|
24
|
+
*/
|
25
|
+
constructor(endpoint, orgId, storeId) {
|
26
|
+
super(endpoint, orgId, storeId);
|
27
|
+
}
|
28
|
+
setToken(token) {
|
29
|
+
this.token = token;
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Creates a store channel.
|
33
|
+
*
|
34
|
+
* @param storeChannelData - The data for creating the store channel.
|
35
|
+
* @returns A promise that resolves to the created store channel response.
|
36
|
+
* @throws If an error occurs while creating the store channel.
|
37
|
+
*/
|
38
|
+
createStoreChannel(storeChannelData) {
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
40
|
+
const endpoint = `/store-channels/${this.orgId}`;
|
41
|
+
const method = "POST";
|
42
|
+
try {
|
43
|
+
const response = yield this.restApiCallWithToken(endpoint, method, Object.assign(Object.assign({}, storeChannelData), { partyId: this.orgId }));
|
44
|
+
return response;
|
45
|
+
}
|
46
|
+
catch (error) {
|
47
|
+
console.log(`Error in createStoreChannel: ${error}`);
|
48
|
+
throw error;
|
49
|
+
}
|
50
|
+
});
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Gets available store channels for an employee.
|
54
|
+
*
|
55
|
+
* @param empId - The employee ID.
|
56
|
+
* @returns A promise that resolves to the available store channels.
|
57
|
+
* @throws If an error occurs while fetching the store channels.
|
58
|
+
*/
|
59
|
+
getAvailableStoreChannels(empId) {
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
61
|
+
const endpoint = `/store-channels/LONGVAN/available/${empId}`;
|
62
|
+
const method = "GET";
|
63
|
+
try {
|
64
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
65
|
+
return response;
|
66
|
+
}
|
67
|
+
catch (error) {
|
68
|
+
console.log(`Error in getAvailableStoreChannels: ${error}`);
|
69
|
+
throw error;
|
70
|
+
}
|
71
|
+
});
|
72
|
+
}
|
73
|
+
}
|
74
|
+
exports.StoreService = StoreService;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.AuthorizationService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class AuthorizationService extends serviceSDK_1.Service {
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
16
|
+
super(endpoint, orgId, storeId);
|
17
|
+
}
|
18
|
+
checkToken(orgId, token) {
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
20
|
+
const endpoint = `/${orgId}/oauth2/api/v1/token/${token}`;
|
21
|
+
const method = "GET";
|
22
|
+
try {
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
24
|
+
return response;
|
25
|
+
}
|
26
|
+
catch (error) {
|
27
|
+
throw error;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
}
|
32
|
+
exports.AuthorizationService = AuthorizationService;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.UploadService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class UploadService extends serviceSDK_1.Service {
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
16
|
+
super(endpoint, orgId, storeId);
|
17
|
+
}
|
18
|
+
uploadImage(imageCode) {
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
20
|
+
const endpoint = "";
|
21
|
+
const method = "POST";
|
22
|
+
try {
|
23
|
+
const formData = new FormData();
|
24
|
+
formData.append("uploadFile", imageCode);
|
25
|
+
formData.append("path", "public");
|
26
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, formData);
|
27
|
+
return response;
|
28
|
+
}
|
29
|
+
catch (error) {
|
30
|
+
throw error;
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
}
|
35
|
+
exports.UploadService = UploadService;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
export declare class WarehouseServiceV2 extends Service {
|
3
|
+
/**
|
4
|
+
* Constructs a new OrderService instance.
|
5
|
+
* @param endpoint - The endpoint URL for the service.
|
6
|
+
* @param orgId - The organization ID.
|
7
|
+
* @param storeId - The store ID.
|
8
|
+
*/
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
10
|
+
setToken(token: string): void;
|
11
|
+
getInventory(warehouseId: string, data: any[]): Promise<any>;
|
12
|
+
getInfoWarehouse(warehouseId: string): Promise<any>;
|
13
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.WarehouseServiceV2 = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class WarehouseServiceV2 extends serviceSDK_1.Service {
|
15
|
+
/**
|
16
|
+
* Constructs a new OrderService instance.
|
17
|
+
* @param endpoint - The endpoint URL for the service.
|
18
|
+
* @param orgId - The organization ID.
|
19
|
+
* @param storeId - The store ID.
|
20
|
+
*/
|
21
|
+
constructor(endpoint, orgId, storeId) {
|
22
|
+
super(endpoint, orgId, storeId);
|
23
|
+
}
|
24
|
+
setToken(token) {
|
25
|
+
this.token = token;
|
26
|
+
}
|
27
|
+
getInventory(warehouseId, data) {
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
29
|
+
const endpoint = `/public-facility/1.0.0/product-inventory-v3/${warehouseId}`;
|
30
|
+
const method = "POST";
|
31
|
+
try {
|
32
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
33
|
+
return response;
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
throw error;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
getInfoWarehouse(warehouseId) {
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
42
|
+
try {
|
43
|
+
const endpoint = `/facility/1.0.0/facility/${warehouseId}`;
|
44
|
+
const method = "GET";
|
45
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
46
|
+
return response;
|
47
|
+
}
|
48
|
+
catch (error) {
|
49
|
+
throw error;
|
50
|
+
}
|
51
|
+
});
|
52
|
+
}
|
53
|
+
}
|
54
|
+
exports.WarehouseServiceV2 = WarehouseServiceV2;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
export declare class ZcaService extends Service {
|
3
|
+
/**
|
4
|
+
* Constructs a new OrderService instance.
|
5
|
+
* @param endpoint - The endpoint URL for the service.
|
6
|
+
* @param orgId - The organization ID.
|
7
|
+
* @param storeId - The store ID.
|
8
|
+
*/
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
10
|
+
setToken(token: string): void;
|
11
|
+
loginQR(sessionId: string, appId: string): Promise<any>;
|
12
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.ZcaService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class ZcaService extends serviceSDK_1.Service {
|
15
|
+
/**
|
16
|
+
* Constructs a new OrderService instance.
|
17
|
+
* @param endpoint - The endpoint URL for the service.
|
18
|
+
* @param orgId - The organization ID.
|
19
|
+
* @param storeId - The store ID.
|
20
|
+
*/
|
21
|
+
constructor(endpoint, orgId, storeId) {
|
22
|
+
super(endpoint, orgId, storeId);
|
23
|
+
}
|
24
|
+
setToken(token) {
|
25
|
+
this.token = token;
|
26
|
+
}
|
27
|
+
loginQR(sessionId, appId) {
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
29
|
+
const endpoint = `/login?sessionId=${sessionId}&orgId=${this.orgId}&storeId=${this.storeId}&appId=${appId}`;
|
30
|
+
const method = "GET";
|
31
|
+
try {
|
32
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
33
|
+
return response;
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
throw error;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
}
|
41
|
+
exports.ZcaService = ZcaService;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export interface SearchVoucherRequest {
|
2
|
+
partyId: String;
|
3
|
+
voucherCodes: [String];
|
4
|
+
voucherCode: String;
|
5
|
+
voucherType: String;
|
6
|
+
campaignId: String;
|
7
|
+
campaignActionId: String;
|
8
|
+
customerId: String;
|
9
|
+
campaignActionType: String;
|
10
|
+
isBirthday: Boolean;
|
11
|
+
isPageAble: Boolean;
|
12
|
+
pageNumber: number;
|
13
|
+
pageSize: number;
|
14
|
+
}
|
@@ -0,0 +1,264 @@
|
|
1
|
+
/**
|
2
|
+
* Common types used across the SDK
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* Environment configuration
|
6
|
+
*/
|
7
|
+
export type Environment = 'dev' | 'live';
|
8
|
+
/**
|
9
|
+
* HTTP methods supported by REST API calls
|
10
|
+
*/
|
11
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
12
|
+
/**
|
13
|
+
* Pagination parameters
|
14
|
+
*/
|
15
|
+
export interface PaginationParams {
|
16
|
+
currentPage?: number;
|
17
|
+
maxResult?: number;
|
18
|
+
pageSize?: number;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Pagination response
|
22
|
+
*/
|
23
|
+
export interface PaginationResponse<T> {
|
24
|
+
total: number;
|
25
|
+
currentPage: number;
|
26
|
+
maxResult: number;
|
27
|
+
totalPage: number;
|
28
|
+
data: T[];
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Search parameters
|
32
|
+
*/
|
33
|
+
export interface SearchParams extends PaginationParams {
|
34
|
+
keyword?: string;
|
35
|
+
sortBy?: string;
|
36
|
+
sortOrder?: 'ASC' | 'DESC';
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* API Response wrapper
|
40
|
+
*/
|
41
|
+
export interface ApiResponse<T = any> {
|
42
|
+
success: boolean;
|
43
|
+
data?: T;
|
44
|
+
message?: string;
|
45
|
+
errors?: string[];
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* Service configuration
|
49
|
+
*/
|
50
|
+
export interface ServiceConfig {
|
51
|
+
endpoint: string;
|
52
|
+
orgId: string;
|
53
|
+
storeId: string;
|
54
|
+
token?: string;
|
55
|
+
}
|
56
|
+
/**
|
57
|
+
* GraphQL variables base interface
|
58
|
+
*/
|
59
|
+
export interface GraphQLVariables {
|
60
|
+
partnerId?: string;
|
61
|
+
storeChannel?: string;
|
62
|
+
[key: string]: any;
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* REST API headers
|
66
|
+
*/
|
67
|
+
export interface RestApiHeaders {
|
68
|
+
'Content-Type'?: string;
|
69
|
+
'Authorization'?: string;
|
70
|
+
'PartnerId'?: string;
|
71
|
+
'Partner-Id'?: string;
|
72
|
+
'X-Ecomos-Access-Token'?: string;
|
73
|
+
[key: string]: string | undefined;
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* File upload configuration
|
77
|
+
*/
|
78
|
+
export interface FileUploadConfig {
|
79
|
+
maxSize?: number;
|
80
|
+
allowedTypes?: string[];
|
81
|
+
multiple?: boolean;
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* Cache configuration
|
85
|
+
*/
|
86
|
+
export interface CacheConfig {
|
87
|
+
ttl?: number;
|
88
|
+
maxSize?: number;
|
89
|
+
enabled?: boolean;
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Retry configuration
|
93
|
+
*/
|
94
|
+
export interface RetryConfig {
|
95
|
+
maxRetries?: number;
|
96
|
+
baseDelay?: number;
|
97
|
+
maxDelay?: number;
|
98
|
+
exponentialBackoff?: boolean;
|
99
|
+
}
|
100
|
+
/**
|
101
|
+
* SDK Configuration
|
102
|
+
*/
|
103
|
+
export interface SDKConfig {
|
104
|
+
orgId: string;
|
105
|
+
storeId: string;
|
106
|
+
environment: Environment;
|
107
|
+
cache?: CacheConfig;
|
108
|
+
retry?: RetryConfig;
|
109
|
+
timeout?: number;
|
110
|
+
}
|
111
|
+
/**
|
112
|
+
* Service method options
|
113
|
+
*/
|
114
|
+
export interface ServiceMethodOptions {
|
115
|
+
timeout?: number;
|
116
|
+
retry?: RetryConfig;
|
117
|
+
cache?: boolean;
|
118
|
+
headers?: RestApiHeaders;
|
119
|
+
}
|
120
|
+
/**
|
121
|
+
* Base entity interface
|
122
|
+
*/
|
123
|
+
export interface BaseEntity {
|
124
|
+
id: string;
|
125
|
+
createdAt?: string;
|
126
|
+
updatedAt?: string;
|
127
|
+
createdBy?: string;
|
128
|
+
updatedBy?: string;
|
129
|
+
}
|
130
|
+
/**
|
131
|
+
* Address interface
|
132
|
+
*/
|
133
|
+
export interface Address {
|
134
|
+
street?: string;
|
135
|
+
city?: string;
|
136
|
+
state?: string;
|
137
|
+
country?: string;
|
138
|
+
postalCode?: string;
|
139
|
+
fullAddress?: string;
|
140
|
+
}
|
141
|
+
/**
|
142
|
+
* Contact information
|
143
|
+
*/
|
144
|
+
export interface ContactInfo {
|
145
|
+
email?: string;
|
146
|
+
phone?: string;
|
147
|
+
website?: string;
|
148
|
+
}
|
149
|
+
/**
|
150
|
+
* Money/Price interface
|
151
|
+
*/
|
152
|
+
export interface Money {
|
153
|
+
amount: number;
|
154
|
+
currency?: string;
|
155
|
+
formatted?: string;
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Image interface
|
159
|
+
*/
|
160
|
+
export interface Image {
|
161
|
+
id?: string;
|
162
|
+
url: string;
|
163
|
+
alt?: string;
|
164
|
+
width?: number;
|
165
|
+
height?: number;
|
166
|
+
size?: number;
|
167
|
+
}
|
168
|
+
/**
|
169
|
+
* Category interface
|
170
|
+
*/
|
171
|
+
export interface Category extends BaseEntity {
|
172
|
+
title: string;
|
173
|
+
handle?: string;
|
174
|
+
description?: string;
|
175
|
+
image?: string;
|
176
|
+
icon?: string;
|
177
|
+
parentId?: string;
|
178
|
+
level?: number;
|
179
|
+
children?: Category[];
|
180
|
+
}
|
181
|
+
/**
|
182
|
+
* Tag interface
|
183
|
+
*/
|
184
|
+
export interface Tag {
|
185
|
+
id: string;
|
186
|
+
name: string;
|
187
|
+
color?: string;
|
188
|
+
}
|
189
|
+
/**
|
190
|
+
* Attribute interface
|
191
|
+
*/
|
192
|
+
export interface Attribute {
|
193
|
+
name: string;
|
194
|
+
value: string;
|
195
|
+
type?: string;
|
196
|
+
}
|
197
|
+
/**
|
198
|
+
* Unit interface
|
199
|
+
*/
|
200
|
+
export interface Unit {
|
201
|
+
id: string;
|
202
|
+
name: string;
|
203
|
+
symbol?: string;
|
204
|
+
}
|
205
|
+
/**
|
206
|
+
* Status enum
|
207
|
+
*/
|
208
|
+
export declare enum Status {
|
209
|
+
ACTIVE = "ACTIVE",
|
210
|
+
INACTIVE = "INACTIVE",
|
211
|
+
PENDING = "PENDING",
|
212
|
+
DRAFT = "DRAFT",
|
213
|
+
PUBLISHED = "PUBLISHED",
|
214
|
+
ARCHIVED = "ARCHIVED"
|
215
|
+
}
|
216
|
+
/**
|
217
|
+
* Gender enum
|
218
|
+
*/
|
219
|
+
export declare enum Gender {
|
220
|
+
MALE = "MALE",
|
221
|
+
FEMALE = "FEMALE",
|
222
|
+
OTHER = "OTHER"
|
223
|
+
}
|
224
|
+
/**
|
225
|
+
* Sort order enum
|
226
|
+
*/
|
227
|
+
export declare enum SortOrder {
|
228
|
+
ASC = "ASC",
|
229
|
+
DESC = "DESC"
|
230
|
+
}
|
231
|
+
/**
|
232
|
+
* Utility type for making all properties optional
|
233
|
+
*/
|
234
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
235
|
+
/**
|
236
|
+
* Utility type for making all properties required
|
237
|
+
*/
|
238
|
+
export type RequiredBy<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
239
|
+
/**
|
240
|
+
* Utility type for nullable properties
|
241
|
+
*/
|
242
|
+
export type Nullable<T> = T | null;
|
243
|
+
/**
|
244
|
+
* Utility type for optional properties
|
245
|
+
*/
|
246
|
+
export type Optional<T> = T | undefined;
|
247
|
+
/**
|
248
|
+
* Deep partial type
|
249
|
+
*/
|
250
|
+
export type DeepPartial<T> = {
|
251
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
252
|
+
};
|
253
|
+
/**
|
254
|
+
* Promise result type
|
255
|
+
*/
|
256
|
+
export type PromiseResult<T> = Promise<T>;
|
257
|
+
/**
|
258
|
+
* Callback function type
|
259
|
+
*/
|
260
|
+
export type Callback<T = void> = (error?: Error, result?: T) => void;
|
261
|
+
/**
|
262
|
+
* Event handler type
|
263
|
+
*/
|
264
|
+
export type EventHandler<T = any> = (event: T) => void;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* Common types used across the SDK
|
4
|
+
*/
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.SortOrder = exports.Gender = exports.Status = void 0;
|
7
|
+
/**
|
8
|
+
* Status enum
|
9
|
+
*/
|
10
|
+
var Status;
|
11
|
+
(function (Status) {
|
12
|
+
Status["ACTIVE"] = "ACTIVE";
|
13
|
+
Status["INACTIVE"] = "INACTIVE";
|
14
|
+
Status["PENDING"] = "PENDING";
|
15
|
+
Status["DRAFT"] = "DRAFT";
|
16
|
+
Status["PUBLISHED"] = "PUBLISHED";
|
17
|
+
Status["ARCHIVED"] = "ARCHIVED";
|
18
|
+
})(Status || (exports.Status = Status = {}));
|
19
|
+
/**
|
20
|
+
* Gender enum
|
21
|
+
*/
|
22
|
+
var Gender;
|
23
|
+
(function (Gender) {
|
24
|
+
Gender["MALE"] = "MALE";
|
25
|
+
Gender["FEMALE"] = "FEMALE";
|
26
|
+
Gender["OTHER"] = "OTHER";
|
27
|
+
})(Gender || (exports.Gender = Gender = {}));
|
28
|
+
/**
|
29
|
+
* Sort order enum
|
30
|
+
*/
|
31
|
+
var SortOrder;
|
32
|
+
(function (SortOrder) {
|
33
|
+
SortOrder["ASC"] = "ASC";
|
34
|
+
SortOrder["DESC"] = "DESC";
|
35
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface VatInvoiceRequestDTO {
|
2
|
+
sourceId: String;
|
3
|
+
sourceType: String;
|
4
|
+
signType: String;
|
5
|
+
includeBuyerTaxCode: Boolean;
|
6
|
+
buyerName: String;
|
7
|
+
buyerTaxCode: String;
|
8
|
+
buyerCompany: String;
|
9
|
+
buyerAddress: String;
|
10
|
+
sendMail: Boolean;
|
11
|
+
receiverName: String;
|
12
|
+
receiverEmail: String;
|
13
|
+
}
|