@longvansoftware/service-js-client 2.4.9 → 2.5.0
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/crm_camping/queries.d.ts +13 -11
- package/dist/src/graphql/crm_camping/queries.js +11 -1
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +19 -1
- package/dist/src/lib/crm_camping/index.d.ts +1 -0
- package/dist/src/lib/crm_camping/index.js +20 -0
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +18 -0
- package/package.json +1 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
1
|
+
import { DocumentNode } from "graphql";
|
|
2
|
+
export declare const SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION: DocumentNode;
|
|
3
|
+
export declare const GET_CAMPAIGN_ACTION_BY_ID: DocumentNode;
|
|
4
|
+
export declare const SUGGEST_VOUCHER: DocumentNode;
|
|
5
|
+
export declare const GET_VOUCHERS: DocumentNode;
|
|
6
|
+
export declare const GET_AVERAGE_RATING: DocumentNode;
|
|
7
|
+
export declare const GET_URL_EVALUATION: DocumentNode;
|
|
8
|
+
export declare const GET_NUMBER_OF_TICKET_EVALUATION: DocumentNode;
|
|
9
|
+
export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: DocumentNode;
|
|
10
|
+
export declare const GET_VOUCHERS_V2: DocumentNode;
|
|
11
|
+
export declare const SEARCH_CAMPAIGN: DocumentNode;
|
|
12
|
+
export declare const GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS: DocumentNode;
|
|
13
|
+
export declare const GET_VOUCHERS_FOR_USER: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS = exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
3
|
+
exports.GET_VOUCHERS_FOR_USER = exports.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS = exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = (0, graphql_tag_1.gql) `
|
|
6
6
|
query SearchProductQuantityPromotionAction(
|
|
@@ -388,3 +388,13 @@ exports.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS = (0, graphql_tag_1.gql) `
|
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
`;
|
|
391
|
+
const GET_VOUCHERS_FOR_USER = (fields = []) => {
|
|
392
|
+
const fieldStr = fields.join("\n ");
|
|
393
|
+
const hasFields = fields.length > 0;
|
|
394
|
+
return (0, graphql_tag_1.gql) `
|
|
395
|
+
query getVouchersForUser($voucherForUserRequest: VoucherForUserRequest) {
|
|
396
|
+
getVouchersForUser(voucherForUserRequest: $voucherForUserRequest) ${hasFields ? `{ ${fieldStr} }` : ""}
|
|
397
|
+
}
|
|
398
|
+
`;
|
|
399
|
+
};
|
|
400
|
+
exports.GET_VOUCHERS_FOR_USER = GET_VOUCHERS_FOR_USER;
|
|
@@ -30,3 +30,4 @@ export declare const GET_SIMPLE_PRODUCTS_DYNAMIC: (fields?: string[]) => Documen
|
|
|
30
30
|
export declare const GET_PRODUCT_RELATED_TO_ARTICLE: (fields?: string[]) => DocumentNode;
|
|
31
31
|
export declare const GET_PRODUCTS_FEATURE_TYPE_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
32
32
|
export declare const GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
33
|
+
export declare const GET_PRODUCT_OPTION_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = exports.GET_PRODUCTS_FEATURE_TYPE_DYNAMIC = exports.GET_PRODUCT_RELATED_TO_ARTICLE = exports.GET_SIMPLE_PRODUCTS_DYNAMIC = exports.GET_PRICE_MENUS = exports.GET_CATEGORIES = exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = 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_SIMPLE_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
3
|
+
exports.GET_PRODUCT_OPTION_DYNAMIC = exports.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = exports.GET_PRODUCTS_FEATURE_TYPE_DYNAMIC = exports.GET_PRODUCT_RELATED_TO_ARTICLE = exports.GET_SIMPLE_PRODUCTS_DYNAMIC = exports.GET_PRICE_MENUS = exports.GET_CATEGORIES = exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = 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_SIMPLE_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
|
6
6
|
// query GetProductById(
|
|
@@ -1253,3 +1253,21 @@ const GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = (fields = []) => {
|
|
|
1253
1253
|
`;
|
|
1254
1254
|
};
|
|
1255
1255
|
exports.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC;
|
|
1256
|
+
const GET_PRODUCT_OPTION_DYNAMIC = (fields = []) => {
|
|
1257
|
+
const fieldStr = fields.join("\n ");
|
|
1258
|
+
const hasFields = fields.length > 0;
|
|
1259
|
+
return (0, graphql_tag_1.gql) `
|
|
1260
|
+
query GetProductOption(
|
|
1261
|
+
$partnerId: String!
|
|
1262
|
+
$storeChannel: String!
|
|
1263
|
+
$productId: String!
|
|
1264
|
+
) {
|
|
1265
|
+
getProductOption(
|
|
1266
|
+
partnerId: $partnerId
|
|
1267
|
+
storeChannel: $storeChannel
|
|
1268
|
+
productId: $productId
|
|
1269
|
+
) ${hasFields ? `{ ${fieldStr} }` : ""}
|
|
1270
|
+
}
|
|
1271
|
+
`;
|
|
1272
|
+
};
|
|
1273
|
+
exports.GET_PRODUCT_OPTION_DYNAMIC = GET_PRODUCT_OPTION_DYNAMIC;
|
|
@@ -16,4 +16,5 @@ export declare class CrmCampingService extends Service {
|
|
|
16
16
|
searchVouchersV2(searchVoucherRequest: any): Promise<any>;
|
|
17
17
|
searchCampaign(searchCampaignRequest: any): Promise<any>;
|
|
18
18
|
getConditionByOrgIdCampaignActionIds(campaignActionIds: [string]): Promise<any>;
|
|
19
|
+
getVouchersForUser(orderId: string, customerId: string, fields: string[]): Promise<any>;
|
|
19
20
|
}
|
|
@@ -276,5 +276,25 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
+
getVouchersForUser(orderId, customerId, fields) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
const query = (0, queries_1.GET_VOUCHERS_FOR_USER)(fields);
|
|
282
|
+
const variables = {
|
|
283
|
+
voucherForUserRequest: {
|
|
284
|
+
orderId: orderId,
|
|
285
|
+
customerId: customerId,
|
|
286
|
+
storeId: this.storeId,
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
try {
|
|
290
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
291
|
+
return response.getVouchersForUser;
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
console.log(`Error fetching getVouchersForUser: ${error}`);
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
279
299
|
}
|
|
280
300
|
exports.CrmCampingService = CrmCampingService;
|
|
@@ -57,4 +57,5 @@ export declare class ProductService extends Service {
|
|
|
57
57
|
getProductRelatedToArticle(articleId: string, storeId: string, fields: string[]): Promise<any>;
|
|
58
58
|
getProductFeatureTypesDynamic(productId: string, storeId: string, fields: string[]): Promise<any>;
|
|
59
59
|
getProductSimpleByHandle(handle: string, store: string, fields: string[]): Promise<any>;
|
|
60
|
+
getProductOptionDynamic(productId: string, store: string, fields: string[]): Promise<any>;
|
|
60
61
|
}
|
|
@@ -473,5 +473,23 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
+
getProductOptionDynamic(productId, store, fields) {
|
|
477
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
478
|
+
const query = (0, queries_1.GET_PRODUCT_OPTION_DYNAMIC)(fields);
|
|
479
|
+
const variablesHandle = {
|
|
480
|
+
partnerId: this.orgId,
|
|
481
|
+
storeChannel: store ? store : this.storeId,
|
|
482
|
+
productId,
|
|
483
|
+
};
|
|
484
|
+
try {
|
|
485
|
+
const response = yield this.graphqlQuery(query, variablesHandle);
|
|
486
|
+
return response.getProductOption;
|
|
487
|
+
}
|
|
488
|
+
catch (error) {
|
|
489
|
+
console.log(`Error fetching getProductOptionDynamic products: ${error}`);
|
|
490
|
+
throw error;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
476
494
|
}
|
|
477
495
|
exports.ProductService = ProductService;
|