@longvansoftware/storefront-js-client 0.0.2 → 1.0.3

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 (42) hide show
  1. package/README.md +93 -93
  2. package/dist/config/config.d.ts +16 -0
  3. package/dist/config/config.js +19 -0
  4. package/dist/src/graphql/auth/mutations.d.ts +7 -0
  5. package/dist/src/graphql/auth/mutations.js +99 -0
  6. package/dist/src/graphql/crm/mutations.d.ts +0 -0
  7. package/dist/src/graphql/crm/mutations.js +1 -0
  8. package/dist/src/graphql/crm/queries.d.ts +0 -0
  9. package/dist/src/graphql/crm/queries.js +1 -0
  10. package/dist/src/graphql/product/mutations.d.ts +0 -0
  11. package/dist/src/graphql/product/mutations.js +1 -0
  12. package/dist/src/graphql/product/queries.d.ts +9 -0
  13. package/dist/src/graphql/product/queries.js +394 -0
  14. package/dist/src/graphql/user/queries.d.ts +1 -0
  15. package/dist/src/graphql/user/queries.js +33 -0
  16. package/dist/src/index.d.ts +1 -0
  17. package/dist/src/index.js +5 -0
  18. package/dist/src/lib/SDK.d.ts +23 -0
  19. package/dist/src/lib/SDK.js +38 -0
  20. package/dist/src/lib/auth/index.d.ts +26 -0
  21. package/dist/src/lib/auth/index.js +54 -0
  22. package/dist/src/lib/crm/index.d.ts +0 -0
  23. package/dist/src/lib/crm/index.js +1 -0
  24. package/dist/src/lib/order/index.d.ts +78 -0
  25. package/dist/src/lib/order/index.js +187 -0
  26. package/dist/src/lib/product/index.d.ts +35 -0
  27. package/dist/src/lib/product/index.js +98 -0
  28. package/dist/src/lib/service.d.ts +14 -0
  29. package/dist/src/lib/service.js +97 -0
  30. package/dist/src/lib/user/index.d.ts +5 -0
  31. package/dist/src/lib/user/index.js +34 -0
  32. package/dist/src/types/auth.d.ts +82 -0
  33. package/dist/src/types/auth.js +2 -0
  34. package/dist/src/types/crm.d.ts +0 -0
  35. package/dist/src/types/crm.js +1 -0
  36. package/dist/src/types/order.d.ts +7 -0
  37. package/dist/src/types/order.js +2 -0
  38. package/dist/src/types/product.d.ts +61 -0
  39. package/dist/src/types/product.js +2 -0
  40. package/dist/src/utils/helpers.d.ts +4 -0
  41. package/dist/src/utils/helpers.js +40 -0
  42. package/package.json +40 -36
@@ -0,0 +1,187 @@
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.OrderService = void 0;
13
+ const service_1 = require("../service");
14
+ /**
15
+ * Represents a service for managing orders.
16
+ */
17
+ class OrderService extends service_1.Service {
18
+ /**
19
+ * Constructs a new OrderService instance.
20
+ * @param endpoint - The endpoint URL for the service.
21
+ * @param orgId - The organization ID.
22
+ * @param storeId - The store ID.
23
+ */
24
+ constructor(endpoint, orgId, storeId) {
25
+ super(endpoint, orgId, storeId);
26
+ }
27
+ /**
28
+ * Creates a new order.
29
+ * @param orderData - The data for the order.
30
+ * @param platform - The platform for the order.
31
+ * @param createDraft - Indicates whether to create a draft order.
32
+ * @returns A promise that resolves with the created order.
33
+ * @throws If an error occurs while creating the order.
34
+ */
35
+ createOrder(orderData, platform, createDraft) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const endpoint = `/orders/${this.orgId}/${this.storeId}/${platform}?create_draft=${createDraft}`; // Replace with your actual endpoint
38
+ const method = "POST";
39
+ try {
40
+ const response = yield this.restApiCallWithToken(endpoint, method, orderData);
41
+ return response;
42
+ }
43
+ catch (error) {
44
+ console.log(`Error in createOrder: ${error}`);
45
+ throw error;
46
+ }
47
+ });
48
+ }
49
+ /**
50
+ * Completes multiple orders.
51
+ * @param orderIds - The IDs of the orders to complete.
52
+ * @returns A promise that resolves when the orders are completed.
53
+ * @throws If an error occurs while completing the orders.
54
+ */
55
+ completeOrder(orderIds) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const endpoint = `/orders/${this.orgId}/${this.storeId}/complete?order_ids=${orderIds.join(",")}`; // Replace with your actual endpoint
58
+ const method = "PUT";
59
+ try {
60
+ const response = yield this.restApiCallWithToken(endpoint, method);
61
+ return response;
62
+ }
63
+ catch (error) {
64
+ console.log(`Error in completeOrder: ${error}`);
65
+ throw error;
66
+ }
67
+ });
68
+ }
69
+ /**
70
+ * Adds a voucher to an order.
71
+ * @param orderId - The ID of the order.
72
+ * @param voucherCode - The voucher code.
73
+ * @returns A promise that resolves when the voucher is added.
74
+ * @throws If an error occurs while adding the voucher.
75
+ */
76
+ addVoucher(orderId, voucherCode) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const endpoint = `/orders/${this.orgId}/${orderId}/voucher/${voucherCode}`;
79
+ const method = "POST";
80
+ try {
81
+ const response = yield this.restApiCallWithToken(endpoint, method);
82
+ return response;
83
+ }
84
+ catch (error) {
85
+ console.log(`Error in addVoucher: ${error}`);
86
+ throw error;
87
+ }
88
+ });
89
+ }
90
+ /**
91
+ * Removes a voucher from an order.
92
+ * @param orderId - The ID of the order.
93
+ * @param voucherCode - The voucher code.
94
+ * @returns A promise that resolves when the voucher is removed.
95
+ * @throws If an error occurs while removing the voucher.
96
+ */
97
+ removeVoucher(orderId, voucherCode) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ const endpoint = `/orders/${this.orgId}/${orderId}/voucher/${voucherCode}`;
100
+ const method = "DELETE";
101
+ try {
102
+ const response = yield this.restApiCallWithToken(endpoint, method);
103
+ return response;
104
+ }
105
+ catch (error) {
106
+ console.log(`Error in removeVoucher: ${error}`);
107
+ throw error;
108
+ }
109
+ });
110
+ }
111
+ /**
112
+ * Updates the VAT (Value Added Tax) for an order.
113
+ * @param orderId - The ID of the order.
114
+ * @param vatFee - The VAT fee.
115
+ * @param vatType - The VAT type. (e.g., VALUE_GOODS, PRODUCT, etc. )
116
+ * @returns A promise that resolves when the VAT is updated.
117
+ * @throws If an error occurs while updating the VAT.
118
+ */
119
+ updateVAT(orderId, vatFee, vatType) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const endpoint = `/v2/orders/${this.orgId}/${orderId}/vat?vat_fee=${vatFee}&vat_type=${vatType}`;
122
+ const method = "PUT";
123
+ try {
124
+ const response = yield this.restApiCallWithToken(endpoint, method);
125
+ return response;
126
+ }
127
+ catch (error) {
128
+ console.log(`Error in updateVAT: ${error}`);
129
+ throw error;
130
+ }
131
+ });
132
+ }
133
+ /**
134
+ * Updates the customer and shipping address for an order.
135
+ * @param orderId - The ID of the order.
136
+ * @param customerData - The data for the customer.
137
+ * @param shippingAddress - The shipping address.
138
+ * @returns A promise that resolves when the customer and shipping address are updated.
139
+ * @throws If an error occurs while updating the customer and shipping address.
140
+ */
141
+ updateCustomerAndShippingAddress(orderId, customerData, shippingAddress) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const endpoint = `/orders/FOX/${orderId}/customer`;
144
+ const method = "PUT";
145
+ const requestData = {
146
+ customer: customerData,
147
+ shipping_address: shippingAddress,
148
+ };
149
+ try {
150
+ const response = yield this.restApiCallWithToken(endpoint, method, requestData);
151
+ return response;
152
+ }
153
+ catch (error) {
154
+ console.log(`Error in updateCustomerAndShippingAddress: ${error}`);
155
+ throw error;
156
+ }
157
+ });
158
+ }
159
+ /**
160
+ * Retrieves the order line items for a specific order.
161
+ * @param partnerId - The partner ID.
162
+ * @returns A promise that resolves with the order line items.
163
+ * @throws If an error occurs while retrieving the order line items.
164
+ */
165
+ /**
166
+ * Adds order line items to an order.
167
+ * @param orderId - The ID of the order.
168
+ * @param lineItems - The line items to add.
169
+ * @returns A promise that resolves when the line items are added.
170
+ * @throws If an error occurs while adding the line items.
171
+ */
172
+ addOrderLineItems(orderId, lineItems) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ const endpoint = `/v2/orders/${this.orgId}/${this.storeId}/${orderId}/orderLineItem`;
175
+ const method = "POST";
176
+ try {
177
+ const response = yield this.restApiCallWithToken(endpoint, method, lineItems);
178
+ return response;
179
+ }
180
+ catch (error) {
181
+ console.log(`Error in addOrderLineItems: ${error}`);
182
+ throw error;
183
+ }
184
+ });
185
+ }
186
+ }
187
+ exports.OrderService = OrderService;
@@ -0,0 +1,35 @@
1
+ import { Service } from "../service";
2
+ import { Product } from "../../types/product";
3
+ /**
4
+ * Service class for managing product-related operations.
5
+ */
6
+ export declare class ProductService extends Service {
7
+ /**
8
+ * Constructs a new ProductService instance.
9
+ * @param endpoint - The endpoint URL for the service.
10
+ * @param orgId - The organization ID.
11
+ * @param storeId - The store ID.
12
+ */
13
+ constructor(endpoint: string, orgId: string, storeId: string);
14
+ /**
15
+ * Retrieves a product by its ID.
16
+ * @param productId - The ID of the product.
17
+ * @returns A promise that resolves to the product.
18
+ * @throws If an error occurs while fetching the product.
19
+ */
20
+ getProductById(productId: string): Promise<any>;
21
+ /**
22
+ * Retrieves a product by its slug.
23
+ * @param slug - The slug of the product.
24
+ * @returns A promise that resolves to the product.
25
+ * @throws If an error occurs while fetching the product.
26
+ */
27
+ getProductBySlug(slug: string): Promise<Product>;
28
+ /**
29
+ * Retrieves simple products based on the provided variables.
30
+ * @param variables - The variables for the query.
31
+ * @returns A promise that resolves to the simple products.
32
+ * @throws If an error occurs while fetching the simple products.
33
+ */
34
+ getSimpleProducts(variables: any): Promise<Product[] | null>;
35
+ }
@@ -0,0 +1,98 @@
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.ProductService = void 0;
13
+ const service_1 = require("../service");
14
+ const queries_1 = require("../../graphql/product/queries");
15
+ /**
16
+ * Service class for managing product-related operations.
17
+ */
18
+ class ProductService extends service_1.Service {
19
+ /**
20
+ * Constructs a new ProductService 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
+ // ...
29
+ /**
30
+ * Retrieves a product by its ID.
31
+ * @param productId - The ID of the product.
32
+ * @returns A promise that resolves to the product.
33
+ * @throws If an error occurs while fetching the product.
34
+ */
35
+ getProductById(productId) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const query = queries_1.GET_PRODUCT_BY_ID_QUERY;
38
+ const variables = {
39
+ partnerId: this.orgId,
40
+ storeChannel: this.storeId,
41
+ productId,
42
+ };
43
+ try {
44
+ const response = yield this.graphqlQuery(query, variables);
45
+ return response.getProductById;
46
+ }
47
+ catch (error) {
48
+ console.log(`Error fetching product by ID: ${error}`);
49
+ throw error;
50
+ }
51
+ });
52
+ }
53
+ /**
54
+ * Retrieves a product by its slug.
55
+ * @param slug - The slug of the product.
56
+ * @returns A promise that resolves to the product.
57
+ * @throws If an error occurs while fetching the product.
58
+ */
59
+ getProductBySlug(slug) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const query = queries_1.GET_PRODUCT_BY_SLUG_QUERY;
62
+ const variables = {
63
+ partnerId: this.orgId,
64
+ storeChannel: this.storeId,
65
+ handle: slug,
66
+ };
67
+ try {
68
+ const response = yield this.graphqlQuery(query, variables);
69
+ return response.getProductByHandle;
70
+ }
71
+ catch (error) {
72
+ console.log(`Error fetching product by slug: ${error}`);
73
+ throw error;
74
+ }
75
+ });
76
+ }
77
+ /**
78
+ * Retrieves simple products based on the provided variables.
79
+ * @param variables - The variables for the query.
80
+ * @returns A promise that resolves to the simple products.
81
+ * @throws If an error occurs while fetching the simple products.
82
+ */
83
+ getSimpleProducts(variables) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const query = queries_1.GET_SIMPLE_PRODUCTS_QUERY;
86
+ const variablesHandle = Object.assign({ partnerId: this.orgId, storeChannel: this.storeId }, variables);
87
+ try {
88
+ const response = yield this.graphqlQuery(query, variablesHandle);
89
+ return response.getSimpleProducts;
90
+ }
91
+ catch (error) {
92
+ console.log(`Error fetching simple products: ${error}`);
93
+ throw error;
94
+ }
95
+ });
96
+ }
97
+ }
98
+ exports.ProductService = ProductService;
@@ -0,0 +1,14 @@
1
+ import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
2
+ import { DocumentNode } from "graphql";
3
+ export declare class Service {
4
+ protected token: string | null;
5
+ protected client: ApolloClient<NormalizedCacheObject>;
6
+ protected orgId: string;
7
+ protected storeId: string;
8
+ protected endpoint: string;
9
+ constructor(endpoint: string, orgId: string, storeId: string);
10
+ setToken(token: string): void;
11
+ protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
12
+ protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
13
+ protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
14
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ // src/service.ts
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Service = void 0;
17
+ const client_1 = require("@apollo/client");
18
+ const axios_1 = __importDefault(require("axios"));
19
+ class Service {
20
+ constructor(endpoint, orgId, storeId) {
21
+ this.token = null;
22
+ this.client = new client_1.ApolloClient({
23
+ uri: endpoint,
24
+ cache: new client_1.InMemoryCache(),
25
+ defaultOptions: {
26
+ query: {
27
+ fetchPolicy: "network-only",
28
+ },
29
+ },
30
+ });
31
+ this.orgId = orgId;
32
+ this.storeId = storeId;
33
+ this.endpoint = endpoint;
34
+ }
35
+ setToken(token) {
36
+ this.token = token;
37
+ }
38
+ graphqlQuery(query, variables) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ try {
41
+ const { data, errors } = yield this.client.query({
42
+ query: (0, client_1.gql) `
43
+ ${query}
44
+ `,
45
+ variables,
46
+ });
47
+ if (errors) {
48
+ throw new Error(`GraphQL error! errors: ${errors}`);
49
+ }
50
+ return data;
51
+ }
52
+ catch (error) {
53
+ console.log(`Error in graphqlQuery: ${error}`);
54
+ throw error;
55
+ }
56
+ });
57
+ }
58
+ graphqlMutation(mutation, variables) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ try {
61
+ const { data, errors } = yield this.client.mutate({
62
+ mutation: (0, client_1.gql) `
63
+ ${mutation}
64
+ `,
65
+ variables,
66
+ });
67
+ if (errors) {
68
+ throw new Error(`GraphQL error! errors: ${errors}`);
69
+ }
70
+ return data;
71
+ }
72
+ catch (error) {
73
+ console.log(`Error in graphqlMutation: ${error}`);
74
+ throw error;
75
+ }
76
+ });
77
+ }
78
+ restApiCallWithToken(path, method, data, headers) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ try {
81
+ const modifiedHeaders = Object.assign(Object.assign({}, headers), { "Partner-Id": this.orgId, "X-Ecomos-Access-Token": this.token });
82
+ const response = yield (0, axios_1.default)({
83
+ url: this.endpoint + path,
84
+ method,
85
+ data,
86
+ headers: modifiedHeaders,
87
+ });
88
+ return response.data;
89
+ }
90
+ catch (error) {
91
+ console.log(`Error in restApiCall: ${error}`);
92
+ throw error;
93
+ }
94
+ });
95
+ }
96
+ }
97
+ exports.Service = Service;
@@ -0,0 +1,5 @@
1
+ import { Service } from '../service';
2
+ export declare class UserService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ getPersonByPartyIds(partyIds: string[]): Promise<any>;
5
+ }
@@ -0,0 +1,34 @@
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.UserService = void 0;
13
+ const service_1 = require("../service");
14
+ const queries_1 = require("../../graphql/user/queries");
15
+ class UserService extends service_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ getPersonByPartyIds(partyIds) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const query = queries_1.GET_PERSON_BY_IDS_QUERY;
22
+ const variables = { partyIds };
23
+ try {
24
+ const response = yield this.graphqlQuery(query, variables);
25
+ return response.getPersonByPartyIds;
26
+ }
27
+ catch (error) {
28
+ console.log(`Error in getPersonByPartyIds: ${error}`);
29
+ throw error;
30
+ }
31
+ });
32
+ }
33
+ }
34
+ exports.UserService = UserService;
@@ -0,0 +1,82 @@
1
+ export interface LoginRequest {
2
+ username: string;
3
+ password: string;
4
+ }
5
+ export interface LoginResponse {
6
+ partyId: string;
7
+ orgId: string;
8
+ fullName: string;
9
+ email: string;
10
+ phone: string;
11
+ address: string;
12
+ identityNumber: string;
13
+ gender: string;
14
+ birthDate: string;
15
+ avatarUrl: string;
16
+ accessToken: string;
17
+ username: string;
18
+ orgPermissionsMap: Record<string, any>;
19
+ orgPositionsMap: Record<string, any>;
20
+ orgRolesMap: Record<string, any>;
21
+ }
22
+ export interface RegisterRequest {
23
+ username: string;
24
+ fullName: string;
25
+ password: string;
26
+ userIP: string;
27
+ }
28
+ export interface RegisterResponse {
29
+ id: string;
30
+ partyId: string;
31
+ type: string;
32
+ username: string;
33
+ status: string;
34
+ accessToken: string;
35
+ }
36
+ export interface SendSmsVerifyCodeResponse {
37
+ id: string;
38
+ code: string;
39
+ username: string;
40
+ timeExpired: string;
41
+ }
42
+ export interface SmsVerifyCodeRequest {
43
+ username: string;
44
+ code: string;
45
+ }
46
+ export interface ResetPasswordRequest {
47
+ username: string;
48
+ newPassword: string;
49
+ accessToken: string;
50
+ }
51
+ export interface ResetPasswordResponse {
52
+ success: boolean;
53
+ }
54
+ export interface UpdateInfoRequest {
55
+ orgId?: string | null;
56
+ accessToken?: string | null;
57
+ updateUserRequest: {
58
+ fullName?: string | null;
59
+ address?: string | null;
60
+ gender?: string | null;
61
+ birthDateLongTime?: string | null;
62
+ birthDate?: string | null;
63
+ email?: string | null;
64
+ identityNumber?: string | null;
65
+ phone?: string | null;
66
+ imageUrl?: string | null;
67
+ personalTitle?: string | null;
68
+ };
69
+ type?: string | null;
70
+ password?: string | null;
71
+ }
72
+ export interface UpdateInfoResponse {
73
+ partyId: string;
74
+ fullName: string;
75
+ email: string;
76
+ phone: string;
77
+ address: string;
78
+ identityNumber: string;
79
+ gender: string;
80
+ birthDate: string;
81
+ avatarUrl: string;
82
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,7 @@
1
+ export interface LineItem {
2
+ quantity: number;
3
+ parent_id: string;
4
+ product_id: string;
5
+ input_price: number;
6
+ discount_amount: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,61 @@
1
+ export interface Product {
2
+ id: string;
3
+ title: string;
4
+ description: string;
5
+ sku: string;
6
+ price: number;
7
+ available: boolean;
8
+ categories: Category[];
9
+ }
10
+ export interface Category {
11
+ id: string;
12
+ title: string;
13
+ image: string;
14
+ icon: string;
15
+ parentId: string | null;
16
+ level: number;
17
+ sequence: number;
18
+ handle: string;
19
+ }
20
+ export interface ProductFilterOptions {
21
+ partnerId?: string;
22
+ storeChannel?: string;
23
+ category?: string;
24
+ product?: string;
25
+ sku?: string;
26
+ tag?: string;
27
+ priceFrom?: number;
28
+ priceTo?: number;
29
+ status?: string;
30
+ productType?: string;
31
+ subType?: string;
32
+ brandId?: string;
33
+ keyword?: string;
34
+ display?: boolean;
35
+ onlyPromotion?: boolean;
36
+ currentPage?: number;
37
+ maxResult?: number;
38
+ }
39
+ export interface CategoryFilterOptions {
40
+ partnerId?: string;
41
+ storeChannel?: string;
42
+ typeBuild?: string;
43
+ level?: number;
44
+ }
45
+ export interface Category {
46
+ id: string;
47
+ title: string;
48
+ image: string;
49
+ icon: string;
50
+ parentId: string | null;
51
+ level: number;
52
+ sequence: number;
53
+ handle: string;
54
+ child?: Category[];
55
+ }
56
+ export interface Brand {
57
+ id: string;
58
+ name: string;
59
+ image: string;
60
+ imageIcon: string;
61
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { Endpoints } from "../lib/SDK";
2
+ export declare function createToken(environment: string): string;
3
+ export declare function decodeToken(token: string): string | null;
4
+ export declare function validateStorefrontAccessToken(storefrontAccessToken: string): Endpoints;