@kohost/api-client 3.0.0-beta.6 → 3.0.0-beta.7

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,32 @@
1
+ module.exports = function AdminCreateAdminUser(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = null;
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/users";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "post",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminCreateCustomer(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = null;
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/customers";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "post",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminDescribeCustomer(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = [":id"];
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/customers/:id";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "get",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminListAdminUsers(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = null;
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/users";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "get",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -1,9 +1,9 @@
1
- module.exports = function LoginGateway(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
1
+ module.exports = function AdminLoginUser(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
2
  if (!requestData)
3
3
  requestData = {};
4
4
  const pathParams = null;
5
5
  const { data, query, headers } = requestData;
6
- let url = "/auth/gateway";
6
+ let url = "/admin/auth/user";
7
7
  if (pathParams && data) {
8
8
  for (const param of pathParams) {
9
9
  const paramName = param.replace(":", "");
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminRefreshToken(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = null;
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/auth/refresh";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "post",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminRequestLoginLink(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = null;
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/auth/loginToken";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "post",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
@@ -0,0 +1,32 @@
1
+ module.exports = function AdminUpdateCustomer(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2
+ if (!requestData)
3
+ requestData = {};
4
+ const pathParams = [":id"];
5
+ const { data, query, headers } = requestData;
6
+ let url = "/admin/customers/:id";
7
+ if (pathParams && data) {
8
+ for (const param of pathParams) {
9
+ const paramName = param.replace(":", "");
10
+ url = url.replace(param, data[paramName]);
11
+ }
12
+ }
13
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
14
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
15
+ const missing = missingParams.map((param) => param.replace(":", ""));
16
+ return Promise.reject(
17
+ new Error("Missing parameters: " + missing.join(", "))
18
+ );
19
+ }
20
+ const config = {
21
+ method: "put",
22
+ url,
23
+ ...httpConfigOptions
24
+ };
25
+ if (data)
26
+ config.data = data;
27
+ if (query)
28
+ config.params = query;
29
+ if (headers)
30
+ config.headers = headers;
31
+ return this._http.request(config);
32
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kohost/api-client",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "API client, models, schemas, commands, and events for Kohost applications",
5
5
  "author": "Ian Rogers",
6
6
  "main": "dist/cjs/index.cjs.js",