@djangocfg/api 2.1.88 → 2.1.90
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/auth-server.cjs +335 -320
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +335 -320
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +464 -394
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +464 -394
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +460 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +26 -6
- package/dist/clients.d.ts +26 -6
- package/dist/clients.mjs +460 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +130 -105
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +24 -4
- package/dist/hooks.d.ts +24 -4
- package/dist/hooks.mjs +130 -105
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +373 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -8
- package/dist/index.d.ts +54 -8
- package/dist/index.mjs +373 -311
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AccountsContext.tsx +3 -3
- package/src/auth/hooks/useTokenRefresh.ts +4 -10
- package/src/auth/middlewares/tokenRefresh.ts +4 -15
- package/src/generated/cfg_accounts/CLAUDE.md +2 -9
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts/models.ts +0 -1
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
- package/src/generated/cfg_accounts/client.ts +18 -0
- package/src/generated/cfg_accounts/index.ts +3 -1
- package/src/generated/cfg_accounts/schema.json +2 -2
- package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
- package/src/generated/cfg_centrifugo/client.ts +18 -0
- package/src/generated/cfg_centrifugo/index.ts +3 -1
- package/src/generated/cfg_totp/CLAUDE.md +1 -8
- package/src/generated/cfg_totp/client.ts +18 -0
- package/src/generated/cfg_totp/index.ts +3 -1
- package/src/generated/cfg_totp/totp/models.ts +2 -0
- package/src/generated/cfg_webpush/CLAUDE.md +1 -8
- package/src/generated/cfg_webpush/client.ts +18 -0
- package/src/generated/cfg_webpush/index.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
AuthTypes: () => models_exports,
|
|
39
39
|
BaseClient: () => BaseClient,
|
|
40
40
|
CentrifugoTokenSchema: () => CentrifugoTokenSchema,
|
|
41
|
+
CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
|
|
41
42
|
CfgAccountsTypes: () => cfg_accounts_exports,
|
|
42
43
|
CookieStorageAdapter: () => CookieStorageAdapter,
|
|
43
44
|
DEFAULT_RETRY_CONFIG: () => DEFAULT_RETRY_CONFIG,
|
|
@@ -112,6 +113,7 @@ __export(cfg_accounts_exports, {
|
|
|
112
113
|
AccountsTypes: () => models_exports4,
|
|
113
114
|
AuthTypes: () => models_exports,
|
|
114
115
|
CentrifugoTokenSchema: () => CentrifugoTokenSchema,
|
|
116
|
+
CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
|
|
115
117
|
CookieStorageAdapter: () => CookieStorageAdapter,
|
|
116
118
|
DEFAULT_RETRY_CONFIG: () => DEFAULT_RETRY_CONFIG,
|
|
117
119
|
Enums: () => enums_exports,
|
|
@@ -275,7 +277,9 @@ var UserProfile = class {
|
|
|
275
277
|
* multipart/form-data with 'avatar' field.
|
|
276
278
|
*/
|
|
277
279
|
async accountsProfileAvatarCreate(data) {
|
|
278
|
-
const
|
|
280
|
+
const formData = new FormData();
|
|
281
|
+
formData.append("avatar", data.avatar);
|
|
282
|
+
const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
|
|
279
283
|
return response;
|
|
280
284
|
}
|
|
281
285
|
/**
|
|
@@ -717,8 +721,10 @@ var APIClient = class {
|
|
|
717
721
|
constructor(baseUrl, options) {
|
|
718
722
|
this.logger = null;
|
|
719
723
|
this.retryConfig = null;
|
|
724
|
+
this.tokenGetter = null;
|
|
720
725
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
721
726
|
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
727
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
722
728
|
if (options?.loggerConfig !== void 0) {
|
|
723
729
|
this.logger = new APILogger(options.loggerConfig);
|
|
724
730
|
}
|
|
@@ -747,6 +753,19 @@ var APIClient = class {
|
|
|
747
753
|
}
|
|
748
754
|
return null;
|
|
749
755
|
}
|
|
756
|
+
/**
|
|
757
|
+
* Get the base URL for building streaming/download URLs.
|
|
758
|
+
*/
|
|
759
|
+
getBaseUrl() {
|
|
760
|
+
return this.baseUrl;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
764
|
+
* Returns null if no token getter is configured or no token is available.
|
|
765
|
+
*/
|
|
766
|
+
getToken() {
|
|
767
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
768
|
+
}
|
|
750
769
|
/**
|
|
751
770
|
* Make HTTP request with Django CSRF and session handling.
|
|
752
771
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -1062,6 +1081,7 @@ var OTPVerifyRequestChannel = /* @__PURE__ */ ((OTPVerifyRequestChannel2) => {
|
|
|
1062
1081
|
var schemas_exports = {};
|
|
1063
1082
|
__export(schemas_exports, {
|
|
1064
1083
|
CentrifugoTokenSchema: () => CentrifugoTokenSchema,
|
|
1084
|
+
CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
|
|
1065
1085
|
OAuthAuthorizeRequestRequestSchema: () => OAuthAuthorizeRequestRequestSchema,
|
|
1066
1086
|
OAuthAuthorizeResponseSchema: () => OAuthAuthorizeResponseSchema,
|
|
1067
1087
|
OAuthCallbackRequestRequestSchema: () => OAuthCallbackRequestRequestSchema,
|
|
@@ -1091,168 +1111,174 @@ var CentrifugoTokenSchema = import_zod.z.object({
|
|
|
1091
1111
|
channels: import_zod.z.array(import_zod.z.string())
|
|
1092
1112
|
});
|
|
1093
1113
|
|
|
1094
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1114
|
+
// src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
|
|
1095
1115
|
var import_zod2 = require("zod");
|
|
1096
|
-
var
|
|
1097
|
-
|
|
1098
|
-
source_url: import_zod2.z.union([import_zod2.z.url(), import_zod2.z.literal("")]).optional()
|
|
1116
|
+
var CfgAccountsProfileAvatarCreateRequestSchema = import_zod2.z.object({
|
|
1117
|
+
avatar: import_zod2.z.union([import_zod2.z.instanceof(File), import_zod2.z.instanceof(Blob)])
|
|
1099
1118
|
});
|
|
1100
1119
|
|
|
1101
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1120
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
|
|
1102
1121
|
var import_zod3 = require("zod");
|
|
1103
|
-
var
|
|
1104
|
-
|
|
1105
|
-
|
|
1122
|
+
var OAuthAuthorizeRequestRequestSchema = import_zod3.z.object({
|
|
1123
|
+
redirect_uri: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional(),
|
|
1124
|
+
source_url: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional()
|
|
1106
1125
|
});
|
|
1107
1126
|
|
|
1108
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1127
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
|
|
1109
1128
|
var import_zod4 = require("zod");
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1112
|
-
state: import_zod4.z.string()
|
|
1113
|
-
redirect_uri: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]).optional()
|
|
1129
|
+
var OAuthAuthorizeResponseSchema = import_zod4.z.object({
|
|
1130
|
+
authorization_url: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]),
|
|
1131
|
+
state: import_zod4.z.string()
|
|
1114
1132
|
});
|
|
1115
1133
|
|
|
1116
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1134
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
|
|
1117
1135
|
var import_zod5 = require("zod");
|
|
1118
|
-
var
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
provider_username: import_zod5.z.string(),
|
|
1123
|
-
provider_email: import_zod5.z.email(),
|
|
1124
|
-
provider_avatar_url: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]),
|
|
1125
|
-
connected_at: import_zod5.z.iso.datetime(),
|
|
1126
|
-
last_login_at: import_zod5.z.iso.datetime()
|
|
1136
|
+
var OAuthCallbackRequestRequestSchema = import_zod5.z.object({
|
|
1137
|
+
code: import_zod5.z.string().min(10).max(500),
|
|
1138
|
+
state: import_zod5.z.string().min(20).max(100),
|
|
1139
|
+
redirect_uri: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]).optional()
|
|
1127
1140
|
});
|
|
1128
1141
|
|
|
1129
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1142
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
|
|
1130
1143
|
var import_zod6 = require("zod");
|
|
1131
|
-
var
|
|
1132
|
-
|
|
1144
|
+
var OAuthConnectionSchema = import_zod6.z.object({
|
|
1145
|
+
id: import_zod6.z.int(),
|
|
1146
|
+
provider: import_zod6.z.nativeEnum(OAuthConnectionProvider),
|
|
1147
|
+
provider_display: import_zod6.z.string(),
|
|
1148
|
+
provider_username: import_zod6.z.string(),
|
|
1149
|
+
provider_email: import_zod6.z.email(),
|
|
1150
|
+
provider_avatar_url: import_zod6.z.union([import_zod6.z.url(), import_zod6.z.literal("")]),
|
|
1151
|
+
connected_at: import_zod6.z.iso.datetime(),
|
|
1152
|
+
last_login_at: import_zod6.z.iso.datetime()
|
|
1133
1153
|
});
|
|
1134
1154
|
|
|
1135
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1155
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
|
|
1136
1156
|
var import_zod7 = require("zod");
|
|
1137
|
-
var
|
|
1138
|
-
|
|
1139
|
-
error_description: import_zod7.z.string().optional()
|
|
1157
|
+
var OAuthDisconnectRequestRequestSchema = import_zod7.z.object({
|
|
1158
|
+
provider: import_zod7.z.nativeEnum(OAuthDisconnectRequestRequestProvider)
|
|
1140
1159
|
});
|
|
1141
1160
|
|
|
1142
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1161
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
|
|
1143
1162
|
var import_zod8 = require("zod");
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1163
|
+
var OAuthErrorSchema = import_zod8.z.object({
|
|
1164
|
+
error: import_zod8.z.string(),
|
|
1165
|
+
error_description: import_zod8.z.string().optional()
|
|
1146
1166
|
});
|
|
1147
1167
|
|
|
1148
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1168
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
|
|
1149
1169
|
var import_zod9 = require("zod");
|
|
1150
|
-
var
|
|
1151
|
-
|
|
1152
|
-
session_id: import_zod9.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
1153
|
-
access: import_zod9.z.string().nullable().optional(),
|
|
1154
|
-
refresh: import_zod9.z.string().nullable().optional(),
|
|
1155
|
-
user: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()).nullable().optional(),
|
|
1156
|
-
is_new_user: import_zod9.z.boolean(),
|
|
1157
|
-
is_new_connection: import_zod9.z.boolean(),
|
|
1158
|
-
should_prompt_2fa: import_zod9.z.boolean().optional()
|
|
1170
|
+
var OAuthProvidersResponseSchema = import_zod9.z.object({
|
|
1171
|
+
providers: import_zod9.z.array(import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()))
|
|
1159
1172
|
});
|
|
1160
1173
|
|
|
1161
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1174
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
|
|
1162
1175
|
var import_zod10 = require("zod");
|
|
1163
|
-
var
|
|
1164
|
-
|
|
1176
|
+
var OAuthTokenResponseSchema = import_zod10.z.object({
|
|
1177
|
+
requires_2fa: import_zod10.z.boolean().optional(),
|
|
1178
|
+
session_id: import_zod10.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
1179
|
+
access: import_zod10.z.string().nullable().optional(),
|
|
1180
|
+
refresh: import_zod10.z.string().nullable().optional(),
|
|
1181
|
+
user: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).nullable().optional(),
|
|
1182
|
+
is_new_user: import_zod10.z.boolean(),
|
|
1183
|
+
is_new_connection: import_zod10.z.boolean(),
|
|
1184
|
+
should_prompt_2fa: import_zod10.z.boolean().optional()
|
|
1165
1185
|
});
|
|
1166
1186
|
|
|
1167
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1187
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
1168
1188
|
var import_zod11 = require("zod");
|
|
1169
|
-
var
|
|
1170
|
-
|
|
1171
|
-
channel: import_zod11.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
1172
|
-
source_url: import_zod11.z.union([import_zod11.z.url(), import_zod11.z.literal("")]).optional()
|
|
1189
|
+
var OTPErrorResponseSchema = import_zod11.z.object({
|
|
1190
|
+
error: import_zod11.z.string()
|
|
1173
1191
|
});
|
|
1174
1192
|
|
|
1175
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1193
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
1176
1194
|
var import_zod12 = require("zod");
|
|
1177
|
-
var
|
|
1178
|
-
|
|
1195
|
+
var OTPRequestRequestSchema = import_zod12.z.object({
|
|
1196
|
+
identifier: import_zod12.z.string().min(1),
|
|
1197
|
+
channel: import_zod12.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
1198
|
+
source_url: import_zod12.z.union([import_zod12.z.url(), import_zod12.z.literal("")]).optional()
|
|
1179
1199
|
});
|
|
1180
1200
|
|
|
1181
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1201
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
|
|
1182
1202
|
var import_zod13 = require("zod");
|
|
1183
|
-
var
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1203
|
+
var OTPRequestResponseSchema = import_zod13.z.object({
|
|
1204
|
+
message: import_zod13.z.string()
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
|
|
1208
|
+
var import_zod14 = require("zod");
|
|
1209
|
+
var OTPVerifyRequestSchema = import_zod14.z.object({
|
|
1210
|
+
identifier: import_zod14.z.string().min(1),
|
|
1211
|
+
otp: import_zod14.z.string().min(6).max(6),
|
|
1212
|
+
channel: import_zod14.z.nativeEnum(OTPVerifyRequestChannel).optional(),
|
|
1213
|
+
source_url: import_zod14.z.union([import_zod14.z.url(), import_zod14.z.literal("")]).optional()
|
|
1188
1214
|
});
|
|
1189
1215
|
|
|
1190
1216
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
1191
|
-
var
|
|
1217
|
+
var import_zod16 = require("zod");
|
|
1192
1218
|
|
|
1193
1219
|
// src/generated/cfg_accounts/_utils/schemas/User.schema.ts
|
|
1194
|
-
var
|
|
1195
|
-
var UserSchema =
|
|
1196
|
-
id:
|
|
1197
|
-
email:
|
|
1198
|
-
first_name:
|
|
1199
|
-
last_name:
|
|
1200
|
-
full_name:
|
|
1201
|
-
initials:
|
|
1202
|
-
display_username:
|
|
1203
|
-
company:
|
|
1204
|
-
phone:
|
|
1205
|
-
position:
|
|
1206
|
-
avatar:
|
|
1207
|
-
is_staff:
|
|
1208
|
-
is_superuser:
|
|
1209
|
-
date_joined:
|
|
1210
|
-
last_login:
|
|
1211
|
-
unanswered_messages_count:
|
|
1220
|
+
var import_zod15 = require("zod");
|
|
1221
|
+
var UserSchema = import_zod15.z.object({
|
|
1222
|
+
id: import_zod15.z.int(),
|
|
1223
|
+
email: import_zod15.z.email(),
|
|
1224
|
+
first_name: import_zod15.z.string().max(50).optional(),
|
|
1225
|
+
last_name: import_zod15.z.string().max(50).optional(),
|
|
1226
|
+
full_name: import_zod15.z.string(),
|
|
1227
|
+
initials: import_zod15.z.string(),
|
|
1228
|
+
display_username: import_zod15.z.string(),
|
|
1229
|
+
company: import_zod15.z.string().max(100).optional(),
|
|
1230
|
+
phone: import_zod15.z.string().max(20).optional(),
|
|
1231
|
+
position: import_zod15.z.string().max(100).optional(),
|
|
1232
|
+
avatar: import_zod15.z.union([import_zod15.z.url(), import_zod15.z.literal("")]).nullable(),
|
|
1233
|
+
is_staff: import_zod15.z.boolean(),
|
|
1234
|
+
is_superuser: import_zod15.z.boolean(),
|
|
1235
|
+
date_joined: import_zod15.z.iso.datetime(),
|
|
1236
|
+
last_login: import_zod15.z.iso.datetime().nullable(),
|
|
1237
|
+
unanswered_messages_count: import_zod15.z.int(),
|
|
1212
1238
|
centrifugo: CentrifugoTokenSchema.nullable()
|
|
1213
1239
|
});
|
|
1214
1240
|
|
|
1215
1241
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
1216
|
-
var OTPVerifyResponseSchema =
|
|
1217
|
-
requires_2fa:
|
|
1218
|
-
session_id:
|
|
1219
|
-
refresh:
|
|
1220
|
-
access:
|
|
1242
|
+
var OTPVerifyResponseSchema = import_zod16.z.object({
|
|
1243
|
+
requires_2fa: import_zod16.z.boolean().optional(),
|
|
1244
|
+
session_id: import_zod16.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
1245
|
+
refresh: import_zod16.z.string().nullable().optional(),
|
|
1246
|
+
access: import_zod16.z.string().nullable().optional(),
|
|
1221
1247
|
user: UserSchema.nullable().optional(),
|
|
1222
|
-
should_prompt_2fa:
|
|
1248
|
+
should_prompt_2fa: import_zod16.z.boolean().optional()
|
|
1223
1249
|
});
|
|
1224
1250
|
|
|
1225
1251
|
// src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
|
|
1226
|
-
var
|
|
1227
|
-
var PatchedUserProfileUpdateRequestSchema =
|
|
1228
|
-
first_name:
|
|
1229
|
-
last_name:
|
|
1230
|
-
company:
|
|
1231
|
-
phone:
|
|
1232
|
-
position:
|
|
1252
|
+
var import_zod17 = require("zod");
|
|
1253
|
+
var PatchedUserProfileUpdateRequestSchema = import_zod17.z.object({
|
|
1254
|
+
first_name: import_zod17.z.string().max(50).optional(),
|
|
1255
|
+
last_name: import_zod17.z.string().max(50).optional(),
|
|
1256
|
+
company: import_zod17.z.string().max(100).optional(),
|
|
1257
|
+
phone: import_zod17.z.string().max(20).optional(),
|
|
1258
|
+
position: import_zod17.z.string().max(100).optional()
|
|
1233
1259
|
});
|
|
1234
1260
|
|
|
1235
1261
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
|
|
1236
|
-
var
|
|
1237
|
-
var TokenRefreshSchema =
|
|
1238
|
-
access:
|
|
1239
|
-
refresh:
|
|
1262
|
+
var import_zod18 = require("zod");
|
|
1263
|
+
var TokenRefreshSchema = import_zod18.z.object({
|
|
1264
|
+
access: import_zod18.z.string(),
|
|
1265
|
+
refresh: import_zod18.z.string()
|
|
1240
1266
|
});
|
|
1241
1267
|
|
|
1242
1268
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
|
|
1243
|
-
var
|
|
1244
|
-
var TokenRefreshRequestSchema =
|
|
1245
|
-
refresh:
|
|
1269
|
+
var import_zod19 = require("zod");
|
|
1270
|
+
var TokenRefreshRequestSchema = import_zod19.z.object({
|
|
1271
|
+
refresh: import_zod19.z.string().min(1)
|
|
1246
1272
|
});
|
|
1247
1273
|
|
|
1248
1274
|
// src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
|
|
1249
|
-
var
|
|
1250
|
-
var UserProfileUpdateRequestSchema =
|
|
1251
|
-
first_name:
|
|
1252
|
-
last_name:
|
|
1253
|
-
company:
|
|
1254
|
-
phone:
|
|
1255
|
-
position:
|
|
1275
|
+
var import_zod20 = require("zod");
|
|
1276
|
+
var UserProfileUpdateRequestSchema = import_zod20.z.object({
|
|
1277
|
+
first_name: import_zod20.z.string().max(50).optional(),
|
|
1278
|
+
last_name: import_zod20.z.string().max(50).optional(),
|
|
1279
|
+
company: import_zod20.z.string().max(100).optional(),
|
|
1280
|
+
phone: import_zod20.z.string().max(20).optional(),
|
|
1281
|
+
position: import_zod20.z.string().max(100).optional()
|
|
1256
1282
|
});
|
|
1257
1283
|
|
|
1258
1284
|
// src/generated/cfg_accounts/validation-events.ts
|
|
@@ -1940,7 +1966,8 @@ var API = class {
|
|
|
1940
1966
|
this._loadTokensFromStorage();
|
|
1941
1967
|
this._client = new APIClient(this.baseUrl, {
|
|
1942
1968
|
retryConfig: this.options?.retryConfig,
|
|
1943
|
-
loggerConfig: this.options?.loggerConfig
|
|
1969
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1970
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1944
1971
|
});
|
|
1945
1972
|
this._injectAuthHeader();
|
|
1946
1973
|
this.auth = this._client.auth;
|
|
@@ -1958,7 +1985,8 @@ var API = class {
|
|
|
1958
1985
|
_reinitClients() {
|
|
1959
1986
|
this._client = new APIClient(this.baseUrl, {
|
|
1960
1987
|
retryConfig: this.options?.retryConfig,
|
|
1961
|
-
loggerConfig: this.options?.loggerConfig
|
|
1988
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1989
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1962
1990
|
});
|
|
1963
1991
|
this._injectAuthHeader();
|
|
1964
1992
|
this.auth = this._client.auth;
|
|
@@ -2630,8 +2658,10 @@ var APIClient2 = class {
|
|
|
2630
2658
|
constructor(baseUrl, options) {
|
|
2631
2659
|
this.logger = null;
|
|
2632
2660
|
this.retryConfig = null;
|
|
2661
|
+
this.tokenGetter = null;
|
|
2633
2662
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
2634
2663
|
this.httpClient = options?.httpClient || new FetchAdapter2();
|
|
2664
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
2635
2665
|
if (options?.loggerConfig !== void 0) {
|
|
2636
2666
|
this.logger = new APILogger2(options.loggerConfig);
|
|
2637
2667
|
}
|
|
@@ -2660,6 +2690,19 @@ var APIClient2 = class {
|
|
|
2660
2690
|
}
|
|
2661
2691
|
return null;
|
|
2662
2692
|
}
|
|
2693
|
+
/**
|
|
2694
|
+
* Get the base URL for building streaming/download URLs.
|
|
2695
|
+
*/
|
|
2696
|
+
getBaseUrl() {
|
|
2697
|
+
return this.baseUrl;
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
2701
|
+
* Returns null if no token getter is configured or no token is available.
|
|
2702
|
+
*/
|
|
2703
|
+
getToken() {
|
|
2704
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
2705
|
+
}
|
|
2663
2706
|
/**
|
|
2664
2707
|
* Make HTTP request with Django CSRF and session handling.
|
|
2665
2708
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -2872,320 +2915,320 @@ var LocalStorageAdapter2 = class {
|
|
|
2872
2915
|
};
|
|
2873
2916
|
|
|
2874
2917
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
|
|
2875
|
-
var
|
|
2876
|
-
var CentrifugoChannelInfoSchema =
|
|
2877
|
-
num_clients:
|
|
2918
|
+
var import_zod21 = require("zod");
|
|
2919
|
+
var CentrifugoChannelInfoSchema = import_zod21.z.object({
|
|
2920
|
+
num_clients: import_zod21.z.int()
|
|
2878
2921
|
});
|
|
2879
2922
|
|
|
2880
2923
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
|
|
2881
|
-
var
|
|
2882
|
-
var CentrifugoChannelsRequestRequestSchema =
|
|
2883
|
-
pattern:
|
|
2924
|
+
var import_zod22 = require("zod");
|
|
2925
|
+
var CentrifugoChannelsRequestRequestSchema = import_zod22.z.object({
|
|
2926
|
+
pattern: import_zod22.z.string().nullable().optional()
|
|
2884
2927
|
});
|
|
2885
2928
|
|
|
2886
2929
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2887
|
-
var
|
|
2930
|
+
var import_zod25 = require("zod");
|
|
2888
2931
|
|
|
2889
2932
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
|
|
2890
|
-
var
|
|
2891
|
-
var CentrifugoChannelsResultSchema =
|
|
2892
|
-
channels:
|
|
2933
|
+
var import_zod23 = require("zod");
|
|
2934
|
+
var CentrifugoChannelsResultSchema = import_zod23.z.object({
|
|
2935
|
+
channels: import_zod23.z.record(import_zod23.z.string(), CentrifugoChannelInfoSchema)
|
|
2893
2936
|
});
|
|
2894
2937
|
|
|
2895
2938
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
|
|
2896
|
-
var
|
|
2897
|
-
var CentrifugoErrorSchema =
|
|
2898
|
-
code:
|
|
2899
|
-
message:
|
|
2939
|
+
var import_zod24 = require("zod");
|
|
2940
|
+
var CentrifugoErrorSchema = import_zod24.z.object({
|
|
2941
|
+
code: import_zod24.z.int().optional(),
|
|
2942
|
+
message: import_zod24.z.string().optional()
|
|
2900
2943
|
});
|
|
2901
2944
|
|
|
2902
2945
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2903
|
-
var CentrifugoChannelsResponseSchema =
|
|
2946
|
+
var CentrifugoChannelsResponseSchema = import_zod25.z.object({
|
|
2904
2947
|
error: CentrifugoErrorSchema.optional(),
|
|
2905
2948
|
result: CentrifugoChannelsResultSchema.optional()
|
|
2906
2949
|
});
|
|
2907
2950
|
|
|
2908
2951
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
|
|
2909
|
-
var
|
|
2910
|
-
var CentrifugoClientInfoSchema =
|
|
2911
|
-
user:
|
|
2912
|
-
client:
|
|
2913
|
-
conn_info:
|
|
2914
|
-
chan_info:
|
|
2952
|
+
var import_zod26 = require("zod");
|
|
2953
|
+
var CentrifugoClientInfoSchema = import_zod26.z.object({
|
|
2954
|
+
user: import_zod26.z.string(),
|
|
2955
|
+
client: import_zod26.z.string(),
|
|
2956
|
+
conn_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional(),
|
|
2957
|
+
chan_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional()
|
|
2915
2958
|
});
|
|
2916
2959
|
|
|
2917
2960
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
|
|
2918
|
-
var
|
|
2919
|
-
var CentrifugoHealthCheckSchema =
|
|
2920
|
-
status:
|
|
2921
|
-
wrapper_url:
|
|
2922
|
-
has_api_key:
|
|
2923
|
-
timestamp:
|
|
2961
|
+
var import_zod27 = require("zod");
|
|
2962
|
+
var CentrifugoHealthCheckSchema = import_zod27.z.object({
|
|
2963
|
+
status: import_zod27.z.string(),
|
|
2964
|
+
wrapper_url: import_zod27.z.string(),
|
|
2965
|
+
has_api_key: import_zod27.z.boolean(),
|
|
2966
|
+
timestamp: import_zod27.z.string()
|
|
2924
2967
|
});
|
|
2925
2968
|
|
|
2926
2969
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2927
|
-
var
|
|
2970
|
+
var import_zod29 = require("zod");
|
|
2928
2971
|
|
|
2929
2972
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
|
|
2930
|
-
var
|
|
2931
|
-
var CentrifugoStreamPositionSchema =
|
|
2932
|
-
offset:
|
|
2933
|
-
epoch:
|
|
2973
|
+
var import_zod28 = require("zod");
|
|
2974
|
+
var CentrifugoStreamPositionSchema = import_zod28.z.object({
|
|
2975
|
+
offset: import_zod28.z.int(),
|
|
2976
|
+
epoch: import_zod28.z.string()
|
|
2934
2977
|
});
|
|
2935
2978
|
|
|
2936
2979
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2937
|
-
var CentrifugoHistoryRequestRequestSchema =
|
|
2938
|
-
channel:
|
|
2939
|
-
limit:
|
|
2980
|
+
var CentrifugoHistoryRequestRequestSchema = import_zod29.z.object({
|
|
2981
|
+
channel: import_zod29.z.string(),
|
|
2982
|
+
limit: import_zod29.z.int().nullable().optional(),
|
|
2940
2983
|
since: CentrifugoStreamPositionSchema.optional(),
|
|
2941
|
-
reverse:
|
|
2984
|
+
reverse: import_zod29.z.boolean().nullable().optional()
|
|
2942
2985
|
});
|
|
2943
2986
|
|
|
2944
2987
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2945
|
-
var
|
|
2988
|
+
var import_zod32 = require("zod");
|
|
2946
2989
|
|
|
2947
2990
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2948
|
-
var
|
|
2991
|
+
var import_zod31 = require("zod");
|
|
2949
2992
|
|
|
2950
2993
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
|
|
2951
|
-
var
|
|
2952
|
-
var CentrifugoPublicationSchema =
|
|
2953
|
-
data:
|
|
2994
|
+
var import_zod30 = require("zod");
|
|
2995
|
+
var CentrifugoPublicationSchema = import_zod30.z.object({
|
|
2996
|
+
data: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()),
|
|
2954
2997
|
info: CentrifugoClientInfoSchema.optional(),
|
|
2955
|
-
offset:
|
|
2956
|
-
tags:
|
|
2998
|
+
offset: import_zod30.z.int(),
|
|
2999
|
+
tags: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()).nullable().optional()
|
|
2957
3000
|
});
|
|
2958
3001
|
|
|
2959
3002
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2960
|
-
var CentrifugoHistoryResultSchema =
|
|
2961
|
-
publications:
|
|
2962
|
-
epoch:
|
|
2963
|
-
offset:
|
|
3003
|
+
var CentrifugoHistoryResultSchema = import_zod31.z.object({
|
|
3004
|
+
publications: import_zod31.z.array(CentrifugoPublicationSchema),
|
|
3005
|
+
epoch: import_zod31.z.string(),
|
|
3006
|
+
offset: import_zod31.z.int()
|
|
2964
3007
|
});
|
|
2965
3008
|
|
|
2966
3009
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2967
|
-
var CentrifugoHistoryResponseSchema =
|
|
3010
|
+
var CentrifugoHistoryResponseSchema = import_zod32.z.object({
|
|
2968
3011
|
error: CentrifugoErrorSchema.optional(),
|
|
2969
3012
|
result: CentrifugoHistoryResultSchema.optional()
|
|
2970
3013
|
});
|
|
2971
3014
|
|
|
2972
3015
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2973
|
-
var
|
|
3016
|
+
var import_zod37 = require("zod");
|
|
2974
3017
|
|
|
2975
3018
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2976
|
-
var
|
|
3019
|
+
var import_zod36 = require("zod");
|
|
2977
3020
|
|
|
2978
3021
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2979
|
-
var
|
|
3022
|
+
var import_zod35 = require("zod");
|
|
2980
3023
|
|
|
2981
3024
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
|
|
2982
|
-
var
|
|
2983
|
-
var CentrifugoMetricsSchema =
|
|
2984
|
-
interval:
|
|
2985
|
-
items:
|
|
3025
|
+
var import_zod33 = require("zod");
|
|
3026
|
+
var CentrifugoMetricsSchema = import_zod33.z.object({
|
|
3027
|
+
interval: import_zod33.z.number(),
|
|
3028
|
+
items: import_zod33.z.record(import_zod33.z.string(), import_zod33.z.number())
|
|
2986
3029
|
});
|
|
2987
3030
|
|
|
2988
3031
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
|
|
2989
|
-
var
|
|
2990
|
-
var CentrifugoProcessSchema =
|
|
2991
|
-
cpu:
|
|
2992
|
-
rss:
|
|
3032
|
+
var import_zod34 = require("zod");
|
|
3033
|
+
var CentrifugoProcessSchema = import_zod34.z.object({
|
|
3034
|
+
cpu: import_zod34.z.number(),
|
|
3035
|
+
rss: import_zod34.z.int()
|
|
2993
3036
|
});
|
|
2994
3037
|
|
|
2995
3038
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2996
|
-
var CentrifugoNodeInfoSchema =
|
|
2997
|
-
uid:
|
|
2998
|
-
name:
|
|
2999
|
-
version:
|
|
3000
|
-
num_clients:
|
|
3001
|
-
num_users:
|
|
3002
|
-
num_channels:
|
|
3003
|
-
uptime:
|
|
3004
|
-
num_subs:
|
|
3039
|
+
var CentrifugoNodeInfoSchema = import_zod35.z.object({
|
|
3040
|
+
uid: import_zod35.z.string(),
|
|
3041
|
+
name: import_zod35.z.string(),
|
|
3042
|
+
version: import_zod35.z.string(),
|
|
3043
|
+
num_clients: import_zod35.z.int(),
|
|
3044
|
+
num_users: import_zod35.z.int(),
|
|
3045
|
+
num_channels: import_zod35.z.int(),
|
|
3046
|
+
uptime: import_zod35.z.int(),
|
|
3047
|
+
num_subs: import_zod35.z.int(),
|
|
3005
3048
|
metrics: CentrifugoMetricsSchema.optional(),
|
|
3006
3049
|
process: CentrifugoProcessSchema.optional()
|
|
3007
3050
|
});
|
|
3008
3051
|
|
|
3009
3052
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
3010
|
-
var CentrifugoInfoResultSchema =
|
|
3011
|
-
nodes:
|
|
3053
|
+
var CentrifugoInfoResultSchema = import_zod36.z.object({
|
|
3054
|
+
nodes: import_zod36.z.array(CentrifugoNodeInfoSchema)
|
|
3012
3055
|
});
|
|
3013
3056
|
|
|
3014
3057
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
3015
|
-
var CentrifugoInfoResponseSchema =
|
|
3058
|
+
var CentrifugoInfoResponseSchema = import_zod37.z.object({
|
|
3016
3059
|
error: CentrifugoErrorSchema.optional(),
|
|
3017
3060
|
result: CentrifugoInfoResultSchema.optional()
|
|
3018
3061
|
});
|
|
3019
3062
|
|
|
3020
3063
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
|
|
3021
|
-
var
|
|
3022
|
-
var CentrifugoOverviewStatsSchema =
|
|
3023
|
-
total:
|
|
3024
|
-
successful:
|
|
3025
|
-
failed:
|
|
3026
|
-
timeout:
|
|
3027
|
-
success_rate:
|
|
3028
|
-
avg_duration_ms:
|
|
3029
|
-
avg_acks_received:
|
|
3030
|
-
period_hours:
|
|
3064
|
+
var import_zod38 = require("zod");
|
|
3065
|
+
var CentrifugoOverviewStatsSchema = import_zod38.z.object({
|
|
3066
|
+
total: import_zod38.z.int(),
|
|
3067
|
+
successful: import_zod38.z.int(),
|
|
3068
|
+
failed: import_zod38.z.int(),
|
|
3069
|
+
timeout: import_zod38.z.int(),
|
|
3070
|
+
success_rate: import_zod38.z.number(),
|
|
3071
|
+
avg_duration_ms: import_zod38.z.number(),
|
|
3072
|
+
avg_acks_received: import_zod38.z.number(),
|
|
3073
|
+
period_hours: import_zod38.z.int()
|
|
3031
3074
|
});
|
|
3032
3075
|
|
|
3033
3076
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
|
|
3034
|
-
var
|
|
3035
|
-
var CentrifugoPresenceRequestRequestSchema =
|
|
3036
|
-
channel:
|
|
3077
|
+
var import_zod39 = require("zod");
|
|
3078
|
+
var CentrifugoPresenceRequestRequestSchema = import_zod39.z.object({
|
|
3079
|
+
channel: import_zod39.z.string()
|
|
3037
3080
|
});
|
|
3038
3081
|
|
|
3039
3082
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
3040
|
-
var
|
|
3083
|
+
var import_zod41 = require("zod");
|
|
3041
3084
|
|
|
3042
3085
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
|
|
3043
|
-
var
|
|
3044
|
-
var CentrifugoPresenceResultSchema =
|
|
3045
|
-
presence:
|
|
3086
|
+
var import_zod40 = require("zod");
|
|
3087
|
+
var CentrifugoPresenceResultSchema = import_zod40.z.object({
|
|
3088
|
+
presence: import_zod40.z.record(import_zod40.z.string(), CentrifugoClientInfoSchema)
|
|
3046
3089
|
});
|
|
3047
3090
|
|
|
3048
3091
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
3049
|
-
var CentrifugoPresenceResponseSchema =
|
|
3092
|
+
var CentrifugoPresenceResponseSchema = import_zod41.z.object({
|
|
3050
3093
|
error: CentrifugoErrorSchema.optional(),
|
|
3051
3094
|
result: CentrifugoPresenceResultSchema.optional()
|
|
3052
3095
|
});
|
|
3053
3096
|
|
|
3054
3097
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
|
|
3055
|
-
var
|
|
3056
|
-
var CentrifugoPresenceStatsRequestRequestSchema =
|
|
3057
|
-
channel:
|
|
3098
|
+
var import_zod42 = require("zod");
|
|
3099
|
+
var CentrifugoPresenceStatsRequestRequestSchema = import_zod42.z.object({
|
|
3100
|
+
channel: import_zod42.z.string()
|
|
3058
3101
|
});
|
|
3059
3102
|
|
|
3060
3103
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
3061
|
-
var
|
|
3104
|
+
var import_zod44 = require("zod");
|
|
3062
3105
|
|
|
3063
3106
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
|
|
3064
|
-
var
|
|
3065
|
-
var CentrifugoPresenceStatsResultSchema =
|
|
3066
|
-
num_clients:
|
|
3067
|
-
num_users:
|
|
3107
|
+
var import_zod43 = require("zod");
|
|
3108
|
+
var CentrifugoPresenceStatsResultSchema = import_zod43.z.object({
|
|
3109
|
+
num_clients: import_zod43.z.int(),
|
|
3110
|
+
num_users: import_zod43.z.int()
|
|
3068
3111
|
});
|
|
3069
3112
|
|
|
3070
3113
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
3071
|
-
var CentrifugoPresenceStatsResponseSchema =
|
|
3114
|
+
var CentrifugoPresenceStatsResponseSchema = import_zod44.z.object({
|
|
3072
3115
|
error: CentrifugoErrorSchema.optional(),
|
|
3073
3116
|
result: CentrifugoPresenceStatsResultSchema.optional()
|
|
3074
3117
|
});
|
|
3075
3118
|
|
|
3076
3119
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
3077
|
-
var
|
|
3120
|
+
var import_zod46 = require("zod");
|
|
3078
3121
|
|
|
3079
3122
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
|
|
3080
|
-
var
|
|
3081
|
-
var ChannelStatsSchema =
|
|
3082
|
-
channel:
|
|
3083
|
-
total:
|
|
3084
|
-
successful:
|
|
3085
|
-
failed:
|
|
3086
|
-
avg_duration_ms:
|
|
3087
|
-
avg_acks:
|
|
3088
|
-
last_activity_at:
|
|
3123
|
+
var import_zod45 = require("zod");
|
|
3124
|
+
var ChannelStatsSchema = import_zod45.z.object({
|
|
3125
|
+
channel: import_zod45.z.string(),
|
|
3126
|
+
total: import_zod45.z.int(),
|
|
3127
|
+
successful: import_zod45.z.int(),
|
|
3128
|
+
failed: import_zod45.z.int(),
|
|
3129
|
+
avg_duration_ms: import_zod45.z.number(),
|
|
3130
|
+
avg_acks: import_zod45.z.number(),
|
|
3131
|
+
last_activity_at: import_zod45.z.string().nullable()
|
|
3089
3132
|
});
|
|
3090
3133
|
|
|
3091
3134
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
3092
|
-
var ChannelListSchema =
|
|
3093
|
-
channels:
|
|
3094
|
-
total_channels:
|
|
3135
|
+
var ChannelListSchema = import_zod46.z.object({
|
|
3136
|
+
channels: import_zod46.z.array(ChannelStatsSchema),
|
|
3137
|
+
total_channels: import_zod46.z.int()
|
|
3095
3138
|
});
|
|
3096
3139
|
|
|
3097
3140
|
// src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
|
|
3098
|
-
var
|
|
3099
|
-
var ConnectionTokenResponseSchema =
|
|
3100
|
-
token:
|
|
3101
|
-
centrifugo_url:
|
|
3102
|
-
expires_at:
|
|
3103
|
-
channels:
|
|
3141
|
+
var import_zod47 = require("zod");
|
|
3142
|
+
var ConnectionTokenResponseSchema = import_zod47.z.object({
|
|
3143
|
+
token: import_zod47.z.string(),
|
|
3144
|
+
centrifugo_url: import_zod47.z.string(),
|
|
3145
|
+
expires_at: import_zod47.z.string(),
|
|
3146
|
+
channels: import_zod47.z.array(import_zod47.z.string())
|
|
3104
3147
|
});
|
|
3105
3148
|
|
|
3106
3149
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
|
|
3107
|
-
var
|
|
3108
|
-
var ManualAckRequestRequestSchema =
|
|
3109
|
-
message_id:
|
|
3110
|
-
client_id:
|
|
3150
|
+
var import_zod48 = require("zod");
|
|
3151
|
+
var ManualAckRequestRequestSchema = import_zod48.z.object({
|
|
3152
|
+
message_id: import_zod48.z.string(),
|
|
3153
|
+
client_id: import_zod48.z.string()
|
|
3111
3154
|
});
|
|
3112
3155
|
|
|
3113
3156
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
|
|
3114
|
-
var
|
|
3115
|
-
var ManualAckResponseSchema =
|
|
3116
|
-
success:
|
|
3117
|
-
message_id:
|
|
3118
|
-
error:
|
|
3157
|
+
var import_zod49 = require("zod");
|
|
3158
|
+
var ManualAckResponseSchema = import_zod49.z.object({
|
|
3159
|
+
success: import_zod49.z.boolean(),
|
|
3160
|
+
message_id: import_zod49.z.string(),
|
|
3161
|
+
error: import_zod49.z.string().nullable().optional()
|
|
3119
3162
|
});
|
|
3120
3163
|
|
|
3121
3164
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
3122
|
-
var
|
|
3165
|
+
var import_zod51 = require("zod");
|
|
3123
3166
|
|
|
3124
3167
|
// src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
|
|
3125
|
-
var
|
|
3126
|
-
var PublishSchema =
|
|
3127
|
-
message_id:
|
|
3128
|
-
channel:
|
|
3129
|
-
status:
|
|
3130
|
-
wait_for_ack:
|
|
3131
|
-
acks_received:
|
|
3132
|
-
acks_expected:
|
|
3133
|
-
duration_ms:
|
|
3134
|
-
created_at:
|
|
3135
|
-
completed_at:
|
|
3136
|
-
error_code:
|
|
3137
|
-
error_message:
|
|
3168
|
+
var import_zod50 = require("zod");
|
|
3169
|
+
var PublishSchema = import_zod50.z.object({
|
|
3170
|
+
message_id: import_zod50.z.string(),
|
|
3171
|
+
channel: import_zod50.z.string(),
|
|
3172
|
+
status: import_zod50.z.string(),
|
|
3173
|
+
wait_for_ack: import_zod50.z.boolean(),
|
|
3174
|
+
acks_received: import_zod50.z.int(),
|
|
3175
|
+
acks_expected: import_zod50.z.int().nullable(),
|
|
3176
|
+
duration_ms: import_zod50.z.number().nullable(),
|
|
3177
|
+
created_at: import_zod50.z.iso.datetime(),
|
|
3178
|
+
completed_at: import_zod50.z.iso.datetime().nullable(),
|
|
3179
|
+
error_code: import_zod50.z.string().nullable(),
|
|
3180
|
+
error_message: import_zod50.z.string().nullable()
|
|
3138
3181
|
});
|
|
3139
3182
|
|
|
3140
3183
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
3141
|
-
var PaginatedPublishListSchema =
|
|
3142
|
-
count:
|
|
3143
|
-
page:
|
|
3144
|
-
pages:
|
|
3145
|
-
page_size:
|
|
3146
|
-
has_next:
|
|
3147
|
-
has_previous:
|
|
3148
|
-
next_page:
|
|
3149
|
-
previous_page:
|
|
3150
|
-
results:
|
|
3184
|
+
var PaginatedPublishListSchema = import_zod51.z.object({
|
|
3185
|
+
count: import_zod51.z.int(),
|
|
3186
|
+
page: import_zod51.z.int(),
|
|
3187
|
+
pages: import_zod51.z.int(),
|
|
3188
|
+
page_size: import_zod51.z.int(),
|
|
3189
|
+
has_next: import_zod51.z.boolean(),
|
|
3190
|
+
has_previous: import_zod51.z.boolean(),
|
|
3191
|
+
next_page: import_zod51.z.int().nullable().optional(),
|
|
3192
|
+
previous_page: import_zod51.z.int().nullable().optional(),
|
|
3193
|
+
results: import_zod51.z.array(PublishSchema)
|
|
3151
3194
|
});
|
|
3152
3195
|
|
|
3153
3196
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
|
|
3154
|
-
var
|
|
3155
|
-
var PublishTestRequestRequestSchema =
|
|
3156
|
-
channel:
|
|
3157
|
-
data:
|
|
3158
|
-
wait_for_ack:
|
|
3159
|
-
ack_timeout:
|
|
3197
|
+
var import_zod52 = require("zod");
|
|
3198
|
+
var PublishTestRequestRequestSchema = import_zod52.z.object({
|
|
3199
|
+
channel: import_zod52.z.string(),
|
|
3200
|
+
data: import_zod52.z.record(import_zod52.z.string(), import_zod52.z.any()),
|
|
3201
|
+
wait_for_ack: import_zod52.z.boolean().optional(),
|
|
3202
|
+
ack_timeout: import_zod52.z.int().min(1).max(60).optional()
|
|
3160
3203
|
});
|
|
3161
3204
|
|
|
3162
3205
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
|
|
3163
|
-
var
|
|
3164
|
-
var PublishTestResponseSchema =
|
|
3165
|
-
success:
|
|
3166
|
-
message_id:
|
|
3167
|
-
channel:
|
|
3168
|
-
acks_received:
|
|
3169
|
-
delivered:
|
|
3170
|
-
error:
|
|
3206
|
+
var import_zod53 = require("zod");
|
|
3207
|
+
var PublishTestResponseSchema = import_zod53.z.object({
|
|
3208
|
+
success: import_zod53.z.boolean(),
|
|
3209
|
+
message_id: import_zod53.z.string(),
|
|
3210
|
+
channel: import_zod53.z.string(),
|
|
3211
|
+
acks_received: import_zod53.z.int().optional(),
|
|
3212
|
+
delivered: import_zod53.z.boolean().optional(),
|
|
3213
|
+
error: import_zod53.z.string().nullable().optional()
|
|
3171
3214
|
});
|
|
3172
3215
|
|
|
3173
3216
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
|
|
3174
|
-
var
|
|
3175
|
-
var TimelineItemSchema =
|
|
3176
|
-
timestamp:
|
|
3177
|
-
count:
|
|
3178
|
-
successful:
|
|
3179
|
-
failed:
|
|
3180
|
-
timeout:
|
|
3217
|
+
var import_zod54 = require("zod");
|
|
3218
|
+
var TimelineItemSchema = import_zod54.z.object({
|
|
3219
|
+
timestamp: import_zod54.z.string(),
|
|
3220
|
+
count: import_zod54.z.int(),
|
|
3221
|
+
successful: import_zod54.z.int(),
|
|
3222
|
+
failed: import_zod54.z.int(),
|
|
3223
|
+
timeout: import_zod54.z.int()
|
|
3181
3224
|
});
|
|
3182
3225
|
|
|
3183
3226
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
|
|
3184
|
-
var
|
|
3185
|
-
var TimelineResponseSchema =
|
|
3186
|
-
timeline:
|
|
3187
|
-
period_hours:
|
|
3188
|
-
interval:
|
|
3227
|
+
var import_zod55 = require("zod");
|
|
3228
|
+
var TimelineResponseSchema = import_zod55.z.object({
|
|
3229
|
+
timeline: import_zod55.z.array(TimelineItemSchema),
|
|
3230
|
+
period_hours: import_zod55.z.int(),
|
|
3231
|
+
interval: import_zod55.z.string()
|
|
3189
3232
|
});
|
|
3190
3233
|
|
|
3191
3234
|
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
|
|
@@ -3282,7 +3325,8 @@ var API2 = class {
|
|
|
3282
3325
|
this._loadTokensFromStorage();
|
|
3283
3326
|
this._client = new APIClient2(this.baseUrl, {
|
|
3284
3327
|
retryConfig: this.options?.retryConfig,
|
|
3285
|
-
loggerConfig: this.options?.loggerConfig
|
|
3328
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3329
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3286
3330
|
});
|
|
3287
3331
|
this._injectAuthHeader();
|
|
3288
3332
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -3300,7 +3344,8 @@ var API2 = class {
|
|
|
3300
3344
|
_reinitClients() {
|
|
3301
3345
|
this._client = new APIClient2(this.baseUrl, {
|
|
3302
3346
|
retryConfig: this.options?.retryConfig,
|
|
3303
|
-
loggerConfig: this.options?.loggerConfig
|
|
3347
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3348
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3304
3349
|
});
|
|
3305
3350
|
this._injectAuthHeader();
|
|
3306
3351
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -3842,8 +3887,10 @@ var APIClient3 = class {
|
|
|
3842
3887
|
constructor(baseUrl, options) {
|
|
3843
3888
|
this.logger = null;
|
|
3844
3889
|
this.retryConfig = null;
|
|
3890
|
+
this.tokenGetter = null;
|
|
3845
3891
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
3846
3892
|
this.httpClient = options?.httpClient || new FetchAdapter3();
|
|
3893
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
3847
3894
|
if (options?.loggerConfig !== void 0) {
|
|
3848
3895
|
this.logger = new APILogger3(options.loggerConfig);
|
|
3849
3896
|
}
|
|
@@ -3869,6 +3916,19 @@ var APIClient3 = class {
|
|
|
3869
3916
|
}
|
|
3870
3917
|
return null;
|
|
3871
3918
|
}
|
|
3919
|
+
/**
|
|
3920
|
+
* Get the base URL for building streaming/download URLs.
|
|
3921
|
+
*/
|
|
3922
|
+
getBaseUrl() {
|
|
3923
|
+
return this.baseUrl;
|
|
3924
|
+
}
|
|
3925
|
+
/**
|
|
3926
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
3927
|
+
* Returns null if no token getter is configured or no token is available.
|
|
3928
|
+
*/
|
|
3929
|
+
getToken() {
|
|
3930
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
3931
|
+
}
|
|
3872
3932
|
/**
|
|
3873
3933
|
* Make HTTP request with Django CSRF and session handling.
|
|
3874
3934
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -4164,40 +4224,40 @@ __export(schemas_exports3, {
|
|
|
4164
4224
|
});
|
|
4165
4225
|
|
|
4166
4226
|
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
4167
|
-
var
|
|
4168
|
-
var SendPushRequestRequestSchema =
|
|
4169
|
-
title:
|
|
4170
|
-
body:
|
|
4171
|
-
icon:
|
|
4172
|
-
url:
|
|
4227
|
+
var import_zod56 = require("zod");
|
|
4228
|
+
var SendPushRequestRequestSchema = import_zod56.z.object({
|
|
4229
|
+
title: import_zod56.z.string().min(1).max(255),
|
|
4230
|
+
body: import_zod56.z.string().min(1),
|
|
4231
|
+
icon: import_zod56.z.union([import_zod56.z.url(), import_zod56.z.literal("")]).nullable().optional(),
|
|
4232
|
+
url: import_zod56.z.union([import_zod56.z.url(), import_zod56.z.literal("")]).nullable().optional()
|
|
4173
4233
|
});
|
|
4174
4234
|
|
|
4175
4235
|
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
4176
|
-
var
|
|
4177
|
-
var SendPushResponseSchema =
|
|
4178
|
-
success:
|
|
4179
|
-
sent_to:
|
|
4236
|
+
var import_zod57 = require("zod");
|
|
4237
|
+
var SendPushResponseSchema = import_zod57.z.object({
|
|
4238
|
+
success: import_zod57.z.boolean(),
|
|
4239
|
+
sent_to: import_zod57.z.int()
|
|
4180
4240
|
});
|
|
4181
4241
|
|
|
4182
4242
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
4183
|
-
var
|
|
4184
|
-
var SubscribeRequestRequestSchema =
|
|
4185
|
-
endpoint:
|
|
4186
|
-
keys:
|
|
4243
|
+
var import_zod58 = require("zod");
|
|
4244
|
+
var SubscribeRequestRequestSchema = import_zod58.z.object({
|
|
4245
|
+
endpoint: import_zod58.z.union([import_zod58.z.url(), import_zod58.z.literal("")]),
|
|
4246
|
+
keys: import_zod58.z.record(import_zod58.z.string(), import_zod58.z.string().min(1))
|
|
4187
4247
|
});
|
|
4188
4248
|
|
|
4189
4249
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
4190
|
-
var
|
|
4191
|
-
var SubscribeResponseSchema =
|
|
4192
|
-
success:
|
|
4193
|
-
subscription_id:
|
|
4194
|
-
created:
|
|
4250
|
+
var import_zod59 = require("zod");
|
|
4251
|
+
var SubscribeResponseSchema = import_zod59.z.object({
|
|
4252
|
+
success: import_zod59.z.boolean(),
|
|
4253
|
+
subscription_id: import_zod59.z.int(),
|
|
4254
|
+
created: import_zod59.z.boolean()
|
|
4195
4255
|
});
|
|
4196
4256
|
|
|
4197
4257
|
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
4198
|
-
var
|
|
4199
|
-
var VapidPublicKeyResponseSchema =
|
|
4200
|
-
publicKey:
|
|
4258
|
+
var import_zod60 = require("zod");
|
|
4259
|
+
var VapidPublicKeyResponseSchema = import_zod60.z.object({
|
|
4260
|
+
publicKey: import_zod60.z.string()
|
|
4201
4261
|
});
|
|
4202
4262
|
|
|
4203
4263
|
// src/generated/cfg_webpush/validation-events.ts
|
|
@@ -4466,7 +4526,8 @@ var API3 = class {
|
|
|
4466
4526
|
this._loadTokensFromStorage();
|
|
4467
4527
|
this._client = new APIClient3(this.baseUrl, {
|
|
4468
4528
|
retryConfig: this.options?.retryConfig,
|
|
4469
|
-
loggerConfig: this.options?.loggerConfig
|
|
4529
|
+
loggerConfig: this.options?.loggerConfig,
|
|
4530
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
4470
4531
|
});
|
|
4471
4532
|
this._injectAuthHeader();
|
|
4472
4533
|
this.web_push = this._client.web_push;
|
|
@@ -4481,7 +4542,8 @@ var API3 = class {
|
|
|
4481
4542
|
_reinitClients() {
|
|
4482
4543
|
this._client = new APIClient3(this.baseUrl, {
|
|
4483
4544
|
retryConfig: this.options?.retryConfig,
|
|
4484
|
-
loggerConfig: this.options?.loggerConfig
|
|
4545
|
+
loggerConfig: this.options?.loggerConfig,
|
|
4546
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
4485
4547
|
});
|
|
4486
4548
|
this._injectAuthHeader();
|
|
4487
4549
|
this.web_push = this._client.web_push;
|