@longvansoftware/storefront-js-client 4.7.7 → 4.7.9

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.
@@ -22,11 +22,7 @@ exports.GET_TAGS_BY_PRODUCT_ID = (0, graphql_tag_1.gql) `
22
22
  `;
23
23
  exports.SEARCH_TAG = (0, graphql_tag_1.gql) `
24
24
  query SearchTag($keyword: String, $currentPage: Int, $maxResult: Int) {
25
- searchTag(
26
- keyword: $keyword
27
- currentPage: $currentPage
28
- maxResult: $maxResult
29
- ) {
25
+ searchTag(keyword: $keyword, currentPage: $currentPage, maxResult: $maxResult) {
30
26
  total
31
27
  maxResult
32
28
  index
@@ -39,6 +35,7 @@ exports.SEARCH_TAG = (0, graphql_tag_1.gql) `
39
35
  storeIds
40
36
  selected
41
37
  title
38
+ tagId
42
39
  }
43
40
  }
44
41
  }
@@ -1,8 +1,10 @@
1
- export declare const GET_PAYMENT_METHOD: import("graphql").DocumentNode;
2
- export declare const GEN_QR_PAYMENT: import("graphql").DocumentNode;
3
- export declare const GET_PAYMENT_METHOD_OF_STORE_CHANNEL: import("graphql").DocumentNode;
4
- export declare const GET_INVOICE_DETAIL: import("graphql").DocumentNode;
5
- export declare const GET_INVOICES_OF_ORDER: import("graphql").DocumentNode;
6
- export declare const VIEW_PUBLISHED_INVOICE: import("graphql").DocumentNode;
7
- export declare const GET_INVOICE_ITEM_OF_INVOICE: import("graphql").DocumentNode;
8
- export declare const SUGGEST_INVOINCE_NOTE: import("graphql").DocumentNode;
1
+ import { DocumentNode } from "graphql";
2
+ export declare const GET_PAYMENT_METHOD: DocumentNode;
3
+ export declare const GEN_QR_PAYMENT: DocumentNode;
4
+ export declare const GET_PAYMENT_METHOD_OF_STORE_CHANNEL: DocumentNode;
5
+ export declare const GET_INVOICE_DETAIL: DocumentNode;
6
+ export declare const GET_INVOICES_OF_ORDER: DocumentNode;
7
+ export declare const VIEW_PUBLISHED_INVOICE: DocumentNode;
8
+ export declare const GET_INVOICE_ITEM_OF_INVOICE: DocumentNode;
9
+ export declare const SUGGEST_INVOINCE_NOTE: DocumentNode;
10
+ export declare const GET_BUSINESS_TAX_INFO: (fields?: string[]) => DocumentNode;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SUGGEST_INVOINCE_NOTE = exports.GET_INVOICE_ITEM_OF_INVOICE = exports.VIEW_PUBLISHED_INVOICE = exports.GET_INVOICES_OF_ORDER = exports.GET_INVOICE_DETAIL = exports.GET_PAYMENT_METHOD_OF_STORE_CHANNEL = exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
3
+ exports.GET_BUSINESS_TAX_INFO = exports.SUGGEST_INVOINCE_NOTE = exports.GET_INVOICE_ITEM_OF_INVOICE = exports.VIEW_PUBLISHED_INVOICE = exports.GET_INVOICES_OF_ORDER = exports.GET_INVOICE_DETAIL = exports.GET_PAYMENT_METHOD_OF_STORE_CHANNEL = exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
+ const helpers_1 = require("../../utils/helpers");
5
6
  exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
6
7
  query GetPaymentMethod($orgId: String!, $storeChannelId: String) {
7
8
  getPaymentMethod(orgId: $orgId, storeChannelId: $storeChannelId) {
@@ -12,29 +13,13 @@ exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
12
13
  }
13
14
  `;
14
15
  exports.GEN_QR_PAYMENT = (0, graphql_tag_1.gql) `
15
- query GenQRPayment(
16
- $orgId: String!
17
- $orderId: String!
18
- $storeId: String!
19
- $totalAmount: BigDecimal
20
- ) {
21
- genQRPayment(
22
- orgId: $orgId
23
- orderId: $orderId
24
- storeId: $storeId
25
- totalAmount: $totalAmount
26
- )
16
+ query GenQRPayment($orgId: String!, $orderId: String!, $storeId: String!, $totalAmount: BigDecimal) {
17
+ genQRPayment(orgId: $orgId, orderId: $orderId, storeId: $storeId, totalAmount: $totalAmount)
27
18
  }
28
19
  `;
29
20
  exports.GET_PAYMENT_METHOD_OF_STORE_CHANNEL = (0, graphql_tag_1.gql) `
30
- query GetPaymentMethodOfStoreChannel(
31
- $orgId: String!
32
- $storeChannelId: String!
33
- ) {
34
- getPaymentMethodOfStoreChannel(
35
- orgId: $orgId
36
- storeChannelId: $storeChannelId
37
- ) {
21
+ query GetPaymentMethodOfStoreChannel($orgId: String!, $storeChannelId: String!) {
22
+ getPaymentMethodOfStoreChannel(orgId: $orgId, storeChannelId: $storeChannelId) {
38
23
  id
39
24
  code
40
25
  name
@@ -131,3 +116,19 @@ exports.SUGGEST_INVOINCE_NOTE = (0, graphql_tag_1.gql) `
131
116
  suggestInvoiceNote(partnerId: $partnerId, query: $query)
132
117
  }
133
118
  `;
119
+ const GET_BUSINESS_TAX_INFO = (fields = []) => {
120
+ const fieldStr = (0, helpers_1.joinField)(fields);
121
+ const hasField = (0, helpers_1.hasFields)(fields);
122
+ return (0, graphql_tag_1.gql) `
123
+ query getBusinessTaxInfo(
124
+ $taxCode: String!
125
+ ) {
126
+ getBusinessTaxInfo(
127
+ taxCode: $taxCode
128
+ ) {
129
+ ${hasField ? `${fieldStr}` : ""}
130
+ }
131
+ }
132
+ `;
133
+ };
134
+ exports.GET_BUSINESS_TAX_INFO = GET_BUSINESS_TAX_INFO;
@@ -17,4 +17,5 @@ export declare class PaymentService extends Service {
17
17
  deleteInvoiceItem(invoiceId: string, invoiceItemId: string, byUser: string): Promise<any>;
18
18
  reorderInvoiceItems(invoiceId: string, items: [any], byUser: string): Promise<any>;
19
19
  suggestInvoiceNote(query: string): Promise<any>;
20
+ getBusinessTaxInfo(taxCode: string, fields: string[]): Promise<any>;
20
21
  }
@@ -21,7 +21,7 @@ class PaymentService extends serviceSDK_1.Service {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  const query = queries_1.GET_PAYMENT_METHOD;
23
23
  const variables = {
24
- orgId: this.orgId,
24
+ orgId: this.orgId
25
25
  };
26
26
  try {
27
27
  const response = yield this.graphqlQuery(query, variables);
@@ -53,7 +53,7 @@ class PaymentService extends serviceSDK_1.Service {
53
53
  orgId: this.orgId,
54
54
  orderId,
55
55
  storeId: this.storeId,
56
- totalAmount,
56
+ totalAmount
57
57
  };
58
58
  try {
59
59
  const response = yield this.graphqlQuery(query, variables);
@@ -70,7 +70,7 @@ class PaymentService extends serviceSDK_1.Service {
70
70
  const query = queries_1.GET_PAYMENT_METHOD_OF_STORE_CHANNEL;
71
71
  const variables = {
72
72
  orgId: this.orgId,
73
- storeChannelId: this.storeId,
73
+ storeChannelId: this.storeId
74
74
  };
75
75
  try {
76
76
  const response = yield this.graphqlQuery(query, variables);
@@ -85,7 +85,7 @@ class PaymentService extends serviceSDK_1.Service {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  const query = queries_1.GET_INVOICE_DETAIL;
87
87
  const variables = {
88
- invoiceId: invoiceId,
88
+ invoiceId: invoiceId
89
89
  };
90
90
  try {
91
91
  const response = yield this.graphqlQueryV2(query, variables);
@@ -99,7 +99,7 @@ class PaymentService extends serviceSDK_1.Service {
99
99
  requestUnpublishVatInvoice(VatInvoiceRequest, byUser) {
100
100
  return __awaiter(this, void 0, void 0, function* () {
101
101
  const mutation = mutations_1.REQUEST_UNPUBLISH_VAT_INVOICE;
102
- const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerPhone, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
102
+ const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerPhone, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail } = VatInvoiceRequest;
103
103
  const variables = {
104
104
  partnerId: this.orgId,
105
105
  sourceId,
@@ -114,7 +114,7 @@ class PaymentService extends serviceSDK_1.Service {
114
114
  sendMail,
115
115
  receiverName,
116
116
  receiverEmail,
117
- byUser,
117
+ byUser
118
118
  };
119
119
  try {
120
120
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -128,7 +128,7 @@ class PaymentService extends serviceSDK_1.Service {
128
128
  requestPublishVatInvoice(VatInvoiceRequest, byUser) {
129
129
  return __awaiter(this, void 0, void 0, function* () {
130
130
  const mutation = mutations_1.REQUEST_PUBLISH_VAT_INVOICE;
131
- const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerPhone, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
131
+ const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerPhone, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail } = VatInvoiceRequest;
132
132
  const variables = {
133
133
  partnerId: this.orgId,
134
134
  sourceId,
@@ -143,7 +143,7 @@ class PaymentService extends serviceSDK_1.Service {
143
143
  sendMail,
144
144
  receiverName,
145
145
  receiverEmail,
146
- byUser,
146
+ byUser
147
147
  };
148
148
  try {
149
149
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -158,7 +158,7 @@ class PaymentService extends serviceSDK_1.Service {
158
158
  return __awaiter(this, void 0, void 0, function* () {
159
159
  const query = queries_1.GET_INVOICES_OF_ORDER;
160
160
  const variables = {
161
- orderId,
161
+ orderId
162
162
  };
163
163
  try {
164
164
  const response = yield this.graphqlQueryV3(query, variables);
@@ -174,7 +174,7 @@ class PaymentService extends serviceSDK_1.Service {
174
174
  const query = queries_1.VIEW_PUBLISHED_INVOICE;
175
175
  const variables = {
176
176
  partnerId: this.orgId,
177
- invoiceId,
177
+ invoiceId
178
178
  };
179
179
  try {
180
180
  const response = yield this.graphqlQueryV3(query, variables);
@@ -192,7 +192,7 @@ class PaymentService extends serviceSDK_1.Service {
192
192
  partnerId: this.orgId,
193
193
  invoiceId,
194
194
  updateInvoiceItemDTO,
195
- byUser,
195
+ byUser
196
196
  };
197
197
  try {
198
198
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -207,7 +207,7 @@ class PaymentService extends serviceSDK_1.Service {
207
207
  return __awaiter(this, void 0, void 0, function* () {
208
208
  const query = queries_1.GET_INVOICE_ITEM_OF_INVOICE;
209
209
  const variables = {
210
- invoiceId,
210
+ invoiceId
211
211
  };
212
212
  try {
213
213
  const response = yield this.graphqlQueryV3(query, variables);
@@ -225,7 +225,7 @@ class PaymentService extends serviceSDK_1.Service {
225
225
  partnerId: this.orgId,
226
226
  invoiceId,
227
227
  invoiceItem,
228
- byUser,
228
+ byUser
229
229
  };
230
230
  try {
231
231
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -243,7 +243,7 @@ class PaymentService extends serviceSDK_1.Service {
243
243
  partnerId: this.orgId,
244
244
  invoiceId,
245
245
  invoiceItemId,
246
- byUser,
246
+ byUser
247
247
  };
248
248
  try {
249
249
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -260,7 +260,7 @@ class PaymentService extends serviceSDK_1.Service {
260
260
  const variables = {
261
261
  invoiceId,
262
262
  items,
263
- byUser,
263
+ byUser
264
264
  };
265
265
  try {
266
266
  const response = yield this.graphqlMutationV3(mutation, variables);
@@ -276,7 +276,7 @@ class PaymentService extends serviceSDK_1.Service {
276
276
  const queries = queries_1.SUGGEST_INVOINCE_NOTE;
277
277
  const variables = {
278
278
  partnerId: this.orgId,
279
- query,
279
+ query
280
280
  };
281
281
  try {
282
282
  const response = yield this.graphqlQueryV3(queries, variables);
@@ -287,5 +287,21 @@ class PaymentService extends serviceSDK_1.Service {
287
287
  }
288
288
  });
289
289
  }
290
+ getBusinessTaxInfo(taxCode, fields) {
291
+ return __awaiter(this, void 0, void 0, function* () {
292
+ const query = (0, queries_1.GET_BUSINESS_TAX_INFO)(fields);
293
+ const variables = {
294
+ taxCode
295
+ };
296
+ try {
297
+ const response = yield this.graphqlQuery(query, variables);
298
+ return response.getBusinessTaxInfo;
299
+ }
300
+ catch (error) {
301
+ console.log(`Error in getBusinessTaxInfo: ${error}`);
302
+ throw error;
303
+ }
304
+ });
305
+ }
290
306
  }
291
307
  exports.PaymentService = PaymentService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.7.7",
3
+ "version": "4.7.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
File without changes
@@ -1 +0,0 @@
1
- "use strict";