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.
package/api/common.ts ADDED
@@ -0,0 +1,150 @@
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 { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
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
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
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
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
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
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
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
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = searchParams.toString();
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
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 || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }
@@ -0,0 +1,101 @@
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
+ export interface ConfigurationParameters {
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;
24
+ }
25
+
26
+ export class Configuration {
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;
76
+
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;
85
+ }
86
+
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
+ }
101
+ }
@@ -0,0 +1,57 @@
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+ git_host=$4
10
+
11
+ if [ "$git_host" = "" ]; then
12
+ git_host="github.com"
13
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
+ fi
15
+
16
+ if [ "$git_user_id" = "" ]; then
17
+ git_user_id="GIT_USER_ID"
18
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
+ fi
20
+
21
+ if [ "$git_repo_id" = "" ]; then
22
+ git_repo_id="GIT_REPO_ID"
23
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
+ fi
25
+
26
+ if [ "$release_note" = "" ]; then
27
+ release_note="Minor update"
28
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
+ fi
30
+
31
+ # Initialize the local directory as a Git repository
32
+ git init
33
+
34
+ # Adds the files in the local repository and stages them for commit.
35
+ git add .
36
+
37
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
+ git commit -m "$release_note"
39
+
40
+ # Sets the new remote
41
+ git_remote=$(git remote)
42
+ if [ "$git_remote" = "" ]; then # git remote not defined
43
+
44
+ if [ "$GIT_TOKEN" = "" ]; then
45
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
+ else
48
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
+ fi
50
+
51
+ fi
52
+
53
+ git pull origin master
54
+
55
+ # Pushes (Forces) the changes in the local repository up to the remote repository
56
+ echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
+ git push origin master 2>&1 | grep -v 'To https'
package/api/index.ts ADDED
@@ -0,0 +1,18 @@
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
+ export * from "./api";
17
+ export * from "./configuration";
18
+
@@ -0,0 +1,317 @@
1
+ /**
2
+ * obk-parking
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0
6
+ *
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 { Configuration } from './configuration';
13
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
14
+ import type { RequestArgs } from './base';
15
+ import { BaseAPI } from './base';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AddParkingTicketQuery
20
+ */
21
+ export interface AddParkingTicketQuery {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AddParkingTicketQuery
26
+ */
27
+ 'log_id': string;
28
+ /**
29
+ *
30
+ * @type {AddParkingTicketType}
31
+ * @memberof AddParkingTicketQuery
32
+ */
33
+ 'type': AddParkingTicketType;
34
+ }
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface AddParkingTicketResponse
39
+ */
40
+ export interface AddParkingTicketResponse {
41
+ /**
42
+ *
43
+ * @type {string}
44
+ * @memberof AddParkingTicketResponse
45
+ */
46
+ 'parkingDetailId': string;
47
+ }
48
+ /**
49
+ *
50
+ * @export
51
+ * @enum {string}
52
+ */
53
+ export declare const AddParkingTicketType: {
54
+ readonly Cms: "CMS";
55
+ readonly App: "APP";
56
+ };
57
+ export type AddParkingTicketType = typeof AddParkingTicketType[keyof typeof AddParkingTicketType];
58
+ /**
59
+ *
60
+ * @export
61
+ * @interface GetParkingDetailResponse
62
+ */
63
+ export interface GetParkingDetailResponse {
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof GetParkingDetailResponse
68
+ */
69
+ 'id': string;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof GetParkingDetailResponse
74
+ */
75
+ 'parkingTicket': string;
76
+ /**
77
+ *
78
+ * @type {ParkingAccountDetail}
79
+ * @memberof GetParkingDetailResponse
80
+ */
81
+ 'accountDetail': ParkingAccountDetail;
82
+ /**
83
+ *
84
+ * @type {string}
85
+ * @memberof GetParkingDetailResponse
86
+ */
87
+ 'totalAmount': string;
88
+ /**
89
+ *
90
+ * @type {Array<Receipt>}
91
+ * @memberof GetParkingDetailResponse
92
+ */
93
+ 'receipts': Array<Receipt>;
94
+ }
95
+ /**
96
+ *
97
+ * @export
98
+ * @interface ParkingAccountDetail
99
+ */
100
+ export interface ParkingAccountDetail {
101
+ /**
102
+ *
103
+ * @type {string}
104
+ * @memberof ParkingAccountDetail
105
+ */
106
+ 'id': string;
107
+ /**
108
+ *
109
+ * @type {string}
110
+ * @memberof ParkingAccountDetail
111
+ */
112
+ 'firstName': string;
113
+ /**
114
+ *
115
+ * @type {string}
116
+ * @memberof ParkingAccountDetail
117
+ */
118
+ 'lastName': string;
119
+ /**
120
+ *
121
+ * @type {string}
122
+ * @memberof ParkingAccountDetail
123
+ */
124
+ 'middleName': string;
125
+ }
126
+ /**
127
+ *
128
+ * @export
129
+ * @interface Receipt
130
+ */
131
+ export interface Receipt {
132
+ /**
133
+ *
134
+ * @type {string}
135
+ * @memberof Receipt
136
+ */
137
+ 'id': string;
138
+ /**
139
+ *
140
+ * @type {string}
141
+ * @memberof Receipt
142
+ */
143
+ 'subTotal': string;
144
+ /**
145
+ *
146
+ * @type {string}
147
+ * @memberof Receipt
148
+ */
149
+ 'createdAt': string;
150
+ /**
151
+ *
152
+ * @type {string}
153
+ * @memberof Receipt
154
+ */
155
+ 'updatedAt': string;
156
+ /**
157
+ *
158
+ * @type {ReceiptStatus}
159
+ * @memberof Receipt
160
+ */
161
+ 'status': ReceiptStatus;
162
+ /**
163
+ *
164
+ * @type {string}
165
+ * @memberof Receipt
166
+ */
167
+ 'reason': string;
168
+ /**
169
+ *
170
+ * @type {string}
171
+ * @memberof Receipt
172
+ */
173
+ 'imageUrl': string;
174
+ }
175
+ /**
176
+ *
177
+ * @export
178
+ * @enum {string}
179
+ */
180
+ export declare const ReceiptStatus: {
181
+ readonly Declined: "declined";
182
+ readonly Success: "success";
183
+ readonly Pending: "pending";
184
+ readonly Dispute: "dispute";
185
+ readonly Redeemed: "redeemed";
186
+ };
187
+ export type ReceiptStatus = typeof ReceiptStatus[keyof typeof ReceiptStatus];
188
+ /**
189
+ *
190
+ * @export
191
+ * @interface TestTest200Response
192
+ */
193
+ export interface TestTest200Response {
194
+ /**
195
+ *
196
+ * @type {string}
197
+ * @memberof TestTest200Response
198
+ */
199
+ 'status': string;
200
+ }
201
+ /**
202
+ * DefaultApi - axios parameter creator
203
+ * @export
204
+ */
205
+ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
206
+ /**
207
+ *
208
+ * @param {string} logId
209
+ * @param {AddParkingTicketType} type
210
+ * @param {string} [xAccountId]
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ parkingAddParkingTicket: (logId: string, type: AddParkingTicketType, xAccountId?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
215
+ /**
216
+ *
217
+ * @param {string} id
218
+ * @param {*} [options] Override http request option.
219
+ * @throws {RequiredError}
220
+ */
221
+ parkingDetailsGetParkingDetail: (id: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
222
+ /**
223
+ *
224
+ * @param {*} [options] Override http request option.
225
+ * @throws {RequiredError}
226
+ */
227
+ testTest: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
228
+ };
229
+ /**
230
+ * DefaultApi - functional programming interface
231
+ * @export
232
+ */
233
+ export declare const DefaultApiFp: (configuration?: Configuration) => {
234
+ /**
235
+ *
236
+ * @param {string} logId
237
+ * @param {AddParkingTicketType} type
238
+ * @param {string} [xAccountId]
239
+ * @param {*} [options] Override http request option.
240
+ * @throws {RequiredError}
241
+ */
242
+ parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AddParkingTicketResponse>>;
243
+ /**
244
+ *
245
+ * @param {string} id
246
+ * @param {*} [options] Override http request option.
247
+ * @throws {RequiredError}
248
+ */
249
+ parkingDetailsGetParkingDetail(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetParkingDetailResponse>>;
250
+ /**
251
+ *
252
+ * @param {*} [options] Override http request option.
253
+ * @throws {RequiredError}
254
+ */
255
+ testTest(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TestTest200Response>>;
256
+ };
257
+ /**
258
+ * DefaultApi - factory interface
259
+ * @export
260
+ */
261
+ export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
262
+ /**
263
+ *
264
+ * @param {string} logId
265
+ * @param {AddParkingTicketType} type
266
+ * @param {string} [xAccountId]
267
+ * @param {*} [options] Override http request option.
268
+ * @throws {RequiredError}
269
+ */
270
+ parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: any): AxiosPromise<AddParkingTicketResponse>;
271
+ /**
272
+ *
273
+ * @param {string} id
274
+ * @param {*} [options] Override http request option.
275
+ * @throws {RequiredError}
276
+ */
277
+ parkingDetailsGetParkingDetail(id: string, options?: any): AxiosPromise<GetParkingDetailResponse>;
278
+ /**
279
+ *
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ */
283
+ testTest(options?: any): AxiosPromise<TestTest200Response>;
284
+ };
285
+ /**
286
+ * DefaultApi - object-oriented interface
287
+ * @export
288
+ * @class DefaultApi
289
+ * @extends {BaseAPI}
290
+ */
291
+ export declare class DefaultApi extends BaseAPI {
292
+ /**
293
+ *
294
+ * @param {string} logId
295
+ * @param {AddParkingTicketType} type
296
+ * @param {string} [xAccountId]
297
+ * @param {*} [options] Override http request option.
298
+ * @throws {RequiredError}
299
+ * @memberof DefaultApi
300
+ */
301
+ parkingAddParkingTicket(logId: string, type: AddParkingTicketType, xAccountId?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AddParkingTicketResponse, any>>;
302
+ /**
303
+ *
304
+ * @param {string} id
305
+ * @param {*} [options] Override http request option.
306
+ * @throws {RequiredError}
307
+ * @memberof DefaultApi
308
+ */
309
+ parkingDetailsGetParkingDetail(id: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetParkingDetailResponse, any>>;
310
+ /**
311
+ *
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ * @memberof DefaultApi
315
+ */
316
+ testTest(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<TestTest200Response, any>>;
317
+ }