@scout9/admin 1.0.1 → 1.0.2

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 (54) hide show
  1. package/build/api.d.ts +1116 -32
  2. package/build/api.js +475 -12
  3. package/build/base.d.ts +11 -0
  4. package/build/base.js +14 -0
  5. package/build/common.d.ts +11 -0
  6. package/build/common.js +13 -0
  7. package/build/configuration.d.ts +11 -12
  8. package/build/configuration.js +13 -28
  9. package/build/index.d.ts +11 -0
  10. package/build/index.js +13 -0
  11. package/package.json +6 -2
  12. package/src/.openapi-generator/FILES +9 -0
  13. package/src/.openapi-generator/VERSION +1 -0
  14. package/src/api.ts +1417 -95
  15. package/src/base.ts +34 -17
  16. package/src/common.ts +73 -59
  17. package/src/configuration.ts +92 -115
  18. package/src/index.ts +16 -0
  19. package/tsconfig.tsbuildinfo +1 -1
  20. package/src/api-openai.txt +0 -4117
  21. package/src/schemas/common/algolia.ts +0 -24
  22. package/src/schemas/common/contact-map.ts +0 -35
  23. package/src/schemas/common/currency.ts +0 -1
  24. package/src/schemas/common/index.ts +0 -6
  25. package/src/schemas/common/location.ts +0 -6
  26. package/src/schemas/common/task.ts +0 -26
  27. package/src/schemas/common/time.ts +0 -15
  28. package/src/schemas/common.ts +0 -94
  29. package/src/schemas/conversations/context.ts +0 -64
  30. package/src/schemas/conversations/conversation.ts +0 -68
  31. package/src/schemas/conversations/index.ts +0 -6
  32. package/src/schemas/conversations/message.ts +0 -78
  33. package/src/schemas/conversations/parsed.ts +0 -5
  34. package/src/schemas/conversations/scheduled-conversation.ts +0 -35
  35. package/src/schemas/conversations/webhook.ts +0 -10
  36. package/src/schemas/index.ts +0 -3
  37. package/src/schemas/users/businesses/agents/agent.ts +0 -107
  38. package/src/schemas/users/businesses/agents/auth.ts +0 -8
  39. package/src/schemas/users/businesses/agents/index.ts +0 -2
  40. package/src/schemas/users/businesses/business-location.ts +0 -15
  41. package/src/schemas/users/businesses/business.ts +0 -43
  42. package/src/schemas/users/businesses/context/context-indexed.ts +0 -11
  43. package/src/schemas/users/businesses/context/context-saves.ts +0 -14
  44. package/src/schemas/users/businesses/context/context.ts +0 -76
  45. package/src/schemas/users/businesses/context/index.ts +0 -2
  46. package/src/schemas/users/businesses/index.ts +0 -6
  47. package/src/schemas/users/businesses/notifications.ts +0 -12
  48. package/src/schemas/users/businesses/offerings/index.ts +0 -2
  49. package/src/schemas/users/businesses/offerings/offer-indexed.ts +0 -42
  50. package/src/schemas/users/businesses/offerings/offer.ts +0 -39
  51. package/src/schemas/users/businesses/thread.ts +0 -55
  52. package/src/schemas/users/customers/customer.ts +0 -46
  53. package/src/schemas/users/customers/index.ts +0 -1
  54. package/src/schemas/users/index.ts +0 -2
package/src/base.ts CHANGED
@@ -1,4 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Scout9 API
5
+ * APIs for managing Scout9 users and conversations
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
1
16
  import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
2
19
  import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
3
20
  import globalAxios from 'axios';
4
21
 
@@ -9,10 +26,10 @@ export const BASE_PATH = "https://us-central1-jumpstart.cloudfunctions.net".repl
9
26
  * @export
10
27
  */
11
28
  export const COLLECTION_FORMATS = {
12
- csv: ",",
13
- ssv: " ",
14
- tsv: "\t",
15
- pipes: "|",
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
16
33
  };
17
34
 
18
35
  /**
@@ -21,8 +38,8 @@ export const COLLECTION_FORMATS = {
21
38
  * @interface RequestArgs
22
39
  */
23
40
  export interface RequestArgs {
24
- url: string;
25
- options: AxiosRequestConfig;
41
+ url: string;
42
+ options: AxiosRequestConfig;
26
43
  }
27
44
 
28
45
  /**
@@ -31,15 +48,15 @@ export interface RequestArgs {
31
48
  * @class BaseAPI
32
49
  */
33
50
  export class BaseAPI {
34
- protected configuration: Configuration | undefined;
51
+ protected configuration: Configuration | undefined;
35
52
 
36
- constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
37
- if (configuration) {
38
- this.configuration = configuration;
39
- this.basePath = configuration.basePath || this.basePath;
53
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath || this.basePath;
57
+ }
40
58
  }
41
- }
42
- }
59
+ };
43
60
 
44
61
  /**
45
62
  *
@@ -48,8 +65,8 @@ export class BaseAPI {
48
65
  * @extends {Error}
49
66
  */
50
67
  export class RequiredError extends Error {
51
- constructor(public field: string, msg?: string) {
52
- super(msg as string);
53
- this.name = "RequiredError"
54
- }
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
55
72
  }
package/src/common.ts CHANGED
@@ -1,8 +1,22 @@
1
- import { AxiosRequestConfig } from 'axios';
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Scout9 API
5
+ * APIs for managing Scout9 users and conversations
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
2
16
  import type { Configuration } from "./configuration";
3
- import type { RequestArgs, } from "./base";
17
+ import type { RequestArgs } from "./base";
4
18
  import type { AxiosInstance, AxiosResponse } from 'axios';
5
- import {RequiredError} from './base';
19
+ import { RequiredError } from "./base";
6
20
 
7
21
  /**
8
22
  *
@@ -16,9 +30,9 @@ export const DUMMY_BASE_URL = 'https://example.com'
16
30
  * @export
17
31
  */
18
32
  export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
19
- if (paramValue === null || paramValue === undefined) {
20
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
21
- }
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
22
36
  }
23
37
 
24
38
  /**
@@ -26,12 +40,12 @@ export const assertParamExists = function (functionName: string, paramName: stri
26
40
  * @export
27
41
  */
28
42
  export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
29
- if (configuration && configuration.apiKey) {
30
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
31
- ? await configuration.apiKey(keyParamName)
32
- : await configuration.apiKey;
33
- object[keyParamName] = localVarApiKeyValue;
34
- }
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
35
49
  }
36
50
 
37
51
  /**
@@ -39,9 +53,9 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri
39
53
  * @export
40
54
  */
41
55
  export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
42
- if (configuration && (configuration.username || configuration.password)) {
43
- object["auth"] = { username: configuration.username, password: configuration.password };
44
- }
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
45
59
  }
46
60
 
47
61
  /**
@@ -49,12 +63,12 @@ export const setBasicAuthToObject = function (object: any, configuration?: Confi
49
63
  * @export
50
64
  */
51
65
  export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
52
- if (configuration && configuration.accessToken) {
53
- const accessToken = typeof configuration.accessToken === 'function'
54
- ? await configuration.accessToken()
55
- : await configuration.accessToken;
56
- object["Authorization"] = "Bearer " + accessToken;
57
- }
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
58
72
  }
59
73
 
60
74
  /**
@@ -62,34 +76,34 @@ export const setBearerAuthToObject = async function (object: any, configuration?
62
76
  * @export
63
77
  */
64
78
  export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
65
- if (configuration && configuration.accessToken) {
66
- const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
67
- ? await configuration.accessToken(name, scopes)
68
- : await configuration.accessToken;
69
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
70
- }
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
71
85
  }
72
86
 
73
87
  function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
74
- if (parameter == null) return;
75
- if (typeof parameter === "object") {
76
- if (Array.isArray(parameter)) {
77
- (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
78
- }
79
- else {
80
- Object.keys(parameter).forEach(currentKey =>
81
- setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
82
- );
83
- }
84
- }
85
- else {
86
- if (urlSearchParams.has(key)) {
87
- urlSearchParams.append(key, parameter);
88
- }
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
89
99
  else {
90
- urlSearchParams.set(key, parameter);
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
91
106
  }
92
- }
93
107
  }
94
108
 
95
109
  /**
@@ -97,9 +111,9 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
97
111
  * @export
98
112
  */
99
113
  export const setSearchParams = function (url: URL, ...objects: any[]) {
100
- const searchParams = new URLSearchParams(url.search);
101
- setFlattenedQueryParams(searchParams, objects);
102
- url.search = searchParams.toString();
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = searchParams.toString();
103
117
  }
104
118
 
105
119
  /**
@@ -107,13 +121,13 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
107
121
  * @export
108
122
  */
109
123
  export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
110
- const nonString = typeof value !== 'string';
111
- const needsSerialization = nonString && configuration && configuration.isJsonMime
112
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
113
- : nonString;
114
- return needsSerialization
115
- ? JSON.stringify(value !== undefined ? value : {})
116
- : (value || "");
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
117
131
  }
118
132
 
119
133
  /**
@@ -121,7 +135,7 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any,
121
135
  * @export
122
136
  */
123
137
  export const toPathString = function (url: URL) {
124
- return url.pathname + url.search + url.hash
138
+ return url.pathname + url.search + url.hash
125
139
  }
126
140
 
127
141
  /**
@@ -129,8 +143,8 @@ export const toPathString = function (url: URL) {
129
143
  * @export
130
144
  */
131
145
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
132
- return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
133
- const axiosRequestArgs: AxiosRequestConfig<any> = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
134
- return axios.request<T, R>(axiosRequestArgs);
135
- };
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
136
150
  }
@@ -1,124 +1,101 @@
1
- const packageJson = require("../package.json");
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Scout9 API
5
+ * APIs for managing Scout9 users and conversations
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
2
15
 
3
16
  export interface ConfigurationParameters {
4
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
5
- organization?: string;
6
- username?: string;
7
- password?: string;
8
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
9
- basePath?: string;
10
- baseOptions?: any;
11
- formDataCtor?: new () => any;
17
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
18
+ username?: string;
19
+ password?: string;
20
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
21
+ basePath?: string;
22
+ baseOptions?: any;
23
+ formDataCtor?: new () => any;
12
24
  }
13
25
 
14
26
  export class Configuration {
15
- /**
16
- * parameter for apiKey security
17
- * @param name security name
18
- * @memberof Configuration
19
- */
20
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
21
-
22
- /**
23
- * Scout9 organization id
24
- *
25
- * @type {string}
26
- * @memberof Configuration
27
- */
28
- organization?: string;
29
-
30
- /**
31
- * parameter for basic security
32
- *
33
- * @type {string}
34
- * @memberof Configuration
35
- */
36
- username?: string;
37
-
38
- /**
39
- * parameter for basic security
40
- *
41
- * @type {string}
42
- * @memberof Configuration
43
- */
44
- password?: string;
45
-
46
- /**
47
- * parameter for oauth2 security
48
- * @param name security name
49
- * @param scopes oauth2 scope
50
- * @memberof Configuration
51
- */
52
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
53
-
54
- /**
55
- * override base path
56
- *
57
- * @type {string}
58
- * @memberof Configuration
59
- */
60
- basePath?: string;
61
- /**
62
- * base options for axios calls
63
- *
64
- * @type {any}
65
- * @memberof Configuration
66
- */
67
- baseOptions?: any;
68
-
69
- /**
70
- * The FormData constructor that will be used to create multipart form data
71
- * requests. You can inject this here so that execution environments that
72
- * do not support the FormData class can still run the generated client.
73
- *
74
- * @type {new () => FormData}
75
- */
76
- formDataCtor?: new () => any;
27
+ /**
28
+ * parameter for apiKey security
29
+ * @param name security name
30
+ * @memberof Configuration
31
+ */
32
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
33
+ /**
34
+ * parameter for basic security
35
+ *
36
+ * @type {string}
37
+ * @memberof Configuration
38
+ */
39
+ username?: string;
40
+ /**
41
+ * parameter for basic security
42
+ *
43
+ * @type {string}
44
+ * @memberof Configuration
45
+ */
46
+ password?: string;
47
+ /**
48
+ * parameter for oauth2 security
49
+ * @param name security name
50
+ * @param scopes oauth2 scope
51
+ * @memberof Configuration
52
+ */
53
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
54
+ /**
55
+ * override base path
56
+ *
57
+ * @type {string}
58
+ * @memberof Configuration
59
+ */
60
+ basePath?: string;
61
+ /**
62
+ * base options for axios calls
63
+ *
64
+ * @type {any}
65
+ * @memberof Configuration
66
+ */
67
+ baseOptions?: any;
68
+ /**
69
+ * The FormData constructor that will be used to create multipart form data
70
+ * requests. You can inject this here so that execution environments that
71
+ * do not support the FormData class can still run the generated client.
72
+ *
73
+ * @type {new () => FormData}
74
+ */
75
+ formDataCtor?: new () => any;
77
76
 
78
- /**
79
- * The version of the Scout9 API that this client library version is
80
- */
81
- apiVersion?: string;
82
-
83
- constructor(param: ConfigurationParameters = {}) {
84
- this.apiKey = param.apiKey;
85
- this.organization = param.organization;
86
- this.username = param.username;
87
- this.password = param.password;
88
- this.accessToken = param.accessToken;
89
- this.basePath = param.basePath;
90
- this.baseOptions = param.baseOptions;
91
- this.formDataCtor = param.formDataCtor;
92
- this.apiVersion = 'v' + packageJson.version.split(".")[0];
93
-
94
- if (!this.baseOptions) {
95
- this.baseOptions = {};
96
- }
97
- this.baseOptions.headers = {
98
- 'User-Agent': `Scout9/NodeJS/${packageJson.version}`,
99
- 'Authorization': `Bearer ${this.apiKey}`,
100
- ...this.baseOptions.headers,
77
+ constructor(param: ConfigurationParameters = {}) {
78
+ this.apiKey = param.apiKey;
79
+ this.username = param.username;
80
+ this.password = param.password;
81
+ this.accessToken = param.accessToken;
82
+ this.basePath = param.basePath;
83
+ this.baseOptions = param.baseOptions;
84
+ this.formDataCtor = param.formDataCtor;
101
85
  }
102
- if (this.organization) {
103
- this.baseOptions.headers['Scout9-Organization'] = this.organization;
104
- }
105
- if (!this.formDataCtor) {
106
- this.formDataCtor = require("form-data");
107
- }
108
- }
109
86
 
110
- /**
111
- * Check if the given MIME is a JSON MIME.
112
- * JSON MIME examples:
113
- * application/json
114
- * application/json; charset=UTF8
115
- * APPLICATION/JSON
116
- * application/vnd.company+json
117
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
118
- * @return True if the given MIME is JSON, false otherwise.
119
- */
120
- public isJsonMime(mime: string): boolean {
121
- const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
122
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
123
- }
87
+ /**
88
+ * Check if the given MIME is a JSON MIME.
89
+ * JSON MIME examples:
90
+ * application/json
91
+ * application/json; charset=UTF8
92
+ * APPLICATION/JSON
93
+ * application/vnd.company+json
94
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
95
+ * @return True if the given MIME is JSON, false otherwise.
96
+ */
97
+ public isJsonMime(mime: string): boolean {
98
+ const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
99
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
100
+ }
124
101
  }
package/src/index.ts CHANGED
@@ -1,2 +1,18 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Scout9 API
5
+ * APIs for managing Scout9 users and conversations
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
1
16
  export * from "./api";
2
17
  export * from "./configuration";
18
+