@kohost/api-client 3.9.0 → 3.9.1

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.
@@ -21,5 +21,6 @@ export interface Issue {
21
21
  tags?: string[];
22
22
  [k: string]: unknown;
23
23
  };
24
+ systemKey?: string;
24
25
  [k: string]: unknown;
25
26
  }
@@ -0,0 +1,28 @@
1
+ module.exports = function CreateVendor(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 = "/vendors";
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: "post",
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 DeleteVendor(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 = "/vendors/: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: "delete",
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 DescribeVendor(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 = "/vendors/: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 ListVendors(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 = "/vendors";
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 UpdateVendor(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 = "/vendors/: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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kohost/api-client",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "API client, models, schemas, commands, and events for Kohost applications",
5
5
  "author": "Ian Rogers",
6
6
  "readme": "README.md",