@teemill/website 0.1.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.
package/common.ts ADDED
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Website API
5
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.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 { 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 !== '' ? `${key}[]` : 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 = decodeURIComponent(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: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }
@@ -0,0 +1,110 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Website API
5
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.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
+ 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
+ serverIndex?: number;
23
+ baseOptions?: any;
24
+ formDataCtor?: new () => any;
25
+ }
26
+
27
+ export class Configuration {
28
+ /**
29
+ * parameter for apiKey security
30
+ * @param name security name
31
+ * @memberof Configuration
32
+ */
33
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
34
+ /**
35
+ * parameter for basic security
36
+ *
37
+ * @type {string}
38
+ * @memberof Configuration
39
+ */
40
+ username?: string;
41
+ /**
42
+ * parameter for basic security
43
+ *
44
+ * @type {string}
45
+ * @memberof Configuration
46
+ */
47
+ password?: string;
48
+ /**
49
+ * parameter for oauth2 security
50
+ * @param name security name
51
+ * @param scopes oauth2 scope
52
+ * @memberof Configuration
53
+ */
54
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
55
+ /**
56
+ * override base path
57
+ *
58
+ * @type {string}
59
+ * @memberof Configuration
60
+ */
61
+ basePath?: string;
62
+ /**
63
+ * override server index
64
+ *
65
+ * @type {number}
66
+ * @memberof Configuration
67
+ */
68
+ serverIndex?: number;
69
+ /**
70
+ * base options for axios calls
71
+ *
72
+ * @type {any}
73
+ * @memberof Configuration
74
+ */
75
+ baseOptions?: any;
76
+ /**
77
+ * The FormData constructor that will be used to create multipart form data
78
+ * requests. You can inject this here so that execution environments that
79
+ * do not support the FormData class can still run the generated client.
80
+ *
81
+ * @type {new () => FormData}
82
+ */
83
+ formDataCtor?: new () => any;
84
+
85
+ constructor(param: ConfigurationParameters = {}) {
86
+ this.apiKey = param.apiKey;
87
+ this.username = param.username;
88
+ this.password = param.password;
89
+ this.accessToken = param.accessToken;
90
+ this.basePath = param.basePath;
91
+ this.serverIndex = param.serverIndex;
92
+ this.baseOptions = param.baseOptions;
93
+ this.formDataCtor = param.formDataCtor;
94
+ }
95
+
96
+ /**
97
+ * Check if the given MIME is a JSON MIME.
98
+ * JSON MIME examples:
99
+ * application/json
100
+ * application/json; charset=UTF8
101
+ * APPLICATION/JSON
102
+ * application/vnd.company+json
103
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
104
+ * @return True if the given MIME is JSON, false otherwise.
105
+ */
106
+ public isJsonMime(mime: string): boolean {
107
+ const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
108
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
109
+ }
110
+ }
package/dist/api.d.ts ADDED
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Website API
3
+ * Manage your Teemill Website Currently this API is in development and is not yet publicly accessible. All paths and models are subject to change. For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
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 { Configuration } from './configuration';
13
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ import type { RequestArgs } from './base';
15
+ import { BaseAPI } from './base';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ApiError
20
+ */
21
+ export interface ApiError {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ApiError
26
+ */
27
+ 'code': string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ApiError
32
+ */
33
+ 'message': string;
34
+ }
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface ConnectStripeRequest
39
+ */
40
+ export interface ConnectStripeRequest {
41
+ /**
42
+ * The code returned from the Stripe connect flow
43
+ * @type {string}
44
+ * @memberof ConnectStripeRequest
45
+ */
46
+ 'code': string;
47
+ /**
48
+ * The state returned from the Stripe connect flow
49
+ * @type {string}
50
+ * @memberof ConnectStripeRequest
51
+ */
52
+ 'state': string;
53
+ }
54
+ /**
55
+ *
56
+ * @export
57
+ * @interface PaymentAccount
58
+ */
59
+ export interface PaymentAccount {
60
+ /**
61
+ * The name of the payment account
62
+ * @type {string}
63
+ * @memberof PaymentAccount
64
+ */
65
+ 'name': string;
66
+ /**
67
+ * The payment method
68
+ * @type {string}
69
+ * @memberof PaymentAccount
70
+ */
71
+ 'method': PaymentAccountMethodEnum;
72
+ /**
73
+ * The configuration for the payment account
74
+ * @type {{ [key: string]: string; }}
75
+ * @memberof PaymentAccount
76
+ */
77
+ 'config': {
78
+ [key: string]: string;
79
+ };
80
+ }
81
+ export declare const PaymentAccountMethodEnum: {
82
+ readonly Stripe: "stripe";
83
+ readonly Paypal: "paypal";
84
+ };
85
+ export type PaymentAccountMethodEnum = typeof PaymentAccountMethodEnum[keyof typeof PaymentAccountMethodEnum];
86
+ /**
87
+ * PaymentApi - axios parameter creator
88
+ * @export
89
+ */
90
+ export declare const PaymentApiAxiosParamCreator: (configuration?: Configuration) => {
91
+ /**
92
+ * Authorize a Stripe payment account
93
+ * @summary Authorize Stripe
94
+ * @param {string} project What project it is
95
+ * @param {*} [options] Override http request option.
96
+ * @throws {RequiredError}
97
+ */
98
+ authorizeStripe: (project: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
99
+ /**
100
+ * Connect a Stripe payment account
101
+ * @summary Connect Stripe
102
+ * @param {string} project What project it is
103
+ * @param {ConnectStripeRequest} connectStripeRequest Connect a Stripe payment account
104
+ * @param {*} [options] Override http request option.
105
+ * @throws {RequiredError}
106
+ */
107
+ connectStripe: (project: string, connectStripeRequest: ConnectStripeRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
108
+ /**
109
+ * Deauthorize a Stripe payment account
110
+ * @summary Deauthorize Stripe
111
+ * @param {string} project What project it is
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ */
115
+ deauthorizeStripe: (project: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
116
+ /**
117
+ * Get the Stripe payment account for the project
118
+ * @summary Get Stripe Payment Account
119
+ * @param {string} project What project it is
120
+ * @param {*} [options] Override http request option.
121
+ * @throws {RequiredError}
122
+ */
123
+ getStripePaymentAccount: (project: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
124
+ };
125
+ /**
126
+ * PaymentApi - functional programming interface
127
+ * @export
128
+ */
129
+ export declare const PaymentApiFp: (configuration?: Configuration) => {
130
+ /**
131
+ * Authorize a Stripe payment account
132
+ * @summary Authorize Stripe
133
+ * @param {string} project What project it is
134
+ * @param {*} [options] Override http request option.
135
+ * @throws {RequiredError}
136
+ */
137
+ authorizeStripe(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
138
+ /**
139
+ * Connect a Stripe payment account
140
+ * @summary Connect Stripe
141
+ * @param {string} project What project it is
142
+ * @param {ConnectStripeRequest} connectStripeRequest Connect a Stripe payment account
143
+ * @param {*} [options] Override http request option.
144
+ * @throws {RequiredError}
145
+ */
146
+ connectStripe(project: string, connectStripeRequest: ConnectStripeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentAccount>>;
147
+ /**
148
+ * Deauthorize a Stripe payment account
149
+ * @summary Deauthorize Stripe
150
+ * @param {string} project What project it is
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ deauthorizeStripe(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
155
+ /**
156
+ * Get the Stripe payment account for the project
157
+ * @summary Get Stripe Payment Account
158
+ * @param {string} project What project it is
159
+ * @param {*} [options] Override http request option.
160
+ * @throws {RequiredError}
161
+ */
162
+ getStripePaymentAccount(project: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentAccount>>;
163
+ };
164
+ /**
165
+ * PaymentApi - factory interface
166
+ * @export
167
+ */
168
+ export declare const PaymentApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
169
+ /**
170
+ * Authorize a Stripe payment account
171
+ * @summary Authorize Stripe
172
+ * @param {PaymentApiAuthorizeStripeRequest} requestParameters Request parameters.
173
+ * @param {*} [options] Override http request option.
174
+ * @throws {RequiredError}
175
+ */
176
+ authorizeStripe(requestParameters: PaymentApiAuthorizeStripeRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
177
+ /**
178
+ * Connect a Stripe payment account
179
+ * @summary Connect Stripe
180
+ * @param {PaymentApiConnectStripeRequest} requestParameters Request parameters.
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ */
184
+ connectStripe(requestParameters: PaymentApiConnectStripeRequest, options?: RawAxiosRequestConfig): AxiosPromise<PaymentAccount>;
185
+ /**
186
+ * Deauthorize a Stripe payment account
187
+ * @summary Deauthorize Stripe
188
+ * @param {PaymentApiDeauthorizeStripeRequest} requestParameters Request parameters.
189
+ * @param {*} [options] Override http request option.
190
+ * @throws {RequiredError}
191
+ */
192
+ deauthorizeStripe(requestParameters: PaymentApiDeauthorizeStripeRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
193
+ /**
194
+ * Get the Stripe payment account for the project
195
+ * @summary Get Stripe Payment Account
196
+ * @param {PaymentApiGetStripePaymentAccountRequest} requestParameters Request parameters.
197
+ * @param {*} [options] Override http request option.
198
+ * @throws {RequiredError}
199
+ */
200
+ getStripePaymentAccount(requestParameters: PaymentApiGetStripePaymentAccountRequest, options?: RawAxiosRequestConfig): AxiosPromise<PaymentAccount>;
201
+ };
202
+ /**
203
+ * Request parameters for authorizeStripe operation in PaymentApi.
204
+ * @export
205
+ * @interface PaymentApiAuthorizeStripeRequest
206
+ */
207
+ export interface PaymentApiAuthorizeStripeRequest {
208
+ /**
209
+ * What project it is
210
+ * @type {string}
211
+ * @memberof PaymentApiAuthorizeStripe
212
+ */
213
+ readonly project: string;
214
+ }
215
+ /**
216
+ * Request parameters for connectStripe operation in PaymentApi.
217
+ * @export
218
+ * @interface PaymentApiConnectStripeRequest
219
+ */
220
+ export interface PaymentApiConnectStripeRequest {
221
+ /**
222
+ * What project it is
223
+ * @type {string}
224
+ * @memberof PaymentApiConnectStripe
225
+ */
226
+ readonly project: string;
227
+ /**
228
+ * Connect a Stripe payment account
229
+ * @type {ConnectStripeRequest}
230
+ * @memberof PaymentApiConnectStripe
231
+ */
232
+ readonly connectStripeRequest: ConnectStripeRequest;
233
+ }
234
+ /**
235
+ * Request parameters for deauthorizeStripe operation in PaymentApi.
236
+ * @export
237
+ * @interface PaymentApiDeauthorizeStripeRequest
238
+ */
239
+ export interface PaymentApiDeauthorizeStripeRequest {
240
+ /**
241
+ * What project it is
242
+ * @type {string}
243
+ * @memberof PaymentApiDeauthorizeStripe
244
+ */
245
+ readonly project: string;
246
+ }
247
+ /**
248
+ * Request parameters for getStripePaymentAccount operation in PaymentApi.
249
+ * @export
250
+ * @interface PaymentApiGetStripePaymentAccountRequest
251
+ */
252
+ export interface PaymentApiGetStripePaymentAccountRequest {
253
+ /**
254
+ * What project it is
255
+ * @type {string}
256
+ * @memberof PaymentApiGetStripePaymentAccount
257
+ */
258
+ readonly project: string;
259
+ }
260
+ /**
261
+ * PaymentApi - object-oriented interface
262
+ * @export
263
+ * @class PaymentApi
264
+ * @extends {BaseAPI}
265
+ */
266
+ export declare class PaymentApi extends BaseAPI {
267
+ /**
268
+ * Authorize a Stripe payment account
269
+ * @summary Authorize Stripe
270
+ * @param {PaymentApiAuthorizeStripeRequest} requestParameters Request parameters.
271
+ * @param {*} [options] Override http request option.
272
+ * @throws {RequiredError}
273
+ * @memberof PaymentApi
274
+ */
275
+ authorizeStripe(requestParameters: PaymentApiAuthorizeStripeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
276
+ /**
277
+ * Connect a Stripe payment account
278
+ * @summary Connect Stripe
279
+ * @param {PaymentApiConnectStripeRequest} requestParameters Request parameters.
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ * @memberof PaymentApi
283
+ */
284
+ connectStripe(requestParameters: PaymentApiConnectStripeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<PaymentAccount, any>>;
285
+ /**
286
+ * Deauthorize a Stripe payment account
287
+ * @summary Deauthorize Stripe
288
+ * @param {PaymentApiDeauthorizeStripeRequest} requestParameters Request parameters.
289
+ * @param {*} [options] Override http request option.
290
+ * @throws {RequiredError}
291
+ * @memberof PaymentApi
292
+ */
293
+ deauthorizeStripe(requestParameters: PaymentApiDeauthorizeStripeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
294
+ /**
295
+ * Get the Stripe payment account for the project
296
+ * @summary Get Stripe Payment Account
297
+ * @param {PaymentApiGetStripePaymentAccountRequest} requestParameters Request parameters.
298
+ * @param {*} [options] Override http request option.
299
+ * @throws {RequiredError}
300
+ * @memberof PaymentApi
301
+ */
302
+ getStripePaymentAccount(requestParameters: PaymentApiGetStripePaymentAccountRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<PaymentAccount, any>>;
303
+ }