@longvansoftware/storefront-js-client 0.0.3 → 1.0.1

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 (64) hide show
  1. package/dist/config/config.d.ts +18 -0
  2. package/dist/config/config.js +21 -0
  3. package/dist/{constants/graphql/mutations/crmMutations.d.ts → src/graphql/crm/mutations.d.ts} +0 -2
  4. package/dist/{constants/graphql/mutations/crmMutations.js → src/graphql/crm/mutations.js} +1 -111
  5. package/dist/src/graphql/crm/queries.d.ts +3 -0
  6. package/dist/src/graphql/crm/queries.js +155 -0
  7. package/dist/src/graphql/payment/mutations.d.ts +1 -0
  8. package/dist/src/graphql/payment/mutations.js +35 -0
  9. package/dist/src/graphql/payment/queries.d.ts +1 -0
  10. package/dist/src/graphql/payment/queries.js +12 -0
  11. package/dist/src/graphql/product/mutations.d.ts +0 -0
  12. package/dist/src/graphql/product/mutations.js +1 -0
  13. package/dist/{constants/graphql/queries/productQueries.d.ts → src/graphql/product/queries.d.ts} +2 -1
  14. package/dist/src/graphql/product/queries.js +415 -0
  15. package/dist/{constants/graphql/mutations/userMutations.d.ts → src/graphql/user/mutations.d.ts} +0 -1
  16. package/dist/{constants/graphql/mutations/userMutations.js → src/graphql/user/mutations.js} +4 -33
  17. package/dist/src/graphql/user/queries.d.ts +3 -0
  18. package/dist/src/graphql/user/queries.js +67 -0
  19. package/dist/src/index.d.ts +1 -0
  20. package/dist/src/index.js +5 -0
  21. package/dist/src/lib/SDK.d.ts +28 -0
  22. package/dist/src/lib/SDK.js +43 -0
  23. package/dist/src/lib/auth/index.d.ts +26 -0
  24. package/dist/src/lib/auth/index.js +54 -0
  25. package/dist/src/lib/crm/index.d.ts +14 -0
  26. package/dist/src/lib/crm/index.js +185 -0
  27. package/dist/src/lib/order/index.d.ts +87 -0
  28. package/dist/src/lib/order/index.js +209 -0
  29. package/dist/src/lib/payment/index.d.ts +6 -0
  30. package/dist/src/lib/payment/index.js +50 -0
  31. package/dist/src/lib/product/index.d.ts +36 -0
  32. package/dist/src/lib/product/index.js +116 -0
  33. package/dist/src/lib/service.d.ts +14 -0
  34. package/dist/src/lib/service.js +97 -0
  35. package/dist/src/lib/user/index.d.ts +11 -0
  36. package/dist/src/lib/user/index.js +135 -0
  37. package/dist/{constants/interfaces → src/types}/crm.d.ts +1 -0
  38. package/dist/src/types/order.d.ts +7 -0
  39. package/dist/src/types/user.js +2 -0
  40. package/dist/src/utils/helpers.d.ts +4 -0
  41. package/dist/src/utils/helpers.js +41 -0
  42. package/package.json +25 -19
  43. package/dist/constants/graphql/queries/crmQueries.d.ts +0 -1
  44. package/dist/constants/graphql/queries/crmQueries.js +0 -45
  45. package/dist/constants/graphql/queries/productQueries.js +0 -368
  46. package/dist/index.d.ts +0 -19
  47. package/dist/index.js +0 -17
  48. package/dist/modules/authorization/graphql.d.ts +0 -15
  49. package/dist/modules/authorization/graphql.js +0 -116
  50. package/dist/modules/crm/graphql.d.ts +0 -19
  51. package/dist/modules/crm/graphql.js +0 -291
  52. package/dist/modules/product/graphql.d.ts +0 -19
  53. package/dist/modules/product/graphql.js +0 -180
  54. package/dist/modules/user/graphql.d.ts +0 -14
  55. package/dist/modules/user/graphql.js +0 -156
  56. /package/dist/{constants/graphql/mutations/authorizationMutations.d.ts → src/graphql/auth/mutations.d.ts} +0 -0
  57. /package/dist/{constants/graphql/mutations/authorizationMutations.js → src/graphql/auth/mutations.js} +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 → src/types}/crm.js +0 -0
  61. /package/dist/{constants/interfaces/product.js → src/types/order.js} +0 -0
  62. /package/dist/{constants/interfaces → src/types}/product.d.ts +0 -0
  63. /package/dist/{constants/interfaces/user.js → src/types/product.js} +0 -0
  64. /package/dist/{constants/interfaces → src/types}/user.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ export declare const environmentEndpoints: {
2
+ dev: {
3
+ product: string;
4
+ crm: string;
5
+ auth: string;
6
+ order: string;
7
+ user: string;
8
+ payment: string;
9
+ };
10
+ live: {
11
+ product: string;
12
+ crm: string;
13
+ auth: string;
14
+ order: string;
15
+ user: string;
16
+ payment: string;
17
+ };
18
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.environmentEndpoints = void 0;
4
+ exports.environmentEndpoints = {
5
+ dev: {
6
+ product: "https://product-service.dev.longvan.vn/product-service/graphql",
7
+ crm: "https://crm-ticket-gateway.dev.longvan.vn/crm-graph-gateway/graphql",
8
+ auth: "https://crm.dev.longvan.vn/authorization-gateway/graphql",
9
+ order: "https://storefront.dev.longvan.vn/v2",
10
+ user: "https://user.dev.longvan.vn/user-gateway/graphql",
11
+ payment: "https://portal.dev.longvan.vn/invoice-gateway/graphql",
12
+ },
13
+ live: {
14
+ product: "https://product-service.dev.longvan.vn/product-service/graphql",
15
+ crm: "https://crm-ticket-gateway.dev.longvan.vn/crm-graph-gateway/graphql",
16
+ auth: "https://crm.dev.longvan.vn/authorization-gateway/graphql",
17
+ order: "https://storefront.dev.longvan.vn/v2",
18
+ user: "https://user.dev.longvan.vn/user-gateway/graphql",
19
+ payment: "https://portal.dev.longvan.vn/invoice-gateway/graphql",
20
+ },
21
+ };
@@ -1,6 +1,4 @@
1
1
  export declare const ADD_OPPORTUNITY_MUTATION: import("graphql").DocumentNode;
2
- export declare const GET_LIST_TODO: import("graphql").DocumentNode;
3
- export declare const GET_LIST_WORK_EFFORT_TYPE: import("graphql").DocumentNode;
4
2
  export declare const UPDATE_STATUS_ATTACHMENT_BY_ID: import("graphql").DocumentNode;
5
3
  export declare const UPDATE_WORK_EFFORT_DESCRIPTION: import("graphql").DocumentNode;
6
4
  export declare const UPDATE_WORK_EFFORT_NAME: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ADD_ATTACHMENT_FOR_WORK_EFFORT = exports.UPDATE_WORK_EFFORT_STATUS = exports.UPDATE_WORK_EFFORT_NAME = exports.UPDATE_WORK_EFFORT_DESCRIPTION = exports.UPDATE_STATUS_ATTACHMENT_BY_ID = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.ADD_OPPORTUNITY_MUTATION = void 0;
3
+ exports.ADD_ATTACHMENT_FOR_WORK_EFFORT = exports.UPDATE_WORK_EFFORT_STATUS = exports.UPDATE_WORK_EFFORT_NAME = exports.UPDATE_WORK_EFFORT_DESCRIPTION = exports.UPDATE_STATUS_ATTACHMENT_BY_ID = exports.ADD_OPPORTUNITY_MUTATION = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.ADD_OPPORTUNITY_MUTATION = (0, graphql_tag_1.gql) `
6
6
  mutation AddOpportunity(
@@ -44,116 +44,6 @@ exports.ADD_OPPORTUNITY_MUTATION = (0, graphql_tag_1.gql) `
44
44
  }
45
45
  }
46
46
  `;
47
- exports.GET_LIST_TODO = (0, graphql_tag_1.gql) `
48
- query GetListTodo($partyId: String!, $workEffortId: [String]!) {
49
- getListTodo(partyId: $partyId, workEffortId: $workEffortId) {
50
- workEffortId
51
- toDoList {
52
- listAttachment {
53
- id
54
- createdStamp
55
- createdBy
56
- updatedBy
57
- updatedStamp
58
- partyId
59
- path
60
- srcId
61
- srcName
62
- srcPath
63
- srcConfigPathId
64
- name
65
- fileType
66
- type
67
- status
68
- referId
69
- }
70
- isDone
71
- id
72
- workEffortTypeId
73
- workEffortType {
74
- id
75
- name
76
- group
77
- createdStamp
78
- updatedStamp
79
- updatedBy
80
- createdBy
81
- partyId
82
- actionLinkId
83
- partyGroupIds
84
- description
85
- workFlow {
86
- stages {
87
- id
88
- name
89
- mode
90
- workEffortTypeId
91
- }
92
- }
93
- }
94
- partyId
95
- name
96
- description
97
- parentId
98
- parentType
99
- status
100
- createdStamp
101
- updatedStamp
102
- source
103
- mode
104
- connectorId
105
- actionLink {
106
- name
107
- uri
108
- type
109
- partyId
110
- fromCollection
111
- toCollection
112
- group
113
- params
114
- id
115
- createdStamp
116
- updatedStamp
117
- updatedBy
118
- createdBy
119
- }
120
- partyGroupIds
121
- tagIds
122
- processResult
123
- }
124
- }
125
- }
126
- `;
127
- exports.GET_LIST_WORK_EFFORT_TYPE = (0, graphql_tag_1.gql) `
128
- query GetListWorkEffortType($partyId: String!, $id: String!){
129
- getListWorkEffortType(
130
- partyId: $partyId
131
- getWorkEffortTypeRequest: {
132
- id: $id
133
- isPagination: true }
134
- ) {
135
- id
136
- name
137
- group
138
- createdStamp
139
- updatedStamp
140
- updatedBy
141
- createdBy
142
- partyId
143
- actionLinkId
144
- partyGroupIds
145
- description
146
- workFlow {
147
- stages{
148
- id
149
- name
150
- mode
151
- workEffortTypeId
152
- }
153
- }
154
- }
155
- }
156
- `;
157
47
  exports.UPDATE_STATUS_ATTACHMENT_BY_ID = (0, graphql_tag_1.gql) `
158
48
  mutation UpdateStatusAttachmentById(
159
49
  $performerId: String!,
@@ -0,0 +1,3 @@
1
+ export declare const GET_LIST_OPPORTUNITY_QUERY: import("graphql").DocumentNode;
2
+ export declare const GET_LIST_TODO: import("graphql").DocumentNode;
3
+ export declare const GET_LIST_WORK_EFFORT_TYPE: import("graphql").DocumentNode;
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = 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
+ `;
46
+ exports.GET_LIST_TODO = (0, graphql_tag_1.gql) `
47
+ query GetListTodo($partyId: String!, $workEffortId: [String]!) {
48
+ getListTodo(partyId: $partyId, workEffortId: $workEffortId) {
49
+ workEffortId
50
+ toDoList {
51
+ listAttachment {
52
+ id
53
+ createdStamp
54
+ createdBy
55
+ updatedBy
56
+ updatedStamp
57
+ partyId
58
+ path
59
+ srcId
60
+ srcName
61
+ srcPath
62
+ srcConfigPathId
63
+ name
64
+ fileType
65
+ type
66
+ status
67
+ referId
68
+ }
69
+ isDone
70
+ id
71
+ workEffortTypeId
72
+ workEffortType {
73
+ id
74
+ name
75
+ group
76
+ createdStamp
77
+ updatedStamp
78
+ updatedBy
79
+ createdBy
80
+ partyId
81
+ actionLinkId
82
+ partyGroupIds
83
+ description
84
+ workFlow {
85
+ stages {
86
+ id
87
+ name
88
+ mode
89
+ workEffortTypeId
90
+ }
91
+ }
92
+ }
93
+ partyId
94
+ name
95
+ description
96
+ parentId
97
+ parentType
98
+ status
99
+ createdStamp
100
+ updatedStamp
101
+ source
102
+ mode
103
+ connectorId
104
+ actionLink {
105
+ name
106
+ uri
107
+ type
108
+ partyId
109
+ fromCollection
110
+ toCollection
111
+ group
112
+ params
113
+ id
114
+ createdStamp
115
+ updatedStamp
116
+ updatedBy
117
+ createdBy
118
+ }
119
+ partyGroupIds
120
+ tagIds
121
+ processResult
122
+ }
123
+ }
124
+ }
125
+ `;
126
+ exports.GET_LIST_WORK_EFFORT_TYPE = (0, graphql_tag_1.gql) `
127
+ query GetListWorkEffortType($partyId: String!, $id: String!){
128
+ getListWorkEffortType(
129
+ partyId: $partyId
130
+ getWorkEffortTypeRequest: {
131
+ id: $id
132
+ isPagination: true }
133
+ ) {
134
+ id
135
+ name
136
+ group
137
+ createdStamp
138
+ updatedStamp
139
+ updatedBy
140
+ createdBy
141
+ partyId
142
+ actionLinkId
143
+ partyGroupIds
144
+ description
145
+ workFlow {
146
+ stages{
147
+ id
148
+ name
149
+ mode
150
+ workEffortTypeId
151
+ }
152
+ }
153
+ }
154
+ }
155
+ `;
@@ -0,0 +1 @@
1
+ export declare const CREATE_PAYMENT_ORDER_MUTATION: import("graphql").DocumentNode;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
6
+ mutation CreatePaymentOrder(
7
+ $orgId: String!
8
+ $orderId: String!
9
+ $paymentMethod: String!
10
+ $storeId: String!
11
+ $source: String!
12
+ $appliedAmount: Float!
13
+ $payDate: String!
14
+ $returnUrl: String
15
+ $paymentType: String!
16
+ $createBy: String!
17
+ ) {
18
+ createPaymentOrder(
19
+ orgId: $orgId
20
+ orderId: $orderId
21
+ paymentMethod: $paymentMethod
22
+ storeId: $storeId
23
+ source: $source
24
+ appliedAmount: $appliedAmount
25
+ payDate: $payDate
26
+ returnUrl: $returnUrl
27
+ paymentType: $paymentType
28
+ createBy: $createBy
29
+ ) {
30
+ code
31
+ message
32
+ data
33
+ }
34
+ }
35
+ `;
@@ -0,0 +1 @@
1
+ export declare const GET_PAYMENT_METHOD: import("graphql").DocumentNode;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_PAYMENT_METHOD = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
6
+ query GetPaymentMethod($orgId: String!, $storeChannelId: String) {
7
+ getPaymentMethod(orgId: $orgId, storeChannelId: $storeChannelId) {
8
+ code
9
+ name
10
+ }
11
+ }
12
+ `;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,9 +1,10 @@
1
1
  export declare const GET_PRODUCT_BY_ID_QUERY: import("graphql").DocumentNode;
2
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";
3
+ export declare const GET_SIMPLE_PRODUCTS_QUERY: import("graphql").DocumentNode;
4
4
  export declare const GET_CATEGORIES_QUERY: import("graphql").DocumentNode;
5
5
  export declare const GET_CATEGORY_BY_HANDLE_QUERY: import("graphql").DocumentNode;
6
6
  export declare const GET_CATEGORY_BY_ID_QUERY: import("graphql").DocumentNode;
7
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
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
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";
10
+ export declare const GET_PRODUCT_OPTION: import("graphql").DocumentNode;