@teemill/projects 1.0.0 → 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 (57) hide show
  1. package/.openapi-generator/FILES +13 -6
  2. package/README.md +3 -3
  3. package/dist/apis/IntegrationsApi.d.ts +58 -0
  4. package/dist/apis/IntegrationsApi.js +221 -0
  5. package/dist/apis/ProjectsApi.d.ts +77 -0
  6. package/dist/apis/ProjectsApi.js +304 -0
  7. package/dist/apis/index.d.ts +2 -0
  8. package/dist/apis/index.js +20 -0
  9. package/dist/index.d.ts +3 -13
  10. package/dist/index.js +5 -15
  11. package/dist/models/ApiError.d.ts +37 -0
  12. package/dist/models/ApiError.js +53 -0
  13. package/dist/models/Integration.d.ts +56 -0
  14. package/dist/models/Integration.js +62 -0
  15. package/dist/models/IntegrationInfo.d.ts +49 -0
  16. package/dist/models/IntegrationInfo.js +59 -0
  17. package/dist/models/IntegrationsResponse.d.ts +32 -0
  18. package/dist/models/IntegrationsResponse.js +51 -0
  19. package/dist/models/Project.d.ts +50 -0
  20. package/dist/models/Project.js +60 -0
  21. package/dist/models/ProjectLogo.d.ts +37 -0
  22. package/dist/models/ProjectLogo.js +52 -0
  23. package/dist/models/ProjectsResponse.d.ts +32 -0
  24. package/dist/models/ProjectsResponse.js +51 -0
  25. package/dist/models/index.d.ts +7 -0
  26. package/dist/models/index.js +25 -0
  27. package/dist/runtime.d.ts +182 -0
  28. package/dist/runtime.js +562 -0
  29. package/package.json +3 -15
  30. package/src/apis/IntegrationsApi.ts +149 -0
  31. package/src/apis/ProjectsApi.ts +200 -0
  32. package/src/apis/index.ts +4 -0
  33. package/src/index.ts +5 -0
  34. package/src/models/ApiError.ts +74 -0
  35. package/src/models/Integration.ts +107 -0
  36. package/src/models/IntegrationInfo.ts +93 -0
  37. package/src/models/IntegrationsResponse.ts +73 -0
  38. package/src/models/Project.ts +99 -0
  39. package/src/models/ProjectLogo.ts +73 -0
  40. package/src/models/ProjectsResponse.ts +73 -0
  41. package/src/models/index.ts +9 -0
  42. package/src/runtime.ts +431 -0
  43. package/tsconfig.json +2 -3
  44. package/api.ts +0 -462
  45. package/base.ts +0 -72
  46. package/common.ts +0 -150
  47. package/configuration.ts +0 -101
  48. package/dist/api.d.ts +0 -274
  49. package/dist/api.js +0 -489
  50. package/dist/base.d.ts +0 -54
  51. package/dist/base.js +0 -80
  52. package/dist/common.d.ts +0 -65
  53. package/dist/common.js +0 -252
  54. package/dist/configuration.d.ts +0 -83
  55. package/dist/configuration.js +0 -44
  56. package/git_push.sh +0 -57
  57. package/index.ts +0 -18
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Projects API
6
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.IntegrationInfoToJSON = exports.IntegrationInfoFromJSONTyped = exports.IntegrationInfoFromJSON = exports.instanceOfIntegrationInfo = void 0;
17
+ /**
18
+ * Check if a given object implements the IntegrationInfo interface.
19
+ */
20
+ function instanceOfIntegrationInfo(value) {
21
+ var isInstance = true;
22
+ isInstance = isInstance && "name" in value;
23
+ isInstance = isInstance && "description" in value;
24
+ isInstance = isInstance && "author" in value;
25
+ isInstance = isInstance && "icon" in value;
26
+ return isInstance;
27
+ }
28
+ exports.instanceOfIntegrationInfo = instanceOfIntegrationInfo;
29
+ function IntegrationInfoFromJSON(json) {
30
+ return IntegrationInfoFromJSONTyped(json, false);
31
+ }
32
+ exports.IntegrationInfoFromJSON = IntegrationInfoFromJSON;
33
+ function IntegrationInfoFromJSONTyped(json, ignoreDiscriminator) {
34
+ if ((json === undefined) || (json === null)) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'name': json['name'],
39
+ 'description': json['description'],
40
+ 'author': json['author'],
41
+ 'icon': json['icon'],
42
+ };
43
+ }
44
+ exports.IntegrationInfoFromJSONTyped = IntegrationInfoFromJSONTyped;
45
+ function IntegrationInfoToJSON(value) {
46
+ if (value === undefined) {
47
+ return undefined;
48
+ }
49
+ if (value === null) {
50
+ return null;
51
+ }
52
+ return {
53
+ 'name': value.name,
54
+ 'description': value.description,
55
+ 'author': value.author,
56
+ 'icon': value.icon,
57
+ };
58
+ }
59
+ exports.IntegrationInfoToJSON = IntegrationInfoToJSON;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Projects API
3
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Integration } from './Integration';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface IntegrationsResponse
17
+ */
18
+ export interface IntegrationsResponse {
19
+ /**
20
+ *
21
+ * @type {Array<Integration>}
22
+ * @memberof IntegrationsResponse
23
+ */
24
+ projects: Array<Integration>;
25
+ }
26
+ /**
27
+ * Check if a given object implements the IntegrationsResponse interface.
28
+ */
29
+ export declare function instanceOfIntegrationsResponse(value: object): boolean;
30
+ export declare function IntegrationsResponseFromJSON(json: any): IntegrationsResponse;
31
+ export declare function IntegrationsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationsResponse;
32
+ export declare function IntegrationsResponseToJSON(value?: IntegrationsResponse | null): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Projects API
6
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.IntegrationsResponseToJSON = exports.IntegrationsResponseFromJSONTyped = exports.IntegrationsResponseFromJSON = exports.instanceOfIntegrationsResponse = void 0;
17
+ var Integration_1 = require("./Integration");
18
+ /**
19
+ * Check if a given object implements the IntegrationsResponse interface.
20
+ */
21
+ function instanceOfIntegrationsResponse(value) {
22
+ var isInstance = true;
23
+ isInstance = isInstance && "projects" in value;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfIntegrationsResponse = instanceOfIntegrationsResponse;
27
+ function IntegrationsResponseFromJSON(json) {
28
+ return IntegrationsResponseFromJSONTyped(json, false);
29
+ }
30
+ exports.IntegrationsResponseFromJSON = IntegrationsResponseFromJSON;
31
+ function IntegrationsResponseFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'projects': (json['projects'].map(Integration_1.IntegrationFromJSON)),
37
+ };
38
+ }
39
+ exports.IntegrationsResponseFromJSONTyped = IntegrationsResponseFromJSONTyped;
40
+ function IntegrationsResponseToJSON(value) {
41
+ if (value === undefined) {
42
+ return undefined;
43
+ }
44
+ if (value === null) {
45
+ return null;
46
+ }
47
+ return {
48
+ 'projects': (value.projects.map(Integration_1.IntegrationToJSON)),
49
+ };
50
+ }
51
+ exports.IntegrationsResponseToJSON = IntegrationsResponseToJSON;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Projects API
3
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ProjectLogo } from './ProjectLogo';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface Project
17
+ */
18
+ export interface Project {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof Project
23
+ */
24
+ id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof Project
29
+ */
30
+ name: string;
31
+ /**
32
+ *
33
+ * @type {ProjectLogo}
34
+ * @memberof Project
35
+ */
36
+ logo: ProjectLogo;
37
+ /**
38
+ *
39
+ * @type {Array<string>}
40
+ * @memberof Project
41
+ */
42
+ integrations?: Array<string>;
43
+ }
44
+ /**
45
+ * Check if a given object implements the Project interface.
46
+ */
47
+ export declare function instanceOfProject(value: object): boolean;
48
+ export declare function ProjectFromJSON(json: any): Project;
49
+ export declare function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project;
50
+ export declare function ProjectToJSON(value?: Project | null): any;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Projects API
6
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ProjectToJSON = exports.ProjectFromJSONTyped = exports.ProjectFromJSON = exports.instanceOfProject = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ var ProjectLogo_1 = require("./ProjectLogo");
19
+ /**
20
+ * Check if a given object implements the Project interface.
21
+ */
22
+ function instanceOfProject(value) {
23
+ var isInstance = true;
24
+ isInstance = isInstance && "id" in value;
25
+ isInstance = isInstance && "name" in value;
26
+ isInstance = isInstance && "logo" in value;
27
+ return isInstance;
28
+ }
29
+ exports.instanceOfProject = instanceOfProject;
30
+ function ProjectFromJSON(json) {
31
+ return ProjectFromJSONTyped(json, false);
32
+ }
33
+ exports.ProjectFromJSON = ProjectFromJSON;
34
+ function ProjectFromJSONTyped(json, ignoreDiscriminator) {
35
+ if ((json === undefined) || (json === null)) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'id': json['id'],
40
+ 'name': json['name'],
41
+ 'logo': (0, ProjectLogo_1.ProjectLogoFromJSON)(json['logo']),
42
+ 'integrations': !(0, runtime_1.exists)(json, 'integrations') ? undefined : json['integrations'],
43
+ };
44
+ }
45
+ exports.ProjectFromJSONTyped = ProjectFromJSONTyped;
46
+ function ProjectToJSON(value) {
47
+ if (value === undefined) {
48
+ return undefined;
49
+ }
50
+ if (value === null) {
51
+ return null;
52
+ }
53
+ return {
54
+ 'id': value.id,
55
+ 'name': value.name,
56
+ 'logo': (0, ProjectLogo_1.ProjectLogoToJSON)(value.logo),
57
+ 'integrations': value.integrations,
58
+ };
59
+ }
60
+ exports.ProjectToJSON = ProjectToJSON;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Projects API
3
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ProjectLogo
16
+ */
17
+ export interface ProjectLogo {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ProjectLogo
22
+ */
23
+ url?: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof ProjectLogo
28
+ */
29
+ backgroundColor?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProjectLogo interface.
33
+ */
34
+ export declare function instanceOfProjectLogo(value: object): boolean;
35
+ export declare function ProjectLogoFromJSON(json: any): ProjectLogo;
36
+ export declare function ProjectLogoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectLogo;
37
+ export declare function ProjectLogoToJSON(value?: ProjectLogo | null): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Projects API
6
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ProjectLogoToJSON = exports.ProjectLogoFromJSONTyped = exports.ProjectLogoFromJSON = exports.instanceOfProjectLogo = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * Check if a given object implements the ProjectLogo interface.
20
+ */
21
+ function instanceOfProjectLogo(value) {
22
+ var isInstance = true;
23
+ return isInstance;
24
+ }
25
+ exports.instanceOfProjectLogo = instanceOfProjectLogo;
26
+ function ProjectLogoFromJSON(json) {
27
+ return ProjectLogoFromJSONTyped(json, false);
28
+ }
29
+ exports.ProjectLogoFromJSON = ProjectLogoFromJSON;
30
+ function ProjectLogoFromJSONTyped(json, ignoreDiscriminator) {
31
+ if ((json === undefined) || (json === null)) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'url': !(0, runtime_1.exists)(json, 'url') ? undefined : json['url'],
36
+ 'backgroundColor': !(0, runtime_1.exists)(json, 'backgroundColor') ? undefined : json['backgroundColor'],
37
+ };
38
+ }
39
+ exports.ProjectLogoFromJSONTyped = ProjectLogoFromJSONTyped;
40
+ function ProjectLogoToJSON(value) {
41
+ if (value === undefined) {
42
+ return undefined;
43
+ }
44
+ if (value === null) {
45
+ return null;
46
+ }
47
+ return {
48
+ 'url': value.url,
49
+ 'backgroundColor': value.backgroundColor,
50
+ };
51
+ }
52
+ exports.ProjectLogoToJSON = ProjectLogoToJSON;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Projects API
3
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Project } from './Project';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface ProjectsResponse
17
+ */
18
+ export interface ProjectsResponse {
19
+ /**
20
+ *
21
+ * @type {Array<Project>}
22
+ * @memberof ProjectsResponse
23
+ */
24
+ projects: Array<Project>;
25
+ }
26
+ /**
27
+ * Check if a given object implements the ProjectsResponse interface.
28
+ */
29
+ export declare function instanceOfProjectsResponse(value: object): boolean;
30
+ export declare function ProjectsResponseFromJSON(json: any): ProjectsResponse;
31
+ export declare function ProjectsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectsResponse;
32
+ export declare function ProjectsResponseToJSON(value?: ProjectsResponse | null): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Projects API
6
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ProjectsResponseToJSON = exports.ProjectsResponseFromJSONTyped = exports.ProjectsResponseFromJSON = exports.instanceOfProjectsResponse = void 0;
17
+ var Project_1 = require("./Project");
18
+ /**
19
+ * Check if a given object implements the ProjectsResponse interface.
20
+ */
21
+ function instanceOfProjectsResponse(value) {
22
+ var isInstance = true;
23
+ isInstance = isInstance && "projects" in value;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfProjectsResponse = instanceOfProjectsResponse;
27
+ function ProjectsResponseFromJSON(json) {
28
+ return ProjectsResponseFromJSONTyped(json, false);
29
+ }
30
+ exports.ProjectsResponseFromJSON = ProjectsResponseFromJSON;
31
+ function ProjectsResponseFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'projects': (json['projects'].map(Project_1.ProjectFromJSON)),
37
+ };
38
+ }
39
+ exports.ProjectsResponseFromJSONTyped = ProjectsResponseFromJSONTyped;
40
+ function ProjectsResponseToJSON(value) {
41
+ if (value === undefined) {
42
+ return undefined;
43
+ }
44
+ if (value === null) {
45
+ return null;
46
+ }
47
+ return {
48
+ 'projects': (value.projects.map(Project_1.ProjectToJSON)),
49
+ };
50
+ }
51
+ exports.ProjectsResponseToJSON = ProjectsResponseToJSON;
@@ -0,0 +1,7 @@
1
+ export * from './ApiError';
2
+ export * from './Integration';
3
+ export * from './IntegrationInfo';
4
+ export * from './IntegrationsResponse';
5
+ export * from './Project';
6
+ export * from './ProjectLogo';
7
+ export * from './ProjectsResponse';
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./ApiError"), exports);
20
+ __exportStar(require("./Integration"), exports);
21
+ __exportStar(require("./IntegrationInfo"), exports);
22
+ __exportStar(require("./IntegrationsResponse"), exports);
23
+ __exportStar(require("./Project"), exports);
24
+ __exportStar(require("./ProjectLogo"), exports);
25
+ __exportStar(require("./ProjectsResponse"), exports);
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Projects API
3
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
6
+ * Contact: hello@teemill.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export declare const BASE_PATH: string;
13
+ export interface ConfigurationParameters {
14
+ basePath?: string;
15
+ fetchApi?: FetchAPI;
16
+ middleware?: Middleware[];
17
+ queryParamsStringify?: (params: HTTPQuery) => string;
18
+ username?: string;
19
+ password?: string;
20
+ apiKey?: string | ((name: string) => string);
21
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
22
+ headers?: HTTPHeaders;
23
+ credentials?: RequestCredentials;
24
+ }
25
+ export declare class Configuration {
26
+ private configuration;
27
+ constructor(configuration?: ConfigurationParameters);
28
+ set config(configuration: Configuration);
29
+ get basePath(): string;
30
+ get fetchApi(): FetchAPI | undefined;
31
+ get middleware(): Middleware[];
32
+ get queryParamsStringify(): (params: HTTPQuery) => string;
33
+ get username(): string | undefined;
34
+ get password(): string | undefined;
35
+ get apiKey(): ((name: string) => string) | undefined;
36
+ get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
37
+ get headers(): HTTPHeaders | undefined;
38
+ get credentials(): RequestCredentials | undefined;
39
+ }
40
+ export declare const DefaultConfig: Configuration;
41
+ /**
42
+ * This is the base class for all generated API classes.
43
+ */
44
+ export declare class BaseAPI {
45
+ protected configuration: Configuration;
46
+ private static readonly jsonRegex;
47
+ private middleware;
48
+ constructor(configuration?: Configuration);
49
+ withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
50
+ withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
51
+ withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
52
+ /**
53
+ * Check if the given MIME is a JSON MIME.
54
+ * JSON MIME examples:
55
+ * application/json
56
+ * application/json; charset=UTF8
57
+ * APPLICATION/JSON
58
+ * application/vnd.company+json
59
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
60
+ * @return True if the given MIME is JSON, false otherwise.
61
+ */
62
+ protected isJsonMime(mime: string | null | undefined): boolean;
63
+ protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
64
+ private createFetchParams;
65
+ private fetchApi;
66
+ /**
67
+ * Create a shallow clone of `this` by constructing a new instance
68
+ * and then shallow cloning data members.
69
+ */
70
+ private clone;
71
+ }
72
+ export declare class ResponseError extends Error {
73
+ response: Response;
74
+ name: "ResponseError";
75
+ constructor(response: Response, msg?: string);
76
+ }
77
+ export declare class FetchError extends Error {
78
+ cause: Error;
79
+ name: "FetchError";
80
+ constructor(cause: Error, msg?: string);
81
+ }
82
+ export declare class RequiredError extends Error {
83
+ field: string;
84
+ name: "RequiredError";
85
+ constructor(field: string, msg?: string);
86
+ }
87
+ export declare const COLLECTION_FORMATS: {
88
+ csv: string;
89
+ ssv: string;
90
+ tsv: string;
91
+ pipes: string;
92
+ };
93
+ export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
94
+ export type Json = any;
95
+ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
96
+ export type HTTPHeaders = {
97
+ [key: string]: string;
98
+ };
99
+ export type HTTPQuery = {
100
+ [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
101
+ };
102
+ export type HTTPBody = Json | FormData | URLSearchParams;
103
+ export type HTTPRequestInit = {
104
+ headers?: HTTPHeaders;
105
+ method: HTTPMethod;
106
+ credentials?: RequestCredentials;
107
+ body?: HTTPBody;
108
+ };
109
+ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
110
+ export type InitOverrideFunction = (requestContext: {
111
+ init: HTTPRequestInit;
112
+ context: RequestOpts;
113
+ }) => Promise<RequestInit>;
114
+ export interface FetchParams {
115
+ url: string;
116
+ init: RequestInit;
117
+ }
118
+ export interface RequestOpts {
119
+ path: string;
120
+ method: HTTPMethod;
121
+ headers: HTTPHeaders;
122
+ query?: HTTPQuery;
123
+ body?: HTTPBody;
124
+ }
125
+ export declare function exists(json: any, key: string): boolean;
126
+ export declare function querystring(params: HTTPQuery, prefix?: string): string;
127
+ export declare function mapValues(data: any, fn: (item: any) => any): {};
128
+ export declare function canConsumeForm(consumes: Consume[]): boolean;
129
+ export interface Consume {
130
+ contentType: string;
131
+ }
132
+ export interface RequestContext {
133
+ fetch: FetchAPI;
134
+ url: string;
135
+ init: RequestInit;
136
+ }
137
+ export interface ResponseContext {
138
+ fetch: FetchAPI;
139
+ url: string;
140
+ init: RequestInit;
141
+ response: Response;
142
+ }
143
+ export interface ErrorContext {
144
+ fetch: FetchAPI;
145
+ url: string;
146
+ init: RequestInit;
147
+ error: unknown;
148
+ response?: Response;
149
+ }
150
+ export interface Middleware {
151
+ pre?(context: RequestContext): Promise<FetchParams | void>;
152
+ post?(context: ResponseContext): Promise<Response | void>;
153
+ onError?(context: ErrorContext): Promise<Response | void>;
154
+ }
155
+ export interface ApiResponse<T> {
156
+ raw: Response;
157
+ value(): Promise<T>;
158
+ }
159
+ export interface ResponseTransformer<T> {
160
+ (json: any): T;
161
+ }
162
+ export declare class JSONApiResponse<T> {
163
+ raw: Response;
164
+ private transformer;
165
+ constructor(raw: Response, transformer?: ResponseTransformer<T>);
166
+ value(): Promise<T>;
167
+ }
168
+ export declare class VoidApiResponse {
169
+ raw: Response;
170
+ constructor(raw: Response);
171
+ value(): Promise<void>;
172
+ }
173
+ export declare class BlobApiResponse {
174
+ raw: Response;
175
+ constructor(raw: Response);
176
+ value(): Promise<Blob>;
177
+ }
178
+ export declare class TextApiResponse {
179
+ raw: Response;
180
+ constructor(raw: Response);
181
+ value(): Promise<string>;
182
+ }