@kohost/api-client 3.6.2 → 3.7.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.
@@ -0,0 +1,17 @@
1
+ export = Issue;
2
+ declare class Issue extends Entity {
3
+ /**
4
+ * @typedef {import("../schemas/IssueSchema").Issue} IssueType
5
+ * Create a Ticket instance.
6
+ * @constructor
7
+ * @param {IssueType} issue - The ticket object of type Ticket.
8
+ */
9
+ constructor(issue: any);
10
+ readonly schema: any;
11
+ get validator(): any;
12
+ }
13
+ declare namespace Issue {
14
+ let validProperties: string[];
15
+ }
16
+ import Entity = require("./Entity");
17
+ //# sourceMappingURL=Issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../src/Models/Issue.js"],"names":[],"mappings":";AAQA;IACE;;;;;OAKG;IACH,wBAEC;;;CACF"}
@@ -35,5 +35,6 @@ import Order = require("./Order");
35
35
  import Announcement = require("./Announcement");
36
36
  import TimeSheet = require("./TimeSheet");
37
37
  import Policy = require("./Policy");
38
- export { Entity, Organization, Property, MediaFile, Gateway, Switch, Alarm, Dimmer, Lock, Courtesy, Camera, MotionSensor, Thermostat, WindowCovering, MediaSource, Identification, Product, User, SystemUser, Room, Space, Category, Ticket, Scene, DiscoveredDevice, DeviceRouter, Reservation, Credential, ShortLink, EnergyReportShard, EnergyReport, SMSMessage, EmailMessage, Order, Announcement, TimeSheet, Policy };
38
+ import Issue = require("./Issue");
39
+ export { Entity, Organization, Property, MediaFile, Gateway, Switch, Alarm, Dimmer, Lock, Courtesy, Camera, MotionSensor, Thermostat, WindowCovering, MediaSource, Identification, Product, User, SystemUser, Room, Space, Category, Ticket, Scene, DiscoveredDevice, DeviceRouter, Reservation, Credential, ShortLink, EnergyReportShard, EnergyReport, SMSMessage, EmailMessage, Order, Announcement, TimeSheet, Policy, Issue };
39
40
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,24 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * An issue associated with ticketing and concierge.
10
+ */
11
+ export interface Issue {
12
+ id: string;
13
+ type: "issue";
14
+ name: string;
15
+ description?: string;
16
+ department: string;
17
+ autoAssign?: {
18
+ userId?: string;
19
+ priority?: "low" | "normal" | "high";
20
+ tags?: string[];
21
+ [k: string]: unknown;
22
+ };
23
+ [k: string]: unknown;
24
+ }
@@ -104,6 +104,10 @@ export interface Property {
104
104
  image: MediaFile;
105
105
  [k: string]: unknown;
106
106
  }[];
107
+ issues?: {
108
+ syncWithPropertyId?: string;
109
+ [k: string]: unknown;
110
+ };
107
111
  [k: string]: unknown;
108
112
  };
109
113
  DigitalKey?: {
@@ -18,6 +18,7 @@ export interface Ticket {
18
18
  id: string;
19
19
  type?: "ticket";
20
20
  number?: string;
21
+ issueId?: string;
21
22
  conversation: {
22
23
  [k: string]: unknown;
23
24
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"entityFactory.d.ts","sourceRoot":"","sources":["../../../src/utils/entityFactory.js"],"names":[],"mappings":"AAEiB,0DA6EhB"}
1
+ {"version":3,"file":"entityFactory.d.ts","sourceRoot":"","sources":["../../../src/utils/entityFactory.js"],"names":[],"mappings":"AAEiB,0DA+EhB"}
@@ -1,8 +1,8 @@
1
- module.exports = function AddDefaultScenesToRooms(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
1
+ module.exports = function CreateIssue(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
2
  if (!requestData) requestData = {};
3
3
  const pathParams = null;
4
4
  const { data, query, headers } = requestData;
5
- let url = "/rooms/scenes/default";
5
+ let url = "/issues";
6
6
  if (pathParams && data) {
7
7
  for (const param of pathParams) {
8
8
  const paramName = param.replace(":", "");
@@ -1,8 +1,8 @@
1
- module.exports = function AddScenesToRoom(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
1
+ module.exports = function DeleteIssue(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
2
  if (!requestData) requestData = {};
3
3
  const pathParams = [":id"];
4
4
  const { data, query, headers } = requestData;
5
- let url = "/rooms/:id/scenes";
5
+ let url = "/issues/:id";
6
6
  if (pathParams && data) {
7
7
  for (const param of pathParams) {
8
8
  const paramName = param.replace(":", "");
@@ -17,7 +17,7 @@ module.exports = function AddScenesToRoom(requestData = { data: null, query: nul
17
17
  );
18
18
  }
19
19
  const config = {
20
- method: "post",
20
+ method: "delete",
21
21
  url,
22
22
  ...httpConfigOptions
23
23
  };
@@ -0,0 +1,28 @@
1
+ module.exports = function DescribeIssue(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData) requestData = {};
3
+ const pathParams = [":id"];
4
+ const { data, query, headers } = requestData;
5
+ let url = "/issues/:id";
6
+ if (pathParams && data) {
7
+ for (const param of pathParams) {
8
+ const paramName = param.replace(":", "");
9
+ url = url.replace(param, data[paramName]);
10
+ }
11
+ }
12
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
13
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
14
+ const missing = missingParams.map((param) => param.replace(":", ""));
15
+ return Promise.reject(
16
+ new Error("Missing parameters: " + missing.join(", "))
17
+ );
18
+ }
19
+ const config = {
20
+ method: "get",
21
+ url,
22
+ ...httpConfigOptions
23
+ };
24
+ if (data) config.data = data;
25
+ if (query) config.params = query;
26
+ if (headers) config.headers = headers;
27
+ return this._http.request(config);
28
+ };
@@ -0,0 +1,28 @@
1
+ module.exports = function ListIssues(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData) requestData = {};
3
+ const pathParams = null;
4
+ const { data, query, headers } = requestData;
5
+ let url = "/issues";
6
+ if (pathParams && data) {
7
+ for (const param of pathParams) {
8
+ const paramName = param.replace(":", "");
9
+ url = url.replace(param, data[paramName]);
10
+ }
11
+ }
12
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
13
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
14
+ const missing = missingParams.map((param) => param.replace(":", ""));
15
+ return Promise.reject(
16
+ new Error("Missing parameters: " + missing.join(", "))
17
+ );
18
+ }
19
+ const config = {
20
+ method: "get",
21
+ url,
22
+ ...httpConfigOptions
23
+ };
24
+ if (data) config.data = data;
25
+ if (query) config.params = query;
26
+ if (headers) config.headers = headers;
27
+ return this._http.request(config);
28
+ };
@@ -0,0 +1,28 @@
1
+ module.exports = function UpdateIssue(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData) requestData = {};
3
+ const pathParams = [":id"];
4
+ const { data, query, headers } = requestData;
5
+ let url = "/issues/:id";
6
+ if (pathParams && data) {
7
+ for (const param of pathParams) {
8
+ const paramName = param.replace(":", "");
9
+ url = url.replace(param, data[paramName]);
10
+ }
11
+ }
12
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
13
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
14
+ const missing = missingParams.map((param) => param.replace(":", ""));
15
+ return Promise.reject(
16
+ new Error("Missing parameters: " + missing.join(", "))
17
+ );
18
+ }
19
+ const config = {
20
+ method: "put",
21
+ url,
22
+ ...httpConfigOptions
23
+ };
24
+ if (data) config.data = data;
25
+ if (query) config.params = query;
26
+ if (headers) config.headers = headers;
27
+ return this._http.request(config);
28
+ };
@@ -0,0 +1,28 @@
1
+ module.exports = function UpdatePropertySettings(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData) requestData = {};
3
+ const pathParams = [":id"];
4
+ const { data, query, headers } = requestData;
5
+ let url = "/properties/:id/settings";
6
+ if (pathParams && data) {
7
+ for (const param of pathParams) {
8
+ const paramName = param.replace(":", "");
9
+ url = url.replace(param, data[paramName]);
10
+ }
11
+ }
12
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
13
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
14
+ const missing = missingParams.map((param) => param.replace(":", ""));
15
+ return Promise.reject(
16
+ new Error("Missing parameters: " + missing.join(", "))
17
+ );
18
+ }
19
+ const config = {
20
+ method: "put",
21
+ url,
22
+ ...httpConfigOptions
23
+ };
24
+ if (data) config.data = data;
25
+ if (query) config.params = query;
26
+ if (headers) config.headers = headers;
27
+ return this._http.request(config);
28
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kohost/api-client",
3
- "version": "3.6.2",
3
+ "version": "3.7.0",
4
4
  "description": "API client, models, schemas, commands, and events for Kohost applications",
5
5
  "author": "Ian Rogers",
6
6
  "readme": "README.md",