@longvansoftware/storefront-js-client 0.0.3 → 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 (62) 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/{constants/graphql/mutations/authorizationMutations.js → src/graphql/auth/mutations.js} +88 -88
  5. package/dist/src/graphql/crm/mutations.d.ts +0 -0
  6. package/dist/src/graphql/crm/mutations.js +1 -0
  7. package/dist/src/graphql/crm/queries.d.ts +0 -0
  8. package/dist/src/graphql/crm/queries.js +1 -0
  9. package/dist/src/graphql/product/mutations.d.ts +0 -0
  10. package/dist/src/graphql/product/mutations.js +1 -0
  11. package/dist/{constants/graphql/queries/productQueries.d.ts → src/graphql/product/queries.d.ts} +1 -1
  12. package/dist/src/graphql/product/queries.js +394 -0
  13. package/dist/src/graphql/user/queries.d.ts +1 -0
  14. package/dist/src/graphql/user/queries.js +33 -0
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/index.js +5 -0
  17. package/dist/src/lib/SDK.d.ts +23 -0
  18. package/dist/src/lib/SDK.js +38 -0
  19. package/dist/src/lib/auth/index.d.ts +26 -0
  20. package/dist/src/lib/auth/index.js +54 -0
  21. package/dist/src/lib/crm/index.d.ts +0 -0
  22. package/dist/src/lib/crm/index.js +1 -0
  23. package/dist/src/lib/order/index.d.ts +78 -0
  24. package/dist/src/lib/order/index.js +187 -0
  25. package/dist/src/lib/product/index.d.ts +35 -0
  26. package/dist/src/lib/product/index.js +98 -0
  27. package/dist/src/lib/service.d.ts +14 -0
  28. package/dist/src/lib/service.js +97 -0
  29. package/dist/src/lib/user/index.d.ts +5 -0
  30. package/dist/src/lib/user/index.js +34 -0
  31. package/dist/src/types/crm.d.ts +0 -0
  32. package/dist/src/types/crm.js +1 -0
  33. package/dist/src/types/order.d.ts +7 -0
  34. package/dist/src/utils/helpers.d.ts +4 -0
  35. package/dist/src/utils/helpers.js +40 -0
  36. package/package.json +40 -36
  37. package/dist/constants/graphql/mutations/crmMutations.d.ts +0 -8
  38. package/dist/constants/graphql/mutations/crmMutations.js +0 -368
  39. package/dist/constants/graphql/mutations/userMutations.d.ts +0 -4
  40. package/dist/constants/graphql/mutations/userMutations.js +0 -116
  41. package/dist/constants/graphql/queries/crmQueries.d.ts +0 -1
  42. package/dist/constants/graphql/queries/crmQueries.js +0 -45
  43. package/dist/constants/graphql/queries/productQueries.js +0 -368
  44. package/dist/constants/interfaces/crm.d.ts +0 -218
  45. package/dist/constants/interfaces/user.d.ts +0 -49
  46. package/dist/constants/interfaces/user.js +0 -2
  47. package/dist/index.d.ts +0 -19
  48. package/dist/index.js +0 -17
  49. package/dist/modules/authorization/graphql.d.ts +0 -15
  50. package/dist/modules/authorization/graphql.js +0 -116
  51. package/dist/modules/crm/graphql.d.ts +0 -19
  52. package/dist/modules/crm/graphql.js +0 -291
  53. package/dist/modules/product/graphql.d.ts +0 -19
  54. package/dist/modules/product/graphql.js +0 -180
  55. package/dist/modules/user/graphql.d.ts +0 -14
  56. package/dist/modules/user/graphql.js +0 -156
  57. /package/dist/{constants/graphql/mutations/authorizationMutations.d.ts → src/graphql/auth/mutations.d.ts} +0 -0
  58. /package/dist/{constants/interfaces/authorization.d.ts → src/types/auth.d.ts} +0 -0
  59. /package/dist/{constants/interfaces/authorization.js → src/types/auth.js} +0 -0
  60. /package/dist/{constants/interfaces/crm.js → src/types/order.js} +0 -0
  61. /package/dist/{constants/interfaces → src/types}/product.d.ts +0 -0
  62. /package/dist/{constants/interfaces → src/types}/product.js +0 -0
@@ -1,368 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
4
- const graphql_tag_1 = require("graphql-tag");
5
- exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
6
- query GetProductById(
7
- $partnerId: String!
8
- $storeChannel: String!
9
- $productId: String!
10
- ) {
11
- getProductById(
12
- partnerId: $partnerId
13
- storeChannel: $storeChannel
14
- productId: $productId
15
- ) {
16
- title
17
- id
18
- description
19
- sku
20
- shortDescription
21
- weight
22
- width
23
- height
24
- vat
25
- unit
26
- qualify
27
- parentId
28
- handle
29
- price
30
- priceVaries
31
- available
32
- options
33
- compareAtPrice
34
- featuredImage
35
- images
36
- createdAt
37
- favorite
38
- productAttributes {
39
- id
40
- productId
41
- attributeName
42
- attributeValue
43
- }
44
- variants {
45
- id
46
- handle
47
- title
48
- price
49
- weight
50
- width
51
- depth
52
- height
53
- compareAtPrice
54
- available
55
- option1
56
- option2
57
- option3
58
- options
59
- weightUnit
60
- optionsIds
61
- featuredImage
62
- sku
63
- qualify
64
- featureTypeDTOS {
65
- id
66
- name
67
- position
68
- values
69
- required
70
- valuesFull
71
- enable
72
- }
73
- }
74
- featureTypes {
75
- id
76
- name
77
- position
78
- values
79
- required
80
- valuesFull
81
- enable
82
- }
83
- categories {
84
- id
85
- title
86
- handle
87
- description
88
- }
89
- }
90
- }
91
- `;
92
- exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
93
- query GetProductByHandle(
94
- $partnerId: String!
95
- $storeChannel: String!
96
- $productId: String!
97
- ) {
98
- getProductByHandle(
99
- partnerId: $partnerId
100
- storeChannel: $storeChannel
101
- productId: $productId
102
- ) {
103
- title
104
- id
105
- description
106
- sku
107
- shortDescription
108
- weight
109
- width
110
- height
111
- vat
112
- unit
113
- qualify
114
- parentId
115
- handle
116
- price
117
- priceVaries
118
- available
119
- options
120
- compareAtPrice
121
- featuredImage
122
- images
123
- createdAt
124
- favorite
125
- productAttributes {
126
- id
127
- productId
128
- attributeName
129
- attributeValue
130
- }
131
- variants {
132
- id
133
- handle
134
- title
135
- price
136
- weight
137
- width
138
- depth
139
- height
140
- compareAtPrice
141
- available
142
- option1
143
- option2
144
- option3
145
- options
146
- weightUnit
147
- optionsIds
148
- featuredImage
149
- sku
150
- qualify
151
- featureTypeDTOS {
152
- id
153
- name
154
- position
155
- values
156
- required
157
- valuesFull
158
- enable
159
- }
160
- }
161
- featureTypes {
162
- id
163
- name
164
- position
165
- values
166
- required
167
- valuesFull
168
- enable
169
- }
170
- categories {
171
- id
172
- title
173
- handle
174
- description
175
- }
176
- }
177
- }
178
- `;
179
- exports.GET_SIMPLE_PRODUCTS_QUERY = `
180
- query GetSimpleProducts (
181
- $partnerId: String!
182
- $storeChannel: String!
183
- $category: String
184
- $product: String
185
- $sku: String
186
- $tag: String
187
- $priceFrom: BigDecimal
188
- $priceTo: BigDecimal
189
- $status: String
190
- $productType: String
191
- $subType: String
192
- $sortOrder: String
193
- $sortBy: String
194
- $brandId: String
195
- $keyword: String
196
- $display: String
197
- $onlyPromotion: Boolean
198
- $currentPage: Int
199
- $maxResult: Int
200
- ) {
201
- getSimpleProducts(
202
- partnerId: $partnerId
203
- storeChannel: $storeChannel
204
- category: $category
205
- product: $product
206
- sku: $sku
207
- tag: $tag
208
- priceFrom: $priceFrom
209
- priceTo: $priceTo
210
- status: $status
211
- productType: $productType
212
- subType: $subType
213
- sortOrder: $sortOrder
214
- sortBy: $sortBy
215
- brandId: $brandId
216
- keyword: $keyword
217
- display: $display
218
- onlyPromotion: $onlyPromotion
219
- currentPage: $currentPage
220
- maxResult: $maxResult
221
- ) {
222
- total
223
- currentPage
224
- maxResult
225
- totalPage
226
- data {
227
- id
228
- title
229
- sku
230
- shortDescription
231
- vat
232
- unit
233
- qualify
234
- parentId
235
- handle
236
- price
237
- compareAtPrice
238
- featuredImage
239
- images
240
- options
241
- }
242
- }
243
- }
244
- `;
245
- exports.GET_CATEGORIES_QUERY = (0, graphql_tag_1.gql) `
246
- query GetCategories(
247
- $partnerId: String!
248
- $storeChannel: String!
249
- $typeBuild: String!
250
- $level: Int!
251
- ) {
252
- getCategories(
253
- partnerId: $partnerId
254
- storeChannel: $storeChannel
255
- typeBuild: $typeBuild
256
- level: $level
257
- ) {
258
- id
259
- title
260
- image
261
- icon
262
- parentId
263
- level
264
- sequence
265
- handle
266
- child {
267
- id
268
- title
269
- image
270
- icon
271
- parentId
272
- level
273
- sequence
274
- handle
275
- }
276
- }
277
- }
278
- `;
279
- exports.GET_CATEGORY_BY_HANDLE_QUERY = (0, graphql_tag_1.gql) `
280
- query GetCategoryByHandle(
281
- $partnerId: String!
282
- $storeChannel: String!
283
- $handle: String!
284
- ) {
285
- getCategoryByHandle(
286
- partnerId: $partnerId
287
- storeChannel: $storeChannel
288
- handle: $handle
289
- ) {
290
- id
291
- title
292
- image
293
- icon
294
- parentId
295
- level
296
- handle
297
- child {
298
- id
299
- title
300
- image
301
- icon
302
- parentId
303
- level
304
- handle
305
- }
306
- }
307
- }
308
- `;
309
- exports.GET_CATEGORY_BY_ID_QUERY = (0, graphql_tag_1.gql) `
310
- query GetCategoryById(
311
- $partnerId: String!
312
- $storeChannel: String!
313
- $categoryId: String!
314
- ) {
315
- getCategoryById(
316
- partnerId: $partnerId
317
- storeChannel: $storeChannel
318
- categoryId: $categoryId
319
- ) {
320
- id
321
- title
322
- image
323
- icon
324
- parentId
325
- level
326
- handle
327
- child {
328
- id
329
- title
330
- image
331
- icon
332
- parentId
333
- level
334
- handle
335
- }
336
- }
337
- }
338
- `;
339
- exports.GET_BRANDS_QUERY = `
340
- query GetBrands($partnerId: String!, $storeChannel: String!, $enable: Boolean) {
341
- getBrands(partnerId: $partnerId, storeChannel: $storeChannel, enable: $enable) {
342
- id
343
- name
344
- image
345
- imageIcon
346
- }
347
- }
348
- `;
349
- exports.GET_BRANDS_BY_CATEGORY_QUERY = `
350
- query GetBrandsByCategory($partnerId: String!, $storeChannel: String!, $categoryId: String!) {
351
- getBrandsByCategory(partnerId: $partnerId, storeChannel: $storeChannel, categoryId: $categoryId) {
352
- id
353
- name
354
- image
355
- imageIcon
356
- }
357
- }
358
- `;
359
- exports.GET_BRAND_DETAIL_QUERY = `
360
- query GetBrandDetail($partnerId: String!, $brandId: String!, $storeChannel: String!) {
361
- getDetail(partnerId: $partnerId, brandId: $brandId, storeChannel: $storeChannel) {
362
- id
363
- name
364
- image
365
- imageIcon
366
- }
367
- }
368
- `;
@@ -1,218 +0,0 @@
1
- export interface AddOpportunityRequest {
2
- name: string;
3
- description: string;
4
- parentId?: string | null;
5
- priorityName: string;
6
- referName: string;
7
- referPhone: string;
8
- referEmail: string;
9
- targetId: string;
10
- extSource: string;
11
- }
12
- export interface Opportunity {
13
- goal: string;
14
- campaignId: string;
15
- valueReal: number;
16
- valueExpect: number;
17
- successRate: number;
18
- referName?: string | null;
19
- referPhone?: string | null;
20
- referEmail?: string | null;
21
- id: string;
22
- createdBy: string;
23
- ownerId?: string | null;
24
- workEffortTypeId: string;
25
- partyId?: string | null;
26
- name: string;
27
- description: string;
28
- parentId: string | null;
29
- status: string;
30
- stmId: string;
31
- createdStamp: string;
32
- updatedStamp: string;
33
- endDateExpect?: string | null;
34
- priorityName: string;
35
- targetId?: string | null;
36
- targetType?: string | null;
37
- targetUrl?: string | null;
38
- extSource?: string | null;
39
- connectorId?: string | null;
40
- processResult?: string | null;
41
- }
42
- export interface GetOpportunityRequest {
43
- pageSize: number;
44
- pageNumber: number;
45
- isPagination: boolean;
46
- sort: {
47
- key: string;
48
- asc: boolean;
49
- };
50
- }
51
- export interface GetOpportunity {
52
- total: number;
53
- data: OpjectOpportunity[];
54
- }
55
- export interface OpjectOpportunity {
56
- goal: string;
57
- campaignId: string;
58
- valueReal: number;
59
- valueExpect: number;
60
- successRate: number;
61
- referName: string;
62
- referPhone: string;
63
- referEmail: string;
64
- id: string;
65
- createdBy: string;
66
- ownerId: string;
67
- workEffortTypeId: string;
68
- partyId: string;
69
- name: string;
70
- description: string;
71
- parentId: string;
72
- status: number;
73
- stmId: string;
74
- createdStamp: string;
75
- updatedStamp: string;
76
- endDateExpect: string;
77
- priorityName: string;
78
- targetId: string;
79
- targetType: string;
80
- targetUrl: string;
81
- extSource: string;
82
- connectorId: string;
83
- processResult: number;
84
- }
85
- export interface getListWorkEffortType {
86
- id: string;
87
- name: string;
88
- group: string;
89
- createdStamp: string;
90
- updatedStamp: string;
91
- updatedBy: string;
92
- createdBy: string;
93
- partyId: string;
94
- actionLinkId: string;
95
- partyGroupIds: string[];
96
- description: string;
97
- workFlow: workFlow;
98
- }
99
- export interface ListToDo {
100
- workEffortId: string;
101
- toDoList: toDoList;
102
- }
103
- export interface toDoList {
104
- listAttachment: listAttachment;
105
- isDone: boolean;
106
- id: string;
107
- workEffortTypeId: string;
108
- workEffortType: workEffortType;
109
- partyId: string;
110
- name: string;
111
- description: string;
112
- parentId: string;
113
- parentType: string;
114
- status: number;
115
- createdStamp: string;
116
- updatedStamp: string;
117
- source: string;
118
- mode: string;
119
- connectorId: string;
120
- actionLink: actionLink;
121
- partyGroupIds: string;
122
- tagIds: string;
123
- processResult: number;
124
- }
125
- export interface actionLink {
126
- name: string;
127
- uri: string;
128
- type: string;
129
- partyId: string;
130
- fromCollection: string;
131
- toCollection: string;
132
- group: string;
133
- params: string;
134
- id: string;
135
- createdStamp: string;
136
- updatedStamp: string;
137
- updatedBy: string;
138
- createdBy: string;
139
- }
140
- export interface workEffortType {
141
- id: string;
142
- name: string;
143
- group: string;
144
- createdStamp: string;
145
- updatedStamp: string;
146
- updatedBy: string;
147
- createdBy: string;
148
- partyId: string;
149
- actionLinkId: string;
150
- partyGroupIds: string;
151
- description: string;
152
- workFlow: workFlow;
153
- }
154
- export interface workFlow {
155
- stages: stages;
156
- }
157
- export interface stages {
158
- id: string;
159
- name: string;
160
- mode: string;
161
- workEffortTypeId: string;
162
- }
163
- export interface listAttachment {
164
- id: string;
165
- createdStamp: string;
166
- createdBy: string;
167
- updatedBy: string;
168
- updatedStamp: string;
169
- partyId: string;
170
- path: string;
171
- srcId: string;
172
- srcName: string;
173
- srcPath: string;
174
- srcConfigPathId: string;
175
- name: string;
176
- fileType: string;
177
- type: string;
178
- status: string;
179
- referId: string[];
180
- }
181
- export interface updateWorkEffortDescription {
182
- id: string;
183
- createdStamp: string;
184
- updatedStamp: string;
185
- createdBy: string;
186
- updatedBy: string;
187
- name: string;
188
- partyId: string;
189
- targetId: string;
190
- targetType: string;
191
- targetUrl: string;
192
- description: string;
193
- status: number;
194
- parentId: string;
195
- workEffortTypeId: string;
196
- stmId: string;
197
- workflowId: string;
198
- endDateExpect: string;
199
- endDateActual: string;
200
- startDateActual: string;
201
- startDateExpect: string;
202
- source: string;
203
- ownerId: string;
204
- priorityName: string;
205
- priorityValue: number;
206
- extSource: string;
207
- extSourceTopicId: string;
208
- extSourceSocialAppId: string;
209
- extSourceSupportChannelType: string;
210
- extSourceSocialChannelType: string;
211
- extSourceSocialAppName: string;
212
- extSourceTopicUrl: string;
213
- connectorId: string;
214
- mode: string;
215
- partyGroupIds: [string];
216
- tagIds: [string];
217
- processResult: number;
218
- }
@@ -1,49 +0,0 @@
1
- export interface createCompanyRequest {
2
- name: string;
3
- phone: string;
4
- address: string;
5
- }
6
- export interface CreateCompany {
7
- id: string;
8
- name: string;
9
- address: string;
10
- gender: string;
11
- identityNumber: string;
12
- birthDate: Date;
13
- email: string;
14
- phone: string;
15
- createdStamp: Date;
16
- createdBy: string;
17
- memberLevel: string;
18
- }
19
- export interface updateCustomerRequest {
20
- fullName: string;
21
- phone: string;
22
- address: string;
23
- }
24
- export interface GetPersonByPartyIds {
25
- status: string;
26
- partyId: string;
27
- fullName: string;
28
- phone: string;
29
- address: string;
30
- gender: string;
31
- birthDate: Date;
32
- email: string;
33
- personalTitle: string;
34
- imageUrl: string;
35
- identityNumber: string;
36
- addressModel: addressModel;
37
- id: string;
38
- }
39
- export interface addressModel {
40
- id: string;
41
- addressInfo: string;
42
- provinceGeoId: string;
43
- districtGeoId: string;
44
- wardGeoId: string;
45
- provinceName: string;
46
- districtName: string;
47
- wardName: string;
48
- isDefault: boolean;
49
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import { CRMModuleGraphQL } from "./modules/crm/graphql";
2
- import { ProductModuleGraphQL } from "./modules/product/graphql";
3
- import { AuthorizationModuleGraphQL } from "./modules/authorization/graphql";
4
- import { USERModuleGraphQL } from "./modules/user/graphql";
5
- interface Endpoints {
6
- crmEndpoint: string;
7
- productEndpoint: string;
8
- authorizationEndpoint: string;
9
- storeFrontEndpoint: string;
10
- userEndpoint: string;
11
- }
12
- export declare class SDKLongVan {
13
- crm: CRMModuleGraphQL;
14
- product: ProductModuleGraphQL;
15
- authorization: AuthorizationModuleGraphQL;
16
- user: USERModuleGraphQL;
17
- constructor(endpoints: Endpoints, partnerId: string, storeId: string);
18
- }
19
- export {};
package/dist/index.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SDKLongVan = void 0;
4
- const graphql_1 = require("./modules/crm/graphql");
5
- const graphql_2 = require("./modules/product/graphql");
6
- const graphql_3 = require("./modules/authorization/graphql");
7
- const graphql_4 = require("./modules/user/graphql");
8
- class SDKLongVan {
9
- constructor(endpoints, partnerId, storeId) {
10
- const { crmEndpoint, productEndpoint, authorizationEndpoint, userEndpoint } = endpoints;
11
- this.crm = new graphql_1.CRMModuleGraphQL(crmEndpoint, partnerId, storeId);
12
- this.product = new graphql_2.ProductModuleGraphQL(productEndpoint, partnerId, storeId);
13
- this.authorization = new graphql_3.AuthorizationModuleGraphQL(authorizationEndpoint, partnerId, storeId);
14
- this.user = new graphql_4.USERModuleGraphQL(userEndpoint, partnerId, storeId);
15
- }
16
- }
17
- exports.SDKLongVan = SDKLongVan;
@@ -1,15 +0,0 @@
1
- import { GraphQLClient } from "graphql-request";
2
- import { LoginRequest, LoginResponse, RegisterRequest, RegisterResponse, SendSmsVerifyCodeResponse, SmsVerifyCodeRequest, UpdateInfoRequest, UpdateInfoResponse } from "../../constants/interfaces/authorization";
3
- export declare class AuthorizationModuleGraphQL {
4
- private client;
5
- private endpoint;
6
- partnerId: string;
7
- private storeId;
8
- constructor(endpoint: string, partnerId: string, storeId: string);
9
- getClient(): GraphQLClient;
10
- login(loginRequest: LoginRequest): Promise<LoginResponse | null>;
11
- register(registerRequest: RegisterRequest): Promise<RegisterResponse | null>;
12
- sendSmsVerifyCode(username: string): Promise<SendSmsVerifyCodeResponse | null>;
13
- verifyCode(verifyCodeRequest: SmsVerifyCodeRequest): Promise<boolean>;
14
- updateInfo(updateInfoRequest: UpdateInfoRequest): Promise<UpdateInfoResponse | null>;
15
- }