@teemill/projects 0.3.0

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,11 @@
1
+ .gitignore
2
+ .npmignore
3
+ README.md
4
+ api.ts
5
+ base.ts
6
+ common.ts
7
+ configuration.ts
8
+ git_push.sh
9
+ index.ts
10
+ package.json
11
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 7.1.0-SNAPSHOT
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ ## @teemill/projects@0.3.0
2
+
3
+ This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
+
5
+ Environment
6
+ * Node.js
7
+ * Webpack
8
+ * Browserify
9
+
10
+ Language level
11
+ * ES5 - you must have a Promises/A+ library installed
12
+ * ES6
13
+
14
+ Module system
15
+ * CommonJS
16
+ * ES6 module system
17
+
18
+ It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
19
+
20
+ ### Building
21
+
22
+ To build and compile the typescript sources to javascript use:
23
+ ```
24
+ npm install
25
+ npm run build
26
+ ```
27
+
28
+ ### Publishing
29
+
30
+ First build the package then run ```npm publish```
31
+
32
+ ### Consuming
33
+
34
+ navigate to the folder of your consuming project and run one of the following commands.
35
+
36
+ _published:_
37
+
38
+ ```
39
+ npm install @teemill/projects@0.3.0 --save
40
+ ```
41
+
42
+ _unPublished (not recommended):_
43
+
44
+ ```
45
+ npm install PATH_TO_GENERATED_PACKAGE --save
package/api.ts ADDED
@@ -0,0 +1,462 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Projects API
5
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.3.0
8
+ * Contact: hello@teemill.com
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
+
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
25
+
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface List200Response
30
+ */
31
+ export interface List200Response {
32
+ /**
33
+ *
34
+ * @type {Array<Project>}
35
+ * @memberof List200Response
36
+ */
37
+ 'projects': Array<Project>;
38
+ }
39
+ /**
40
+ *
41
+ * @export
42
+ * @interface ModelError
43
+ */
44
+ export interface ModelError {
45
+ /**
46
+ *
47
+ * @type {string}
48
+ * @memberof ModelError
49
+ */
50
+ 'code'?: string;
51
+ /**
52
+ *
53
+ * @type {string}
54
+ * @memberof ModelError
55
+ */
56
+ 'message': string;
57
+ }
58
+ /**
59
+ *
60
+ * @export
61
+ * @interface Project
62
+ */
63
+ export interface Project {
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof Project
68
+ */
69
+ 'id': string;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof Project
74
+ */
75
+ 'name': string;
76
+ /**
77
+ *
78
+ * @type {ProjectLogo}
79
+ * @memberof Project
80
+ */
81
+ 'logo': ProjectLogo;
82
+ }
83
+ /**
84
+ *
85
+ * @export
86
+ * @interface ProjectLogo
87
+ */
88
+ export interface ProjectLogo {
89
+ /**
90
+ *
91
+ * @type {string}
92
+ * @memberof ProjectLogo
93
+ */
94
+ 'url'?: string;
95
+ /**
96
+ *
97
+ * @type {string}
98
+ * @memberof ProjectLogo
99
+ */
100
+ 'backgroundColor'?: string;
101
+ }
102
+
103
+ /**
104
+ * ProjectsApi - axios parameter creator
105
+ * @export
106
+ */
107
+ export const ProjectsApiAxiosParamCreator = function (configuration?: Configuration) {
108
+ return {
109
+ /**
110
+ * Delete a project
111
+ * @summary Delete project
112
+ * @param {string} projectId Projects unique identifier
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ */
116
+ _delete: async (projectId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
117
+ // verify required parameter 'projectId' is not null or undefined
118
+ assertParamExists('_delete', 'projectId', projectId)
119
+ const localVarPath = `/dashboard/projects/{projectId}`
120
+ .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)));
121
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
122
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
123
+ let baseOptions;
124
+ if (configuration) {
125
+ baseOptions = configuration.baseOptions;
126
+ }
127
+
128
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
129
+ const localVarHeaderParameter = {} as any;
130
+ const localVarQueryParameter = {} as any;
131
+
132
+
133
+
134
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
135
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
136
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
137
+
138
+ return {
139
+ url: toPathString(localVarUrlObj),
140
+ options: localVarRequestOptions,
141
+ };
142
+ },
143
+ /**
144
+ * Create a new projects
145
+ * @summary Create project
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ */
149
+ create: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
150
+ const localVarPath = `/dashboard/projects`;
151
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
152
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
153
+ let baseOptions;
154
+ if (configuration) {
155
+ baseOptions = configuration.baseOptions;
156
+ }
157
+
158
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
159
+ const localVarHeaderParameter = {} as any;
160
+ const localVarQueryParameter = {} as any;
161
+
162
+
163
+
164
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
165
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
166
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
167
+
168
+ return {
169
+ url: toPathString(localVarUrlObj),
170
+ options: localVarRequestOptions,
171
+ };
172
+ },
173
+ /**
174
+ * Get a project
175
+ * @summary Get project
176
+ * @param {string} projectId Projects unique identifier
177
+ * @param {*} [options] Override http request option.
178
+ * @throws {RequiredError}
179
+ */
180
+ get: async (projectId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
181
+ // verify required parameter 'projectId' is not null or undefined
182
+ assertParamExists('get', 'projectId', projectId)
183
+ const localVarPath = `/dashboard/projects/{projectId}`
184
+ .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)));
185
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
186
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
187
+ let baseOptions;
188
+ if (configuration) {
189
+ baseOptions = configuration.baseOptions;
190
+ }
191
+
192
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
193
+ const localVarHeaderParameter = {} as any;
194
+ const localVarQueryParameter = {} as any;
195
+
196
+
197
+
198
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
199
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
200
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
201
+
202
+ return {
203
+ url: toPathString(localVarUrlObj),
204
+ options: localVarRequestOptions,
205
+ };
206
+ },
207
+ /**
208
+ * List all projects available
209
+ * @summary List projects
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ */
213
+ list: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
214
+ const localVarPath = `/dashboard/projects`;
215
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
216
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
217
+ let baseOptions;
218
+ if (configuration) {
219
+ baseOptions = configuration.baseOptions;
220
+ }
221
+
222
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
223
+ const localVarHeaderParameter = {} as any;
224
+ const localVarQueryParameter = {} as any;
225
+
226
+
227
+
228
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
229
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
230
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
231
+
232
+ return {
233
+ url: toPathString(localVarUrlObj),
234
+ options: localVarRequestOptions,
235
+ };
236
+ },
237
+ /**
238
+ * Update a project
239
+ * @summary Update project
240
+ * @param {string} projectId Projects unique identifier
241
+ * @param {*} [options] Override http request option.
242
+ * @throws {RequiredError}
243
+ */
244
+ update: async (projectId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
245
+ // verify required parameter 'projectId' is not null or undefined
246
+ assertParamExists('update', 'projectId', projectId)
247
+ const localVarPath = `/dashboard/projects/{projectId}`
248
+ .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)));
249
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
250
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
251
+ let baseOptions;
252
+ if (configuration) {
253
+ baseOptions = configuration.baseOptions;
254
+ }
255
+
256
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
257
+ const localVarHeaderParameter = {} as any;
258
+ const localVarQueryParameter = {} as any;
259
+
260
+
261
+
262
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
263
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
264
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
265
+
266
+ return {
267
+ url: toPathString(localVarUrlObj),
268
+ options: localVarRequestOptions,
269
+ };
270
+ },
271
+ }
272
+ };
273
+
274
+ /**
275
+ * ProjectsApi - functional programming interface
276
+ * @export
277
+ */
278
+ export const ProjectsApiFp = function(configuration?: Configuration) {
279
+ const localVarAxiosParamCreator = ProjectsApiAxiosParamCreator(configuration)
280
+ return {
281
+ /**
282
+ * Delete a project
283
+ * @summary Delete project
284
+ * @param {string} projectId Projects unique identifier
285
+ * @param {*} [options] Override http request option.
286
+ * @throws {RequiredError}
287
+ */
288
+ async _delete(projectId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Project>> {
289
+ const localVarAxiosArgs = await localVarAxiosParamCreator._delete(projectId, options);
290
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
291
+ },
292
+ /**
293
+ * Create a new projects
294
+ * @summary Create project
295
+ * @param {*} [options] Override http request option.
296
+ * @throws {RequiredError}
297
+ */
298
+ async create(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Project>> {
299
+ const localVarAxiosArgs = await localVarAxiosParamCreator.create(options);
300
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
301
+ },
302
+ /**
303
+ * Get a project
304
+ * @summary Get project
305
+ * @param {string} projectId Projects unique identifier
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ async get(projectId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Project>> {
310
+ const localVarAxiosArgs = await localVarAxiosParamCreator.get(projectId, options);
311
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
312
+ },
313
+ /**
314
+ * List all projects available
315
+ * @summary List projects
316
+ * @param {*} [options] Override http request option.
317
+ * @throws {RequiredError}
318
+ */
319
+ async list(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<List200Response>> {
320
+ const localVarAxiosArgs = await localVarAxiosParamCreator.list(options);
321
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
322
+ },
323
+ /**
324
+ * Update a project
325
+ * @summary Update project
326
+ * @param {string} projectId Projects unique identifier
327
+ * @param {*} [options] Override http request option.
328
+ * @throws {RequiredError}
329
+ */
330
+ async update(projectId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Project>> {
331
+ const localVarAxiosArgs = await localVarAxiosParamCreator.update(projectId, options);
332
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
333
+ },
334
+ }
335
+ };
336
+
337
+ /**
338
+ * ProjectsApi - factory interface
339
+ * @export
340
+ */
341
+ export const ProjectsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
342
+ const localVarFp = ProjectsApiFp(configuration)
343
+ return {
344
+ /**
345
+ * Delete a project
346
+ * @summary Delete project
347
+ * @param {string} projectId Projects unique identifier
348
+ * @param {*} [options] Override http request option.
349
+ * @throws {RequiredError}
350
+ */
351
+ _delete(projectId: string, options?: any): AxiosPromise<Project> {
352
+ return localVarFp._delete(projectId, options).then((request) => request(axios, basePath));
353
+ },
354
+ /**
355
+ * Create a new projects
356
+ * @summary Create project
357
+ * @param {*} [options] Override http request option.
358
+ * @throws {RequiredError}
359
+ */
360
+ create(options?: any): AxiosPromise<Project> {
361
+ return localVarFp.create(options).then((request) => request(axios, basePath));
362
+ },
363
+ /**
364
+ * Get a project
365
+ * @summary Get project
366
+ * @param {string} projectId Projects unique identifier
367
+ * @param {*} [options] Override http request option.
368
+ * @throws {RequiredError}
369
+ */
370
+ get(projectId: string, options?: any): AxiosPromise<Project> {
371
+ return localVarFp.get(projectId, options).then((request) => request(axios, basePath));
372
+ },
373
+ /**
374
+ * List all projects available
375
+ * @summary List projects
376
+ * @param {*} [options] Override http request option.
377
+ * @throws {RequiredError}
378
+ */
379
+ list(options?: any): AxiosPromise<List200Response> {
380
+ return localVarFp.list(options).then((request) => request(axios, basePath));
381
+ },
382
+ /**
383
+ * Update a project
384
+ * @summary Update project
385
+ * @param {string} projectId Projects unique identifier
386
+ * @param {*} [options] Override http request option.
387
+ * @throws {RequiredError}
388
+ */
389
+ update(projectId: string, options?: any): AxiosPromise<Project> {
390
+ return localVarFp.update(projectId, options).then((request) => request(axios, basePath));
391
+ },
392
+ };
393
+ };
394
+
395
+ /**
396
+ * ProjectsApi - object-oriented interface
397
+ * @export
398
+ * @class ProjectsApi
399
+ * @extends {BaseAPI}
400
+ */
401
+ export class ProjectsApi extends BaseAPI {
402
+ /**
403
+ * Delete a project
404
+ * @summary Delete project
405
+ * @param {string} projectId Projects unique identifier
406
+ * @param {*} [options] Override http request option.
407
+ * @throws {RequiredError}
408
+ * @memberof ProjectsApi
409
+ */
410
+ public _delete(projectId: string, options?: AxiosRequestConfig) {
411
+ return ProjectsApiFp(this.configuration)._delete(projectId, options).then((request) => request(this.axios, this.basePath));
412
+ }
413
+
414
+ /**
415
+ * Create a new projects
416
+ * @summary Create project
417
+ * @param {*} [options] Override http request option.
418
+ * @throws {RequiredError}
419
+ * @memberof ProjectsApi
420
+ */
421
+ public create(options?: AxiosRequestConfig) {
422
+ return ProjectsApiFp(this.configuration).create(options).then((request) => request(this.axios, this.basePath));
423
+ }
424
+
425
+ /**
426
+ * Get a project
427
+ * @summary Get project
428
+ * @param {string} projectId Projects unique identifier
429
+ * @param {*} [options] Override http request option.
430
+ * @throws {RequiredError}
431
+ * @memberof ProjectsApi
432
+ */
433
+ public get(projectId: string, options?: AxiosRequestConfig) {
434
+ return ProjectsApiFp(this.configuration).get(projectId, options).then((request) => request(this.axios, this.basePath));
435
+ }
436
+
437
+ /**
438
+ * List all projects available
439
+ * @summary List projects
440
+ * @param {*} [options] Override http request option.
441
+ * @throws {RequiredError}
442
+ * @memberof ProjectsApi
443
+ */
444
+ public list(options?: AxiosRequestConfig) {
445
+ return ProjectsApiFp(this.configuration).list(options).then((request) => request(this.axios, this.basePath));
446
+ }
447
+
448
+ /**
449
+ * Update a project
450
+ * @summary Update project
451
+ * @param {string} projectId Projects unique identifier
452
+ * @param {*} [options] Override http request option.
453
+ * @throws {RequiredError}
454
+ * @memberof ProjectsApi
455
+ */
456
+ public update(projectId: string, options?: AxiosRequestConfig) {
457
+ return ProjectsApiFp(this.configuration).update(projectId, options).then((request) => request(this.axios, this.basePath));
458
+ }
459
+ }
460
+
461
+
462
+
package/base.ts ADDED
@@ -0,0 +1,72 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Projects API
5
+ * Manage Teemill Projects For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.3.0
8
+ * Contact: hello@teemill.com
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
+
16
+ import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "https://localhost:8080/omnis/v3".replace(/\/+$/, "");
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const COLLECTION_FORMATS = {
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface RequestArgs
39
+ */
40
+ export interface RequestArgs {
41
+ url: string;
42
+ options: AxiosRequestConfig;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @class BaseAPI
49
+ */
50
+ export class BaseAPI {
51
+ protected configuration: Configuration | undefined;
52
+
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
+ }
58
+ }
59
+ };
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ * @class RequiredError
65
+ * @extends {Error}
66
+ */
67
+ export class RequiredError extends Error {
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
72
+ }