@longvansoftware/storefront-js-client 3.1.5 → 3.1.6

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 (37) hide show
  1. package/README.md +221 -221
  2. package/dist/src/graphql/auth/mutations.js +224 -224
  3. package/dist/src/graphql/auth/queries.js +59 -59
  4. package/dist/src/graphql/campaign/mutations.js +26 -26
  5. package/dist/src/graphql/campaign/queries.js +375 -375
  6. package/dist/src/graphql/cashbook/queries.js +93 -93
  7. package/dist/src/graphql/cloud/mutations.js +103 -103
  8. package/dist/src/graphql/cloud/queries.js +112 -112
  9. package/dist/src/graphql/computing/mutations.js +96 -96
  10. package/dist/src/graphql/computing/queries.js +41 -41
  11. package/dist/src/graphql/crm/mutations.js +813 -813
  12. package/dist/src/graphql/crm/queries.js +661 -661
  13. package/dist/src/graphql/fragments/product.d.ts +38 -0
  14. package/dist/src/graphql/fragments/product.js +196 -0
  15. package/dist/src/graphql/payment/mutations.js +146 -146
  16. package/dist/src/graphql/payment/queries.js +116 -116
  17. package/dist/src/graphql/paymentV2/mutations.js +47 -47
  18. package/dist/src/graphql/paymentV2/queries.js +176 -176
  19. package/dist/src/graphql/product/mutations.js +94 -94
  20. package/dist/src/graphql/product/queries.js +472 -472
  21. package/dist/src/graphql/service/mutations.js +304 -304
  22. package/dist/src/graphql/service/queries.js +131 -131
  23. package/dist/src/graphql/store/mutations.js +24 -24
  24. package/dist/src/graphql/store/queries.js +24 -24
  25. package/dist/src/graphql/user/mutations.js +142 -142
  26. package/dist/src/graphql/user/queries.d.ts +1 -0
  27. package/dist/src/graphql/user/queries.js +319 -299
  28. package/dist/src/lib/serviceSDK.js +12 -12
  29. package/dist/src/lib/shareZalo/index.d.ts +5 -0
  30. package/dist/src/lib/shareZalo/index.js +32 -0
  31. package/dist/src/lib/user/index.d.ts +2 -1
  32. package/dist/src/lib/user/index.js +20 -2
  33. package/dist/src/types/common.d.ts +264 -0
  34. package/dist/src/types/common.js +35 -0
  35. package/dist/src/utils/errorHandler.d.ts +64 -0
  36. package/dist/src/utils/errorHandler.js +197 -0
  37. package/package.json +44 -44
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Common product fields fragment
3
+ * Used across multiple product queries to reduce duplication
4
+ */
5
+ export declare const PRODUCT_CORE_FIELDS: import("graphql").DocumentNode;
6
+ /**
7
+ * Product attributes fragment
8
+ */
9
+ export declare const PRODUCT_ATTRIBUTES: import("graphql").DocumentNode;
10
+ /**
11
+ * Product variants fragment
12
+ */
13
+ export declare const PRODUCT_VARIANTS: import("graphql").DocumentNode;
14
+ /**
15
+ * Product feature types fragment
16
+ */
17
+ export declare const PRODUCT_FEATURE_TYPES: import("graphql").DocumentNode;
18
+ /**
19
+ * Product categories fragment
20
+ */
21
+ export declare const PRODUCT_CATEGORIES: import("graphql").DocumentNode;
22
+ /**
23
+ * Product unit fragment
24
+ */
25
+ export declare const PRODUCT_UNIT: import("graphql").DocumentNode;
26
+ /**
27
+ * Complete product details fragment
28
+ * Combines all product fragments for detailed queries
29
+ */
30
+ export declare const PRODUCT_FULL_DETAILS: import("graphql").DocumentNode;
31
+ /**
32
+ * Simple product fields for list views
33
+ */
34
+ export declare const PRODUCT_SIMPLE_FIELDS: import("graphql").DocumentNode;
35
+ /**
36
+ * Extended product fields for getProducts query
37
+ */
38
+ export declare const PRODUCT_EXTENDED_FIELDS: import("graphql").DocumentNode;
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRODUCT_EXTENDED_FIELDS = exports.PRODUCT_SIMPLE_FIELDS = exports.PRODUCT_FULL_DETAILS = exports.PRODUCT_UNIT = exports.PRODUCT_CATEGORIES = exports.PRODUCT_FEATURE_TYPES = exports.PRODUCT_VARIANTS = exports.PRODUCT_ATTRIBUTES = exports.PRODUCT_CORE_FIELDS = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ /**
6
+ * Common product fields fragment
7
+ * Used across multiple product queries to reduce duplication
8
+ */
9
+ exports.PRODUCT_CORE_FIELDS = (0, graphql_tag_1.gql) `
10
+ fragment ProductCoreFields on Product {
11
+ id
12
+ title
13
+ description
14
+ sku
15
+ shortDescription
16
+ weight
17
+ width
18
+ depth
19
+ height
20
+ vat
21
+ qualify
22
+ parentId
23
+ handle
24
+ price
25
+ options
26
+ optionsRelationship
27
+ compareAtPrice
28
+ featuredImage
29
+ images
30
+ }
31
+ `;
32
+ /**
33
+ * Product attributes fragment
34
+ */
35
+ exports.PRODUCT_ATTRIBUTES = (0, graphql_tag_1.gql) `
36
+ fragment ProductAttributes on Product {
37
+ productAttributes {
38
+ attributeName
39
+ attributeValue
40
+ }
41
+ }
42
+ `;
43
+ /**
44
+ * Product variants fragment
45
+ */
46
+ exports.PRODUCT_VARIANTS = (0, graphql_tag_1.gql) `
47
+ fragment ProductVariants on Product {
48
+ variants {
49
+ id
50
+ handle
51
+ title
52
+ price
53
+ compareAtPrice
54
+ options
55
+ optionsIds
56
+ featuredImage
57
+ sku
58
+ }
59
+ }
60
+ `;
61
+ /**
62
+ * Product feature types fragment
63
+ */
64
+ exports.PRODUCT_FEATURE_TYPES = (0, graphql_tag_1.gql) `
65
+ fragment ProductFeatureTypes on Product {
66
+ featureTypes {
67
+ id
68
+ name
69
+ values
70
+ valuesFull {
71
+ id
72
+ name
73
+ }
74
+ }
75
+ }
76
+ `;
77
+ /**
78
+ * Product categories fragment
79
+ */
80
+ exports.PRODUCT_CATEGORIES = (0, graphql_tag_1.gql) `
81
+ fragment ProductCategories on Product {
82
+ categories {
83
+ id
84
+ title
85
+ handle
86
+ }
87
+ }
88
+ `;
89
+ /**
90
+ * Product unit fragment
91
+ */
92
+ exports.PRODUCT_UNIT = (0, graphql_tag_1.gql) `
93
+ fragment ProductUnit on Product {
94
+ unitDTO {
95
+ id
96
+ name
97
+ }
98
+ }
99
+ `;
100
+ /**
101
+ * Complete product details fragment
102
+ * Combines all product fragments for detailed queries
103
+ */
104
+ exports.PRODUCT_FULL_DETAILS = (0, graphql_tag_1.gql) `
105
+ fragment ProductFullDetails on Product {
106
+ ...ProductCoreFields
107
+ ...ProductAttributes
108
+ ...ProductVariants
109
+ ...ProductFeatureTypes
110
+ ...ProductCategories
111
+ ...ProductUnit
112
+ }
113
+ ${exports.PRODUCT_CORE_FIELDS}
114
+ ${exports.PRODUCT_ATTRIBUTES}
115
+ ${exports.PRODUCT_VARIANTS}
116
+ ${exports.PRODUCT_FEATURE_TYPES}
117
+ ${exports.PRODUCT_CATEGORIES}
118
+ ${exports.PRODUCT_UNIT}
119
+ `;
120
+ /**
121
+ * Simple product fields for list views
122
+ */
123
+ exports.PRODUCT_SIMPLE_FIELDS = (0, graphql_tag_1.gql) `
124
+ fragment ProductSimpleFields on Product {
125
+ id
126
+ title
127
+ sku
128
+ shortDescription
129
+ description
130
+ subType
131
+ vat
132
+ qualify
133
+ parentId
134
+ handle
135
+ price
136
+ compareAtPrice
137
+ priceType
138
+ priceTypeName
139
+ featuredImage
140
+ optionsRelationship
141
+ images
142
+ }
143
+ `;
144
+ /**
145
+ * Extended product fields for getProducts query
146
+ */
147
+ exports.PRODUCT_EXTENDED_FIELDS = (0, graphql_tag_1.gql) `
148
+ fragment ProductExtendedFields on Product {
149
+ id
150
+ title
151
+ subType
152
+ description
153
+ sku
154
+ shortDescription
155
+ weight
156
+ width
157
+ depth
158
+ height
159
+ vat
160
+ qualify
161
+ parentId
162
+ handle
163
+ price
164
+ priceType
165
+ salePolicy
166
+ priceTypeName
167
+ priceVaries
168
+ available
169
+ tags
170
+ options
171
+ optionsRelationship
172
+ compareAtPrice
173
+ featuredImage
174
+ images
175
+ categories {
176
+ id
177
+ title
178
+ image
179
+ icon
180
+ parentId
181
+ level
182
+ handle
183
+ description
184
+ }
185
+ groups {
186
+ id
187
+ name
188
+ policy
189
+ image
190
+ }
191
+ unitDTO {
192
+ id
193
+ name
194
+ }
195
+ }
196
+ `;
@@ -2,153 +2,153 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UPDATE_INVOICE_ITEM = exports.REQUEST_PUBLISH_VAT_INVOICE = exports.REQUEST_UNPUBLISH_VAT_INVOICE = exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
4
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: BigDecimal
13
- $payDate: String!
14
- $returnUrl: String
15
- $paymentType: String!
16
- $createBy: String!
17
- $paymentInfo: String
18
- $attributes: JSON
19
- ) {
20
- createPaymentOrder(
21
- orgId: $orgId
22
- orderId: $orderId
23
- paymentMethod: $paymentMethod
24
- storeId: $storeId
25
- source: $source
26
- appliedAmount: $appliedAmount
27
- payDate: $payDate
28
- returnUrl: $returnUrl
29
- paymentType: $paymentType
30
- createBy: $createBy
31
- paymentInfo: $paymentInfo
32
- attributes: $attributes
33
- ) {
34
- code
35
- message
36
- data
37
- qrCodeUrl
38
- deeplink
39
- deeplinkMiniApp
40
- invoiceId
41
- orderId
42
- paymentId
43
- }
44
- }
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: BigDecimal
13
+ $payDate: String!
14
+ $returnUrl: String
15
+ $paymentType: String!
16
+ $createBy: String!
17
+ $paymentInfo: String
18
+ $attributes: JSON
19
+ ) {
20
+ createPaymentOrder(
21
+ orgId: $orgId
22
+ orderId: $orderId
23
+ paymentMethod: $paymentMethod
24
+ storeId: $storeId
25
+ source: $source
26
+ appliedAmount: $appliedAmount
27
+ payDate: $payDate
28
+ returnUrl: $returnUrl
29
+ paymentType: $paymentType
30
+ createBy: $createBy
31
+ paymentInfo: $paymentInfo
32
+ attributes: $attributes
33
+ ) {
34
+ code
35
+ message
36
+ data
37
+ qrCodeUrl
38
+ deeplink
39
+ deeplinkMiniApp
40
+ invoiceId
41
+ orderId
42
+ paymentId
43
+ }
44
+ }
45
45
  `;
46
- exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
47
- mutation RequestUnpublishVatInvoice(
48
- $partnerId: String!
49
- $sourceId: String!
50
- $sourceType: String!
51
- $signType: String
52
- $includeBuyerTaxCode: Boolean
53
- $buyerName: String
54
- $buyerTaxCode: String
55
- $buyerCompany: String
56
- $buyerAddress: String
57
- $sendMail: Boolean
58
- $receiverName: String
59
- $receiverEmail: String
60
- $byUser: String!
61
- ) {
62
- requestUnpublishVatInvoice(
63
- vatInvoiceRequest: {
64
- partnerId: $partnerId
65
- sourceId: $sourceId
66
- sourceType: $sourceType
67
- signType: $signType
68
- includeBuyerTaxCode: $includeBuyerTaxCode
69
- buyerName: $buyerName
70
- buyerTaxCode: $buyerTaxCode
71
- buyerCompany: $buyerCompany
72
- buyerAddress: $buyerAddress
73
- sendMail: $sendMail
74
- receiverName: $receiverName
75
- receiverEmail: $receiverEmail
76
- }
77
- byUser: $byUser
78
- ) {
79
- code
80
- message
81
- invoiceId
82
- sourceId
83
- sourceType
84
- previewLink
85
- lookupLink
86
- }
87
- }
46
+ exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
47
+ mutation RequestUnpublishVatInvoice(
48
+ $partnerId: String!
49
+ $sourceId: String!
50
+ $sourceType: String!
51
+ $signType: String
52
+ $includeBuyerTaxCode: Boolean
53
+ $buyerName: String
54
+ $buyerTaxCode: String
55
+ $buyerCompany: String
56
+ $buyerAddress: String
57
+ $sendMail: Boolean
58
+ $receiverName: String
59
+ $receiverEmail: String
60
+ $byUser: String!
61
+ ) {
62
+ requestUnpublishVatInvoice(
63
+ vatInvoiceRequest: {
64
+ partnerId: $partnerId
65
+ sourceId: $sourceId
66
+ sourceType: $sourceType
67
+ signType: $signType
68
+ includeBuyerTaxCode: $includeBuyerTaxCode
69
+ buyerName: $buyerName
70
+ buyerTaxCode: $buyerTaxCode
71
+ buyerCompany: $buyerCompany
72
+ buyerAddress: $buyerAddress
73
+ sendMail: $sendMail
74
+ receiverName: $receiverName
75
+ receiverEmail: $receiverEmail
76
+ }
77
+ byUser: $byUser
78
+ ) {
79
+ code
80
+ message
81
+ invoiceId
82
+ sourceId
83
+ sourceType
84
+ previewLink
85
+ lookupLink
86
+ }
87
+ }
88
88
  `;
89
- exports.REQUEST_PUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
90
- mutation RequestPublishVatInvoice(
91
- $partnerId: String!
92
- $sourceId: String!
93
- $sourceType: String!
94
- $signType: String
95
- $includeBuyerTaxCode: Boolean
96
- $buyerName: String
97
- $buyerTaxCode: String
98
- $buyerCompany: String
99
- $buyerAddress: String
100
- $sendMail: Boolean
101
- $receiverName: String
102
- $receiverEmail: String
103
- $byUser: String!
104
- ) {
105
- requestPublishVatInvoice(
106
- vatInvoiceRequest: {
107
- partnerId: $partnerId
108
- sourceId: $sourceId
109
- sourceType: $sourceType
110
- signType: $signType
111
- includeBuyerTaxCode: $includeBuyerTaxCode
112
- buyerName: $buyerName
113
- buyerTaxCode: $buyerTaxCode
114
- buyerCompany: $buyerCompany
115
- buyerAddress: $buyerAddress
116
- sendMail: $sendMail
117
- receiverName: $receiverName
118
- receiverEmail: $receiverEmail
119
- }
120
- byUser: $byUser
121
- ) {
122
- code
123
- message
124
- invoiceId
125
- sourceId
126
- sourceType
127
- previewLink
128
- lookupLink
129
- }
130
- }
89
+ exports.REQUEST_PUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
90
+ mutation RequestPublishVatInvoice(
91
+ $partnerId: String!
92
+ $sourceId: String!
93
+ $sourceType: String!
94
+ $signType: String
95
+ $includeBuyerTaxCode: Boolean
96
+ $buyerName: String
97
+ $buyerTaxCode: String
98
+ $buyerCompany: String
99
+ $buyerAddress: String
100
+ $sendMail: Boolean
101
+ $receiverName: String
102
+ $receiverEmail: String
103
+ $byUser: String!
104
+ ) {
105
+ requestPublishVatInvoice(
106
+ vatInvoiceRequest: {
107
+ partnerId: $partnerId
108
+ sourceId: $sourceId
109
+ sourceType: $sourceType
110
+ signType: $signType
111
+ includeBuyerTaxCode: $includeBuyerTaxCode
112
+ buyerName: $buyerName
113
+ buyerTaxCode: $buyerTaxCode
114
+ buyerCompany: $buyerCompany
115
+ buyerAddress: $buyerAddress
116
+ sendMail: $sendMail
117
+ receiverName: $receiverName
118
+ receiverEmail: $receiverEmail
119
+ }
120
+ byUser: $byUser
121
+ ) {
122
+ code
123
+ message
124
+ invoiceId
125
+ sourceId
126
+ sourceType
127
+ previewLink
128
+ lookupLink
129
+ }
130
+ }
131
131
  `;
132
- exports.UPDATE_INVOICE_ITEM = (0, graphql_tag_1.gql) `
133
- mutation UpdateInvoiceItem(
134
- $partnerId: String!
135
- $invoiceId: String!
136
- $updateInvoiceItemDTO: UpdateInvoiceItemDTO!
137
- $byUser: String!
138
- ) {
139
- updateInvoiceItem(
140
- partnerId: $partnerId
141
- invoiceId: $invoiceId
142
- updateInvoiceItemDTO: $updateInvoiceItemDTO
143
- byUser: $byUser
144
- ) {
145
- code
146
- message
147
- invoiceId
148
- sourceId
149
- sourceType
150
- previewLink
151
- lookupLink
152
- }
153
- }
132
+ exports.UPDATE_INVOICE_ITEM = (0, graphql_tag_1.gql) `
133
+ mutation UpdateInvoiceItem(
134
+ $partnerId: String!
135
+ $invoiceId: String!
136
+ $updateInvoiceItemDTO: UpdateInvoiceItemDTO!
137
+ $byUser: String!
138
+ ) {
139
+ updateInvoiceItem(
140
+ partnerId: $partnerId
141
+ invoiceId: $invoiceId
142
+ updateInvoiceItemDTO: $updateInvoiceItemDTO
143
+ byUser: $byUser
144
+ ) {
145
+ code
146
+ message
147
+ invoiceId
148
+ sourceId
149
+ sourceType
150
+ previewLink
151
+ lookupLink
152
+ }
153
+ }
154
154
  `;