@longvansoftware/service-js-client 2.8.1 → 2.8.3

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 (43) hide show
  1. package/dist/config/config.js +1 -1
  2. package/dist/src/graphql/campaign/queries.d.ts +11 -13
  3. package/dist/src/graphql/campaign/queries.js +111 -39
  4. package/dist/src/graphql/cloud/mutations.d.ts +3 -0
  5. package/dist/src/graphql/cloud/mutations.js +62 -1
  6. package/dist/src/graphql/cloud/queries.d.ts +2 -0
  7. package/dist/src/graphql/cloud/queries.js +34 -1
  8. package/dist/src/graphql/paymentV2/mutations.d.ts +0 -1
  9. package/dist/src/graphql/paymentV2/mutations.js +1 -15
  10. package/dist/src/graphql/paymentV2/queries.d.ts +0 -2
  11. package/dist/src/graphql/paymentV2/queries.js +1 -58
  12. package/dist/src/lib/campaign/index.d.ts +0 -1
  13. package/dist/src/lib/campaign/index.js +12 -69
  14. package/dist/src/lib/cloud/index.d.ts +6 -1
  15. package/dist/src/lib/cloud/index.js +84 -0
  16. package/dist/src/lib/paymentV2/index.d.ts +0 -10
  17. package/dist/src/lib/paymentV2/index.js +0 -39
  18. package/dist/src/lib/portal/index.d.ts +0 -3
  19. package/dist/src/lib/portal/index.js +0 -50
  20. package/dist/src/lib/service.d.ts +14 -0
  21. package/dist/src/lib/service.js +101 -0
  22. package/dist/src/types/cloud.d.ts +37 -0
  23. package/dist/src/utils/build-field-string.d.ts +1 -0
  24. package/dist/src/utils/build-field-string.js +16 -0
  25. package/package.json +1 -1
  26. package/dist/src/graphql/marketplace/mutations.d.ts +0 -3
  27. package/dist/src/graphql/marketplace/mutations.js +0 -54
  28. package/dist/src/graphql/marketplace/queries.d.ts +0 -2
  29. package/dist/src/graphql/marketplace/queries.js +0 -42
  30. package/dist/src/graphql/storefont/mutation.d.ts +0 -0
  31. package/dist/src/graphql/storefont/mutation.js +0 -1
  32. package/dist/src/graphql/storefont/queries.d.ts +0 -2
  33. package/dist/src/graphql/storefont/queries.js +0 -46
  34. package/dist/src/graphql/tag/mutations.d.ts +0 -2
  35. package/dist/src/graphql/tag/mutations.js +0 -44
  36. package/dist/src/graphql/tag/queries.d.ts +0 -1
  37. package/dist/src/graphql/tag/queries.js +0 -20
  38. package/dist/src/lib/marketplace/index.d.ts +0 -9
  39. package/dist/src/lib/marketplace/index.js +0 -106
  40. package/dist/src/lib/storefont/index.d.ts +0 -6
  41. package/dist/src/lib/storefont/index.js +0 -51
  42. package/dist/src/lib/tag/index.d.ts +0 -7
  43. package/dist/src/lib/tag/index.js +0 -61
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEARCH_TAG = exports.GET_TAGS_BY_PRODUCT_ID = void 0;
4
- const graphql_tag_1 = require("graphql-tag");
5
- exports.GET_TAGS_BY_PRODUCT_ID = (0, graphql_tag_1.gql) `
6
- query GetTagsByProductId($productId: String!) {
7
- getTagsByProductId(productId: $productId) {
8
- id
9
- title
10
- items {
11
- id
12
- name
13
- slug
14
- type
15
- scope
16
- storeIds
17
- selected
18
- title
19
- }
20
- }
21
- }
22
- `;
23
- exports.SEARCH_TAG = (0, graphql_tag_1.gql) `
24
- query SearchTag($keyword: String, $currentPage: Int, $maxResult: Int) {
25
- searchTag(keyword: $keyword, currentPage: $currentPage, maxResult: $maxResult) {
26
- total
27
- maxResult
28
- index
29
- resultList {
30
- id
31
- name
32
- slug
33
- type
34
- scope
35
- storeIds
36
- selected
37
- title
38
- tagId
39
- }
40
- }
41
- }
42
- `;
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- export declare const GET_REVENUE_STATISTIC_BY_PRODUCT: import("graphql").DocumentNode;
2
- export declare const GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY: import("graphql").DocumentNode;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = exports.GET_REVENUE_STATISTIC_BY_PRODUCT = void 0;
4
- const graphql_tag_1 = require("graphql-tag");
5
- exports.GET_REVENUE_STATISTIC_BY_PRODUCT = (0, graphql_tag_1.gql) `
6
- query GetRevenueStatisticByProduct($input: ProductStatisticPagedInput!) {
7
- getRevenueStatisticByProduct(input: $input) {
8
- totalElements
9
- totalPages
10
- page
11
- size
12
- content {
13
- id
14
- name
15
- sku
16
- image
17
- productParentId
18
- totalQuantity
19
- inventory
20
- }
21
- }
22
- }
23
- `;
24
- exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = (0, graphql_tag_1.gql) `
25
- query GetRevenueStatisticByGroupOrCategory(
26
- $input: ProductStatisticInput!
27
- $groupBy: StatisticGroupBy!
28
- ) {
29
- getRevenueStatisticByGroupOrCategory(input: $input, groupBy: $groupBy) {
30
- totalElements
31
- totalPages
32
- page
33
- size
34
- content {
35
- id
36
- name
37
- totalOrders
38
- totalPriceOfSales
39
- totalPriceOfService
40
- totalPriceOfRenewals
41
- totalPrice
42
- totalNotPayYet
43
- }
44
- }
45
- }
46
- `;
@@ -1,2 +0,0 @@
1
- export declare const ADD_TAG_TO_TAG_GROUP: import("graphql").DocumentNode;
2
- export declare const REMOVE_TAG_TO_TAG_GROUP: import("graphql").DocumentNode;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REMOVE_TAG_TO_TAG_GROUP = exports.ADD_TAG_TO_TAG_GROUP = void 0;
4
- const graphql_tag_1 = require("graphql-tag");
5
- exports.ADD_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
6
- mutation AddTagToTagGroup(
7
- $resourceId: String!
8
- $resourceType: String!
9
- $tagId: String!
10
- $tagGroupId: String
11
- $addedBy: String!
12
- ) {
13
- addTagToTagGroup(
14
- resourceId: $resourceId
15
- resourceType: $resourceType
16
- tagId: $tagId
17
- tagGroupId: $tagGroupId
18
- addedBy: $addedBy
19
- ) {
20
- code
21
- message
22
- }
23
- }
24
- `;
25
- exports.REMOVE_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
26
- mutation RemoveTagToTagGroup(
27
- $resourceId: String!
28
- $resourceType: String!
29
- $tagId: String!
30
- $tagGroupId: String
31
- $updateBy: String!
32
- ) {
33
- removeTagToTagGroup(
34
- resourceId: $resourceId
35
- resourceType: $resourceType
36
- tagId: $tagId
37
- tagGroupId: $tagGroupId
38
- updateBy: $updateBy
39
- ) {
40
- code
41
- message
42
- }
43
- }
44
- `;
@@ -1 +0,0 @@
1
- export declare const GET_RESULT_TAG: import("graphql").DocumentNode;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_RESULT_TAG = void 0;
4
- const graphql_tag_1 = require("graphql-tag");
5
- exports.GET_RESULT_TAG = (0, graphql_tag_1.gql) `
6
- query GetResultTag($resourceId: String!, $resourceType: String!) {
7
- getResultTag(resourceId: $resourceId, resourceType: $resourceType) {
8
- id
9
- title
10
- items {
11
- id
12
- title
13
- items {
14
- id
15
- title
16
- }
17
- }
18
- }
19
- }
20
- `;
@@ -1,9 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class MarketPlaceService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- createTag(name: string, slug: string, createdBy: string): Promise<any>;
5
- searchTag(keyword: string, currentPage: number, maxResult: number): Promise<any>;
6
- getTagsByProductId(productId: string): Promise<any>;
7
- removeProductTag(productId: string, tagId: string, updatedBy: string, tagGroupId?: string): Promise<any>;
8
- addProductTag(productId: string, tagId: string, createBy: string, tagGroupId?: string): Promise<any>;
9
- }
@@ -1,106 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MarketPlaceService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- const queries_1 = require("../../graphql/marketplace/queries");
15
- const mutations_1 = require("../../graphql/marketplace/mutations");
16
- class MarketPlaceService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- createTag(name, slug, createdBy) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const mutation = mutations_1.CREATE_TAG;
23
- const variables = {
24
- name,
25
- slug,
26
- createdBy,
27
- };
28
- try {
29
- const response = yield this.graphqlMutation(mutation, variables);
30
- return response.createTag;
31
- }
32
- catch (error) {
33
- throw error;
34
- }
35
- });
36
- }
37
- searchTag(keyword, currentPage, maxResult) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const queries = queries_1.SEARCH_TAG;
40
- const variables = {
41
- keyword,
42
- currentPage,
43
- maxResult,
44
- };
45
- try {
46
- const response = yield this.graphqlQuery(queries, variables);
47
- return response.searchTag;
48
- }
49
- catch (error) {
50
- throw error;
51
- }
52
- });
53
- }
54
- getTagsByProductId(productId) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const queries = queries_1.GET_TAGS_BY_PRODUCT_ID;
57
- const variables = {
58
- productId,
59
- };
60
- try {
61
- const response = yield this.graphqlQuery(queries, variables);
62
- return response.getTagsByProductId;
63
- }
64
- catch (error) {
65
- throw error;
66
- }
67
- });
68
- }
69
- removeProductTag(productId, tagId, updatedBy, tagGroupId) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- const mutation = mutations_1.REMOVE_PRODUCT_TAG;
72
- const variables = {
73
- productId,
74
- tagId,
75
- updatedBy,
76
- tagGroupId,
77
- };
78
- try {
79
- const response = yield this.graphqlMutation(mutation, variables);
80
- return response.removeProductTag;
81
- }
82
- catch (error) {
83
- throw error;
84
- }
85
- });
86
- }
87
- addProductTag(productId, tagId, createBy, tagGroupId) {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- const mutation = mutations_1.ADD_PRODUCT_TAG;
90
- const variables = {
91
- productId,
92
- tagId,
93
- createBy,
94
- tagGroupId,
95
- };
96
- try {
97
- const response = yield this.graphqlMutation(mutation, variables);
98
- return response.addProductTag;
99
- }
100
- catch (error) {
101
- throw error;
102
- }
103
- });
104
- }
105
- }
106
- exports.MarketPlaceService = MarketPlaceService;
@@ -1,6 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class StorefontService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- getRevenueStatisticByGroupOrCategory(dataQuery: any, groupBy: any): Promise<any>;
5
- getRevenueStatisticByProduct(dataQuery: any): Promise<any>;
6
- }
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StorefontService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- const queries_1 = require("../../graphql/storefont/queries");
15
- class StorefontService extends serviceSDK_1.Service {
16
- constructor(endpoint, orgId, storeId) {
17
- super(endpoint, orgId, storeId);
18
- }
19
- getRevenueStatisticByGroupOrCategory(dataQuery, groupBy) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = queries_1.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY;
22
- const variables = {
23
- input: dataQuery,
24
- groupBy,
25
- };
26
- try {
27
- const response = yield this.graphqlQuery(query, variables);
28
- return response.getRevenueStatisticByGroupOrCategory;
29
- }
30
- catch (error) {
31
- throw error;
32
- }
33
- });
34
- }
35
- getRevenueStatisticByProduct(dataQuery) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const query = queries_1.GET_REVENUE_STATISTIC_BY_PRODUCT;
38
- const variables = {
39
- input: dataQuery,
40
- };
41
- try {
42
- const response = yield this.graphqlQuery(query, variables);
43
- return response.getRevenueStatisticByProduct;
44
- }
45
- catch (error) {
46
- throw error;
47
- }
48
- });
49
- }
50
- }
51
- exports.StorefontService = StorefontService;
@@ -1,7 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class TagService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- addTagToTagGroup(data: any): Promise<any>;
5
- removeTagToTagGroup(data: any): Promise<any>;
6
- getResultTag(resourceId: string, resourceType: string): Promise<any>;
7
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TagService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- const mutations_1 = require("../../graphql/tag/mutations");
15
- const queries_1 = require("../../graphql/tag/queries");
16
- class TagService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- addTagToTagGroup(data) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const mutation = mutations_1.ADD_TAG_TO_TAG_GROUP;
23
- try {
24
- const response = yield this.graphqlMutation(mutation, data);
25
- return response.addTagToTagGroup;
26
- }
27
- catch (error) {
28
- throw error;
29
- }
30
- });
31
- }
32
- removeTagToTagGroup(data) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const mutation = mutations_1.REMOVE_TAG_TO_TAG_GROUP;
35
- try {
36
- const response = yield this.graphqlMutation(mutation, data);
37
- return response.removeTagToTagGroup;
38
- }
39
- catch (error) {
40
- throw error;
41
- }
42
- });
43
- }
44
- getResultTag(resourceId, resourceType) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const queries = queries_1.GET_RESULT_TAG;
47
- const variables = {
48
- resourceId,
49
- resourceType,
50
- };
51
- try {
52
- const response = yield this.graphqlMutationV3(queries, variables);
53
- return response.getResultTag;
54
- }
55
- catch (error) {
56
- throw error;
57
- }
58
- });
59
- }
60
- }
61
- exports.TagService = TagService;