@longvansoftware/storefront-js-client 1.4.1 → 1.4.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.
@@ -1,9 +1,10 @@
1
1
  export declare const CREATE_SERVICE: import("graphql").DocumentNode;
2
2
  export declare const UPDATE_SERVICE: import("graphql").DocumentNode;
3
3
  export declare const DELETE_SERVICE: import("graphql").DocumentNode;
4
- export declare const UPDATE_ATTR_VALUE: import("graphql").DocumentNode;
5
4
  export declare const DELETE_ATTR_VALUE: import("graphql").DocumentNode;
6
5
  export declare const UPDATE_SUCCESS_ACTION_PROCESS_STATUS: import("graphql").DocumentNode;
7
6
  export declare const UPDATE_FAIL_ACTION_PROCESS_STATUS: import("graphql").DocumentNode;
8
7
  export declare const CREATE_SERVICE_TICKET: import("graphql").DocumentNode;
9
8
  export declare const CREATE_SERVICE_ACTION: import("graphql").DocumentNode;
9
+ export declare const UPDATE_ATTR_VALUE: import("graphql").DocumentNode;
10
+ export declare const ADD_ACTION_ATTRIBUTE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_SERVICE_ACTION = exports.CREATE_SERVICE_TICKET = exports.UPDATE_FAIL_ACTION_PROCESS_STATUS = exports.UPDATE_SUCCESS_ACTION_PROCESS_STATUS = exports.DELETE_ATTR_VALUE = exports.UPDATE_ATTR_VALUE = exports.DELETE_SERVICE = exports.UPDATE_SERVICE = exports.CREATE_SERVICE = void 0;
3
+ exports.ADD_ACTION_ATTRIBUTE = exports.UPDATE_ATTR_VALUE = exports.CREATE_SERVICE_ACTION = exports.CREATE_SERVICE_TICKET = exports.UPDATE_FAIL_ACTION_PROCESS_STATUS = exports.UPDATE_SUCCESS_ACTION_PROCESS_STATUS = exports.DELETE_ATTR_VALUE = exports.DELETE_SERVICE = exports.UPDATE_SERVICE = exports.CREATE_SERVICE = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CREATE_SERVICE = (0, graphql_tag_1.gql) `
6
6
  mutation CreateService($partnerId: String!, $createModel: ServiceRequest!) {
@@ -97,23 +97,23 @@ exports.DELETE_SERVICE = (0, graphql_tag_1.gql) `
97
97
  )
98
98
  }
99
99
  `;
100
- exports.UPDATE_ATTR_VALUE = (0, graphql_tag_1.gql) `
101
- mutation UpdateAttrValue(
102
- $partnerId: String!
103
- $serviceId: String!
104
- $attrName: String!
105
- $attrValue: String!
106
- $updatedBy: String!
107
- ) {
108
- updateAttrValue(
109
- partnerId: $partnerId
110
- serviceId: $serviceId
111
- attrName: $attrName
112
- attrValue: $attrValue
113
- updatedBy: $updatedBy
114
- )
115
- }
116
- `;
100
+ // export const UPDATE_ATTR_VALUE = gql`
101
+ // mutation UpdateAttrValue(
102
+ // $partnerId: String!
103
+ // $serviceId: String!
104
+ // $attrName: String!
105
+ // $attrValue: String!
106
+ // $updatedBy: String!
107
+ // ) {
108
+ // updateAttrValue(
109
+ // partnerId: $partnerId
110
+ // serviceId: $serviceId
111
+ // attrName: $attrName
112
+ // attrValue: $attrValue
113
+ // updatedBy: $updatedBy
114
+ // )
115
+ // }
116
+ // `;
117
117
  exports.DELETE_ATTR_VALUE = (0, graphql_tag_1.gql) `
118
118
  mutation DeleteAttrValue(
119
119
  $partnerId: String!
@@ -239,3 +239,46 @@ exports.CREATE_SERVICE_ACTION = (0, graphql_tag_1.gql) `
239
239
  }
240
240
  }
241
241
  `;
242
+ // const mutation = gql`
243
+ // mutation UpdateAttrValue {
244
+ // updateAttrValue(
245
+ // partnerId: "PKH"
246
+ // serviceId: "20.5791"
247
+ // attrName: "test"
248
+ // attrValue: "123123"
249
+ // updatedBy: "20.5791"
250
+ // )
251
+ // }
252
+ // `;
253
+ exports.UPDATE_ATTR_VALUE = (0, graphql_tag_1.gql) `
254
+ mutation UpdateAttrValue(
255
+ $partnerId: String!
256
+ $serviceId: String!
257
+ $attrName: String!
258
+ $attrValue: String!
259
+ $updatedBy: String!
260
+ ) {
261
+ updateAttrValue(
262
+ partnerId: $partnerId
263
+ serviceId: $serviceId
264
+ attrName: $attrName
265
+ attrValue: $attrValue
266
+ updatedBy: $updatedBy
267
+ )
268
+ }
269
+ `;
270
+ exports.ADD_ACTION_ATTRIBUTE = (0, graphql_tag_1.gql) `
271
+ mutation AddActionAttribute(
272
+ $actionId: String!
273
+ $attributeName: String!
274
+ $attributeValue: String!
275
+ $createdBy: String!
276
+ ) {
277
+ addActionAttribute(
278
+ actionId: $actionId
279
+ attributeName: $attributeName
280
+ attributeValue: $attributeValue
281
+ createdBy: $createdBy
282
+ )
283
+ }
284
+ `;
@@ -3,3 +3,4 @@ export declare const GET_SERVICE_BY_TYPE: import("graphql").DocumentNode;
3
3
  export declare const GET_SERVICE_BY_OWNER_ID: import("graphql").DocumentNode;
4
4
  export declare const GET_SERVICE_ACTION: import("graphql").DocumentNode;
5
5
  export declare const GET_SERVICE_TICKETS: import("graphql").DocumentNode;
6
+ export declare const GET_ACTION_ATTRIBUTE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_SERVICE_TICKETS = exports.GET_SERVICE_ACTION = exports.GET_SERVICE_BY_OWNER_ID = exports.GET_SERVICE_BY_TYPE = exports.GET_SERVICE_BY_ID = void 0;
3
+ exports.GET_ACTION_ATTRIBUTE = exports.GET_SERVICE_TICKETS = exports.GET_SERVICE_ACTION = exports.GET_SERVICE_BY_OWNER_ID = exports.GET_SERVICE_BY_TYPE = exports.GET_SERVICE_BY_ID = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_SERVICE_BY_ID = (0, graphql_tag_1.gql) `
6
6
  query GetServiceById($partnerId: String!, $serviceId: String!) {
@@ -167,3 +167,8 @@ exports.GET_SERVICE_TICKETS = (0, graphql_tag_1.gql) `
167
167
  }
168
168
  }
169
169
  `;
170
+ exports.GET_ACTION_ATTRIBUTE = (0, graphql_tag_1.gql) `
171
+ query GetActionAttribute($actionId: String!, $attributeName: String!) {
172
+ getActionAttribute(actionId: $actionId, attributeName: $attributeName)
173
+ }
174
+ `;
@@ -89,4 +89,6 @@ export declare class ServiceManagementService extends Service {
89
89
  createServiceTicket(serviceId: string, name: string, createdBy: string, description: string): Promise<any>;
90
90
  getServiceTicket(serviceId: string): Promise<any>;
91
91
  createServiceAction(serviceId: string, actionType: string, createdBy: string): Promise<any>;
92
+ addActionAttribute(actionId: string, attributeName: string, attributeValue: string, createdBy: string): Promise<any>;
93
+ getActionAttribute(actionId: string, attributeName: string): Promise<any>;
92
94
  }
@@ -310,5 +310,42 @@ class ServiceManagementService extends serviceSDK_1.Service {
310
310
  }
311
311
  });
312
312
  }
313
+ addActionAttribute(actionId, attributeName, attributeValue, createdBy) {
314
+ return __awaiter(this, void 0, void 0, function* () {
315
+ const mutation = mutations_1.ADD_ACTION_ATTRIBUTE;
316
+ const variables = {
317
+ actionId,
318
+ attributeName,
319
+ attributeValue,
320
+ createdBy,
321
+ };
322
+ try {
323
+ const response = yield this.graphqlMutation(mutation, variables);
324
+ return response.addActionAttribute;
325
+ }
326
+ catch (error) {
327
+ throw error;
328
+ }
329
+ });
330
+ }
331
+ // query GetActionAttribute {
332
+ // getActionAttribute(actionId: "20.27592", attributeName: "ztbee")
333
+ // }
334
+ getActionAttribute(actionId, attributeName) {
335
+ return __awaiter(this, void 0, void 0, function* () {
336
+ const query = queries_1.GET_ACTION_ATTRIBUTE;
337
+ const variables = {
338
+ actionId,
339
+ attributeName,
340
+ };
341
+ try {
342
+ const response = yield this.graphqlQuery(query, variables);
343
+ return response.getActionAttribute;
344
+ }
345
+ catch (error) {
346
+ throw error;
347
+ }
348
+ });
349
+ }
313
350
  }
314
351
  exports.ServiceManagementService = ServiceManagementService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [