@takaro/apiclient 0.0.0-dev.f68a514 → 0.0.0-dev.f6aee21
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/dist/generated/api.d.ts +11466 -5120
- package/dist/generated/api.d.ts.map +1 -1
- package/dist/generated/api.js +11065 -6364
- package/dist/generated/api.js.map +1 -1
- package/dist/generated/base.d.ts +1 -1
- package/dist/generated/base.js +1 -1
- package/dist/generated/common.d.ts +1 -1
- package/dist/generated/common.js +1 -1
- package/dist/generated/configuration.d.ts +1 -1
- package/dist/generated/configuration.js +2 -2
- package/dist/generated/configuration.js.map +1 -1
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/index.js +1 -1
- package/dist/lib/baseClient.d.ts.map +1 -1
- package/dist/lib/baseClient.js +6 -1
- package/dist/lib/baseClient.js.map +1 -1
- package/dist/lib/client.d.ts +3 -2
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +11 -6
- package/dist/lib/client.js.map +1 -1
- package/package.json +2 -2
- package/src/generated/api.ts +12583 -2122
- package/src/generated/base.ts +1 -1
- package/src/generated/common.ts +1 -1
- package/src/generated/configuration.ts +2 -2
- package/src/generated/index.ts +1 -1
- package/src/lib/baseClient.ts +7 -1
- package/src/lib/client.ts +18 -7
package/src/generated/base.ts
CHANGED
package/src/generated/common.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Takaro
|
|
4
|
+
* Takaro API
|
|
5
5
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 0.0.0
|
|
@@ -117,7 +117,7 @@ export class Configuration {
|
|
|
117
117
|
* @return True if the given MIME is JSON, false otherwise.
|
|
118
118
|
*/
|
|
119
119
|
public isJsonMime(mime: string): boolean {
|
|
120
|
-
const jsonMime: RegExp = new RegExp('^(application
|
|
120
|
+
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
121
121
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
122
122
|
}
|
|
123
123
|
}
|
package/src/generated/index.ts
CHANGED
package/src/lib/baseClient.ts
CHANGED
|
@@ -23,11 +23,17 @@ export class BaseApiClient<T extends IBaseApiClientConfig> {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
constructor(protected readonly config: T) {
|
|
26
|
+
// Browsers refuse to let JS set the User-Agent header (it's a "forbidden header").
|
|
27
|
+
// Only include it when running outside a browser context (Node.js / server-side).
|
|
28
|
+
// Use globalThis so this compiles under both DOM and non-DOM TypeScript lib targets.
|
|
29
|
+
const isBrowser =
|
|
30
|
+
typeof (globalThis as Record<string, unknown>)['window'] !== 'undefined' &&
|
|
31
|
+
typeof (globalThis as Record<string, unknown>)['document'] !== 'undefined';
|
|
26
32
|
const axiosConfig: AxiosRequestConfig = {
|
|
27
33
|
baseURL: this.config.url,
|
|
28
34
|
headers: {
|
|
29
35
|
'Content-Type': 'application/json',
|
|
30
|
-
'User-Agent': 'Takaro-API-Client',
|
|
36
|
+
...(!isBrowser && { 'User-Agent': 'Takaro-API-Client' }),
|
|
31
37
|
},
|
|
32
38
|
withCredentials: true,
|
|
33
39
|
};
|
package/src/lib/client.ts
CHANGED
|
@@ -14,13 +14,14 @@ import {
|
|
|
14
14
|
EventApi,
|
|
15
15
|
PlayerOnGameServerApi,
|
|
16
16
|
ItemApi,
|
|
17
|
-
StatsApi,
|
|
18
17
|
ShopOrderApi,
|
|
19
18
|
ShopListingApi,
|
|
20
19
|
ShopCategoryApi,
|
|
20
|
+
ShopActionApi,
|
|
21
21
|
TrackingApi,
|
|
22
22
|
EntityApi,
|
|
23
23
|
AnalyticsApi,
|
|
24
|
+
InviteLinkApi,
|
|
24
25
|
} from '../generated/api.js';
|
|
25
26
|
import { BaseApiClient, IBaseApiClientConfig } from './baseClient.js';
|
|
26
27
|
|
|
@@ -236,8 +237,8 @@ export class Client extends BaseApiClient<IApiClientConfig> {
|
|
|
236
237
|
);
|
|
237
238
|
}
|
|
238
239
|
|
|
239
|
-
get
|
|
240
|
-
return new
|
|
240
|
+
get shopListing() {
|
|
241
|
+
return new ShopListingApi(
|
|
241
242
|
{
|
|
242
243
|
isJsonMime: this.isJsonMime,
|
|
243
244
|
},
|
|
@@ -246,8 +247,8 @@ export class Client extends BaseApiClient<IApiClientConfig> {
|
|
|
246
247
|
);
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
get
|
|
250
|
-
return new
|
|
250
|
+
get shopCategory() {
|
|
251
|
+
return new ShopCategoryApi(
|
|
251
252
|
{
|
|
252
253
|
isJsonMime: this.isJsonMime,
|
|
253
254
|
},
|
|
@@ -256,8 +257,8 @@ export class Client extends BaseApiClient<IApiClientConfig> {
|
|
|
256
257
|
);
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
get
|
|
260
|
-
return new
|
|
260
|
+
get shopAction() {
|
|
261
|
+
return new ShopActionApi(
|
|
261
262
|
{
|
|
262
263
|
isJsonMime: this.isJsonMime,
|
|
263
264
|
},
|
|
@@ -305,4 +306,14 @@ export class Client extends BaseApiClient<IApiClientConfig> {
|
|
|
305
306
|
this.axios,
|
|
306
307
|
);
|
|
307
308
|
}
|
|
309
|
+
|
|
310
|
+
get inviteLink() {
|
|
311
|
+
return new InviteLinkApi(
|
|
312
|
+
{
|
|
313
|
+
isJsonMime: this.isJsonMime,
|
|
314
|
+
},
|
|
315
|
+
'',
|
|
316
|
+
this.axios,
|
|
317
|
+
);
|
|
318
|
+
}
|
|
308
319
|
}
|