ob-parking-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,9 @@
1
+ .gitignore
2
+ .npmignore
3
+ .openapi-generator-ignore
4
+ api.ts
5
+ base.ts
6
+ common.ts
7
+ configuration.ts
8
+ git_push.sh
9
+ index.ts
@@ -0,0 +1 @@
1
+ 7.0.1
@@ -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/api/api.ts ADDED
@@ -0,0 +1,465 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * obk-parking
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 0.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
+
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 AddParkingTicketQuery
30
+ */
31
+ export interface AddParkingTicketQuery {
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof AddParkingTicketQuery
36
+ */
37
+ 'log_id': string;
38
+ /**
39
+ *
40
+ * @type {AddParkingTicketType}
41
+ * @memberof AddParkingTicketQuery
42
+ */
43
+ 'type': AddParkingTicketType;
44
+ }
45
+
46
+
47
+ /**
48
+ *
49
+ * @export
50
+ * @interface AddParkingTicketResponse
51
+ */
52
+ export interface AddParkingTicketResponse {
53
+ /**
54
+ *
55
+ * @type {string}
56
+ * @memberof AddParkingTicketResponse
57
+ */
58
+ 'parkingDetailId': string;
59
+ }
60
+ /**
61
+ *
62
+ * @export
63
+ * @enum {string}
64
+ */
65
+
66
+ export const AddParkingTicketType = {
67
+ Cms: 'CMS',
68
+ App: 'APP'
69
+ } as const;
70
+
71
+ export type AddParkingTicketType = typeof AddParkingTicketType[keyof typeof AddParkingTicketType];
72
+
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ * @interface GetParkingDetailResponse
78
+ */
79
+ export interface GetParkingDetailResponse {
80
+ /**
81
+ *
82
+ * @type {string}
83
+ * @memberof GetParkingDetailResponse
84
+ */
85
+ 'id': string;
86
+ /**
87
+ *
88
+ * @type {string}
89
+ * @memberof GetParkingDetailResponse
90
+ */
91
+ 'parkingTicket': string;
92
+ /**
93
+ *
94
+ * @type {ParkingAccountDetail}
95
+ * @memberof GetParkingDetailResponse
96
+ */
97
+ 'accountDetail': ParkingAccountDetail;
98
+ /**
99
+ *
100
+ * @type {string}
101
+ * @memberof GetParkingDetailResponse
102
+ */
103
+ 'totalAmount': string;
104
+ /**
105
+ *
106
+ * @type {Array<Receipt>}
107
+ * @memberof GetParkingDetailResponse
108
+ */
109
+ 'receipts': Array<Receipt>;
110
+ }
111
+ /**
112
+ *
113
+ * @export
114
+ * @interface ParkingAccountDetail
115
+ */
116
+ export interface ParkingAccountDetail {
117
+ /**
118
+ *
119
+ * @type {string}
120
+ * @memberof ParkingAccountDetail
121
+ */
122
+ 'id': string;
123
+ /**
124
+ *
125
+ * @type {string}
126
+ * @memberof ParkingAccountDetail
127
+ */
128
+ 'firstName': string;
129
+ /**
130
+ *
131
+ * @type {string}
132
+ * @memberof ParkingAccountDetail
133
+ */
134
+ 'lastName': string;
135
+ /**
136
+ *
137
+ * @type {string}
138
+ * @memberof ParkingAccountDetail
139
+ */
140
+ 'middleName': string;
141
+ }
142
+ /**
143
+ *
144
+ * @export
145
+ * @interface Receipt
146
+ */
147
+ export interface Receipt {
148
+ /**
149
+ *
150
+ * @type {string}
151
+ * @memberof Receipt
152
+ */
153
+ 'id': string;
154
+ /**
155
+ *
156
+ * @type {string}
157
+ * @memberof Receipt
158
+ */
159
+ 'subTotal': string;
160
+ /**
161
+ *
162
+ * @type {string}
163
+ * @memberof Receipt
164
+ */
165
+ 'createdAt': string;
166
+ /**
167
+ *
168
+ * @type {string}
169
+ * @memberof Receipt
170
+ */
171
+ 'updatedAt': string;
172
+ /**
173
+ *
174
+ * @type {ReceiptStatus}
175
+ * @memberof Receipt
176
+ */
177
+ 'status': ReceiptStatus;
178
+ /**
179
+ *
180
+ * @type {string}
181
+ * @memberof Receipt
182
+ */
183
+ 'reason': string;
184
+ /**
185
+ *
186
+ * @type {string}
187
+ * @memberof Receipt
188
+ */
189
+ 'imageUrl': string;
190
+ }
191
+
192
+
193
+ /**
194
+ *
195
+ * @export
196
+ * @enum {string}
197
+ */
198
+
199
+ export const ReceiptStatus = {
200
+ Declined: 'declined',
201
+ Success: 'success',
202
+ Pending: 'pending',
203
+ Dispute: 'dispute',
204
+ Redeemed: 'redeemed'
205
+ } as const;
206
+
207
+ export type ReceiptStatus = typeof ReceiptStatus[keyof typeof ReceiptStatus];
208
+
209
+
210
+ /**
211
+ *
212
+ * @export
213
+ * @interface TestTest200Response
214
+ */
215
+ export interface TestTest200Response {
216
+ /**
217
+ *
218
+ * @type {string}
219
+ * @memberof TestTest200Response
220
+ */
221
+ 'status': string;
222
+ }
223
+
224
+ /**
225
+ * DefaultApi - axios parameter creator
226
+ * @export
227
+ */
228
+ export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
229
+ return {
230
+ /**
231
+ *
232
+ * @param {string} logId
233
+ * @param {AddParkingTicketType} type
234
+ * @param {string} [xAccountId]
235
+ * @param {*} [options] Override http request option.
236
+ * @throws {RequiredError}
237
+ */
238
+ parkingAddParkingTicket: async (logId: string, type: AddParkingTicketType, xAccountId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
239
+ // verify required parameter 'logId' is not null or undefined
240
+ assertParamExists('parkingAddParkingTicket', 'logId', logId)
241
+ // verify required parameter 'type' is not null or undefined
242
+ assertParamExists('parkingAddParkingTicket', 'type', type)
243
+ const localVarPath = `/parking-details/add-parking-ticket`;
244
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
245
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
246
+ let baseOptions;
247
+ if (configuration) {
248
+ baseOptions = configuration.baseOptions;
249
+ }
250
+
251
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
252
+ const localVarHeaderParameter = {} as any;
253
+ const localVarQueryParameter = {} as any;
254
+
255
+ if (logId !== undefined) {
256
+ localVarQueryParameter['log_id'] = logId;
257
+ }
258
+
259
+ if (type !== undefined) {
260
+ localVarQueryParameter['type'] = type;
261
+ }
262
+
263
+ if (xAccountId != null) {
264
+ localVarHeaderParameter['x-account-id'] = String(xAccountId);
265
+ }
266
+
267
+
268
+
269
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
270
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
271
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
272
+
273
+ return {
274
+ url: toPathString(localVarUrlObj),
275
+ options: localVarRequestOptions,
276
+ };
277
+ },
278
+ /**
279
+ *
280
+ * @param {string} id
281
+ * @param {*} [options] Override http request option.
282
+ * @throws {RequiredError}
283
+ */
284
+ parkingDetailsGetParkingDetail: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
285
+ // verify required parameter 'id' is not null or undefined
286
+ assertParamExists('parkingDetailsGetParkingDetail', 'id', id)
287
+ const localVarPath = `/parking-details/{id}`
288
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
289
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
290
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
291
+ let baseOptions;
292
+ if (configuration) {
293
+ baseOptions = configuration.baseOptions;
294
+ }
295
+
296
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
297
+ const localVarHeaderParameter = {} as any;
298
+ const localVarQueryParameter = {} as any;
299
+
300
+
301
+
302
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
303
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
304
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
305
+
306
+ return {
307
+ url: toPathString(localVarUrlObj),
308
+ options: localVarRequestOptions,
309
+ };
310
+ },
311
+ /**
312
+ *
313
+ * @param {*} [options] Override http request option.
314
+ * @throws {RequiredError}
315
+ */
316
+ testTest: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
317
+ const localVarPath = `/test`;
318
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
319
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
320
+ let baseOptions;
321
+ if (configuration) {
322
+ baseOptions = configuration.baseOptions;
323
+ }
324
+
325
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
326
+ const localVarHeaderParameter = {} as any;
327
+ const localVarQueryParameter = {} as any;
328
+
329
+
330
+
331
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
332
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
333
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
334
+
335
+ return {
336
+ url: toPathString(localVarUrlObj),
337
+ options: localVarRequestOptions,
338
+ };
339
+ },
340
+ }
341
+ };
342
+
343
+ /**
344
+ * DefaultApi - functional programming interface
345
+ * @export
346
+ */
347
+ export const DefaultApiFp = function(configuration?: Configuration) {
348
+ const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
349
+ return {
350
+ /**
351
+ *
352
+ * @param {string} logId
353
+ * @param {AddParkingTicketType} type
354
+ * @param {string} [xAccountId]
355
+ * @param {*} [options] Override http request option.
356
+ * @throws {RequiredError}
357
+ */
358
+ async parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AddParkingTicketResponse>> {
359
+ const localVarAxiosArgs = await localVarAxiosParamCreator.parkingAddParkingTicket(logId, type, xAccountId, options);
360
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
361
+ },
362
+ /**
363
+ *
364
+ * @param {string} id
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ */
368
+ async parkingDetailsGetParkingDetail(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetParkingDetailResponse>> {
369
+ const localVarAxiosArgs = await localVarAxiosParamCreator.parkingDetailsGetParkingDetail(id, options);
370
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
371
+ },
372
+ /**
373
+ *
374
+ * @param {*} [options] Override http request option.
375
+ * @throws {RequiredError}
376
+ */
377
+ async testTest(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TestTest200Response>> {
378
+ const localVarAxiosArgs = await localVarAxiosParamCreator.testTest(options);
379
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
380
+ },
381
+ }
382
+ };
383
+
384
+ /**
385
+ * DefaultApi - factory interface
386
+ * @export
387
+ */
388
+ export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
389
+ const localVarFp = DefaultApiFp(configuration)
390
+ return {
391
+ /**
392
+ *
393
+ * @param {string} logId
394
+ * @param {AddParkingTicketType} type
395
+ * @param {string} [xAccountId]
396
+ * @param {*} [options] Override http request option.
397
+ * @throws {RequiredError}
398
+ */
399
+ parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: any): AxiosPromise<AddParkingTicketResponse> {
400
+ return localVarFp.parkingAddParkingTicket(logId, type, xAccountId, options).then((request) => request(axios, basePath));
401
+ },
402
+ /**
403
+ *
404
+ * @param {string} id
405
+ * @param {*} [options] Override http request option.
406
+ * @throws {RequiredError}
407
+ */
408
+ parkingDetailsGetParkingDetail(id: string, options?: any): AxiosPromise<GetParkingDetailResponse> {
409
+ return localVarFp.parkingDetailsGetParkingDetail(id, options).then((request) => request(axios, basePath));
410
+ },
411
+ /**
412
+ *
413
+ * @param {*} [options] Override http request option.
414
+ * @throws {RequiredError}
415
+ */
416
+ testTest(options?: any): AxiosPromise<TestTest200Response> {
417
+ return localVarFp.testTest(options).then((request) => request(axios, basePath));
418
+ },
419
+ };
420
+ };
421
+
422
+ /**
423
+ * DefaultApi - object-oriented interface
424
+ * @export
425
+ * @class DefaultApi
426
+ * @extends {BaseAPI}
427
+ */
428
+ export class DefaultApi extends BaseAPI {
429
+ /**
430
+ *
431
+ * @param {string} logId
432
+ * @param {AddParkingTicketType} type
433
+ * @param {string} [xAccountId]
434
+ * @param {*} [options] Override http request option.
435
+ * @throws {RequiredError}
436
+ * @memberof DefaultApi
437
+ */
438
+ public parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: AxiosRequestConfig) {
439
+ return DefaultApiFp(this.configuration).parkingAddParkingTicket(logId, type, xAccountId, options).then((request) => request(this.axios, this.basePath));
440
+ }
441
+
442
+ /**
443
+ *
444
+ * @param {string} id
445
+ * @param {*} [options] Override http request option.
446
+ * @throws {RequiredError}
447
+ * @memberof DefaultApi
448
+ */
449
+ public parkingDetailsGetParkingDetail(id: string, options?: AxiosRequestConfig) {
450
+ return DefaultApiFp(this.configuration).parkingDetailsGetParkingDetail(id, options).then((request) => request(this.axios, this.basePath));
451
+ }
452
+
453
+ /**
454
+ *
455
+ * @param {*} [options] Override http request option.
456
+ * @throws {RequiredError}
457
+ * @memberof DefaultApi
458
+ */
459
+ public testTest(options?: AxiosRequestConfig) {
460
+ return DefaultApiFp(this.configuration).testTest(options).then((request) => request(this.axios, this.basePath));
461
+ }
462
+ }
463
+
464
+
465
+
package/api/base.ts ADDED
@@ -0,0 +1,72 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * obk-parking
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 0.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
+
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 = "http://localhost".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
+ }