@djangocfg/api 2.1.231 → 2.1.232
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/README.md +19 -4
- package/dist/auth-server.cjs +45 -358
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +43 -356
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +223 -735
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +218 -730
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +313 -1568
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +211 -1932
- package/dist/clients.d.ts +211 -1932
- package/dist/clients.mjs +309 -1564
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +36 -32
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +76 -76
- package/dist/hooks.d.ts +76 -76
- package/dist/hooks.mjs +36 -32
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +88 -593
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -88
- package/dist/index.d.ts +88 -88
- package/dist/index.mjs +88 -593
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/accounts/models.ts +34 -34
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +41 -41
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +18 -18
- package/src/_api/generated/cfg_accounts/client.ts +39 -42
- package/src/_api/generated/cfg_centrifugo/CLAUDE.md +2 -27
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/index.ts +0 -3
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/index.ts +0 -3
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/index.ts +0 -34
- package/src/_api/generated/cfg_centrifugo/client.ts +39 -51
- package/src/_api/generated/cfg_centrifugo/index.ts +0 -21
- package/src/_api/generated/cfg_centrifugo/schema.json +4 -2039
- package/src/_api/generated/cfg_totp/client.ts +39 -42
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +12 -12
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts +0 -344
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts +0 -326
- package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts +0 -211
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts +0 -141
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts +0 -99
- package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts +0 -82
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts +0 -19
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +0 -23
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts +0 -30
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts +0 -26
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +0 -19
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts +0 -23
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts +0 -21
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts +0 -25
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts +0 -20
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts +0 -21
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts +0 -24
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts +0 -29
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts +0 -24
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts +0 -23
- package/src/_api/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts +0 -22
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/client.ts +0 -76
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +0 -4
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +0 -268
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts +0 -110
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +0 -4
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +0 -144
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/client.ts +0 -48
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +0 -4
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +0 -64
package/dist/hooks.cjs
CHANGED
|
@@ -760,43 +760,47 @@ var APIClient = class {
|
|
|
760
760
|
if (error instanceof APIError) {
|
|
761
761
|
throw error;
|
|
762
762
|
}
|
|
763
|
-
|
|
763
|
+
let possiblyCors = false;
|
|
764
|
+
if (error instanceof TypeError && typeof window !== "undefined") {
|
|
765
|
+
try {
|
|
766
|
+
const isCrossOrigin = (() => {
|
|
767
|
+
try {
|
|
768
|
+
return new URL(url).origin !== window.location.origin;
|
|
769
|
+
} catch {
|
|
770
|
+
return false;
|
|
771
|
+
}
|
|
772
|
+
})();
|
|
773
|
+
if (isCrossOrigin) {
|
|
774
|
+
const entries = performance.getEntriesByName(url, "resource");
|
|
775
|
+
if (entries.length > 0) {
|
|
776
|
+
const last = entries[entries.length - 1];
|
|
777
|
+
possiblyCors = "responseStatus" in last && last.responseStatus === 0;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
} catch {
|
|
781
|
+
}
|
|
782
|
+
}
|
|
764
783
|
if (this.logger) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
this.logger.error(` \u2192
|
|
769
|
-
} else {
|
|
770
|
-
this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
|
|
771
|
-
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
784
|
+
this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
|
|
785
|
+
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
786
|
+
if (possiblyCors) {
|
|
787
|
+
this.logger.error(` \u2192 Possibly blocked by CORS policy (configure CORS on the server)`);
|
|
772
788
|
}
|
|
773
789
|
}
|
|
774
790
|
if (typeof window !== "undefined") {
|
|
775
791
|
try {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
window.dispatchEvent(new CustomEvent("network-error", {
|
|
789
|
-
detail: {
|
|
790
|
-
url,
|
|
791
|
-
method,
|
|
792
|
-
error: error instanceof Error ? error.message : String(error),
|
|
793
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
794
|
-
},
|
|
795
|
-
bubbles: true,
|
|
796
|
-
cancelable: false
|
|
797
|
-
}));
|
|
798
|
-
}
|
|
799
|
-
} catch (eventError) {
|
|
792
|
+
window.dispatchEvent(new CustomEvent("network-error", {
|
|
793
|
+
detail: {
|
|
794
|
+
url,
|
|
795
|
+
method,
|
|
796
|
+
error: error instanceof Error ? error.message : String(error),
|
|
797
|
+
possibly_cors: possiblyCors,
|
|
798
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
799
|
+
},
|
|
800
|
+
bubbles: true,
|
|
801
|
+
cancelable: false
|
|
802
|
+
}));
|
|
803
|
+
} catch {
|
|
800
804
|
}
|
|
801
805
|
}
|
|
802
806
|
const networkError = error instanceof Error ? new NetworkError(error.message, url, error) : new NetworkError("Unknown error", url);
|