@djangocfg/api 2.1.261 → 2.1.263
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 +9 -0
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +9 -0
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +27 -0
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +27 -0
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +65 -1
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +145 -122
- package/dist/clients.d.ts +145 -122
- package/dist/clients.mjs +65 -1
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +47 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +91 -68
- package/dist/hooks.d.ts +91 -68
- package/dist/hooks.mjs +47 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +56 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -89
- package/dist/index.d.ts +89 -89
- package/dist/index.mjs +56 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +46 -2
- package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +3 -2
- package/src/_api/generated/cfg_accounts/accounts/models.ts +12 -12
- package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +55 -55
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
- package/src/_api/generated/cfg_accounts/client.ts +8 -0
- package/src/_api/generated/cfg_accounts/errors.ts +5 -0
- package/src/_api/generated/cfg_centrifugo/client.ts +8 -0
- package/src/_api/generated/cfg_centrifugo/errors.ts +5 -0
- package/src/_api/generated/cfg_totp/client.ts +8 -0
- package/src/_api/generated/cfg_totp/errors.ts +5 -0
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +25 -25
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
package/dist/clients.cjs
CHANGED
|
@@ -387,6 +387,9 @@ var APIError = class extends Error {
|
|
|
387
387
|
if (details.detail) {
|
|
388
388
|
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
389
389
|
}
|
|
390
|
+
if (details.error) {
|
|
391
|
+
return String(details.error);
|
|
392
|
+
}
|
|
390
393
|
if (details.message) {
|
|
391
394
|
return String(details.message);
|
|
392
395
|
}
|
|
@@ -725,6 +728,12 @@ var APIClient = class {
|
|
|
725
728
|
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
726
729
|
headers["Content-Type"] = "application/json";
|
|
727
730
|
}
|
|
731
|
+
if (!headers["Authorization"]) {
|
|
732
|
+
const token = this.getToken();
|
|
733
|
+
if (token) {
|
|
734
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
728
737
|
if (this.logger) {
|
|
729
738
|
this.logger.logRequest({
|
|
730
739
|
method,
|
|
@@ -1273,7 +1282,44 @@ var import_consola4 = require("consola");
|
|
|
1273
1282
|
async function getAccountsOauthConnectionsList(client) {
|
|
1274
1283
|
const api = client || getAPIInstance();
|
|
1275
1284
|
const response = await api.oauth.accountsOauthConnectionsList();
|
|
1276
|
-
|
|
1285
|
+
try {
|
|
1286
|
+
return OAuthConnectionSchema.array().parse(response);
|
|
1287
|
+
} catch (error) {
|
|
1288
|
+
import_consola4.consola.error("\u274C Zod Validation Failed");
|
|
1289
|
+
import_consola4.consola.box(`getAccountsOauthConnectionsList
|
|
1290
|
+
Path: /cfg/accounts/oauth/connections/
|
|
1291
|
+
Method: GET`);
|
|
1292
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1293
|
+
import_consola4.consola.error("Validation Issues:");
|
|
1294
|
+
error.issues.forEach((issue, index) => {
|
|
1295
|
+
import_consola4.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1296
|
+
import_consola4.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1297
|
+
if (issue.expected) import_consola4.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1298
|
+
if (issue.received) import_consola4.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
import_consola4.consola.error("Response data:", response);
|
|
1302
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1303
|
+
try {
|
|
1304
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1305
|
+
detail: {
|
|
1306
|
+
operation: "getAccountsOauthConnectionsList",
|
|
1307
|
+
path: "/cfg/accounts/oauth/connections/",
|
|
1308
|
+
method: "GET",
|
|
1309
|
+
error,
|
|
1310
|
+
response,
|
|
1311
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1312
|
+
},
|
|
1313
|
+
bubbles: true,
|
|
1314
|
+
cancelable: false
|
|
1315
|
+
});
|
|
1316
|
+
window.dispatchEvent(event);
|
|
1317
|
+
} catch (eventError) {
|
|
1318
|
+
import_consola4.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
throw error;
|
|
1322
|
+
}
|
|
1277
1323
|
}
|
|
1278
1324
|
__name(getAccountsOauthConnectionsList, "getAccountsOauthConnectionsList");
|
|
1279
1325
|
async function createAccountsOauthDisconnectCreate(data, client) {
|
|
@@ -2005,6 +2051,9 @@ var APIError2 = class extends Error {
|
|
|
2005
2051
|
if (details.detail) {
|
|
2006
2052
|
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
2007
2053
|
}
|
|
2054
|
+
if (details.error) {
|
|
2055
|
+
return String(details.error);
|
|
2056
|
+
}
|
|
2008
2057
|
if (details.message) {
|
|
2009
2058
|
return String(details.message);
|
|
2010
2059
|
}
|
|
@@ -2340,6 +2389,12 @@ var APIClient2 = class {
|
|
|
2340
2389
|
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
2341
2390
|
headers["Content-Type"] = "application/json";
|
|
2342
2391
|
}
|
|
2392
|
+
if (!headers["Authorization"]) {
|
|
2393
|
+
const token = this.getToken();
|
|
2394
|
+
if (token) {
|
|
2395
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2343
2398
|
if (this.logger) {
|
|
2344
2399
|
this.logger.logRequest({
|
|
2345
2400
|
method,
|
|
@@ -3004,6 +3059,9 @@ var APIError3 = class extends Error {
|
|
|
3004
3059
|
if (details.detail) {
|
|
3005
3060
|
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
3006
3061
|
}
|
|
3062
|
+
if (details.error) {
|
|
3063
|
+
return String(details.error);
|
|
3064
|
+
}
|
|
3007
3065
|
if (details.message) {
|
|
3008
3066
|
return String(details.message);
|
|
3009
3067
|
}
|
|
@@ -3343,6 +3401,12 @@ var APIClient3 = class {
|
|
|
3343
3401
|
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
3344
3402
|
headers["Content-Type"] = "application/json";
|
|
3345
3403
|
}
|
|
3404
|
+
if (!headers["Authorization"]) {
|
|
3405
|
+
const token = this.getToken();
|
|
3406
|
+
if (token) {
|
|
3407
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3346
3410
|
if (this.logger) {
|
|
3347
3411
|
this.logger.logRequest({
|
|
3348
3412
|
method,
|