@takaro/apiclient 0.0.0-dev.fbd8199 → 0.0.0-dev.fc4b15f

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@takaro/apiclient",
3
3
  "description": "API client for Takaro",
4
- "version": "0.0.0-dev.fbd8199",
4
+ "version": "0.0.0-dev.fc4b15f",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "axios": "1.7.7"
@@ -2278,16 +2278,16 @@ export interface DomainCreateInputDTO {
2278
2278
  maxDiscordLinkedRoles?: number;
2279
2279
  /**
2280
2280
  *
2281
- * @type {string}
2281
+ * @type {boolean}
2282
2282
  * @memberof DomainCreateInputDTO
2283
2283
  */
2284
- serverRegistrationToken?: string;
2284
+ skipBuiltinSeeding?: boolean;
2285
2285
  /**
2286
2286
  *
2287
- * @type {boolean}
2287
+ * @type {string}
2288
2288
  * @memberof DomainCreateInputDTO
2289
2289
  */
2290
- skipBuiltinSeeding?: boolean;
2290
+ serverRegistrationToken?: string;
2291
2291
  }
2292
2292
 
2293
2293
  export const DomainCreateInputDTOStateEnum = {
@@ -3153,19 +3153,19 @@ export interface ErrorOutput {
3153
3153
  * @type {string}
3154
3154
  * @memberof ErrorOutput
3155
3155
  */
3156
- code: string;
3156
+ code?: string;
3157
3157
  /**
3158
3158
  *
3159
3159
  * @type {string}
3160
3160
  * @memberof ErrorOutput
3161
3161
  */
3162
- message: string;
3162
+ message?: string;
3163
3163
  /**
3164
3164
  *
3165
3165
  * @type {string}
3166
3166
  * @memberof ErrorOutput
3167
3167
  */
3168
- details: string;
3168
+ details?: string;
3169
3169
  }
3170
3170
  /**
3171
3171
  *
@@ -3178,7 +3178,7 @@ export interface EventChatMessage {
3178
3178
  * @type {IGamePlayer}
3179
3179
  * @memberof EventChatMessage
3180
3180
  */
3181
- player: IGamePlayer;
3181
+ player?: IGamePlayer;
3182
3182
  /**
3183
3183
  *
3184
3184
  * @type {string}
@@ -8326,7 +8326,7 @@ export interface MetadataOutput {
8326
8326
  * @type {ErrorOutput}
8327
8327
  * @memberof MetadataOutput
8328
8328
  */
8329
- error: ErrorOutput;
8329
+ error?: ErrorOutput;
8330
8330
  /**
8331
8331
  *
8332
8332
  * @type {number}
@@ -12618,7 +12618,7 @@ export interface RedirectQs {
12618
12618
  * @type {string}
12619
12619
  * @memberof RedirectQs
12620
12620
  */
12621
- redirect: string;
12621
+ redirect?: string;
12622
12622
  }
12623
12623
  /**
12624
12624
  *
@@ -16345,6 +16345,36 @@ export interface TakaroEventHookExecuted {
16345
16345
  * @interface TakaroEventInviteLinkCreated
16346
16346
  */
16347
16347
  export interface TakaroEventInviteLinkCreated {
16348
+ /**
16349
+ *
16350
+ * @type {string}
16351
+ * @memberof TakaroEventInviteLinkCreated
16352
+ */
16353
+ inviteLinkId: string;
16354
+ /**
16355
+ *
16356
+ * @type {NOTDOMAINSCOPEDTakaroModelDTOCreatedAt}
16357
+ * @memberof TakaroEventInviteLinkCreated
16358
+ */
16359
+ expiresAt: NOTDOMAINSCOPEDTakaroModelDTOCreatedAt;
16360
+ /**
16361
+ *
16362
+ * @type {number}
16363
+ * @memberof TakaroEventInviteLinkCreated
16364
+ */
16365
+ maxUses: number;
16366
+ /**
16367
+ *
16368
+ * @type {Array<string>}
16369
+ * @memberof TakaroEventInviteLinkCreated
16370
+ */
16371
+ roleIds: Array<string>;
16372
+ /**
16373
+ *
16374
+ * @type {boolean}
16375
+ * @memberof TakaroEventInviteLinkCreated
16376
+ */
16377
+ staffOrigin: boolean;
16348
16378
  /**
16349
16379
  *
16350
16380
  * @type {NOTDOMAINSCOPEDTakaroModelDTOCreatedAt}
@@ -17710,6 +17740,37 @@ export interface UserCreateInputDTO {
17710
17740
  */
17711
17741
  isDashboardUser?: boolean;
17712
17742
  }
17743
+ /**
17744
+ *
17745
+ * @export
17746
+ * @interface UserCreateInviteDTO
17747
+ */
17748
+ export interface UserCreateInviteDTO {
17749
+ /**
17750
+ *
17751
+ * @type {string}
17752
+ * @memberof UserCreateInviteDTO
17753
+ */
17754
+ name: string;
17755
+ /**
17756
+ *
17757
+ * @type {string}
17758
+ * @memberof UserCreateInviteDTO
17759
+ */
17760
+ email: string;
17761
+ /**
17762
+ *
17763
+ * @type {string}
17764
+ * @memberof UserCreateInviteDTO
17765
+ */
17766
+ idpId?: string;
17767
+ /**
17768
+ *
17769
+ * @type {boolean}
17770
+ * @memberof UserCreateInviteDTO
17771
+ */
17772
+ isDashboardUser?: boolean;
17773
+ }
17713
17774
  /**
17714
17775
  *
17715
17776
  * @export
@@ -17813,7 +17874,7 @@ export interface UserOutputDTO {
17813
17874
  * @type {PlayerOutputWithRolesDTO}
17814
17875
  * @memberof UserOutputDTO
17815
17876
  */
17816
- player: PlayerOutputWithRolesDTO;
17877
+ player?: PlayerOutputWithRolesDTO;
17817
17878
  /**
17818
17879
  *
17819
17880
  * @type {boolean}
@@ -17941,7 +18002,7 @@ export interface UserOutputWithRolesDTO {
17941
18002
  * @type {PlayerOutputWithRolesDTO}
17942
18003
  * @memberof UserOutputWithRolesDTO
17943
18004
  */
17944
- player: PlayerOutputWithRolesDTO;
18005
+ player?: PlayerOutputWithRolesDTO;
17945
18006
  /**
17946
18007
  *
17947
18008
  * @type {boolean}
@@ -26478,7 +26539,7 @@ export const DomainApiAxiosParamCreator = function (configuration?: Configuratio
26478
26539
  },
26479
26540
  /**
26480
26541
  * Creates a staff-recovery invite link scoped to the target domain. The `token` and `inviteUrl` fields are returned ONCE and are not stored on the server — distribute securely. Hardened for recovery use: expiry is forced to 24 hours and maxUses is forced to 1, regardless of request body values. roleIds is passed through as-is; omit it to grant no extra roles (plain member). Attribution is limited: the admin secret is a single shared identity; this event records that staff acted on the domain but cannot name the individual.<br> OperationId: `DomainControllerCreateInviteLink`
26481
- * @summary Create admin invite link for a domain
26542
+ * @summary Create staff-recovery invite link for a domain
26482
26543
  * @param {string} id
26483
26544
  * @param {InviteLinkCreateInputDTO} [inviteLinkCreateInputDTO] InviteLinkCreateInputDTO
26484
26545
  * @param {*} [options] Override http request option.
@@ -26796,7 +26857,7 @@ export const DomainApiFp = function (configuration?: Configuration) {
26796
26857
  },
26797
26858
  /**
26798
26859
  * Creates a staff-recovery invite link scoped to the target domain. The `token` and `inviteUrl` fields are returned ONCE and are not stored on the server — distribute securely. Hardened for recovery use: expiry is forced to 24 hours and maxUses is forced to 1, regardless of request body values. roleIds is passed through as-is; omit it to grant no extra roles (plain member). Attribution is limited: the admin secret is a single shared identity; this event records that staff acted on the domain but cannot name the individual.<br> OperationId: `DomainControllerCreateInviteLink`
26799
- * @summary Create admin invite link for a domain
26860
+ * @summary Create staff-recovery invite link for a domain
26800
26861
  * @param {string} id
26801
26862
  * @param {InviteLinkCreateInputDTO} [inviteLinkCreateInputDTO] InviteLinkCreateInputDTO
26802
26863
  * @param {*} [options] Override http request option.
@@ -26999,7 +27060,7 @@ export const DomainApiFactory = function (configuration?: Configuration, basePat
26999
27060
  },
27000
27061
  /**
27001
27062
  * Creates a staff-recovery invite link scoped to the target domain. The `token` and `inviteUrl` fields are returned ONCE and are not stored on the server — distribute securely. Hardened for recovery use: expiry is forced to 24 hours and maxUses is forced to 1, regardless of request body values. roleIds is passed through as-is; omit it to grant no extra roles (plain member). Attribution is limited: the admin secret is a single shared identity; this event records that staff acted on the domain but cannot name the individual.<br> OperationId: `DomainControllerCreateInviteLink`
27002
- * @summary Create admin invite link for a domain
27063
+ * @summary Create staff-recovery invite link for a domain
27003
27064
  * @param {string} id
27004
27065
  * @param {InviteLinkCreateInputDTO} [inviteLinkCreateInputDTO] InviteLinkCreateInputDTO
27005
27066
  * @param {*} [options] Override http request option.
@@ -27121,7 +27182,7 @@ export class DomainApi extends BaseAPI {
27121
27182
 
27122
27183
  /**
27123
27184
  * Creates a staff-recovery invite link scoped to the target domain. The `token` and `inviteUrl` fields are returned ONCE and are not stored on the server — distribute securely. Hardened for recovery use: expiry is forced to 24 hours and maxUses is forced to 1, regardless of request body values. roleIds is passed through as-is; omit it to grant no extra roles (plain member). Attribution is limited: the admin secret is a single shared identity; this event records that staff acted on the domain but cannot name the individual.<br> OperationId: `DomainControllerCreateInviteLink`
27124
- * @summary Create admin invite link for a domain
27185
+ * @summary Create staff-recovery invite link for a domain
27125
27186
  * @param {string} id
27126
27187
  * @param {InviteLinkCreateInputDTO} [inviteLinkCreateInputDTO] InviteLinkCreateInputDTO
27127
27188
  * @param {*} [options] Override http request option.
@@ -28098,16 +28159,14 @@ export const ExternalAuthApiAxiosParamCreator = function (configuration?: Config
28098
28159
  /**
28099
28160
  * <br> OperationId: `ExternalAuthControllerAuthDiscord`
28100
28161
  * @summary Auth discord
28101
- * @param {string} redirect
28162
+ * @param {string} [redirect]
28102
28163
  * @param {*} [options] Override http request option.
28103
28164
  * @throws {RequiredError}
28104
28165
  */
28105
28166
  externalAuthControllerAuthDiscord: async (
28106
- redirect: string,
28167
+ redirect?: string,
28107
28168
  options: RawAxiosRequestConfig = {},
28108
28169
  ): Promise<RequestArgs> => {
28109
- // verify required parameter 'redirect' is not null or undefined
28110
- assertParamExists('externalAuthControllerAuthDiscord', 'redirect', redirect);
28111
28170
  const localVarPath = `/auth/discord`;
28112
28171
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
28113
28172
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -28174,12 +28233,12 @@ export const ExternalAuthApiFp = function (configuration?: Configuration) {
28174
28233
  /**
28175
28234
  * <br> OperationId: `ExternalAuthControllerAuthDiscord`
28176
28235
  * @summary Auth discord
28177
- * @param {string} redirect
28236
+ * @param {string} [redirect]
28178
28237
  * @param {*} [options] Override http request option.
28179
28238
  * @throws {RequiredError}
28180
28239
  */
28181
28240
  async externalAuthControllerAuthDiscord(
28182
- redirect: string,
28241
+ redirect?: string,
28183
28242
  options?: RawAxiosRequestConfig,
28184
28243
  ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
28185
28244
  const localVarAxiosArgs = await localVarAxiosParamCreator.externalAuthControllerAuthDiscord(redirect, options);
@@ -28233,11 +28292,11 @@ export const ExternalAuthApiFactory = function (
28233
28292
  /**
28234
28293
  * <br> OperationId: `ExternalAuthControllerAuthDiscord`
28235
28294
  * @summary Auth discord
28236
- * @param {string} redirect
28295
+ * @param {string} [redirect]
28237
28296
  * @param {*} [options] Override http request option.
28238
28297
  * @throws {RequiredError}
28239
28298
  */
28240
- externalAuthControllerAuthDiscord(redirect: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
28299
+ externalAuthControllerAuthDiscord(redirect?: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
28241
28300
  return localVarFp
28242
28301
  .externalAuthControllerAuthDiscord(redirect, options)
28243
28302
  .then((request) => request(axios, basePath));
@@ -28264,12 +28323,12 @@ export class ExternalAuthApi extends BaseAPI {
28264
28323
  /**
28265
28324
  * <br> OperationId: `ExternalAuthControllerAuthDiscord`
28266
28325
  * @summary Auth discord
28267
- * @param {string} redirect
28326
+ * @param {string} [redirect]
28268
28327
  * @param {*} [options] Override http request option.
28269
28328
  * @throws {RequiredError}
28270
28329
  * @memberof ExternalAuthApi
28271
28330
  */
28272
- public externalAuthControllerAuthDiscord(redirect: string, options?: RawAxiosRequestConfig) {
28331
+ public externalAuthControllerAuthDiscord(redirect?: string, options?: RawAxiosRequestConfig) {
28273
28332
  return ExternalAuthApiFp(this.configuration)
28274
28333
  .externalAuthControllerAuthDiscord(redirect, options)
28275
28334
  .then((request) => request(this.axios, this.basePath));
@@ -32691,6 +32750,34 @@ export const MetaApiAxiosParamCreator = function (configuration?: Configuration)
32691
32750
  options: localVarRequestOptions,
32692
32751
  };
32693
32752
  },
32753
+ /**
32754
+ * <br> OperationId: `MetaGetLiveness`
32755
+ * @summary Get liveness
32756
+ * @param {*} [options] Override http request option.
32757
+ * @throws {RequiredError}
32758
+ */
32759
+ metaGetLiveness: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
32760
+ const localVarPath = `/livez`;
32761
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
32762
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
32763
+ let baseOptions;
32764
+ if (configuration) {
32765
+ baseOptions = configuration.baseOptions;
32766
+ }
32767
+
32768
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
32769
+ const localVarHeaderParameter = {} as any;
32770
+ const localVarQueryParameter = {} as any;
32771
+
32772
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
32773
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
32774
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
32775
+
32776
+ return {
32777
+ url: toPathString(localVarUrlObj),
32778
+ options: localVarRequestOptions,
32779
+ };
32780
+ },
32694
32781
  /**
32695
32782
  * <br> OperationId: `MetaGetMetrics`
32696
32783
  * @summary Get metrics
@@ -32862,6 +32949,27 @@ export const MetaApiFp = function (configuration?: Configuration) {
32862
32949
  configuration,
32863
32950
  )(axios, localVarOperationServerBasePath || basePath);
32864
32951
  },
32952
+ /**
32953
+ * <br> OperationId: `MetaGetLiveness`
32954
+ * @summary Get liveness
32955
+ * @param {*} [options] Override http request option.
32956
+ * @throws {RequiredError}
32957
+ */
32958
+ async metaGetLiveness(
32959
+ options?: RawAxiosRequestConfig,
32960
+ ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HealthOutputDTO>> {
32961
+ const localVarAxiosArgs = await localVarAxiosParamCreator.metaGetLiveness(options);
32962
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
32963
+ const localVarOperationServerBasePath =
32964
+ operationServerMap['MetaApi.metaGetLiveness']?.[localVarOperationServerIndex]?.url;
32965
+ return (axios, basePath) =>
32966
+ createRequestFunction(
32967
+ localVarAxiosArgs,
32968
+ globalAxios,
32969
+ BASE_PATH,
32970
+ configuration,
32971
+ )(axios, localVarOperationServerBasePath || basePath);
32972
+ },
32865
32973
  /**
32866
32974
  * <br> OperationId: `MetaGetMetrics`
32867
32975
  * @summary Get metrics
@@ -32986,6 +33094,15 @@ export const MetaApiFactory = function (configuration?: Configuration, basePath?
32986
33094
  metaGetHealth(options?: RawAxiosRequestConfig): AxiosPromise<HealthOutputDTO> {
32987
33095
  return localVarFp.metaGetHealth(options).then((request) => request(axios, basePath));
32988
33096
  },
33097
+ /**
33098
+ * <br> OperationId: `MetaGetLiveness`
33099
+ * @summary Get liveness
33100
+ * @param {*} [options] Override http request option.
33101
+ * @throws {RequiredError}
33102
+ */
33103
+ metaGetLiveness(options?: RawAxiosRequestConfig): AxiosPromise<HealthOutputDTO> {
33104
+ return localVarFp.metaGetLiveness(options).then((request) => request(axios, basePath));
33105
+ },
32989
33106
  /**
32990
33107
  * <br> OperationId: `MetaGetMetrics`
32991
33108
  * @summary Get metrics
@@ -33054,6 +33171,19 @@ export class MetaApi extends BaseAPI {
33054
33171
  .then((request) => request(this.axios, this.basePath));
33055
33172
  }
33056
33173
 
33174
+ /**
33175
+ * <br> OperationId: `MetaGetLiveness`
33176
+ * @summary Get liveness
33177
+ * @param {*} [options] Override http request option.
33178
+ * @throws {RequiredError}
33179
+ * @memberof MetaApi
33180
+ */
33181
+ public metaGetLiveness(options?: RawAxiosRequestConfig) {
33182
+ return MetaApiFp(this.configuration)
33183
+ .metaGetLiveness(options)
33184
+ .then((request) => request(this.axios, this.basePath));
33185
+ }
33186
+
33057
33187
  /**
33058
33188
  * <br> OperationId: `MetaGetMetrics`
33059
33189
  * @summary Get metrics
@@ -1,6 +1,6 @@
1
1
  import { DomainApi } from '../generated/index.js';
2
- import { BaseApiClient, IBaseApiClientConfig } from './baseClient.js';
3
- import { AxiosInstance } from 'axios';
2
+ import { BaseApiClient, type IBaseApiClientConfig } from './baseClient.js';
3
+ import { type AxiosInstance } from 'axios';
4
4
 
5
5
  export interface IAdminApiClientConfig extends IBaseApiClientConfig {
6
6
  auth: {
@@ -16,7 +16,9 @@ export class AdminClient extends BaseApiClient<IAdminApiClientConfig> {
16
16
 
17
17
  private addAuthInterceptor(token: string, axios: AxiosInstance): AxiosInstance {
18
18
  axios.interceptors.request.use(async (request) => {
19
- if (request.url?.includes('health')) return request;
19
+ if (request.url?.includes('health')) {
20
+ return request;
21
+ }
20
22
 
21
23
  request.headers['X-Takaro-Admin-Token'] = token;
22
24
  return request;
@@ -1,5 +1,5 @@
1
1
  import { MetaApi } from '../generated/api.js';
2
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import axios, { type AxiosError, type AxiosInstance, type AxiosRequestConfig } from 'axios';
3
3
 
4
4
  /**
5
5
  * Axios defaults to NO timeout, so a request whose TCP connection stalls blocks its
@@ -42,8 +42,8 @@ export class BaseApiClient<T extends IBaseApiClientConfig> {
42
42
  // Only include it when running outside a browser context (Node.js / server-side).
43
43
  // Use globalThis so this compiles under both DOM and non-DOM TypeScript lib targets.
44
44
  const isBrowser =
45
- typeof (globalThis as Record<string, unknown>)['window'] !== 'undefined' &&
46
- typeof (globalThis as Record<string, unknown>)['document'] !== 'undefined';
45
+ (globalThis as Record<string, unknown>).window !== undefined &&
46
+ (globalThis as Record<string, unknown>).document !== undefined;
47
47
  const axiosConfig: AxiosRequestConfig = {
48
48
  baseURL: this.config.url,
49
49
  headers: {
@@ -55,7 +55,9 @@ export class BaseApiClient<T extends IBaseApiClientConfig> {
55
55
  };
56
56
  this.axios = this.addLoggers(axios.create(axiosConfig));
57
57
 
58
- if (this.config.log) this.log = this.config.log;
58
+ if (this.config.log) {
59
+ this.log = this.config.log;
60
+ }
59
61
  }
60
62
 
61
63
  setHeader(key: string, value: string) {
package/src/lib/client.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  AnalyticsApi,
24
24
  InviteLinkApi,
25
25
  } from '../generated/api.js';
26
- import { BaseApiClient, IBaseApiClientConfig } from './baseClient.js';
26
+ import { BaseApiClient, type IBaseApiClientConfig } from './baseClient.js';
27
27
 
28
28
  export interface IApiClientConfig extends IBaseApiClientConfig {
29
29
  auth: {
@@ -64,13 +64,13 @@ export class Client extends BaseApiClient<IApiClientConfig> {
64
64
  this.config.auth.token = loginRes.data.data.token;
65
65
  this.token = loginRes.data.data.token;
66
66
 
67
- this.axios.defaults.headers.common['Authorization'] = `Bearer ${loginRes.data.data.token}`;
67
+ this.axios.defaults.headers.common.Authorization = `Bearer ${loginRes.data.data.token}`;
68
68
 
69
69
  return loginRes.data.data.token;
70
70
  }
71
71
 
72
72
  public logout() {
73
- delete this.axios.defaults.headers.common['Authorization'];
73
+ delete this.axios.defaults.headers.common.Authorization;
74
74
  }
75
75
 
76
76
  public async permissionCodesToInputs(permissions: string[]) {
@@ -81,8 +81,9 @@ export class Client extends BaseApiClient<IApiClientConfig> {
81
81
  permissionId: p.id,
82
82
  }));
83
83
 
84
- if (records.length !== permissions.length)
84
+ if (records.length !== permissions.length) {
85
85
  throw new Error(`Not all permissions were found: ${permissions.join(', ')}`);
86
+ }
86
87
 
87
88
  return records;
88
89
  }
package/src/main.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AxiosResponse } from 'axios';
1
+ import { type AxiosResponse } from 'axios';
2
2
 
3
3
  export { AxiosResponse } from 'axios';
4
4
  export { isAxiosError } from 'axios';