@longvansoftware/storefront-js-client 4.0.4 → 4.0.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.
- package/dist/src/graphql/campaign/queries.d.ts +1 -0
- package/dist/src/graphql/campaign/queries.js +21 -1
- package/dist/src/graphql/payment/mutations.d.ts +1 -0
- package/dist/src/graphql/payment/mutations.js +24 -1
- package/dist/src/lib/campaign/index.d.ts +1 -0
- package/dist/src/lib/campaign/index.js +15 -0
- package/dist/src/lib/payment/index.d.ts +1 -0
- package/dist/src/lib/payment/index.js +18 -0
- package/package.json +1 -1
|
@@ -7,3 +7,4 @@ export declare const GET_VOUCHER_AVAILABLE_FOR_CUSTOMER: import("graphql").Docum
|
|
|
7
7
|
export declare const SUGGEST_VOUCHER: import("graphql").DocumentNode;
|
|
8
8
|
export declare const GET_CAMPAIGN_ACTION_BY_ID: import("graphql").DocumentNode;
|
|
9
9
|
export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: import("graphql").DocumentNode;
|
|
10
|
+
export declare const GET_CAMPAIGN: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SUGGEST_VOUCHER = exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
|
|
3
|
+
exports.GET_CAMPAIGN = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SUGGEST_VOUCHER = exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetCampaignActionActiveNow(
|
|
@@ -425,3 +425,23 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
`;
|
|
428
|
+
exports.GET_CAMPAIGN = (0, graphql_tag_1.gql) `
|
|
429
|
+
query GetCampaign($id: String!) {
|
|
430
|
+
getCampaign(id: $id) {
|
|
431
|
+
id
|
|
432
|
+
createdStamp
|
|
433
|
+
updatedStamp
|
|
434
|
+
updatedBy
|
|
435
|
+
createdBy
|
|
436
|
+
useForAll
|
|
437
|
+
description
|
|
438
|
+
partyId
|
|
439
|
+
name
|
|
440
|
+
type
|
|
441
|
+
domain
|
|
442
|
+
fromDate
|
|
443
|
+
toDate
|
|
444
|
+
status
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
`;
|
|
@@ -2,3 +2,4 @@ export declare const CREATE_PAYMENT_ORDER_MUTATION: import("graphql").DocumentNo
|
|
|
2
2
|
export declare const REQUEST_UNPUBLISH_VAT_INVOICE: import("graphql").DocumentNode;
|
|
3
3
|
export declare const REQUEST_PUBLISH_VAT_INVOICE: import("graphql").DocumentNode;
|
|
4
4
|
export declare const UPDATE_INVOICE_ITEM: import("graphql").DocumentNode;
|
|
5
|
+
export declare const ADD_INVOICE_ITEM: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPDATE_INVOICE_ITEM = exports.REQUEST_PUBLISH_VAT_INVOICE = exports.REQUEST_UNPUBLISH_VAT_INVOICE = exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
|
|
3
|
+
exports.ADD_INVOICE_ITEM = 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
5
|
exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation CreatePaymentOrder(
|
|
@@ -152,3 +152,26 @@ exports.UPDATE_INVOICE_ITEM = (0, graphql_tag_1.gql) `
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
`;
|
|
155
|
+
exports.ADD_INVOICE_ITEM = (0, graphql_tag_1.gql) `
|
|
156
|
+
mutation AddInvoiceItem(
|
|
157
|
+
$partnerId: String!
|
|
158
|
+
$invoiceId: String!
|
|
159
|
+
$invoiceItem: InvoiceItemInput!
|
|
160
|
+
$byUser: String!
|
|
161
|
+
) {
|
|
162
|
+
addInvoiceItem(
|
|
163
|
+
partnerId: $partnerId
|
|
164
|
+
invoiceId: $invoiceId
|
|
165
|
+
invoiceItem: $invoiceItem
|
|
166
|
+
byUser: $byUser
|
|
167
|
+
) {
|
|
168
|
+
code
|
|
169
|
+
message
|
|
170
|
+
invoiceId
|
|
171
|
+
sourceId
|
|
172
|
+
sourceType
|
|
173
|
+
previewLink
|
|
174
|
+
lookupLink
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
@@ -17,4 +17,5 @@ export declare class CampaignService extends Service {
|
|
|
17
17
|
suggestVoucher(customerId: string, campaignId: string, campaignActionId: string, isBirthday: Boolean): Promise<any>;
|
|
18
18
|
getCampaignActionById(id: string): Promise<any>;
|
|
19
19
|
searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
|
|
20
|
+
getCampaign(id: string): Promise<any>;
|
|
20
21
|
}
|
|
@@ -214,5 +214,20 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
+
getCampaign(id) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
const query = queries_1.GET_CAMPAIGN;
|
|
220
|
+
const variables = {
|
|
221
|
+
id,
|
|
222
|
+
};
|
|
223
|
+
try {
|
|
224
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
225
|
+
return response.getCampaign;
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
217
232
|
}
|
|
218
233
|
exports.CampaignService = CampaignService;
|
|
@@ -13,4 +13,5 @@ export declare class PaymentService extends Service {
|
|
|
13
13
|
viewPublishedInvoice(invoiceId: string): Promise<any>;
|
|
14
14
|
updateInvoiceItem(invoiceId: string, updateInvoiceItemDTO: any, byUser: string): Promise<any>;
|
|
15
15
|
getInvoiceItemOfInvoie(invoiceId: string): Promise<any>;
|
|
16
|
+
addInvoiceItem(invoiceId: string, invoiceItem: any, byUser: string): Promise<any>;
|
|
16
17
|
}
|
|
@@ -216,5 +216,23 @@ class PaymentService extends serviceSDK_1.Service {
|
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
+
addInvoiceItem(invoiceId, invoiceItem, byUser) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
221
|
+
const mutation = mutations_1.ADD_INVOICE_ITEM;
|
|
222
|
+
const variables = {
|
|
223
|
+
partnerId: this.orgId,
|
|
224
|
+
invoiceId,
|
|
225
|
+
invoiceItem,
|
|
226
|
+
byUser,
|
|
227
|
+
};
|
|
228
|
+
try {
|
|
229
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
230
|
+
return response.addInvoiceItem;
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
219
237
|
}
|
|
220
238
|
exports.PaymentService = PaymentService;
|