@cmdop/core 2026.2.26 → 2026.2.28
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/index.cjs +94 -3
- package/dist/index.d.cts +39 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +94 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1958,11 +1958,25 @@ Method: POST`);
|
|
|
1958
1958
|
// src/api/generated/machines/index.ts
|
|
1959
1959
|
var TOKEN_KEY = "auth_token";
|
|
1960
1960
|
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
1961
|
+
function detectLocale() {
|
|
1962
|
+
try {
|
|
1963
|
+
if (typeof document !== "undefined") {
|
|
1964
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
1965
|
+
if (match) return match[1];
|
|
1966
|
+
}
|
|
1967
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
1968
|
+
return navigator.language;
|
|
1969
|
+
}
|
|
1970
|
+
} catch {
|
|
1971
|
+
}
|
|
1972
|
+
return null;
|
|
1973
|
+
}
|
|
1961
1974
|
var API = class {
|
|
1962
1975
|
baseUrl;
|
|
1963
1976
|
_client;
|
|
1964
1977
|
_token = null;
|
|
1965
1978
|
_refreshToken = null;
|
|
1979
|
+
_locale = null;
|
|
1966
1980
|
storage;
|
|
1967
1981
|
options;
|
|
1968
1982
|
// Sub-clients
|
|
@@ -1973,6 +1987,7 @@ var API = class {
|
|
|
1973
1987
|
this.options = options;
|
|
1974
1988
|
const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
|
|
1975
1989
|
this.storage = options?.storage || new LocalStorageAdapter(logger);
|
|
1990
|
+
this._locale = options?.locale || null;
|
|
1976
1991
|
this._loadTokensFromStorage();
|
|
1977
1992
|
this._client = new APIClient(this.baseUrl, {
|
|
1978
1993
|
retryConfig: this.options?.retryConfig,
|
|
@@ -2001,11 +2016,13 @@ var API = class {
|
|
|
2001
2016
|
const originalRequest = this._client.request.bind(this._client);
|
|
2002
2017
|
this._client.request = async (method, path, options) => {
|
|
2003
2018
|
const token = this.getToken();
|
|
2019
|
+
const locale = this._locale || detectLocale();
|
|
2004
2020
|
const mergedOptions = {
|
|
2005
2021
|
...options,
|
|
2006
2022
|
headers: {
|
|
2007
2023
|
...options?.headers || {},
|
|
2008
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
2024
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
2025
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
2009
2026
|
}
|
|
2010
2027
|
};
|
|
2011
2028
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -2067,6 +2084,19 @@ var API = class {
|
|
|
2067
2084
|
getBaseUrl() {
|
|
2068
2085
|
return this.baseUrl;
|
|
2069
2086
|
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Set locale for Accept-Language header
|
|
2089
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
2090
|
+
*/
|
|
2091
|
+
setLocale(locale) {
|
|
2092
|
+
this._locale = locale;
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* Get current locale
|
|
2096
|
+
*/
|
|
2097
|
+
getLocale() {
|
|
2098
|
+
return this._locale;
|
|
2099
|
+
}
|
|
2070
2100
|
/**
|
|
2071
2101
|
* Get OpenAPI schema path
|
|
2072
2102
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -4104,11 +4134,25 @@ async function getWorkspacesWorkspacesStatsRetrieve(id, client) {
|
|
|
4104
4134
|
// src/api/generated/workspaces/index.ts
|
|
4105
4135
|
var TOKEN_KEY2 = "auth_token";
|
|
4106
4136
|
var REFRESH_TOKEN_KEY2 = "refresh_token";
|
|
4137
|
+
function detectLocale2() {
|
|
4138
|
+
try {
|
|
4139
|
+
if (typeof document !== "undefined") {
|
|
4140
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
4141
|
+
if (match) return match[1];
|
|
4142
|
+
}
|
|
4143
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
4144
|
+
return navigator.language;
|
|
4145
|
+
}
|
|
4146
|
+
} catch {
|
|
4147
|
+
}
|
|
4148
|
+
return null;
|
|
4149
|
+
}
|
|
4107
4150
|
var API2 = class {
|
|
4108
4151
|
baseUrl;
|
|
4109
4152
|
_client;
|
|
4110
4153
|
_token = null;
|
|
4111
4154
|
_refreshToken = null;
|
|
4155
|
+
_locale = null;
|
|
4112
4156
|
storage;
|
|
4113
4157
|
options;
|
|
4114
4158
|
// Sub-clients
|
|
@@ -4118,6 +4162,7 @@ var API2 = class {
|
|
|
4118
4162
|
this.options = options;
|
|
4119
4163
|
const logger = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
|
|
4120
4164
|
this.storage = options?.storage || new LocalStorageAdapter2(logger);
|
|
4165
|
+
this._locale = options?.locale || null;
|
|
4121
4166
|
this._loadTokensFromStorage();
|
|
4122
4167
|
this._client = new APIClient2(this.baseUrl, {
|
|
4123
4168
|
retryConfig: this.options?.retryConfig,
|
|
@@ -4144,11 +4189,13 @@ var API2 = class {
|
|
|
4144
4189
|
const originalRequest = this._client.request.bind(this._client);
|
|
4145
4190
|
this._client.request = async (method, path, options) => {
|
|
4146
4191
|
const token = this.getToken();
|
|
4192
|
+
const locale = this._locale || detectLocale2();
|
|
4147
4193
|
const mergedOptions = {
|
|
4148
4194
|
...options,
|
|
4149
4195
|
headers: {
|
|
4150
4196
|
...options?.headers || {},
|
|
4151
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
4197
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
4198
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
4152
4199
|
}
|
|
4153
4200
|
};
|
|
4154
4201
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -4210,6 +4257,19 @@ var API2 = class {
|
|
|
4210
4257
|
getBaseUrl() {
|
|
4211
4258
|
return this.baseUrl;
|
|
4212
4259
|
}
|
|
4260
|
+
/**
|
|
4261
|
+
* Set locale for Accept-Language header
|
|
4262
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
4263
|
+
*/
|
|
4264
|
+
setLocale(locale) {
|
|
4265
|
+
this._locale = locale;
|
|
4266
|
+
}
|
|
4267
|
+
/**
|
|
4268
|
+
* Get current locale
|
|
4269
|
+
*/
|
|
4270
|
+
getLocale() {
|
|
4271
|
+
return this._locale;
|
|
4272
|
+
}
|
|
4213
4273
|
/**
|
|
4214
4274
|
* Get OpenAPI schema path
|
|
4215
4275
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -5304,6 +5364,7 @@ var import_zod36 = require("zod");
|
|
|
5304
5364
|
var ApiKeySchema = import_zod36.z.object({
|
|
5305
5365
|
id: import_zod36.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5306
5366
|
workspace: import_zod36.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5367
|
+
workspace_name: import_zod36.z.string(),
|
|
5307
5368
|
name: import_zod36.z.string(),
|
|
5308
5369
|
key_prefix: import_zod36.z.string(),
|
|
5309
5370
|
last_used: import_zod36.z.string().datetime({ offset: true }).nullable(),
|
|
@@ -6366,11 +6427,25 @@ Method: POST`);
|
|
|
6366
6427
|
// src/api/generated/system/index.ts
|
|
6367
6428
|
var TOKEN_KEY3 = "auth_token";
|
|
6368
6429
|
var REFRESH_TOKEN_KEY3 = "refresh_token";
|
|
6430
|
+
function detectLocale3() {
|
|
6431
|
+
try {
|
|
6432
|
+
if (typeof document !== "undefined") {
|
|
6433
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
6434
|
+
if (match) return match[1];
|
|
6435
|
+
}
|
|
6436
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
6437
|
+
return navigator.language;
|
|
6438
|
+
}
|
|
6439
|
+
} catch {
|
|
6440
|
+
}
|
|
6441
|
+
return null;
|
|
6442
|
+
}
|
|
6369
6443
|
var API3 = class {
|
|
6370
6444
|
baseUrl;
|
|
6371
6445
|
_client;
|
|
6372
6446
|
_token = null;
|
|
6373
6447
|
_refreshToken = null;
|
|
6448
|
+
_locale = null;
|
|
6374
6449
|
storage;
|
|
6375
6450
|
options;
|
|
6376
6451
|
// Sub-clients
|
|
@@ -6381,6 +6456,7 @@ var API3 = class {
|
|
|
6381
6456
|
this.options = options;
|
|
6382
6457
|
const logger = options?.loggerConfig ? new APILogger3(options.loggerConfig) : void 0;
|
|
6383
6458
|
this.storage = options?.storage || new LocalStorageAdapter3(logger);
|
|
6459
|
+
this._locale = options?.locale || null;
|
|
6384
6460
|
this._loadTokensFromStorage();
|
|
6385
6461
|
this._client = new APIClient3(this.baseUrl, {
|
|
6386
6462
|
retryConfig: this.options?.retryConfig,
|
|
@@ -6409,11 +6485,13 @@ var API3 = class {
|
|
|
6409
6485
|
const originalRequest = this._client.request.bind(this._client);
|
|
6410
6486
|
this._client.request = async (method, path, options) => {
|
|
6411
6487
|
const token = this.getToken();
|
|
6488
|
+
const locale = this._locale || detectLocale3();
|
|
6412
6489
|
const mergedOptions = {
|
|
6413
6490
|
...options,
|
|
6414
6491
|
headers: {
|
|
6415
6492
|
...options?.headers || {},
|
|
6416
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
6493
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
6494
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
6417
6495
|
}
|
|
6418
6496
|
};
|
|
6419
6497
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -6475,6 +6553,19 @@ var API3 = class {
|
|
|
6475
6553
|
getBaseUrl() {
|
|
6476
6554
|
return this.baseUrl;
|
|
6477
6555
|
}
|
|
6556
|
+
/**
|
|
6557
|
+
* Set locale for Accept-Language header
|
|
6558
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
6559
|
+
*/
|
|
6560
|
+
setLocale(locale) {
|
|
6561
|
+
this._locale = locale;
|
|
6562
|
+
}
|
|
6563
|
+
/**
|
|
6564
|
+
* Get current locale
|
|
6565
|
+
*/
|
|
6566
|
+
getLocale() {
|
|
6567
|
+
return this._locale;
|
|
6568
|
+
}
|
|
6478
6569
|
/**
|
|
6479
6570
|
* Get OpenAPI schema path
|
|
6480
6571
|
* @returns Path to the OpenAPI schema JSON file
|
package/dist/index.d.cts
CHANGED
|
@@ -1923,12 +1923,15 @@ interface APIOptions$2 {
|
|
|
1923
1923
|
retryConfig?: RetryConfig$2;
|
|
1924
1924
|
/** Logger configuration */
|
|
1925
1925
|
loggerConfig?: Partial<LoggerConfig$2>;
|
|
1926
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
1927
|
+
locale?: string;
|
|
1926
1928
|
}
|
|
1927
1929
|
declare class API$2 {
|
|
1928
1930
|
private baseUrl;
|
|
1929
1931
|
private _client;
|
|
1930
1932
|
private _token;
|
|
1931
1933
|
private _refreshToken;
|
|
1934
|
+
private _locale;
|
|
1932
1935
|
private storage;
|
|
1933
1936
|
private options?;
|
|
1934
1937
|
machines_machine_sharing: MachinesMachineSharing;
|
|
@@ -1968,6 +1971,15 @@ declare class API$2 {
|
|
|
1968
1971
|
* Get current base URL
|
|
1969
1972
|
*/
|
|
1970
1973
|
getBaseUrl(): string;
|
|
1974
|
+
/**
|
|
1975
|
+
* Set locale for Accept-Language header
|
|
1976
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
1977
|
+
*/
|
|
1978
|
+
setLocale(locale: string | null): void;
|
|
1979
|
+
/**
|
|
1980
|
+
* Get current locale
|
|
1981
|
+
*/
|
|
1982
|
+
getLocale(): string | null;
|
|
1971
1983
|
/**
|
|
1972
1984
|
* Get OpenAPI schema path
|
|
1973
1985
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -3823,12 +3835,15 @@ interface APIOptions$1 {
|
|
|
3823
3835
|
retryConfig?: RetryConfig$1;
|
|
3824
3836
|
/** Logger configuration */
|
|
3825
3837
|
loggerConfig?: Partial<LoggerConfig$1>;
|
|
3838
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
3839
|
+
locale?: string;
|
|
3826
3840
|
}
|
|
3827
3841
|
declare class API$1 {
|
|
3828
3842
|
private baseUrl;
|
|
3829
3843
|
private _client;
|
|
3830
3844
|
private _token;
|
|
3831
3845
|
private _refreshToken;
|
|
3846
|
+
private _locale;
|
|
3832
3847
|
private storage;
|
|
3833
3848
|
private options?;
|
|
3834
3849
|
workspaces_workspaces: WorkspacesWorkspaces;
|
|
@@ -3867,6 +3882,15 @@ declare class API$1 {
|
|
|
3867
3882
|
* Get current base URL
|
|
3868
3883
|
*/
|
|
3869
3884
|
getBaseUrl(): string;
|
|
3885
|
+
/**
|
|
3886
|
+
* Set locale for Accept-Language header
|
|
3887
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
3888
|
+
*/
|
|
3889
|
+
setLocale(locale: string | null): void;
|
|
3890
|
+
/**
|
|
3891
|
+
* Get current locale
|
|
3892
|
+
*/
|
|
3893
|
+
getLocale(): string | null;
|
|
3870
3894
|
/**
|
|
3871
3895
|
* Get OpenAPI schema path
|
|
3872
3896
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -4433,6 +4457,7 @@ interface ApiKeyResponse$1 {
|
|
|
4433
4457
|
interface ApiKey$1 {
|
|
4434
4458
|
id: string;
|
|
4435
4459
|
workspace: string;
|
|
4460
|
+
workspace_name: string;
|
|
4436
4461
|
/** Descriptive name for this API key */
|
|
4437
4462
|
name: string;
|
|
4438
4463
|
/** First 12 characters for display */
|
|
@@ -5001,6 +5026,7 @@ type AlertRequest = z.infer<typeof AlertRequestSchema>;
|
|
|
5001
5026
|
declare const ApiKeySchema: z.ZodObject<{
|
|
5002
5027
|
id: z.ZodString;
|
|
5003
5028
|
workspace: z.ZodString;
|
|
5029
|
+
workspace_name: z.ZodString;
|
|
5004
5030
|
name: z.ZodString;
|
|
5005
5031
|
key_prefix: z.ZodString;
|
|
5006
5032
|
last_used: z.ZodNullable<z.ZodString>;
|
|
@@ -5198,6 +5224,7 @@ declare const PaginatedApiKeyListSchema: z.ZodObject<{
|
|
|
5198
5224
|
results: z.ZodArray<z.ZodObject<{
|
|
5199
5225
|
id: z.ZodString;
|
|
5200
5226
|
workspace: z.ZodString;
|
|
5227
|
+
workspace_name: z.ZodString;
|
|
5201
5228
|
name: z.ZodString;
|
|
5202
5229
|
key_prefix: z.ZodString;
|
|
5203
5230
|
last_used: z.ZodNullable<z.ZodString>;
|
|
@@ -5981,12 +6008,15 @@ interface APIOptions {
|
|
|
5981
6008
|
retryConfig?: RetryConfig;
|
|
5982
6009
|
/** Logger configuration */
|
|
5983
6010
|
loggerConfig?: Partial<LoggerConfig>;
|
|
6011
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
6012
|
+
locale?: string;
|
|
5984
6013
|
}
|
|
5985
6014
|
declare class API {
|
|
5986
6015
|
private baseUrl;
|
|
5987
6016
|
private _client;
|
|
5988
6017
|
private _token;
|
|
5989
6018
|
private _refreshToken;
|
|
6019
|
+
private _locale;
|
|
5990
6020
|
private storage;
|
|
5991
6021
|
private options?;
|
|
5992
6022
|
system_oauth: SystemOauth;
|
|
@@ -6026,6 +6056,15 @@ declare class API {
|
|
|
6026
6056
|
* Get current base URL
|
|
6027
6057
|
*/
|
|
6028
6058
|
getBaseUrl(): string;
|
|
6059
|
+
/**
|
|
6060
|
+
* Set locale for Accept-Language header
|
|
6061
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
6062
|
+
*/
|
|
6063
|
+
setLocale(locale: string | null): void;
|
|
6064
|
+
/**
|
|
6065
|
+
* Get current locale
|
|
6066
|
+
*/
|
|
6067
|
+
getLocale(): string | null;
|
|
6029
6068
|
/**
|
|
6030
6069
|
* Get OpenAPI schema path
|
|
6031
6070
|
* @returns Path to the OpenAPI schema JSON file
|
package/dist/index.d.ts
CHANGED
|
@@ -1923,12 +1923,15 @@ interface APIOptions$2 {
|
|
|
1923
1923
|
retryConfig?: RetryConfig$2;
|
|
1924
1924
|
/** Logger configuration */
|
|
1925
1925
|
loggerConfig?: Partial<LoggerConfig$2>;
|
|
1926
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
1927
|
+
locale?: string;
|
|
1926
1928
|
}
|
|
1927
1929
|
declare class API$2 {
|
|
1928
1930
|
private baseUrl;
|
|
1929
1931
|
private _client;
|
|
1930
1932
|
private _token;
|
|
1931
1933
|
private _refreshToken;
|
|
1934
|
+
private _locale;
|
|
1932
1935
|
private storage;
|
|
1933
1936
|
private options?;
|
|
1934
1937
|
machines_machine_sharing: MachinesMachineSharing;
|
|
@@ -1968,6 +1971,15 @@ declare class API$2 {
|
|
|
1968
1971
|
* Get current base URL
|
|
1969
1972
|
*/
|
|
1970
1973
|
getBaseUrl(): string;
|
|
1974
|
+
/**
|
|
1975
|
+
* Set locale for Accept-Language header
|
|
1976
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
1977
|
+
*/
|
|
1978
|
+
setLocale(locale: string | null): void;
|
|
1979
|
+
/**
|
|
1980
|
+
* Get current locale
|
|
1981
|
+
*/
|
|
1982
|
+
getLocale(): string | null;
|
|
1971
1983
|
/**
|
|
1972
1984
|
* Get OpenAPI schema path
|
|
1973
1985
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -3823,12 +3835,15 @@ interface APIOptions$1 {
|
|
|
3823
3835
|
retryConfig?: RetryConfig$1;
|
|
3824
3836
|
/** Logger configuration */
|
|
3825
3837
|
loggerConfig?: Partial<LoggerConfig$1>;
|
|
3838
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
3839
|
+
locale?: string;
|
|
3826
3840
|
}
|
|
3827
3841
|
declare class API$1 {
|
|
3828
3842
|
private baseUrl;
|
|
3829
3843
|
private _client;
|
|
3830
3844
|
private _token;
|
|
3831
3845
|
private _refreshToken;
|
|
3846
|
+
private _locale;
|
|
3832
3847
|
private storage;
|
|
3833
3848
|
private options?;
|
|
3834
3849
|
workspaces_workspaces: WorkspacesWorkspaces;
|
|
@@ -3867,6 +3882,15 @@ declare class API$1 {
|
|
|
3867
3882
|
* Get current base URL
|
|
3868
3883
|
*/
|
|
3869
3884
|
getBaseUrl(): string;
|
|
3885
|
+
/**
|
|
3886
|
+
* Set locale for Accept-Language header
|
|
3887
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
3888
|
+
*/
|
|
3889
|
+
setLocale(locale: string | null): void;
|
|
3890
|
+
/**
|
|
3891
|
+
* Get current locale
|
|
3892
|
+
*/
|
|
3893
|
+
getLocale(): string | null;
|
|
3870
3894
|
/**
|
|
3871
3895
|
* Get OpenAPI schema path
|
|
3872
3896
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -4433,6 +4457,7 @@ interface ApiKeyResponse$1 {
|
|
|
4433
4457
|
interface ApiKey$1 {
|
|
4434
4458
|
id: string;
|
|
4435
4459
|
workspace: string;
|
|
4460
|
+
workspace_name: string;
|
|
4436
4461
|
/** Descriptive name for this API key */
|
|
4437
4462
|
name: string;
|
|
4438
4463
|
/** First 12 characters for display */
|
|
@@ -5001,6 +5026,7 @@ type AlertRequest = z.infer<typeof AlertRequestSchema>;
|
|
|
5001
5026
|
declare const ApiKeySchema: z.ZodObject<{
|
|
5002
5027
|
id: z.ZodString;
|
|
5003
5028
|
workspace: z.ZodString;
|
|
5029
|
+
workspace_name: z.ZodString;
|
|
5004
5030
|
name: z.ZodString;
|
|
5005
5031
|
key_prefix: z.ZodString;
|
|
5006
5032
|
last_used: z.ZodNullable<z.ZodString>;
|
|
@@ -5198,6 +5224,7 @@ declare const PaginatedApiKeyListSchema: z.ZodObject<{
|
|
|
5198
5224
|
results: z.ZodArray<z.ZodObject<{
|
|
5199
5225
|
id: z.ZodString;
|
|
5200
5226
|
workspace: z.ZodString;
|
|
5227
|
+
workspace_name: z.ZodString;
|
|
5201
5228
|
name: z.ZodString;
|
|
5202
5229
|
key_prefix: z.ZodString;
|
|
5203
5230
|
last_used: z.ZodNullable<z.ZodString>;
|
|
@@ -5981,12 +6008,15 @@ interface APIOptions {
|
|
|
5981
6008
|
retryConfig?: RetryConfig;
|
|
5982
6009
|
/** Logger configuration */
|
|
5983
6010
|
loggerConfig?: Partial<LoggerConfig>;
|
|
6011
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
6012
|
+
locale?: string;
|
|
5984
6013
|
}
|
|
5985
6014
|
declare class API {
|
|
5986
6015
|
private baseUrl;
|
|
5987
6016
|
private _client;
|
|
5988
6017
|
private _token;
|
|
5989
6018
|
private _refreshToken;
|
|
6019
|
+
private _locale;
|
|
5990
6020
|
private storage;
|
|
5991
6021
|
private options?;
|
|
5992
6022
|
system_oauth: SystemOauth;
|
|
@@ -6026,6 +6056,15 @@ declare class API {
|
|
|
6026
6056
|
* Get current base URL
|
|
6027
6057
|
*/
|
|
6028
6058
|
getBaseUrl(): string;
|
|
6059
|
+
/**
|
|
6060
|
+
* Set locale for Accept-Language header
|
|
6061
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
6062
|
+
*/
|
|
6063
|
+
setLocale(locale: string | null): void;
|
|
6064
|
+
/**
|
|
6065
|
+
* Get current locale
|
|
6066
|
+
*/
|
|
6067
|
+
getLocale(): string | null;
|
|
6029
6068
|
/**
|
|
6030
6069
|
* Get OpenAPI schema path
|
|
6031
6070
|
* @returns Path to the OpenAPI schema JSON file
|
package/dist/index.js
CHANGED
|
@@ -1909,11 +1909,25 @@ Method: POST`);
|
|
|
1909
1909
|
// src/api/generated/machines/index.ts
|
|
1910
1910
|
var TOKEN_KEY = "auth_token";
|
|
1911
1911
|
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
1912
|
+
function detectLocale() {
|
|
1913
|
+
try {
|
|
1914
|
+
if (typeof document !== "undefined") {
|
|
1915
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
1916
|
+
if (match) return match[1];
|
|
1917
|
+
}
|
|
1918
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
1919
|
+
return navigator.language;
|
|
1920
|
+
}
|
|
1921
|
+
} catch {
|
|
1922
|
+
}
|
|
1923
|
+
return null;
|
|
1924
|
+
}
|
|
1912
1925
|
var API = class {
|
|
1913
1926
|
baseUrl;
|
|
1914
1927
|
_client;
|
|
1915
1928
|
_token = null;
|
|
1916
1929
|
_refreshToken = null;
|
|
1930
|
+
_locale = null;
|
|
1917
1931
|
storage;
|
|
1918
1932
|
options;
|
|
1919
1933
|
// Sub-clients
|
|
@@ -1924,6 +1938,7 @@ var API = class {
|
|
|
1924
1938
|
this.options = options;
|
|
1925
1939
|
const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
|
|
1926
1940
|
this.storage = options?.storage || new LocalStorageAdapter(logger);
|
|
1941
|
+
this._locale = options?.locale || null;
|
|
1927
1942
|
this._loadTokensFromStorage();
|
|
1928
1943
|
this._client = new APIClient(this.baseUrl, {
|
|
1929
1944
|
retryConfig: this.options?.retryConfig,
|
|
@@ -1952,11 +1967,13 @@ var API = class {
|
|
|
1952
1967
|
const originalRequest = this._client.request.bind(this._client);
|
|
1953
1968
|
this._client.request = async (method, path, options) => {
|
|
1954
1969
|
const token = this.getToken();
|
|
1970
|
+
const locale = this._locale || detectLocale();
|
|
1955
1971
|
const mergedOptions = {
|
|
1956
1972
|
...options,
|
|
1957
1973
|
headers: {
|
|
1958
1974
|
...options?.headers || {},
|
|
1959
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
1975
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
1976
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
1960
1977
|
}
|
|
1961
1978
|
};
|
|
1962
1979
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -2018,6 +2035,19 @@ var API = class {
|
|
|
2018
2035
|
getBaseUrl() {
|
|
2019
2036
|
return this.baseUrl;
|
|
2020
2037
|
}
|
|
2038
|
+
/**
|
|
2039
|
+
* Set locale for Accept-Language header
|
|
2040
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
2041
|
+
*/
|
|
2042
|
+
setLocale(locale) {
|
|
2043
|
+
this._locale = locale;
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Get current locale
|
|
2047
|
+
*/
|
|
2048
|
+
getLocale() {
|
|
2049
|
+
return this._locale;
|
|
2050
|
+
}
|
|
2021
2051
|
/**
|
|
2022
2052
|
* Get OpenAPI schema path
|
|
2023
2053
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -4055,11 +4085,25 @@ async function getWorkspacesWorkspacesStatsRetrieve(id, client) {
|
|
|
4055
4085
|
// src/api/generated/workspaces/index.ts
|
|
4056
4086
|
var TOKEN_KEY2 = "auth_token";
|
|
4057
4087
|
var REFRESH_TOKEN_KEY2 = "refresh_token";
|
|
4088
|
+
function detectLocale2() {
|
|
4089
|
+
try {
|
|
4090
|
+
if (typeof document !== "undefined") {
|
|
4091
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
4092
|
+
if (match) return match[1];
|
|
4093
|
+
}
|
|
4094
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
4095
|
+
return navigator.language;
|
|
4096
|
+
}
|
|
4097
|
+
} catch {
|
|
4098
|
+
}
|
|
4099
|
+
return null;
|
|
4100
|
+
}
|
|
4058
4101
|
var API2 = class {
|
|
4059
4102
|
baseUrl;
|
|
4060
4103
|
_client;
|
|
4061
4104
|
_token = null;
|
|
4062
4105
|
_refreshToken = null;
|
|
4106
|
+
_locale = null;
|
|
4063
4107
|
storage;
|
|
4064
4108
|
options;
|
|
4065
4109
|
// Sub-clients
|
|
@@ -4069,6 +4113,7 @@ var API2 = class {
|
|
|
4069
4113
|
this.options = options;
|
|
4070
4114
|
const logger = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
|
|
4071
4115
|
this.storage = options?.storage || new LocalStorageAdapter2(logger);
|
|
4116
|
+
this._locale = options?.locale || null;
|
|
4072
4117
|
this._loadTokensFromStorage();
|
|
4073
4118
|
this._client = new APIClient2(this.baseUrl, {
|
|
4074
4119
|
retryConfig: this.options?.retryConfig,
|
|
@@ -4095,11 +4140,13 @@ var API2 = class {
|
|
|
4095
4140
|
const originalRequest = this._client.request.bind(this._client);
|
|
4096
4141
|
this._client.request = async (method, path, options) => {
|
|
4097
4142
|
const token = this.getToken();
|
|
4143
|
+
const locale = this._locale || detectLocale2();
|
|
4098
4144
|
const mergedOptions = {
|
|
4099
4145
|
...options,
|
|
4100
4146
|
headers: {
|
|
4101
4147
|
...options?.headers || {},
|
|
4102
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
4148
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
4149
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
4103
4150
|
}
|
|
4104
4151
|
};
|
|
4105
4152
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -4161,6 +4208,19 @@ var API2 = class {
|
|
|
4161
4208
|
getBaseUrl() {
|
|
4162
4209
|
return this.baseUrl;
|
|
4163
4210
|
}
|
|
4211
|
+
/**
|
|
4212
|
+
* Set locale for Accept-Language header
|
|
4213
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
4214
|
+
*/
|
|
4215
|
+
setLocale(locale) {
|
|
4216
|
+
this._locale = locale;
|
|
4217
|
+
}
|
|
4218
|
+
/**
|
|
4219
|
+
* Get current locale
|
|
4220
|
+
*/
|
|
4221
|
+
getLocale() {
|
|
4222
|
+
return this._locale;
|
|
4223
|
+
}
|
|
4164
4224
|
/**
|
|
4165
4225
|
* Get OpenAPI schema path
|
|
4166
4226
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -5255,6 +5315,7 @@ import { z as z36 } from "zod";
|
|
|
5255
5315
|
var ApiKeySchema = z36.object({
|
|
5256
5316
|
id: z36.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5257
5317
|
workspace: z36.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5318
|
+
workspace_name: z36.string(),
|
|
5258
5319
|
name: z36.string(),
|
|
5259
5320
|
key_prefix: z36.string(),
|
|
5260
5321
|
last_used: z36.string().datetime({ offset: true }).nullable(),
|
|
@@ -6317,11 +6378,25 @@ Method: POST`);
|
|
|
6317
6378
|
// src/api/generated/system/index.ts
|
|
6318
6379
|
var TOKEN_KEY3 = "auth_token";
|
|
6319
6380
|
var REFRESH_TOKEN_KEY3 = "refresh_token";
|
|
6381
|
+
function detectLocale3() {
|
|
6382
|
+
try {
|
|
6383
|
+
if (typeof document !== "undefined") {
|
|
6384
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
6385
|
+
if (match) return match[1];
|
|
6386
|
+
}
|
|
6387
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
6388
|
+
return navigator.language;
|
|
6389
|
+
}
|
|
6390
|
+
} catch {
|
|
6391
|
+
}
|
|
6392
|
+
return null;
|
|
6393
|
+
}
|
|
6320
6394
|
var API3 = class {
|
|
6321
6395
|
baseUrl;
|
|
6322
6396
|
_client;
|
|
6323
6397
|
_token = null;
|
|
6324
6398
|
_refreshToken = null;
|
|
6399
|
+
_locale = null;
|
|
6325
6400
|
storage;
|
|
6326
6401
|
options;
|
|
6327
6402
|
// Sub-clients
|
|
@@ -6332,6 +6407,7 @@ var API3 = class {
|
|
|
6332
6407
|
this.options = options;
|
|
6333
6408
|
const logger = options?.loggerConfig ? new APILogger3(options.loggerConfig) : void 0;
|
|
6334
6409
|
this.storage = options?.storage || new LocalStorageAdapter3(logger);
|
|
6410
|
+
this._locale = options?.locale || null;
|
|
6335
6411
|
this._loadTokensFromStorage();
|
|
6336
6412
|
this._client = new APIClient3(this.baseUrl, {
|
|
6337
6413
|
retryConfig: this.options?.retryConfig,
|
|
@@ -6360,11 +6436,13 @@ var API3 = class {
|
|
|
6360
6436
|
const originalRequest = this._client.request.bind(this._client);
|
|
6361
6437
|
this._client.request = async (method, path, options) => {
|
|
6362
6438
|
const token = this.getToken();
|
|
6439
|
+
const locale = this._locale || detectLocale3();
|
|
6363
6440
|
const mergedOptions = {
|
|
6364
6441
|
...options,
|
|
6365
6442
|
headers: {
|
|
6366
6443
|
...options?.headers || {},
|
|
6367
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
6444
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
6445
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
6368
6446
|
}
|
|
6369
6447
|
};
|
|
6370
6448
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -6426,6 +6504,19 @@ var API3 = class {
|
|
|
6426
6504
|
getBaseUrl() {
|
|
6427
6505
|
return this.baseUrl;
|
|
6428
6506
|
}
|
|
6507
|
+
/**
|
|
6508
|
+
* Set locale for Accept-Language header
|
|
6509
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
6510
|
+
*/
|
|
6511
|
+
setLocale(locale) {
|
|
6512
|
+
this._locale = locale;
|
|
6513
|
+
}
|
|
6514
|
+
/**
|
|
6515
|
+
* Get current locale
|
|
6516
|
+
*/
|
|
6517
|
+
getLocale() {
|
|
6518
|
+
return this._locale;
|
|
6519
|
+
}
|
|
6429
6520
|
/**
|
|
6430
6521
|
* Get OpenAPI schema path
|
|
6431
6522
|
* @returns Path to the OpenAPI schema JSON file
|