@longvansoftware/storefront-js-client 3.7.5 → 3.7.8

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 (55) hide show
  1. package/dist/src/graphql/product/queries.d.ts +1 -0
  2. package/dist/src/graphql/product/queries.js +59 -1
  3. package/dist/src/lib/product/index.d.ts +1 -0
  4. package/dist/src/lib/product/index.js +17 -0
  5. package/package.json +2 -3
  6. package/dist/src/graphql/accounting_service/mutations.d.ts +0 -2
  7. package/dist/src/graphql/accounting_service/mutations.js +0 -102
  8. package/dist/src/graphql/accounting_service/queries.d.ts +0 -1
  9. package/dist/src/graphql/accounting_service/queries.js +0 -62
  10. package/dist/src/graphql/crm_camping/mutations.d.ts +0 -1
  11. package/dist/src/graphql/crm_camping/mutations.js +0 -37
  12. package/dist/src/graphql/crm_camping/queries.d.ts +0 -8
  13. package/dist/src/graphql/crm_camping/queries.js +0 -279
  14. package/dist/src/graphql/fragments/product.d.ts +0 -38
  15. package/dist/src/graphql/fragments/product.js +0 -196
  16. package/dist/src/graphql/orderGraphQL/mutations.d.ts +0 -4
  17. package/dist/src/graphql/orderGraphQL/mutations.js +0 -359
  18. package/dist/src/graphql/orderGraphQL/queries.d.ts +0 -7
  19. package/dist/src/graphql/orderGraphQL/queries.js +0 -402
  20. package/dist/src/graphql/paymentLV/mutations.d.ts +0 -2
  21. package/dist/src/graphql/paymentLV/mutations.js +0 -25
  22. package/dist/src/graphql/paymentLV/queries.d.ts +0 -4
  23. package/dist/src/graphql/paymentLV/queries.js +0 -83
  24. package/dist/src/graphql/quicklab_service/mutations.d.ts +0 -8
  25. package/dist/src/graphql/quicklab_service/mutations.js +0 -171
  26. package/dist/src/graphql/quicklab_service/queries.d.ts +0 -6
  27. package/dist/src/graphql/quicklab_service/queries.js +0 -121
  28. package/dist/src/graphql/resource_permission/mutations.d.ts +0 -2
  29. package/dist/src/graphql/resource_permission/mutations.js +0 -63
  30. package/dist/src/graphql/resource_permission/queries.d.ts +0 -1
  31. package/dist/src/graphql/resource_permission/queries.js +0 -18
  32. package/dist/src/lib/accounting_service/index.d.ts +0 -9
  33. package/dist/src/lib/accounting_service/index.js +0 -69
  34. package/dist/src/lib/cloud_rest/index.d.ts +0 -17
  35. package/dist/src/lib/cloud_rest/index.js +0 -101
  36. package/dist/src/lib/crm_camping/index.d.ts +0 -16
  37. package/dist/src/lib/crm_camping/index.js +0 -227
  38. package/dist/src/lib/dns/index.d.ts +0 -7
  39. package/dist/src/lib/dns/index.js +0 -40
  40. package/dist/src/lib/orderGraphQL/index.d.ts +0 -16
  41. package/dist/src/lib/orderGraphQL/index.js +0 -192
  42. package/dist/src/lib/order_cloud_rest/index.d.ts +0 -7
  43. package/dist/src/lib/order_cloud_rest/index.js +0 -39
  44. package/dist/src/lib/paymentLV/index.d.ts +0 -12
  45. package/dist/src/lib/paymentLV/index.js +0 -132
  46. package/dist/src/lib/quicklab_service/index.d.ts +0 -18
  47. package/dist/src/lib/quicklab_service/index.js +0 -197
  48. package/dist/src/lib/resource_permission/index.d.ts +0 -9
  49. package/dist/src/lib/resource_permission/index.js +0 -81
  50. package/dist/src/lib/shareZalo/index.d.ts +0 -5
  51. package/dist/src/lib/shareZalo/index.js +0 -32
  52. package/dist/src/types/common.d.ts +0 -264
  53. package/dist/src/types/common.js +0 -35
  54. package/dist/src/utils/errorHandler.d.ts +0 -64
  55. package/dist/src/utils/errorHandler.js +0 -197
@@ -1,40 +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.DnsService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- class DnsService extends serviceSDK_1.Service {
15
- constructor(endpoint, orgId, storeId) {
16
- super(endpoint, orgId, storeId);
17
- }
18
- setToken(token) {
19
- this.token = token;
20
- }
21
- setStoreId(storeId) {
22
- this.storeId = storeId;
23
- }
24
- getDomain(params) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- console.log("🚀 ~ DnsService ~ getDomain ~ params:", params);
27
- const endpoint = `/domain`;
28
- const method = "POST";
29
- try {
30
- const response = yield this.restApiCallWithToken(endpoint, method, params);
31
- return response;
32
- }
33
- catch (error) {
34
- console.log(`Error in addVoucher: ${error}`);
35
- throw error;
36
- }
37
- });
38
- }
39
- }
40
- exports.DnsService = DnsService;
@@ -1,16 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class OrderGraphQLService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- setToken(token: string): void;
5
- setStoreId(storeId: string): void;
6
- createOrder(input: any): Promise<any>;
7
- getOrderDetail(orderId: string): Promise<any>;
8
- getOrderDetailDynamic(orderId: string, fields: string[]): Promise<any>;
9
- getQuantityOrderLineItems(orderId: string): Promise<any>;
10
- updateQuantityV2(payload: any): Promise<any>;
11
- getOrderLineItemByServiceId(serviceId: string): Promise<any>;
12
- getOrderByServiceId(serviceId: string): Promise<any>;
13
- addToCart(serviceId: string, actorId: string, cartId: string): Promise<any>;
14
- removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
15
- findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
16
- }
@@ -1,192 +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.OrderGraphQLService = void 0;
13
- const mutations_1 = require("../../graphql/orderGraphQL/mutations");
14
- const queries_1 = require("../../graphql/orderGraphQL/queries");
15
- const serviceSDK_1 = require("../serviceSDK");
16
- class OrderGraphQLService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- setToken(token) {
21
- this.token = token;
22
- }
23
- setStoreId(storeId) {
24
- this.storeId = storeId;
25
- }
26
- createOrder(input) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const mutation = mutations_1.CREATE_ORDER;
29
- const variables = {
30
- input,
31
- };
32
- try {
33
- const response = yield this.graphqlMutationV2(mutation, variables);
34
- return response.createOrder;
35
- }
36
- catch (error) {
37
- console.log(`Error in createOrder: ${error}`);
38
- throw error;
39
- }
40
- });
41
- }
42
- getOrderDetail(orderId) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- const query = queries_1.GET_ORDER_DETAIL;
45
- const variables = {
46
- orderId,
47
- };
48
- try {
49
- const response = yield this.graphqlQueryV2(query, variables);
50
- return response.orderDetail;
51
- }
52
- catch (error) {
53
- console.log(`Error in orderDetail: ${error}`);
54
- throw error;
55
- }
56
- });
57
- }
58
- getOrderDetailDynamic(orderId, fields) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const query = (0, queries_1.GET_ORDER_DETAIL_DYNAMIC)(fields);
61
- const variables = {
62
- orderId,
63
- };
64
- try {
65
- const response = yield this.graphqlQueryV2(query, variables);
66
- return response.orderDetail;
67
- }
68
- catch (error) {
69
- console.log(`Error in orderDetailDynamic: ${error}`);
70
- throw error;
71
- }
72
- });
73
- }
74
- getQuantityOrderLineItems(orderId) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;
77
- const variables = {
78
- orderId,
79
- };
80
- try {
81
- const response = yield this.graphqlQueryV2(query, variables);
82
- return response.orderDetail;
83
- }
84
- catch (error) {
85
- console.log(`Error in orderDetail: ${error}`);
86
- throw error;
87
- }
88
- });
89
- }
90
- updateQuantityV2(payload) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const mutations = mutations_1.UPDATE_QUANTITY_V2;
93
- const variables = Object.assign({ partnerId: this.orgId }, payload);
94
- try {
95
- const response = yield this.graphqlMutationV2(mutations, variables);
96
- return response.updateQuantityV2;
97
- }
98
- catch (error) {
99
- console.log(`Error in updateQuantityV2: ${error}`);
100
- throw error;
101
- }
102
- });
103
- }
104
- getOrderLineItemByServiceId(serviceId) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- const query = queries_1.GET_ORDER_LINE_ITEM_BY_SERVICE_ID;
107
- const variables = {
108
- partnerId: this.orgId,
109
- serviceId,
110
- };
111
- try {
112
- const response = yield this.graphqlQueryV2(query, variables);
113
- return response.getOrderLineItemByServiceId;
114
- }
115
- catch (error) {
116
- console.log(`Error in getOrderLineItemByServiceId: ${error}`);
117
- throw error;
118
- }
119
- });
120
- }
121
- getOrderByServiceId(serviceId) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const query = queries_1.GET_ORDER_BY_SERVICE_ID;
124
- const variables = {
125
- serviceId,
126
- };
127
- try {
128
- const response = yield this.graphqlQueryV2(query, variables);
129
- return response.getOrderByServiceId;
130
- }
131
- catch (error) {
132
- console.log(`Error in getOrderByServiceId: ${error}`);
133
- throw error;
134
- }
135
- });
136
- }
137
- addToCart(serviceId, actorId, cartId) {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- const mutation = mutations_1.ADD_TO_CART;
140
- const variables = {
141
- serviceId,
142
- actorId,
143
- cartId,
144
- };
145
- try {
146
- const response = yield this.graphqlMutationV2(mutation, variables);
147
- return response.addToCart;
148
- }
149
- catch (error) {
150
- console.log(`Error in addToCart: ${error}`);
151
- throw error;
152
- }
153
- });
154
- }
155
- removeProductOptionOrderLineItem(orderLineItemId, optionId, updateBy) {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const mutation = mutations_1.REMOVE_PRODUCT_OPTION_ORDER_LINE_ITEM;
158
- const variables = {
159
- partnerId: this.orgId,
160
- orderLineItemId,
161
- optionId,
162
- updateBy,
163
- };
164
- try {
165
- const response = yield this.graphqlMutationV2(mutation, variables);
166
- return response.removeProductOptionOrderLineItem;
167
- }
168
- catch (error) {
169
- console.log(`Error in removeProductOptionOrderLineItem: ${error}`);
170
- throw error;
171
- }
172
- });
173
- }
174
- findOrderByOwnerPartyId(ownerPartyId) {
175
- return __awaiter(this, void 0, void 0, function* () {
176
- const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
177
- const variables = {
178
- partnerId: this.orgId,
179
- ownerPartyId,
180
- };
181
- try {
182
- const response = yield this.graphqlQueryV2(query, variables);
183
- return response.findOrderByOwnerPartyId;
184
- }
185
- catch (error) {
186
- console.log(`Error in findOrderByOwnerPartyId: ${error}`);
187
- throw error;
188
- }
189
- });
190
- }
191
- }
192
- exports.OrderGraphQLService = OrderGraphQLService;
@@ -1,7 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class OrderCloudRestService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- setToken(token: string): void;
5
- setStoreId(storeId: string): void;
6
- updateOrderConfirmation(orderId: string, createBy: string): Promise<any>;
7
- }
@@ -1,39 +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.OrderCloudRestService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- class OrderCloudRestService extends serviceSDK_1.Service {
15
- constructor(endpoint, orgId, storeId) {
16
- super(endpoint, orgId, storeId);
17
- }
18
- setToken(token) {
19
- this.token = token;
20
- }
21
- setStoreId(storeId) {
22
- this.storeId = storeId;
23
- }
24
- updateOrderConfirmation(orderId, createBy) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const endpoint = `/service-webhook?partnerId=${this.orgId}&orderId=${orderId}&createBy=${createBy}`;
27
- const method = "GET";
28
- try {
29
- const response = yield this.restApiCallWithToken(endpoint, method);
30
- return response;
31
- }
32
- catch (error) {
33
- console.log(`Error in updateOrderConfirmation: ${error}`);
34
- throw error;
35
- }
36
- });
37
- }
38
- }
39
- exports.OrderCloudRestService = OrderCloudRestService;
@@ -1,12 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class PaymentLVService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- setToken(token: string): void;
5
- setStoreId(storeId: string): void;
6
- paymentsByOrders(orderIds: [string]): Promise<any>;
7
- getTransferInfo(paymentId: string, store: string): Promise<any>;
8
- cancelPayment(paymentId: string, reason: string, createBy: string): Promise<any>;
9
- confirmPaidManual(paymentId: string, confirmBy: string): Promise<any>;
10
- getPaymentMethodTypes(store: string): Promise<any>;
11
- paymentMethods(): Promise<any>;
12
- }
@@ -1,132 +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.PaymentLVService = void 0;
13
- const mutations_1 = require("../../graphql/paymentLV/mutations");
14
- const queries_1 = require("../../graphql/paymentLV/queries");
15
- const serviceSDK_1 = require("../serviceSDK");
16
- class PaymentLVService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- setToken(token) {
21
- this.token = token;
22
- }
23
- setStoreId(storeId) {
24
- this.storeId = storeId;
25
- }
26
- paymentsByOrders(orderIds) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const query = queries_1.PAYMENTS_BY_ORDERS;
29
- const variables = {
30
- orderIds,
31
- };
32
- // const headers = { PartnerId: this.orgId };
33
- try {
34
- const response = yield this.graphqlQueryCustomHeader(query, variables
35
- // headers
36
- );
37
- return response.paymentsByOrders;
38
- }
39
- catch (error) {
40
- console.log(`Error in paymentsByOrders: ${error}`);
41
- throw error;
42
- }
43
- });
44
- }
45
- getTransferInfo(paymentId, store) {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- const query = queries_1.GET_TRANSFER_INFO;
48
- const variables = {
49
- partnerId: this.orgId,
50
- storeId: store ? store : this.storeId,
51
- paymentId,
52
- };
53
- try {
54
- const response = yield this.graphqlQueryCustomHeader(query, variables);
55
- return response.getTransferInfo;
56
- }
57
- catch (error) {
58
- console.log(`Error fetching get getTransferInfo method: ${error}`);
59
- throw error;
60
- }
61
- });
62
- }
63
- cancelPayment(paymentId, reason, createBy) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- const mutation = mutations_1.CANCEL_PAYMENT;
66
- const variables = {
67
- paymentId,
68
- reason,
69
- createBy,
70
- };
71
- try {
72
- const response = yield this.graphqlMutationCustomHeader(mutation, variables);
73
- return response.cancelPayment;
74
- }
75
- catch (error) {
76
- console.log(`Error fetching get cancelPayment method: ${error}`);
77
- throw error;
78
- }
79
- });
80
- }
81
- confirmPaidManual(paymentId, confirmBy) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const mutation = mutations_1.CONFIRM_PAID_MANUAL;
84
- const variables = {
85
- paymentId,
86
- confirmBy,
87
- };
88
- try {
89
- const response = yield this.graphqlMutationCustomHeader(mutation, variables);
90
- return response.confirmPaidManual;
91
- }
92
- catch (error) {
93
- console.log(`Error fetching get confirmPaidManual method: ${error}`);
94
- throw error;
95
- }
96
- });
97
- }
98
- getPaymentMethodTypes(store) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- const query = queries_1.GET_PAYMENT_METHOD_TYPES;
101
- const variables = {
102
- partnerId: this.orgId,
103
- storeId: store ? store : this.storeId,
104
- };
105
- try {
106
- const response = yield this.graphqlQueryCustomHeader(query, variables);
107
- return response.getPaymentMethodTypes;
108
- }
109
- catch (error) {
110
- console.log(`Error fetching get getPaymentMethodTypes method: ${error}`);
111
- throw error;
112
- }
113
- });
114
- }
115
- paymentMethods() {
116
- return __awaiter(this, void 0, void 0, function* () {
117
- const query = queries_1.PAYMENT_METHODS;
118
- const variables = {
119
- partnerCode: this.orgId,
120
- };
121
- try {
122
- const response = yield this.graphqlQueryCustomHeader(query, variables);
123
- return response.paymentMethods;
124
- }
125
- catch (error) {
126
- console.log(`Error fetching get paymentMethods method: ${error}`);
127
- throw error;
128
- }
129
- });
130
- }
131
- }
132
- exports.PaymentLVService = PaymentLVService;
@@ -1,18 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class QuicklabService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- setToken(token: string): void;
5
- setStoreId(storeId: string): void;
6
- getTemplatesByArticleId(articleId: string): Promise<any>;
7
- getTypeLabSessions(): Promise<any>;
8
- getLabSessionsByUserId(userId: string): Promise<any>;
9
- getLabSessionsByUserIdAndArticleId(userId: string, articleId: string): Promise<any>;
10
- createLabSessionByTemplateId(templateId: string, userId: string, articleId: string, typeLabSessionCode: string): Promise<any>;
11
- createLabSessionByLabSessionId(labSessionId: string, userId: string, articleId: string): Promise<any>;
12
- createLabSessionByComputingId(computingId: string, userId: string, articleId: string): Promise<any>;
13
- updateEndTimeLabSession(labSessionId: string, userId: string): Promise<any>;
14
- stopLabSession(labSessionId: string, userId: string, note: string): Promise<any>;
15
- updateTypeLabSession(labSessionId: string, typeLabSessionCode: string, userId: string): Promise<any>;
16
- getLabSessionsChillByParent(labSessionId: string, userId: string): Promise<any>;
17
- stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
18
- }
@@ -1,197 +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.QuicklabService = void 0;
13
- const mutations_1 = require("../../graphql/quicklab_service/mutations");
14
- const queries_1 = require("../../graphql/quicklab_service/queries");
15
- const serviceSDK_1 = require("../serviceSDK");
16
- class QuicklabService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- setToken(token) {
21
- this.token = token;
22
- }
23
- setStoreId(storeId) {
24
- this.storeId = storeId;
25
- }
26
- getTemplatesByArticleId(articleId) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const query = queries_1.GET_TEMPLATE_BY_ARTICLE_ID;
29
- const variables = {
30
- articleId,
31
- };
32
- try {
33
- const response = yield this.graphqlQuery(query, variables);
34
- return response.getTemplatesByArticleId;
35
- }
36
- catch (error) {
37
- console.log(`Error in getTemplatesByArticleId : ${error}`);
38
- throw error;
39
- }
40
- });
41
- }
42
- getTypeLabSessions() {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- const query = queries_1.GET_TYPE_LAB_SESSION;
45
- const variables = {};
46
- try {
47
- const response = yield this.graphqlQuery(query, variables);
48
- return response.getTypeLabSessions;
49
- }
50
- catch (error) {
51
- console.log(`Error in getTypeLabSessions : ${error}`);
52
- throw error;
53
- }
54
- });
55
- }
56
- getLabSessionsByUserId(userId) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const query = queries_1.GET_LAB_SESSIONS_BY_USER_ID;
59
- const variables = { userId };
60
- try {
61
- const response = yield this.graphqlQuery(query, variables);
62
- return response.getLabSessionsByUserId;
63
- }
64
- catch (error) {
65
- console.log(`Error in getLabSessionsByUserId : ${error}`);
66
- throw error;
67
- }
68
- });
69
- }
70
- getLabSessionsByUserIdAndArticleId(userId, articleId) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- const query = queries_1.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID;
73
- const variables = { userId, articleId };
74
- try {
75
- const response = yield this.graphqlQuery(query, variables);
76
- return response.getLabSessionsByUserIdAndArticleId;
77
- }
78
- catch (error) {
79
- console.log(`Error in getLabSessionsByUserIdAndArticleId : ${error}`);
80
- throw error;
81
- }
82
- });
83
- }
84
- createLabSessionByTemplateId(templateId, userId, articleId, typeLabSessionCode) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- const mutation = mutations_1.CREATE_LAB_SESSION_BY_TEMPLATE_ID;
87
- const variables = { templateId, userId, articleId, typeLabSessionCode };
88
- try {
89
- const response = yield this.graphqlMutation(mutation, variables);
90
- return response.createLabSessionByTemplateId;
91
- }
92
- catch (error) {
93
- console.log(`Error in createLabSessionByTemplateId : ${error}`);
94
- throw error;
95
- }
96
- });
97
- }
98
- createLabSessionByLabSessionId(labSessionId, userId, articleId) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- const mutation = mutations_1.CREATE_LAB_SESSION_BY_LAB_SESSION_ID;
101
- const variables = { labSessionId, userId, articleId };
102
- try {
103
- const response = yield this.graphqlMutation(mutation, variables);
104
- return response.createLabSessionByLabSessionId;
105
- }
106
- catch (error) {
107
- console.log(`Error in createLabSessionByLabSessionId : ${error}`);
108
- throw error;
109
- }
110
- });
111
- }
112
- createLabSessionByComputingId(computingId, userId, articleId) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- const mutation = mutations_1.CREATE_LAB_SESSION_BY_COMPUTING_ID;
115
- const variables = { computingId, userId, articleId };
116
- try {
117
- const response = yield this.graphqlMutation(mutation, variables);
118
- return response.createLabSessionByComputingId;
119
- }
120
- catch (error) {
121
- console.log(`Error in createLabSessionByComputingId : ${error}`);
122
- throw error;
123
- }
124
- });
125
- }
126
- updateEndTimeLabSession(labSessionId, userId) {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const mutation = mutations_1.UPDATE_END_TIME_LAB_SESSION;
129
- const variables = { labSessionId, userId };
130
- try {
131
- const response = yield this.graphqlMutation(mutation, variables);
132
- return response.updateEndTimeLabSession;
133
- }
134
- catch (error) {
135
- console.log(`Error in updateEndTimeLabSession : ${error}`);
136
- throw error;
137
- }
138
- });
139
- }
140
- stopLabSession(labSessionId, userId, note) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- const mutation = mutations_1.STOP_LAB_SESSION;
143
- const variables = { labSessionId, userId, note };
144
- try {
145
- const response = yield this.graphqlMutation(mutation, variables);
146
- return response.stopLabSession;
147
- }
148
- catch (error) {
149
- console.log(`Error in stopLabSession : ${error}`);
150
- throw error;
151
- }
152
- });
153
- }
154
- updateTypeLabSession(labSessionId, typeLabSessionCode, userId) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- const mutation = mutations_1.UPDATE_TYPE_LAB_SESSION;
157
- const variables = { labSessionId, typeLabSessionCode, userId };
158
- try {
159
- const response = yield this.graphqlMutation(mutation, variables);
160
- return response.updateTypeLabSession;
161
- }
162
- catch (error) {
163
- console.log(`Error in updateTypeLabSession : ${error}`);
164
- throw error;
165
- }
166
- });
167
- }
168
- getLabSessionsChillByParent(labSessionId, userId) {
169
- return __awaiter(this, void 0, void 0, function* () {
170
- const query = queries_1.GET_LAB_SESSIONS_CHILL_BY_PARENT;
171
- const variables = { labSessionId, userId };
172
- try {
173
- const response = yield this.graphqlQuery(query, variables);
174
- return response.getLabSessionsChillByParent;
175
- }
176
- catch (error) {
177
- console.log(`Error in getLabSessionsChillByParent : ${error}`);
178
- throw error;
179
- }
180
- });
181
- }
182
- stopLabSessionForCustomer(labSessionId, userId, note) {
183
- return __awaiter(this, void 0, void 0, function* () {
184
- const mutation = mutations_1.STOP_LAB_SESSION_FOR_CUSTOMER;
185
- const variables = { labSessionId, userId, note };
186
- try {
187
- const response = yield this.graphqlMutation(mutation, variables);
188
- return response.stopLabSessionForCustomer;
189
- }
190
- catch (error) {
191
- console.log(`Error in stopLabSessionForCustomer : ${error}`);
192
- throw error;
193
- }
194
- });
195
- }
196
- }
197
- exports.QuicklabService = QuicklabService;
@@ -1,9 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class ResourcePermissionService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- setToken(token: string): void;
5
- setStoreId(storeId: string): void;
6
- shareResource(createModel: any, partnerId: string): Promise<any>;
7
- removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, partnerId: string): Promise<any>;
8
- getSharedUserByService(resourceType: string, resourceId: string): Promise<any>;
9
- }