@scout9/admin 1.0.1 → 1.0.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.
- package/package.json +12 -3
- package/src/api.ts +3735 -95
- package/src/base.ts +34 -17
- package/src/common.ts +73 -59
- package/src/configuration.ts +92 -115
- package/src/index.ts +16 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/api-openai.d.ts +0 -2992
- package/build/api-openai.js +0 -1968
- package/build/api.d.ts +0 -78
- package/build/api.js +0 -90
- package/build/base.d.ts +0 -43
- package/build/base.js +0 -52
- package/build/common.d.ts +0 -54
- package/build/common.js +0 -132
- package/build/configuration.d.ts +0 -84
- package/build/configuration.js +0 -106
- package/build/index.d.ts +0 -2
- package/build/index.js +0 -18
- package/build/schemas/common/algolia.d.ts +0 -20
- package/build/schemas/common/algolia.js +0 -2
- package/build/schemas/common/contact-map.d.ts +0 -33
- package/build/schemas/common/contact-map.js +0 -2
- package/build/schemas/common/currency.d.ts +0 -1
- package/build/schemas/common/currency.js +0 -2
- package/build/schemas/common/index.d.ts +0 -6
- package/build/schemas/common/index.js +0 -22
- package/build/schemas/common/location.d.ts +0 -5
- package/build/schemas/common/location.js +0 -2
- package/build/schemas/common/task.d.ts +0 -20
- package/build/schemas/common/task.js +0 -2
- package/build/schemas/common/time.d.ts +0 -14
- package/build/schemas/common/time.js +0 -2
- package/build/schemas/common.d.ts +0 -77
- package/build/schemas/common.js +0 -8
- package/build/schemas/conversations/context.d.ts +0 -55
- package/build/schemas/conversations/context.js +0 -2
- package/build/schemas/conversations/conversation.d.ts +0 -53
- package/build/schemas/conversations/conversation.js +0 -2
- package/build/schemas/conversations/index.d.ts +0 -6
- package/build/schemas/conversations/index.js +0 -22
- package/build/schemas/conversations/message.d.ts +0 -62
- package/build/schemas/conversations/message.js +0 -2
- package/build/schemas/conversations/parsed.d.ts +0 -7
- package/build/schemas/conversations/parsed.js +0 -2
- package/build/schemas/conversations/scheduled-conversation.d.ts +0 -31
- package/build/schemas/conversations/scheduled-conversation.js +0 -2
- package/build/schemas/conversations/webhook.d.ts +0 -8
- package/build/schemas/conversations/webhook.js +0 -2
- package/build/schemas/index.d.ts +0 -3
- package/build/schemas/index.js +0 -19
- package/build/schemas/users/businesses/agents/agent.d.ts +0 -76
- package/build/schemas/users/businesses/agents/agent.js +0 -2
- package/build/schemas/users/businesses/agents/auth.d.ts +0 -7
- package/build/schemas/users/businesses/agents/auth.js +0 -2
- package/build/schemas/users/businesses/agents/index.d.ts +0 -2
- package/build/schemas/users/businesses/agents/index.js +0 -18
- package/build/schemas/users/businesses/business-location.d.ts +0 -10
- package/build/schemas/users/businesses/business-location.js +0 -2
- package/build/schemas/users/businesses/business.d.ts +0 -32
- package/build/schemas/users/businesses/business.js +0 -2
- package/build/schemas/users/businesses/context/context-indexed.d.ts +0 -9
- package/build/schemas/users/businesses/context/context-indexed.js +0 -2
- package/build/schemas/users/businesses/context/context-saves.d.ts +0 -12
- package/build/schemas/users/businesses/context/context-saves.js +0 -2
- package/build/schemas/users/businesses/context/context.d.ts +0 -64
- package/build/schemas/users/businesses/context/context.js +0 -2
- package/build/schemas/users/businesses/context/index.d.ts +0 -2
- package/build/schemas/users/businesses/context/index.js +0 -18
- package/build/schemas/users/businesses/index.d.ts +0 -5
- package/build/schemas/users/businesses/index.js +0 -21
- package/build/schemas/users/businesses/notifications.d.ts +0 -7
- package/build/schemas/users/businesses/notifications.js +0 -2
- package/build/schemas/users/businesses/offerings/index.d.ts +0 -2
- package/build/schemas/users/businesses/offerings/index.js +0 -18
- package/build/schemas/users/businesses/offerings/offer-indexed.d.ts +0 -34
- package/build/schemas/users/businesses/offerings/offer-indexed.js +0 -2
- package/build/schemas/users/businesses/offerings/offer.d.ts +0 -29
- package/build/schemas/users/businesses/offerings/offer.js +0 -2
- package/build/schemas/users/businesses/thread.d.ts +0 -44
- package/build/schemas/users/businesses/thread.js +0 -2
- package/build/schemas/users/customers/customer.d.ts +0 -35
- package/build/schemas/users/customers/customer.js +0 -2
- package/build/schemas/users/customers/index.d.ts +0 -1
- package/build/schemas/users/customers/index.js +0 -17
- package/build/schemas/users/index.d.ts +0 -2
- package/build/schemas/users/index.js +0 -18
- package/src/api-openai.txt +0 -4117
- package/src/schemas/common/algolia.ts +0 -24
- package/src/schemas/common/contact-map.ts +0 -35
- package/src/schemas/common/currency.ts +0 -1
- package/src/schemas/common/index.ts +0 -6
- package/src/schemas/common/location.ts +0 -6
- package/src/schemas/common/task.ts +0 -26
- package/src/schemas/common/time.ts +0 -15
- package/src/schemas/common.ts +0 -94
- package/src/schemas/conversations/context.ts +0 -64
- package/src/schemas/conversations/conversation.ts +0 -68
- package/src/schemas/conversations/index.ts +0 -6
- package/src/schemas/conversations/message.ts +0 -78
- package/src/schemas/conversations/parsed.ts +0 -5
- package/src/schemas/conversations/scheduled-conversation.ts +0 -35
- package/src/schemas/conversations/webhook.ts +0 -10
- package/src/schemas/index.ts +0 -3
- package/src/schemas/users/businesses/agents/agent.ts +0 -107
- package/src/schemas/users/businesses/agents/auth.ts +0 -8
- package/src/schemas/users/businesses/agents/index.ts +0 -2
- package/src/schemas/users/businesses/business-location.ts +0 -15
- package/src/schemas/users/businesses/business.ts +0 -43
- package/src/schemas/users/businesses/context/context-indexed.ts +0 -11
- package/src/schemas/users/businesses/context/context-saves.ts +0 -14
- package/src/schemas/users/businesses/context/context.ts +0 -76
- package/src/schemas/users/businesses/context/index.ts +0 -2
- package/src/schemas/users/businesses/index.ts +0 -6
- package/src/schemas/users/businesses/notifications.ts +0 -12
- package/src/schemas/users/businesses/offerings/index.ts +0 -2
- package/src/schemas/users/businesses/offerings/offer-indexed.ts +0 -42
- package/src/schemas/users/businesses/offerings/offer.ts +0 -39
- package/src/schemas/users/businesses/thread.ts +0 -55
- package/src/schemas/users/customers/customer.ts +0 -46
- package/src/schemas/users/customers/index.ts +0 -1
- 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
51
|
+
protected configuration: Configuration | undefined;
|
|
35
52
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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
|
|
17
|
+
import type { RequestArgs } from "./base";
|
|
4
18
|
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
5
|
-
import {RequiredError} from
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
}
|
package/src/configuration.ts
CHANGED
|
@@ -1,124 +1,101 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
+
|