@speechall/sdk 0.0.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.
@@ -0,0 +1,14 @@
1
+ import type { Configuration } from "./configuration";
2
+ import type { RequestArgs } from "./base";
3
+ import type { AxiosInstance, AxiosResponse } from 'axios';
4
+ export declare const DUMMY_BASE_URL = "https://example.com";
5
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
6
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
7
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
8
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
9
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
10
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
11
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
12
+ export declare const toPathString: (url: URL) => string;
13
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
14
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../common.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO1D,eAAO,MAAM,cAAc,wBAAwB,CAAA;AAOnD,eAAO,MAAM,iBAAiB,GAAa,cAAc,MAAM,EAAE,WAAW,MAAM,EAAE,YAAY,OAAO,SAItG,CAAA;AAMD,eAAO,MAAM,iBAAiB,GAAmB,QAAQ,GAAG,EAAE,cAAc,MAAM,EAAE,gBAAgB,aAAa,kBAOhH,CAAA;AAMD,eAAO,MAAM,oBAAoB,GAAa,QAAQ,GAAG,EAAE,gBAAgB,aAAa,SAIvF,CAAA;AAMD,eAAO,MAAM,qBAAqB,GAAmB,QAAQ,GAAG,EAAE,gBAAgB,aAAa,kBAO9F,CAAA;AAMD,eAAO,MAAM,gBAAgB,GAAmB,QAAQ,GAAG,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,gBAAgB,aAAa,kBAOzH,CAAA;AA4BD,eAAO,MAAM,eAAe,GAAa,KAAK,GAAG,EAAE,GAAG,SAAS,GAAG,EAAE,SAInE,CAAA;AAMD,eAAO,MAAM,qBAAqB,GAAa,OAAO,GAAG,EAAE,gBAAgB,GAAG,EAAE,gBAAgB,aAAa,QAQ5G,CAAA;AAMD,eAAO,MAAM,YAAY,GAAa,KAAK,GAAG,WAE7C,CAAA;AAMD,eAAO,MAAM,qBAAqB,GAAa,WAAW,WAAW,EAAE,aAAa,aAAa,EAAE,WAAW,MAAM,EAAE,gBAAgB,aAAa,MACvI,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,QAAO,aAA2B,EAAE,WAAU,MAAkB,eAI9G,CAAA"}
package/dist/common.js ADDED
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
4
+ const base_1 = require("./base");
5
+ exports.DUMMY_BASE_URL = 'https://example.com';
6
+ const assertParamExists = function (functionName, paramName, paramValue) {
7
+ if (paramValue === null || paramValue === undefined) {
8
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
9
+ }
10
+ };
11
+ exports.assertParamExists = assertParamExists;
12
+ const setApiKeyToObject = async function (object, keyParamName, configuration) {
13
+ if (configuration && configuration.apiKey) {
14
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
15
+ ? await configuration.apiKey(keyParamName)
16
+ : await configuration.apiKey;
17
+ object[keyParamName] = localVarApiKeyValue;
18
+ }
19
+ };
20
+ exports.setApiKeyToObject = setApiKeyToObject;
21
+ const setBasicAuthToObject = function (object, configuration) {
22
+ if (configuration && (configuration.username || configuration.password)) {
23
+ object["auth"] = { username: configuration.username, password: configuration.password };
24
+ }
25
+ };
26
+ exports.setBasicAuthToObject = setBasicAuthToObject;
27
+ const setBearerAuthToObject = async function (object, configuration) {
28
+ if (configuration && configuration.accessToken) {
29
+ const accessToken = typeof configuration.accessToken === 'function'
30
+ ? await configuration.accessToken()
31
+ : await configuration.accessToken;
32
+ object["Authorization"] = "Bearer " + accessToken;
33
+ }
34
+ };
35
+ exports.setBearerAuthToObject = setBearerAuthToObject;
36
+ const setOAuthToObject = async function (object, name, scopes, configuration) {
37
+ if (configuration && configuration.accessToken) {
38
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
39
+ ? await configuration.accessToken(name, scopes)
40
+ : await configuration.accessToken;
41
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
42
+ }
43
+ };
44
+ exports.setOAuthToObject = setOAuthToObject;
45
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
46
+ if (parameter == null)
47
+ return;
48
+ if (typeof parameter === "object") {
49
+ if (Array.isArray(parameter)) {
50
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
51
+ }
52
+ else {
53
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
54
+ }
55
+ }
56
+ else {
57
+ if (urlSearchParams.has(key)) {
58
+ urlSearchParams.append(key, parameter);
59
+ }
60
+ else {
61
+ urlSearchParams.set(key, parameter);
62
+ }
63
+ }
64
+ }
65
+ const setSearchParams = function (url, ...objects) {
66
+ const searchParams = new URLSearchParams(url.search);
67
+ setFlattenedQueryParams(searchParams, objects);
68
+ url.search = searchParams.toString();
69
+ };
70
+ exports.setSearchParams = setSearchParams;
71
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
72
+ const nonString = typeof value !== 'string';
73
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
74
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
75
+ : nonString;
76
+ return needsSerialization
77
+ ? JSON.stringify(value !== undefined ? value : {})
78
+ : (value || "");
79
+ };
80
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
81
+ const toPathString = function (url) {
82
+ return url.pathname + url.search + url.hash;
83
+ };
84
+ exports.toPathString = toPathString;
85
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
86
+ return (axios = globalAxios, basePath = BASE_PATH) => {
87
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
88
+ return axios.request(axiosRequestArgs);
89
+ };
90
+ };
91
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,23 @@
1
+ export interface ConfigurationParameters {
2
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
3
+ username?: string;
4
+ password?: string;
5
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
6
+ basePath?: string;
7
+ serverIndex?: number;
8
+ baseOptions?: any;
9
+ formDataCtor?: new () => any;
10
+ }
11
+ export declare class Configuration {
12
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
13
+ username?: string;
14
+ password?: string;
15
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
16
+ basePath?: string;
17
+ serverIndex?: number;
18
+ baseOptions?: any;
19
+ formDataCtor?: new () => any;
20
+ constructor(param?: ConfigurationParameters);
21
+ isJsonMime(mime: string): boolean;
22
+ }
23
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../configuration.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,uBAAuB;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACrG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAClJ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,UAAU,GAAG,CAAC;CAChC;AAED,qBAAa,aAAa;IAMtB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAOrG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAOlJ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,WAAW,CAAC,EAAE,GAAG,CAAC;IAQlB,YAAY,CAAC,EAAE,UAAU,GAAG,CAAC;gBAEjB,KAAK,GAAE,uBAA4B;IA0BxC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAI3C"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Configuration = void 0;
4
+ class Configuration {
5
+ constructor(param = {}) {
6
+ this.apiKey = param.apiKey;
7
+ this.username = param.username;
8
+ this.password = param.password;
9
+ this.accessToken = param.accessToken;
10
+ this.basePath = param.basePath;
11
+ this.serverIndex = param.serverIndex;
12
+ this.baseOptions = {
13
+ ...param.baseOptions,
14
+ headers: {
15
+ ...param.baseOptions?.headers,
16
+ },
17
+ };
18
+ this.formDataCtor = param.formDataCtor;
19
+ }
20
+ isJsonMime(mime) {
21
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
22
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
23
+ }
24
+ }
25
+ exports.Configuration = Configuration;