@longvansoftware/storefront-js-client 0.0.1 → 0.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 (30) hide show
  1. package/README.md +93 -93
  2. package/dist/constants/graphql/mutations/authorizationMutations.d.ts +7 -0
  3. package/dist/constants/graphql/mutations/authorizationMutations.js +99 -0
  4. package/dist/constants/graphql/mutations/crmMutations.d.ts +8 -0
  5. package/dist/constants/graphql/mutations/crmMutations.js +368 -0
  6. package/dist/constants/graphql/mutations/userMutations.d.ts +4 -0
  7. package/dist/constants/graphql/mutations/userMutations.js +116 -0
  8. package/dist/constants/graphql/queries/crmQueries.d.ts +1 -0
  9. package/dist/constants/graphql/queries/crmQueries.js +45 -0
  10. package/dist/constants/graphql/queries/productQueries.d.ts +9 -0
  11. package/dist/constants/graphql/queries/productQueries.js +368 -0
  12. package/dist/constants/interfaces/authorization.d.ts +82 -0
  13. package/dist/constants/interfaces/authorization.js +2 -0
  14. package/dist/constants/interfaces/crm.d.ts +218 -0
  15. package/dist/constants/interfaces/crm.js +2 -0
  16. package/dist/constants/interfaces/product.d.ts +61 -0
  17. package/dist/constants/interfaces/product.js +2 -0
  18. package/dist/constants/interfaces/user.d.ts +49 -0
  19. package/dist/constants/interfaces/user.js +2 -0
  20. package/dist/index.d.ts +19 -0
  21. package/dist/index.js +17 -0
  22. package/dist/modules/authorization/graphql.d.ts +15 -0
  23. package/dist/modules/authorization/graphql.js +116 -0
  24. package/dist/modules/crm/graphql.d.ts +19 -0
  25. package/dist/modules/crm/graphql.js +291 -0
  26. package/dist/modules/product/graphql.d.ts +19 -0
  27. package/dist/modules/product/graphql.js +180 -0
  28. package/dist/modules/user/graphql.d.ts +14 -0
  29. package/dist/modules/user/graphql.js +156 -0
  30. package/package.json +36 -36
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_PERSON_BY_PARTY_IDS = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.CREATE_COMPANY = (0, graphql_tag_1.gql) `
6
+ mutation CreateCompany(
7
+ $createCompanyRequest: createCompanyRequestInput!,
8
+ $createTaxCodeRequest: createTaxCodeRequestInput,
9
+ $orgId: String!,
10
+ $createdBy: String!
11
+ ) {
12
+ createCompany(
13
+ createCompanyRequest: $createCompanyRequest,
14
+ createTaxCodeRequest: $createTaxCodeRequest,
15
+ orgId: $orgId,
16
+ createdBy: $createdBy
17
+ ) {
18
+ id
19
+ name
20
+ address
21
+ gender
22
+ identityNumber
23
+ birthDate
24
+ email
25
+ phone
26
+ createdStamp
27
+ createdBy
28
+ memberLevel
29
+ }
30
+ }
31
+ `;
32
+ exports.UPDATE_COMPANY_INFOR = (0, graphql_tag_1.gql) `
33
+ mutation UpdateCompanyInfo(
34
+ $id: String!,
35
+ $fieldName: String!,
36
+ $valueUpdate: String!,
37
+ $orgId: String!,
38
+ $updatedBy: String!
39
+ ) {
40
+ updateCompanyInfo(
41
+ id: $id,
42
+ fieldName: $fieldName,
43
+ valueUpdate: $valueUpdate,
44
+ orgId: $orgId,
45
+ updatedBy: $updatedBy
46
+ ) {
47
+ id
48
+ name
49
+ address
50
+ gender
51
+ identityNumber
52
+ birthDate
53
+ email
54
+ phone
55
+ createdStamp
56
+ createdBy
57
+ memberLevel
58
+ }
59
+ }
60
+ `;
61
+ exports.UPDATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
62
+ mutation UpdateCustomerV2(
63
+ $id: String!,
64
+ $updateCustomerRequest: UpdateCustomerRequestInput!,
65
+ $tenantId: String!,
66
+ $updatedBy: String!
67
+ ) {
68
+ updateCustomerV2(
69
+ id: $id,
70
+ updateCustomerRequest: $updateCustomerRequest,
71
+ tenantId: $tenantId,
72
+ updatedBy: $updatedBy
73
+ ) {
74
+ id
75
+ name
76
+ address
77
+ gender
78
+ identityNumber
79
+ birthDate
80
+ email
81
+ phone
82
+ createdStamp
83
+ createdBy
84
+ memberLevel
85
+ }
86
+ }
87
+ `;
88
+ exports.GET_PERSON_BY_PARTY_IDS = (0, graphql_tag_1.gql) `
89
+ query GetPersonByPartyIds($partyIds: [String]!){
90
+ getPersonByPartyIds(partyIds: ["string"]) {
91
+ status
92
+ partyId
93
+ fullName
94
+ phone
95
+ address
96
+ gender
97
+ birthDate
98
+ email
99
+ personalTitle
100
+ imageUrl
101
+ identityNumber
102
+ addressModel {
103
+ id
104
+ addressInfo
105
+ provinceGeoId
106
+ districtGeoId
107
+ wardGeoId
108
+ provinceName
109
+ districtName
110
+ wardName
111
+ isDefault
112
+ }
113
+ id
114
+ }
115
+ }
116
+ `;
@@ -0,0 +1 @@
1
+ export declare const GET_LIST_OPPORTUNITY_QUERY: import("graphql").DocumentNode;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_LIST_OPPORTUNITY_QUERY = (0, graphql_tag_1.gql) `
6
+ query GetListOpportunity($partyId: String!, $performerId: String!, $getOpportunityRequest: GetOpportunityRequest!) {
7
+ getListOpportunity(
8
+ partyId: $partyId
9
+ performerId: $performerId
10
+ getOpportunityRequest: $getOpportunityRequest
11
+ ) {
12
+ total
13
+ data {
14
+ goal
15
+ campaignId
16
+ valueReal
17
+ valueExpect
18
+ successRate
19
+ referName
20
+ referPhone
21
+ referEmail
22
+ id
23
+ createdBy
24
+ ownerId
25
+ workEffortTypeId
26
+ partyId
27
+ name
28
+ description
29
+ parentId
30
+ status
31
+ stmId
32
+ createdStamp
33
+ updatedStamp
34
+ endDateExpect
35
+ priorityName
36
+ targetId
37
+ targetType
38
+ targetUrl
39
+ extSource
40
+ connectorId
41
+ processResult
42
+ }
43
+ }
44
+ }
45
+ `;
@@ -0,0 +1,9 @@
1
+ export declare const GET_PRODUCT_BY_ID_QUERY: import("graphql").DocumentNode;
2
+ export declare const GET_PRODUCT_BY_SLUG_QUERY: import("graphql").DocumentNode;
3
+ export declare const GET_SIMPLE_PRODUCTS_QUERY = "\nquery GetSimpleProducts (\n$partnerId: String!\n$storeChannel: String!\n$category: String\n$product: String\n$sku: String\n$tag: String\n$priceFrom: BigDecimal\n$priceTo: BigDecimal\n$status: String\n$productType: String\n$subType: String\n$sortOrder: String\n$sortBy: String\n$brandId: String\n$keyword: String\n$display: String\n$onlyPromotion: Boolean\n$currentPage: Int\n$maxResult: Int\n) {\n\tgetSimpleProducts(\n\tpartnerId: $partnerId\n\tstoreChannel: $storeChannel\n\tcategory: $category\n\tproduct: $product\n\tsku: $sku\n\ttag: $tag\n\tpriceFrom: $priceFrom\n\tpriceTo: $priceTo\n\tstatus: $status\n\tproductType: $productType\n\tsubType: $subType\n\tsortOrder: $sortOrder\n\tsortBy: $sortBy\n\tbrandId: $brandId\n\tkeyword: $keyword\n\tdisplay: $display\n\tonlyPromotion: $onlyPromotion\n\tcurrentPage: $currentPage\n\tmaxResult: $maxResult\n\t) {\n\t\ttotal\n\t\tcurrentPage\n\t\tmaxResult\n\t\ttotalPage\n\t\tdata {\n\t\t\tid\n\t\t\ttitle\n\t\t\tsku\n\t\t\tshortDescription\n\t\t\tvat\n\t\t\tunit\n\t\t\tqualify\n\t\t\tparentId\n\t\t\thandle\n\t\t\tprice\n\t\t\tcompareAtPrice\n\t\t\tfeaturedImage\n\t\t\timages\n\t\t\toptions\n\t\t}\n\t}\n}\n";
4
+ export declare const GET_CATEGORIES_QUERY: import("graphql").DocumentNode;
5
+ export declare const GET_CATEGORY_BY_HANDLE_QUERY: import("graphql").DocumentNode;
6
+ export declare const GET_CATEGORY_BY_ID_QUERY: import("graphql").DocumentNode;
7
+ export declare const GET_BRANDS_QUERY = "\nquery GetBrands($partnerId: String!, $storeChannel: String!, $enable: Boolean) {\n\tgetBrands(partnerId: $partnerId, storeChannel: $storeChannel, enable: $enable) {\n\t\tid\n\t\tname\n\t\timage\n\t\timageIcon\n\t}\n}\n";
8
+ export declare const GET_BRANDS_BY_CATEGORY_QUERY = "\nquery GetBrandsByCategory($partnerId: String!, $storeChannel: String!, $categoryId: String!) {\n\tgetBrandsByCategory(partnerId: $partnerId, storeChannel: $storeChannel, categoryId: $categoryId) {\n\t\tid\n\t\tname\n\t\timage\n\t\timageIcon\n\t}\n}\n";
9
+ export declare const GET_BRAND_DETAIL_QUERY = "\n query GetBrandDetail($partnerId: String!, $brandId: String!, $storeChannel: String!) {\n getDetail(partnerId: $partnerId, brandId: $brandId, storeChannel: $storeChannel) {\n id\n name\n image\n imageIcon\n }\n }\n";
@@ -0,0 +1,368 @@
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
+ `;
@@ -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 });