@djangocfg/api 2.1.42 → 2.1.44
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.cjs +42 -44
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +50 -45
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +1842 -1842
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +1627 -1837
- package/dist/clients.d.ts +1627 -1837
- package/dist/clients.mjs +1840 -1840
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +0 -66
- package/dist/hooks.d.ts +0 -66
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -210
- package/dist/index.d.ts +0 -210
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AccountsContext.tsx +15 -15
- package/src/auth/context/AuthContext.tsx +6 -5
- package/src/auth/hooks/useAuthForm.ts +1 -1
- package/src/auth/hooks/useAuthGuard.ts +2 -1
- package/src/auth/hooks/useAutoAuth.ts +4 -2
- package/src/auth/hooks/useGithubAuth.ts +3 -2
- package/src/auth/hooks/useLocalStorage.ts +1 -0
- package/src/auth/hooks/useProfileCache.ts +1 -1
- package/src/auth/hooks/useSessionStorage.ts +1 -0
- package/src/clients.ts +1 -1
- package/src/generated/cfg_accounts/CLAUDE.md +92 -0
- package/src/generated/cfg_accounts/_utils/fetchers/accounts.ts +1 -8
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts +1 -8
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +1 -8
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +1 -8
- package/src/generated/cfg_accounts/_utils/fetchers/index.ts +1 -8
- package/src/generated/cfg_accounts/_utils/hooks/accounts.ts +1 -8
- package/src/generated/cfg_accounts/_utils/hooks/accounts__auth.ts +1 -8
- package/src/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +1 -8
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +1 -8
- package/src/generated/cfg_accounts/_utils/hooks/index.ts +1 -8
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -8
- package/src/generated/cfg_accounts/accounts/index.ts +1 -8
- package/src/generated/cfg_accounts/accounts/models.ts +1 -8
- package/src/generated/cfg_accounts/accounts__auth/index.ts +1 -8
- package/src/generated/cfg_accounts/accounts__auth/models.ts +1 -8
- package/src/generated/cfg_accounts/accounts__oauth/index.ts +1 -8
- package/src/generated/cfg_accounts/accounts__oauth/models.ts +1 -8
- package/src/generated/cfg_accounts/accounts__user_profile/index.ts +1 -8
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +1 -8
- package/src/generated/cfg_accounts/api-instance.ts +1 -8
- package/src/generated/cfg_accounts/enums.ts +1 -8
- package/src/generated/cfg_accounts/errors.ts +1 -8
- package/src/generated/cfg_accounts/http.ts +1 -8
- package/src/generated/cfg_accounts/index.ts +1 -8
- package/src/generated/cfg_accounts/logger.ts +1 -8
- package/src/generated/cfg_accounts/retry.ts +1 -8
- package/src/generated/cfg_accounts/storage.ts +1 -8
- package/src/generated/cfg_accounts/validation-events.ts +1 -8
- package/src/generated/cfg_centrifugo/CLAUDE.md +92 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/fetchers/index.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/hooks/index.ts +1 -8
- package/src/generated/cfg_centrifugo/_utils/schemas/index.ts +1 -8
- package/src/generated/cfg_centrifugo/api-instance.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/models.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +1 -8
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +1 -8
- package/src/generated/cfg_centrifugo/errors.ts +1 -8
- package/src/generated/cfg_centrifugo/http.ts +1 -8
- package/src/generated/cfg_centrifugo/index.ts +1 -8
- package/src/generated/cfg_centrifugo/logger.ts +1 -8
- package/src/generated/cfg_centrifugo/retry.ts +1 -8
- package/src/generated/cfg_centrifugo/storage.ts +1 -8
- package/src/generated/cfg_centrifugo/validation-events.ts +1 -8
- package/src/generated/cfg_webpush/CLAUDE.md +70 -0
- package/src/generated/cfg_webpush/_utils/fetchers/index.ts +1 -8
- package/src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts +1 -8
- package/src/generated/cfg_webpush/_utils/hooks/index.ts +1 -8
- package/src/generated/cfg_webpush/_utils/hooks/webpush__web_push.ts +1 -8
- package/src/generated/cfg_webpush/_utils/schemas/index.ts +1 -8
- package/src/generated/cfg_webpush/api-instance.ts +1 -8
- package/src/generated/cfg_webpush/errors.ts +1 -8
- package/src/generated/cfg_webpush/http.ts +1 -8
- package/src/generated/cfg_webpush/index.ts +1 -8
- package/src/generated/cfg_webpush/logger.ts +1 -8
- package/src/generated/cfg_webpush/retry.ts +1 -8
- package/src/generated/cfg_webpush/storage.ts +1 -8
- package/src/generated/cfg_webpush/validation-events.ts +1 -8
- package/src/generated/cfg_webpush/webpush__web_push/index.ts +1 -8
- package/src/generated/cfg_webpush/webpush__web_push/models.ts +1 -8
package/dist/clients.cjs
CHANGED
|
@@ -31,11 +31,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var clients_exports = {};
|
|
32
32
|
__export(clients_exports, {
|
|
33
33
|
AccountsAPI: () => API,
|
|
34
|
-
CentrifugoAPI: () =>
|
|
35
|
-
CentrifugoFetchers: () =>
|
|
34
|
+
CentrifugoAPI: () => API2,
|
|
35
|
+
CentrifugoFetchers: () => fetchers_exports2,
|
|
36
36
|
CentrifugoHooks: () => hooks_exports2,
|
|
37
37
|
CentrifugoTokenSchema: () => CentrifugoTokenSchema,
|
|
38
|
-
CentrifugoTypes: () =>
|
|
38
|
+
CentrifugoTypes: () => schemas_exports2,
|
|
39
39
|
Enums: () => enums_exports,
|
|
40
40
|
OAuthAuthorizeRequestRequestSchema: () => OAuthAuthorizeRequestRequestSchema,
|
|
41
41
|
OAuthAuthorizeResponseSchema: () => OAuthAuthorizeResponseSchema,
|
|
@@ -55,10 +55,10 @@ __export(clients_exports, {
|
|
|
55
55
|
TokenRefreshSchema: () => TokenRefreshSchema,
|
|
56
56
|
UserProfileUpdateRequestSchema: () => UserProfileUpdateRequestSchema,
|
|
57
57
|
UserSchema: () => UserSchema,
|
|
58
|
-
WebPushAPI: () =>
|
|
59
|
-
WebPushFetchers: () =>
|
|
58
|
+
WebPushAPI: () => API3,
|
|
59
|
+
WebPushFetchers: () => fetchers_exports3,
|
|
60
60
|
WebPushHooks: () => hooks_exports,
|
|
61
|
-
WebPushTypes: () =>
|
|
61
|
+
WebPushTypes: () => schemas_exports3,
|
|
62
62
|
apiAccounts: () => apiAccounts,
|
|
63
63
|
apiCentrifugo: () => apiCentrifugo,
|
|
64
64
|
apiWebPush: () => apiWebPush,
|
|
@@ -1736,45 +1736,217 @@ var API = class {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
};
|
|
1738
1738
|
|
|
1739
|
-
// src/generated/
|
|
1740
|
-
var
|
|
1739
|
+
// src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/client.ts
|
|
1740
|
+
var CentrifugoAdminApi = class {
|
|
1741
1741
|
static {
|
|
1742
|
-
__name(this, "
|
|
1742
|
+
__name(this, "CentrifugoAdminApi");
|
|
1743
1743
|
}
|
|
1744
1744
|
constructor(client) {
|
|
1745
1745
|
this.client = client;
|
|
1746
1746
|
}
|
|
1747
1747
|
/**
|
|
1748
|
-
*
|
|
1748
|
+
* Get connection token for dashboard
|
|
1749
1749
|
*
|
|
1750
|
-
*
|
|
1751
|
-
* user.
|
|
1750
|
+
* Returns JWT token and config for WebSocket connection to Centrifugo.
|
|
1752
1751
|
*/
|
|
1753
|
-
async
|
|
1754
|
-
const response = await this.client.request("POST", "/cfg/
|
|
1752
|
+
async centrifugoServerAuthTokenCreate() {
|
|
1753
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/auth/token/");
|
|
1755
1754
|
return response;
|
|
1756
1755
|
}
|
|
1757
1756
|
/**
|
|
1758
|
-
*
|
|
1757
|
+
* List active channels
|
|
1759
1758
|
*
|
|
1760
|
-
*
|
|
1759
|
+
* Returns list of active channels with optional pattern filter.
|
|
1761
1760
|
*/
|
|
1762
|
-
async
|
|
1763
|
-
const response = await this.client.request("POST", "/cfg/
|
|
1761
|
+
async centrifugoServerChannelsCreate(data) {
|
|
1762
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/channels/", { body: data });
|
|
1764
1763
|
return response;
|
|
1765
1764
|
}
|
|
1766
1765
|
/**
|
|
1767
|
-
* Get
|
|
1766
|
+
* Get channel history
|
|
1768
1767
|
*
|
|
1769
|
-
*
|
|
1768
|
+
* Returns message history for a channel.
|
|
1770
1769
|
*/
|
|
1771
|
-
async
|
|
1772
|
-
const response = await this.client.request("
|
|
1770
|
+
async centrifugoServerHistoryCreate(data) {
|
|
1771
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/history/", { body: data });
|
|
1772
|
+
return response;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Get Centrifugo server info
|
|
1776
|
+
*
|
|
1777
|
+
* Returns server information including node count, version, and uptime.
|
|
1778
|
+
*/
|
|
1779
|
+
async centrifugoServerInfoCreate() {
|
|
1780
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/info/");
|
|
1781
|
+
return response;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Get channel presence
|
|
1785
|
+
*
|
|
1786
|
+
* Returns list of clients currently subscribed to a channel.
|
|
1787
|
+
*/
|
|
1788
|
+
async centrifugoServerPresenceCreate(data) {
|
|
1789
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/presence/", { body: data });
|
|
1790
|
+
return response;
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Get channel presence statistics
|
|
1794
|
+
*
|
|
1795
|
+
* Returns quick statistics about channel presence (num_clients,
|
|
1796
|
+
* num_users).
|
|
1797
|
+
*/
|
|
1798
|
+
async centrifugoServerPresenceStatsCreate(data) {
|
|
1799
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/server/presence-stats/", { body: data });
|
|
1773
1800
|
return response;
|
|
1774
1801
|
}
|
|
1775
1802
|
};
|
|
1776
1803
|
|
|
1777
|
-
// src/generated/
|
|
1804
|
+
// src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts
|
|
1805
|
+
var CentrifugoAuth = class {
|
|
1806
|
+
static {
|
|
1807
|
+
__name(this, "CentrifugoAuth");
|
|
1808
|
+
}
|
|
1809
|
+
constructor(client) {
|
|
1810
|
+
this.client = client;
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Get Centrifugo connection token
|
|
1814
|
+
*
|
|
1815
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token
|
|
1816
|
+
* includes user's allowed channels based on their permissions. Requires
|
|
1817
|
+
* authentication.
|
|
1818
|
+
*/
|
|
1819
|
+
async tokenRetrieve() {
|
|
1820
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/auth/token/");
|
|
1821
|
+
return response;
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
// src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts
|
|
1826
|
+
var CentrifugoMonitoring = class {
|
|
1827
|
+
static {
|
|
1828
|
+
__name(this, "CentrifugoMonitoring");
|
|
1829
|
+
}
|
|
1830
|
+
constructor(client) {
|
|
1831
|
+
this.client = client;
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Get channel statistics
|
|
1835
|
+
*
|
|
1836
|
+
* Returns statistics grouped by channel.
|
|
1837
|
+
*/
|
|
1838
|
+
async centrifugoMonitorChannelsRetrieve(...args) {
|
|
1839
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
1840
|
+
let params;
|
|
1841
|
+
if (isParamsObject) {
|
|
1842
|
+
params = args[0];
|
|
1843
|
+
} else {
|
|
1844
|
+
params = { hours: args[0] };
|
|
1845
|
+
}
|
|
1846
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/monitor/channels/", { params });
|
|
1847
|
+
return response.results || response;
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Get Centrifugo health status
|
|
1851
|
+
*
|
|
1852
|
+
* Returns the current health status of the Centrifugo client.
|
|
1853
|
+
*/
|
|
1854
|
+
async centrifugoMonitorHealthRetrieve() {
|
|
1855
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/monitor/health/");
|
|
1856
|
+
return response;
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Get overview statistics
|
|
1860
|
+
*
|
|
1861
|
+
* Returns overview statistics for Centrifugo publishes.
|
|
1862
|
+
*/
|
|
1863
|
+
async centrifugoMonitorOverviewRetrieve(...args) {
|
|
1864
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
1865
|
+
let params;
|
|
1866
|
+
if (isParamsObject) {
|
|
1867
|
+
params = args[0];
|
|
1868
|
+
} else {
|
|
1869
|
+
params = { hours: args[0] };
|
|
1870
|
+
}
|
|
1871
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/monitor/overview/", { params });
|
|
1872
|
+
return response;
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Get recent publishes
|
|
1876
|
+
*
|
|
1877
|
+
* Returns a paginated list of recent Centrifugo publishes with their
|
|
1878
|
+
* details. Uses standard DRF pagination.
|
|
1879
|
+
*/
|
|
1880
|
+
async centrifugoMonitorPublishesList(...args) {
|
|
1881
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
1882
|
+
let params;
|
|
1883
|
+
if (isParamsObject) {
|
|
1884
|
+
params = args[0];
|
|
1885
|
+
} else {
|
|
1886
|
+
params = { channel: args[0], page: args[1], page_size: args[2], status: args[3] };
|
|
1887
|
+
}
|
|
1888
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/monitor/publishes/", { params });
|
|
1889
|
+
return response;
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Get publish timeline
|
|
1893
|
+
*
|
|
1894
|
+
* Returns hourly or daily breakdown of publish counts for charts.
|
|
1895
|
+
*/
|
|
1896
|
+
async centrifugoMonitorTimelineRetrieve(...args) {
|
|
1897
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
1898
|
+
let params;
|
|
1899
|
+
if (isParamsObject) {
|
|
1900
|
+
params = args[0];
|
|
1901
|
+
} else {
|
|
1902
|
+
params = { hours: args[0], interval: args[1] };
|
|
1903
|
+
}
|
|
1904
|
+
const response = await this.client.request("GET", "/cfg/centrifugo/monitor/timeline/", { params });
|
|
1905
|
+
return response;
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
// src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/client.ts
|
|
1910
|
+
var CentrifugoTesting = class {
|
|
1911
|
+
static {
|
|
1912
|
+
__name(this, "CentrifugoTesting");
|
|
1913
|
+
}
|
|
1914
|
+
constructor(client) {
|
|
1915
|
+
this.client = client;
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* Publish test message
|
|
1919
|
+
*
|
|
1920
|
+
* Publish test message to Centrifugo via wrapper with optional ACK
|
|
1921
|
+
* tracking.
|
|
1922
|
+
*/
|
|
1923
|
+
async publishTestCreate(data) {
|
|
1924
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/testing/publish-test/", { body: data });
|
|
1925
|
+
return response;
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Publish with database logging
|
|
1929
|
+
*
|
|
1930
|
+
* Publish message using CentrifugoClient with database logging. This will
|
|
1931
|
+
* create CentrifugoLog records.
|
|
1932
|
+
*/
|
|
1933
|
+
async publishWithLoggingCreate(data) {
|
|
1934
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/testing/publish-with-logging/", { body: data });
|
|
1935
|
+
return response;
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Send manual ACK
|
|
1939
|
+
*
|
|
1940
|
+
* Manually send ACK for a message to the wrapper. Pass message_id in
|
|
1941
|
+
* request body.
|
|
1942
|
+
*/
|
|
1943
|
+
async sendAckCreate(data) {
|
|
1944
|
+
const response = await this.client.request("POST", "/cfg/centrifugo/testing/send-ack/", { body: data });
|
|
1945
|
+
return response;
|
|
1946
|
+
}
|
|
1947
|
+
};
|
|
1948
|
+
|
|
1949
|
+
// src/generated/cfg_centrifugo/http.ts
|
|
1778
1950
|
var FetchAdapter2 = class {
|
|
1779
1951
|
static {
|
|
1780
1952
|
__name(this, "FetchAdapter");
|
|
@@ -1829,7 +2001,7 @@ var FetchAdapter2 = class {
|
|
|
1829
2001
|
}
|
|
1830
2002
|
};
|
|
1831
2003
|
|
|
1832
|
-
// src/generated/
|
|
2004
|
+
// src/generated/cfg_centrifugo/errors.ts
|
|
1833
2005
|
var APIError2 = class extends Error {
|
|
1834
2006
|
constructor(statusCode, statusText, response, url, message) {
|
|
1835
2007
|
super(message || `HTTP ${statusCode}: ${statusText}`);
|
|
@@ -1918,7 +2090,7 @@ var NetworkError2 = class extends Error {
|
|
|
1918
2090
|
}
|
|
1919
2091
|
};
|
|
1920
2092
|
|
|
1921
|
-
// src/generated/
|
|
2093
|
+
// src/generated/cfg_centrifugo/logger.ts
|
|
1922
2094
|
var import_consola6 = require("consola");
|
|
1923
2095
|
var DEFAULT_CONFIG2 = {
|
|
1924
2096
|
enabled: process.env.NODE_ENV !== "production",
|
|
@@ -2072,7 +2244,7 @@ var APILogger2 = class {
|
|
|
2072
2244
|
};
|
|
2073
2245
|
var defaultLogger2 = new APILogger2();
|
|
2074
2246
|
|
|
2075
|
-
// src/generated/
|
|
2247
|
+
// src/generated/cfg_centrifugo/retry.ts
|
|
2076
2248
|
var import_p_retry2 = __toESM(require("p-retry"), 1);
|
|
2077
2249
|
var DEFAULT_RETRY_CONFIG2 = {
|
|
2078
2250
|
retries: 3,
|
|
@@ -2132,7 +2304,7 @@ async function withRetry2(fn, config) {
|
|
|
2132
2304
|
}
|
|
2133
2305
|
__name(withRetry2, "withRetry");
|
|
2134
2306
|
|
|
2135
|
-
// src/generated/
|
|
2307
|
+
// src/generated/cfg_centrifugo/client.ts
|
|
2136
2308
|
var APIClient2 = class {
|
|
2137
2309
|
constructor(baseUrl, options) {
|
|
2138
2310
|
this.logger = null;
|
|
@@ -2145,7 +2317,10 @@ var APIClient2 = class {
|
|
|
2145
2317
|
if (options?.retryConfig !== void 0) {
|
|
2146
2318
|
this.retryConfig = options.retryConfig;
|
|
2147
2319
|
}
|
|
2148
|
-
this.
|
|
2320
|
+
this.centrifugo_admin_api = new CentrifugoAdminApi(this);
|
|
2321
|
+
this.centrifugo_auth = new CentrifugoAuth(this);
|
|
2322
|
+
this.centrifugo_monitoring = new CentrifugoMonitoring(this);
|
|
2323
|
+
this.centrifugo_testing = new CentrifugoTesting(this);
|
|
2149
2324
|
}
|
|
2150
2325
|
static {
|
|
2151
2326
|
__name(this, "APIClient");
|
|
@@ -2327,7 +2502,7 @@ var APIClient2 = class {
|
|
|
2327
2502
|
}
|
|
2328
2503
|
};
|
|
2329
2504
|
|
|
2330
|
-
// src/generated/
|
|
2505
|
+
// src/generated/cfg_centrifugo/storage.ts
|
|
2331
2506
|
var LocalStorageAdapter2 = class {
|
|
2332
2507
|
static {
|
|
2333
2508
|
__name(this, "LocalStorageAdapter");
|
|
@@ -2374,65 +2549,387 @@ var LocalStorageAdapter2 = class {
|
|
|
2374
2549
|
}
|
|
2375
2550
|
};
|
|
2376
2551
|
|
|
2377
|
-
// src/generated/
|
|
2552
|
+
// src/generated/cfg_centrifugo/_utils/schemas/index.ts
|
|
2378
2553
|
var schemas_exports2 = {};
|
|
2379
2554
|
__export(schemas_exports2, {
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
created: import_zod23.z.boolean()
|
|
2416
|
-
});
|
|
2417
|
-
|
|
2418
|
-
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
2419
|
-
var import_zod24 = require("zod");
|
|
2420
|
-
var VapidPublicKeyResponseSchema = import_zod24.z.object({
|
|
2421
|
-
publicKey: import_zod24.z.string()
|
|
2422
|
-
});
|
|
2423
|
-
|
|
2424
|
-
// src/generated/cfg_webpush/_utils/fetchers/index.ts
|
|
2425
|
-
var fetchers_exports2 = {};
|
|
2426
|
-
__export(fetchers_exports2, {
|
|
2427
|
-
createWebpushSendCreate: () => createWebpushSendCreate,
|
|
2428
|
-
createWebpushSubscribeCreate: () => createWebpushSubscribeCreate,
|
|
2429
|
-
getWebpushVapidRetrieve: () => getWebpushVapidRetrieve
|
|
2555
|
+
CentrifugoChannelInfoSchema: () => CentrifugoChannelInfoSchema,
|
|
2556
|
+
CentrifugoChannelsRequestRequestSchema: () => CentrifugoChannelsRequestRequestSchema,
|
|
2557
|
+
CentrifugoChannelsResponseSchema: () => CentrifugoChannelsResponseSchema,
|
|
2558
|
+
CentrifugoChannelsResultSchema: () => CentrifugoChannelsResultSchema,
|
|
2559
|
+
CentrifugoClientInfoSchema: () => CentrifugoClientInfoSchema,
|
|
2560
|
+
CentrifugoErrorSchema: () => CentrifugoErrorSchema,
|
|
2561
|
+
CentrifugoHealthCheckSchema: () => CentrifugoHealthCheckSchema,
|
|
2562
|
+
CentrifugoHistoryRequestRequestSchema: () => CentrifugoHistoryRequestRequestSchema,
|
|
2563
|
+
CentrifugoHistoryResponseSchema: () => CentrifugoHistoryResponseSchema,
|
|
2564
|
+
CentrifugoHistoryResultSchema: () => CentrifugoHistoryResultSchema,
|
|
2565
|
+
CentrifugoInfoResponseSchema: () => CentrifugoInfoResponseSchema,
|
|
2566
|
+
CentrifugoInfoResultSchema: () => CentrifugoInfoResultSchema,
|
|
2567
|
+
CentrifugoMetricsSchema: () => CentrifugoMetricsSchema,
|
|
2568
|
+
CentrifugoNodeInfoSchema: () => CentrifugoNodeInfoSchema,
|
|
2569
|
+
CentrifugoOverviewStatsSchema: () => CentrifugoOverviewStatsSchema,
|
|
2570
|
+
CentrifugoPresenceRequestRequestSchema: () => CentrifugoPresenceRequestRequestSchema,
|
|
2571
|
+
CentrifugoPresenceResponseSchema: () => CentrifugoPresenceResponseSchema,
|
|
2572
|
+
CentrifugoPresenceResultSchema: () => CentrifugoPresenceResultSchema,
|
|
2573
|
+
CentrifugoPresenceStatsRequestRequestSchema: () => CentrifugoPresenceStatsRequestRequestSchema,
|
|
2574
|
+
CentrifugoPresenceStatsResponseSchema: () => CentrifugoPresenceStatsResponseSchema,
|
|
2575
|
+
CentrifugoPresenceStatsResultSchema: () => CentrifugoPresenceStatsResultSchema,
|
|
2576
|
+
CentrifugoProcessSchema: () => CentrifugoProcessSchema,
|
|
2577
|
+
CentrifugoPublicationSchema: () => CentrifugoPublicationSchema,
|
|
2578
|
+
CentrifugoStreamPositionSchema: () => CentrifugoStreamPositionSchema,
|
|
2579
|
+
ChannelListSchema: () => ChannelListSchema,
|
|
2580
|
+
ChannelStatsSchema: () => ChannelStatsSchema,
|
|
2581
|
+
ConnectionTokenResponseSchema: () => ConnectionTokenResponseSchema,
|
|
2582
|
+
ManualAckRequestRequestSchema: () => ManualAckRequestRequestSchema,
|
|
2583
|
+
ManualAckResponseSchema: () => ManualAckResponseSchema,
|
|
2584
|
+
PaginatedPublishListSchema: () => PaginatedPublishListSchema,
|
|
2585
|
+
PublishSchema: () => PublishSchema,
|
|
2586
|
+
PublishTestRequestRequestSchema: () => PublishTestRequestRequestSchema,
|
|
2587
|
+
PublishTestResponseSchema: () => PublishTestResponseSchema,
|
|
2588
|
+
TimelineItemSchema: () => TimelineItemSchema,
|
|
2589
|
+
TimelineResponseSchema: () => TimelineResponseSchema
|
|
2430
2590
|
});
|
|
2431
2591
|
|
|
2432
|
-
// src/generated/
|
|
2592
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
|
|
2593
|
+
var import_zod20 = require("zod");
|
|
2594
|
+
var CentrifugoChannelInfoSchema = import_zod20.z.object({
|
|
2595
|
+
num_clients: import_zod20.z.int()
|
|
2596
|
+
});
|
|
2597
|
+
|
|
2598
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
|
|
2599
|
+
var import_zod21 = require("zod");
|
|
2600
|
+
var CentrifugoChannelsRequestRequestSchema = import_zod21.z.object({
|
|
2601
|
+
pattern: import_zod21.z.string().nullable().optional()
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2604
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2605
|
+
var import_zod24 = require("zod");
|
|
2606
|
+
|
|
2607
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
|
|
2608
|
+
var import_zod22 = require("zod");
|
|
2609
|
+
var CentrifugoChannelsResultSchema = import_zod22.z.object({
|
|
2610
|
+
channels: import_zod22.z.record(import_zod22.z.string(), CentrifugoChannelInfoSchema)
|
|
2611
|
+
});
|
|
2612
|
+
|
|
2613
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
|
|
2614
|
+
var import_zod23 = require("zod");
|
|
2615
|
+
var CentrifugoErrorSchema = import_zod23.z.object({
|
|
2616
|
+
code: import_zod23.z.int().optional(),
|
|
2617
|
+
message: import_zod23.z.string().optional()
|
|
2618
|
+
});
|
|
2619
|
+
|
|
2620
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2621
|
+
var CentrifugoChannelsResponseSchema = import_zod24.z.object({
|
|
2622
|
+
error: CentrifugoErrorSchema.optional(),
|
|
2623
|
+
result: CentrifugoChannelsResultSchema.optional()
|
|
2624
|
+
});
|
|
2625
|
+
|
|
2626
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
|
|
2627
|
+
var import_zod25 = require("zod");
|
|
2628
|
+
var CentrifugoClientInfoSchema = import_zod25.z.object({
|
|
2629
|
+
user: import_zod25.z.string(),
|
|
2630
|
+
client: import_zod25.z.string(),
|
|
2631
|
+
conn_info: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).nullable().optional(),
|
|
2632
|
+
chan_info: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).nullable().optional()
|
|
2633
|
+
});
|
|
2634
|
+
|
|
2635
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
|
|
2636
|
+
var import_zod26 = require("zod");
|
|
2637
|
+
var CentrifugoHealthCheckSchema = import_zod26.z.object({
|
|
2638
|
+
status: import_zod26.z.string(),
|
|
2639
|
+
wrapper_url: import_zod26.z.string(),
|
|
2640
|
+
has_api_key: import_zod26.z.boolean(),
|
|
2641
|
+
timestamp: import_zod26.z.string()
|
|
2642
|
+
});
|
|
2643
|
+
|
|
2644
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2645
|
+
var import_zod28 = require("zod");
|
|
2646
|
+
|
|
2647
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
|
|
2648
|
+
var import_zod27 = require("zod");
|
|
2649
|
+
var CentrifugoStreamPositionSchema = import_zod27.z.object({
|
|
2650
|
+
offset: import_zod27.z.int(),
|
|
2651
|
+
epoch: import_zod27.z.string()
|
|
2652
|
+
});
|
|
2653
|
+
|
|
2654
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2655
|
+
var CentrifugoHistoryRequestRequestSchema = import_zod28.z.object({
|
|
2656
|
+
channel: import_zod28.z.string(),
|
|
2657
|
+
limit: import_zod28.z.int().nullable().optional(),
|
|
2658
|
+
since: CentrifugoStreamPositionSchema.optional(),
|
|
2659
|
+
reverse: import_zod28.z.boolean().nullable().optional()
|
|
2660
|
+
});
|
|
2661
|
+
|
|
2662
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2663
|
+
var import_zod31 = require("zod");
|
|
2664
|
+
|
|
2665
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2666
|
+
var import_zod30 = require("zod");
|
|
2667
|
+
|
|
2668
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
|
|
2669
|
+
var import_zod29 = require("zod");
|
|
2670
|
+
var CentrifugoPublicationSchema = import_zod29.z.object({
|
|
2671
|
+
data: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.any()),
|
|
2672
|
+
info: CentrifugoClientInfoSchema.optional(),
|
|
2673
|
+
offset: import_zod29.z.int(),
|
|
2674
|
+
tags: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.any()).nullable().optional()
|
|
2675
|
+
});
|
|
2676
|
+
|
|
2677
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2678
|
+
var CentrifugoHistoryResultSchema = import_zod30.z.object({
|
|
2679
|
+
publications: import_zod30.z.array(CentrifugoPublicationSchema),
|
|
2680
|
+
epoch: import_zod30.z.string(),
|
|
2681
|
+
offset: import_zod30.z.int()
|
|
2682
|
+
});
|
|
2683
|
+
|
|
2684
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2685
|
+
var CentrifugoHistoryResponseSchema = import_zod31.z.object({
|
|
2686
|
+
error: CentrifugoErrorSchema.optional(),
|
|
2687
|
+
result: CentrifugoHistoryResultSchema.optional()
|
|
2688
|
+
});
|
|
2689
|
+
|
|
2690
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2691
|
+
var import_zod36 = require("zod");
|
|
2692
|
+
|
|
2693
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2694
|
+
var import_zod35 = require("zod");
|
|
2695
|
+
|
|
2696
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2697
|
+
var import_zod34 = require("zod");
|
|
2698
|
+
|
|
2699
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
|
|
2700
|
+
var import_zod32 = require("zod");
|
|
2701
|
+
var CentrifugoMetricsSchema = import_zod32.z.object({
|
|
2702
|
+
interval: import_zod32.z.number(),
|
|
2703
|
+
items: import_zod32.z.record(import_zod32.z.string(), import_zod32.z.number())
|
|
2704
|
+
});
|
|
2705
|
+
|
|
2706
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
|
|
2707
|
+
var import_zod33 = require("zod");
|
|
2708
|
+
var CentrifugoProcessSchema = import_zod33.z.object({
|
|
2709
|
+
cpu: import_zod33.z.number(),
|
|
2710
|
+
rss: import_zod33.z.int()
|
|
2711
|
+
});
|
|
2712
|
+
|
|
2713
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2714
|
+
var CentrifugoNodeInfoSchema = import_zod34.z.object({
|
|
2715
|
+
uid: import_zod34.z.string(),
|
|
2716
|
+
name: import_zod34.z.string(),
|
|
2717
|
+
version: import_zod34.z.string(),
|
|
2718
|
+
num_clients: import_zod34.z.int(),
|
|
2719
|
+
num_users: import_zod34.z.int(),
|
|
2720
|
+
num_channels: import_zod34.z.int(),
|
|
2721
|
+
uptime: import_zod34.z.int(),
|
|
2722
|
+
num_subs: import_zod34.z.int(),
|
|
2723
|
+
metrics: CentrifugoMetricsSchema.optional(),
|
|
2724
|
+
process: CentrifugoProcessSchema.optional()
|
|
2725
|
+
});
|
|
2726
|
+
|
|
2727
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2728
|
+
var CentrifugoInfoResultSchema = import_zod35.z.object({
|
|
2729
|
+
nodes: import_zod35.z.array(CentrifugoNodeInfoSchema)
|
|
2730
|
+
});
|
|
2731
|
+
|
|
2732
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2733
|
+
var CentrifugoInfoResponseSchema = import_zod36.z.object({
|
|
2734
|
+
error: CentrifugoErrorSchema.optional(),
|
|
2735
|
+
result: CentrifugoInfoResultSchema.optional()
|
|
2736
|
+
});
|
|
2737
|
+
|
|
2738
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
|
|
2739
|
+
var import_zod37 = require("zod");
|
|
2740
|
+
var CentrifugoOverviewStatsSchema = import_zod37.z.object({
|
|
2741
|
+
total: import_zod37.z.int(),
|
|
2742
|
+
successful: import_zod37.z.int(),
|
|
2743
|
+
failed: import_zod37.z.int(),
|
|
2744
|
+
timeout: import_zod37.z.int(),
|
|
2745
|
+
success_rate: import_zod37.z.number(),
|
|
2746
|
+
avg_duration_ms: import_zod37.z.number(),
|
|
2747
|
+
avg_acks_received: import_zod37.z.number(),
|
|
2748
|
+
period_hours: import_zod37.z.int()
|
|
2749
|
+
});
|
|
2750
|
+
|
|
2751
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
|
|
2752
|
+
var import_zod38 = require("zod");
|
|
2753
|
+
var CentrifugoPresenceRequestRequestSchema = import_zod38.z.object({
|
|
2754
|
+
channel: import_zod38.z.string()
|
|
2755
|
+
});
|
|
2756
|
+
|
|
2757
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2758
|
+
var import_zod40 = require("zod");
|
|
2759
|
+
|
|
2760
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
|
|
2761
|
+
var import_zod39 = require("zod");
|
|
2762
|
+
var CentrifugoPresenceResultSchema = import_zod39.z.object({
|
|
2763
|
+
presence: import_zod39.z.record(import_zod39.z.string(), CentrifugoClientInfoSchema)
|
|
2764
|
+
});
|
|
2765
|
+
|
|
2766
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2767
|
+
var CentrifugoPresenceResponseSchema = import_zod40.z.object({
|
|
2768
|
+
error: CentrifugoErrorSchema.optional(),
|
|
2769
|
+
result: CentrifugoPresenceResultSchema.optional()
|
|
2770
|
+
});
|
|
2771
|
+
|
|
2772
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
|
|
2773
|
+
var import_zod41 = require("zod");
|
|
2774
|
+
var CentrifugoPresenceStatsRequestRequestSchema = import_zod41.z.object({
|
|
2775
|
+
channel: import_zod41.z.string()
|
|
2776
|
+
});
|
|
2777
|
+
|
|
2778
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2779
|
+
var import_zod43 = require("zod");
|
|
2780
|
+
|
|
2781
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
|
|
2782
|
+
var import_zod42 = require("zod");
|
|
2783
|
+
var CentrifugoPresenceStatsResultSchema = import_zod42.z.object({
|
|
2784
|
+
num_clients: import_zod42.z.int(),
|
|
2785
|
+
num_users: import_zod42.z.int()
|
|
2786
|
+
});
|
|
2787
|
+
|
|
2788
|
+
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2789
|
+
var CentrifugoPresenceStatsResponseSchema = import_zod43.z.object({
|
|
2790
|
+
error: CentrifugoErrorSchema.optional(),
|
|
2791
|
+
result: CentrifugoPresenceStatsResultSchema.optional()
|
|
2792
|
+
});
|
|
2793
|
+
|
|
2794
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2795
|
+
var import_zod45 = require("zod");
|
|
2796
|
+
|
|
2797
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
|
|
2798
|
+
var import_zod44 = require("zod");
|
|
2799
|
+
var ChannelStatsSchema = import_zod44.z.object({
|
|
2800
|
+
channel: import_zod44.z.string(),
|
|
2801
|
+
total: import_zod44.z.int(),
|
|
2802
|
+
successful: import_zod44.z.int(),
|
|
2803
|
+
failed: import_zod44.z.int(),
|
|
2804
|
+
avg_duration_ms: import_zod44.z.number(),
|
|
2805
|
+
avg_acks: import_zod44.z.number(),
|
|
2806
|
+
last_activity_at: import_zod44.z.string().nullable()
|
|
2807
|
+
});
|
|
2808
|
+
|
|
2809
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2810
|
+
var ChannelListSchema = import_zod45.z.object({
|
|
2811
|
+
channels: import_zod45.z.array(ChannelStatsSchema),
|
|
2812
|
+
total_channels: import_zod45.z.int()
|
|
2813
|
+
});
|
|
2814
|
+
|
|
2815
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
|
|
2816
|
+
var import_zod46 = require("zod");
|
|
2817
|
+
var ConnectionTokenResponseSchema = import_zod46.z.object({
|
|
2818
|
+
token: import_zod46.z.string(),
|
|
2819
|
+
centrifugo_url: import_zod46.z.string(),
|
|
2820
|
+
expires_at: import_zod46.z.string(),
|
|
2821
|
+
channels: import_zod46.z.array(import_zod46.z.string())
|
|
2822
|
+
});
|
|
2823
|
+
|
|
2824
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
|
|
2825
|
+
var import_zod47 = require("zod");
|
|
2826
|
+
var ManualAckRequestRequestSchema = import_zod47.z.object({
|
|
2827
|
+
message_id: import_zod47.z.string(),
|
|
2828
|
+
client_id: import_zod47.z.string()
|
|
2829
|
+
});
|
|
2830
|
+
|
|
2831
|
+
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
|
|
2832
|
+
var import_zod48 = require("zod");
|
|
2833
|
+
var ManualAckResponseSchema = import_zod48.z.object({
|
|
2834
|
+
success: import_zod48.z.boolean(),
|
|
2835
|
+
message_id: import_zod48.z.string(),
|
|
2836
|
+
error: import_zod48.z.string().nullable().optional()
|
|
2837
|
+
});
|
|
2838
|
+
|
|
2839
|
+
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2840
|
+
var import_zod50 = require("zod");
|
|
2841
|
+
|
|
2842
|
+
// src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
|
|
2843
|
+
var import_zod49 = require("zod");
|
|
2844
|
+
var PublishSchema = import_zod49.z.object({
|
|
2845
|
+
message_id: import_zod49.z.string(),
|
|
2846
|
+
channel: import_zod49.z.string(),
|
|
2847
|
+
status: import_zod49.z.string(),
|
|
2848
|
+
wait_for_ack: import_zod49.z.boolean(),
|
|
2849
|
+
acks_received: import_zod49.z.int(),
|
|
2850
|
+
acks_expected: import_zod49.z.int().nullable(),
|
|
2851
|
+
duration_ms: import_zod49.z.number().nullable(),
|
|
2852
|
+
created_at: import_zod49.z.iso.datetime(),
|
|
2853
|
+
completed_at: import_zod49.z.iso.datetime().nullable(),
|
|
2854
|
+
error_code: import_zod49.z.string().nullable(),
|
|
2855
|
+
error_message: import_zod49.z.string().nullable()
|
|
2856
|
+
});
|
|
2857
|
+
|
|
2858
|
+
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2859
|
+
var PaginatedPublishListSchema = import_zod50.z.object({
|
|
2860
|
+
count: import_zod50.z.int(),
|
|
2861
|
+
page: import_zod50.z.int(),
|
|
2862
|
+
pages: import_zod50.z.int(),
|
|
2863
|
+
page_size: import_zod50.z.int(),
|
|
2864
|
+
has_next: import_zod50.z.boolean(),
|
|
2865
|
+
has_previous: import_zod50.z.boolean(),
|
|
2866
|
+
next_page: import_zod50.z.int().nullable().optional(),
|
|
2867
|
+
previous_page: import_zod50.z.int().nullable().optional(),
|
|
2868
|
+
results: import_zod50.z.array(PublishSchema)
|
|
2869
|
+
});
|
|
2870
|
+
|
|
2871
|
+
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
|
|
2872
|
+
var import_zod51 = require("zod");
|
|
2873
|
+
var PublishTestRequestRequestSchema = import_zod51.z.object({
|
|
2874
|
+
channel: import_zod51.z.string(),
|
|
2875
|
+
data: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.any()),
|
|
2876
|
+
wait_for_ack: import_zod51.z.boolean().optional(),
|
|
2877
|
+
ack_timeout: import_zod51.z.int().min(1).max(60).optional()
|
|
2878
|
+
});
|
|
2879
|
+
|
|
2880
|
+
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
|
|
2881
|
+
var import_zod52 = require("zod");
|
|
2882
|
+
var PublishTestResponseSchema = import_zod52.z.object({
|
|
2883
|
+
success: import_zod52.z.boolean(),
|
|
2884
|
+
message_id: import_zod52.z.string(),
|
|
2885
|
+
channel: import_zod52.z.string(),
|
|
2886
|
+
acks_received: import_zod52.z.int().optional(),
|
|
2887
|
+
delivered: import_zod52.z.boolean().optional(),
|
|
2888
|
+
error: import_zod52.z.string().nullable().optional()
|
|
2889
|
+
});
|
|
2890
|
+
|
|
2891
|
+
// src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
|
|
2892
|
+
var import_zod53 = require("zod");
|
|
2893
|
+
var TimelineItemSchema = import_zod53.z.object({
|
|
2894
|
+
timestamp: import_zod53.z.string(),
|
|
2895
|
+
count: import_zod53.z.int(),
|
|
2896
|
+
successful: import_zod53.z.int(),
|
|
2897
|
+
failed: import_zod53.z.int(),
|
|
2898
|
+
timeout: import_zod53.z.int()
|
|
2899
|
+
});
|
|
2900
|
+
|
|
2901
|
+
// src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
|
|
2902
|
+
var import_zod54 = require("zod");
|
|
2903
|
+
var TimelineResponseSchema = import_zod54.z.object({
|
|
2904
|
+
timeline: import_zod54.z.array(TimelineItemSchema),
|
|
2905
|
+
period_hours: import_zod54.z.int(),
|
|
2906
|
+
interval: import_zod54.z.string()
|
|
2907
|
+
});
|
|
2908
|
+
|
|
2909
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/index.ts
|
|
2910
|
+
var fetchers_exports2 = {};
|
|
2911
|
+
__export(fetchers_exports2, {
|
|
2912
|
+
createCentrifugoServerAuthTokenCreate: () => createCentrifugoServerAuthTokenCreate,
|
|
2913
|
+
createCentrifugoServerChannelsCreate: () => createCentrifugoServerChannelsCreate,
|
|
2914
|
+
createCentrifugoServerHistoryCreate: () => createCentrifugoServerHistoryCreate,
|
|
2915
|
+
createCentrifugoServerInfoCreate: () => createCentrifugoServerInfoCreate,
|
|
2916
|
+
createCentrifugoServerPresenceCreate: () => createCentrifugoServerPresenceCreate,
|
|
2917
|
+
createCentrifugoServerPresenceStatsCreate: () => createCentrifugoServerPresenceStatsCreate,
|
|
2918
|
+
createCentrifugoTestingPublishTestCreate: () => createCentrifugoTestingPublishTestCreate,
|
|
2919
|
+
createCentrifugoTestingPublishWithLoggingCreate: () => createCentrifugoTestingPublishWithLoggingCreate,
|
|
2920
|
+
createCentrifugoTestingSendAckCreate: () => createCentrifugoTestingSendAckCreate,
|
|
2921
|
+
getCentrifugoAuthTokenRetrieve: () => getCentrifugoAuthTokenRetrieve,
|
|
2922
|
+
getCentrifugoMonitorChannelsRetrieve: () => getCentrifugoMonitorChannelsRetrieve,
|
|
2923
|
+
getCentrifugoMonitorHealthRetrieve: () => getCentrifugoMonitorHealthRetrieve,
|
|
2924
|
+
getCentrifugoMonitorOverviewRetrieve: () => getCentrifugoMonitorOverviewRetrieve,
|
|
2925
|
+
getCentrifugoMonitorPublishesList: () => getCentrifugoMonitorPublishesList,
|
|
2926
|
+
getCentrifugoMonitorTimelineRetrieve: () => getCentrifugoMonitorTimelineRetrieve
|
|
2927
|
+
});
|
|
2928
|
+
|
|
2929
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
|
|
2433
2930
|
var import_consola7 = require("consola");
|
|
2434
2931
|
|
|
2435
|
-
// src/generated/
|
|
2932
|
+
// src/generated/cfg_centrifugo/api-instance.ts
|
|
2436
2933
|
var globalAPI2 = null;
|
|
2437
2934
|
function getAPIInstance2() {
|
|
2438
2935
|
if (!globalAPI2) {
|
|
@@ -2444,16 +2941,22 @@ function getAPIInstance2() {
|
|
|
2444
2941
|
}
|
|
2445
2942
|
__name(getAPIInstance2, "getAPIInstance");
|
|
2446
2943
|
|
|
2447
|
-
// src/generated/
|
|
2448
|
-
async function
|
|
2944
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
|
|
2945
|
+
async function createCentrifugoServerAuthTokenCreate(client) {
|
|
2449
2946
|
const api = client || getAPIInstance2();
|
|
2450
|
-
const response = await api.
|
|
2947
|
+
const response = await api.centrifugo_admin_api.centrifugoServerAuthTokenCreate();
|
|
2948
|
+
return response;
|
|
2949
|
+
}
|
|
2950
|
+
__name(createCentrifugoServerAuthTokenCreate, "createCentrifugoServerAuthTokenCreate");
|
|
2951
|
+
async function createCentrifugoServerChannelsCreate(data, client) {
|
|
2952
|
+
const api = client || getAPIInstance2();
|
|
2953
|
+
const response = await api.centrifugo_admin_api.centrifugoServerChannelsCreate(data);
|
|
2451
2954
|
try {
|
|
2452
|
-
return
|
|
2955
|
+
return CentrifugoChannelsResponseSchema.parse(response);
|
|
2453
2956
|
} catch (error) {
|
|
2454
2957
|
import_consola7.consola.error("\u274C Zod Validation Failed");
|
|
2455
|
-
import_consola7.consola.box(`
|
|
2456
|
-
Path: /cfg/
|
|
2958
|
+
import_consola7.consola.box(`createCentrifugoServerChannelsCreate
|
|
2959
|
+
Path: /cfg/centrifugo/server/channels/
|
|
2457
2960
|
Method: POST`);
|
|
2458
2961
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
2459
2962
|
import_consola7.consola.error("Validation Issues:");
|
|
@@ -2469,9 +2972,9 @@ Method: POST`);
|
|
|
2469
2972
|
try {
|
|
2470
2973
|
const event = new CustomEvent("zod-validation-error", {
|
|
2471
2974
|
detail: {
|
|
2472
|
-
operation: "
|
|
2473
|
-
path: "/cfg/
|
|
2474
|
-
method: "POST",
|
|
2975
|
+
operation: "createCentrifugoServerChannelsCreate",
|
|
2976
|
+
path: "/cfg/centrifugo/server/channels/",
|
|
2977
|
+
method: "POST",
|
|
2475
2978
|
error,
|
|
2476
2979
|
response,
|
|
2477
2980
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -2487,16 +2990,16 @@ Method: POST`);
|
|
|
2487
2990
|
throw error;
|
|
2488
2991
|
}
|
|
2489
2992
|
}
|
|
2490
|
-
__name(
|
|
2491
|
-
async function
|
|
2993
|
+
__name(createCentrifugoServerChannelsCreate, "createCentrifugoServerChannelsCreate");
|
|
2994
|
+
async function createCentrifugoServerHistoryCreate(data, client) {
|
|
2492
2995
|
const api = client || getAPIInstance2();
|
|
2493
|
-
const response = await api.
|
|
2996
|
+
const response = await api.centrifugo_admin_api.centrifugoServerHistoryCreate(data);
|
|
2494
2997
|
try {
|
|
2495
|
-
return
|
|
2998
|
+
return CentrifugoHistoryResponseSchema.parse(response);
|
|
2496
2999
|
} catch (error) {
|
|
2497
3000
|
import_consola7.consola.error("\u274C Zod Validation Failed");
|
|
2498
|
-
import_consola7.consola.box(`
|
|
2499
|
-
Path: /cfg/
|
|
3001
|
+
import_consola7.consola.box(`createCentrifugoServerHistoryCreate
|
|
3002
|
+
Path: /cfg/centrifugo/server/history/
|
|
2500
3003
|
Method: POST`);
|
|
2501
3004
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
2502
3005
|
import_consola7.consola.error("Validation Issues:");
|
|
@@ -2512,8 +3015,8 @@ Method: POST`);
|
|
|
2512
3015
|
try {
|
|
2513
3016
|
const event = new CustomEvent("zod-validation-error", {
|
|
2514
3017
|
detail: {
|
|
2515
|
-
operation: "
|
|
2516
|
-
path: "/cfg/
|
|
3018
|
+
operation: "createCentrifugoServerHistoryCreate",
|
|
3019
|
+
path: "/cfg/centrifugo/server/history/",
|
|
2517
3020
|
method: "POST",
|
|
2518
3021
|
error,
|
|
2519
3022
|
response,
|
|
@@ -2530,17 +3033,17 @@ Method: POST`);
|
|
|
2530
3033
|
throw error;
|
|
2531
3034
|
}
|
|
2532
3035
|
}
|
|
2533
|
-
__name(
|
|
2534
|
-
async function
|
|
3036
|
+
__name(createCentrifugoServerHistoryCreate, "createCentrifugoServerHistoryCreate");
|
|
3037
|
+
async function createCentrifugoServerInfoCreate(client) {
|
|
2535
3038
|
const api = client || getAPIInstance2();
|
|
2536
|
-
const response = await api.
|
|
3039
|
+
const response = await api.centrifugo_admin_api.centrifugoServerInfoCreate();
|
|
2537
3040
|
try {
|
|
2538
|
-
return
|
|
3041
|
+
return CentrifugoInfoResponseSchema.parse(response);
|
|
2539
3042
|
} catch (error) {
|
|
2540
3043
|
import_consola7.consola.error("\u274C Zod Validation Failed");
|
|
2541
|
-
import_consola7.consola.box(`
|
|
2542
|
-
Path: /cfg/
|
|
2543
|
-
Method:
|
|
3044
|
+
import_consola7.consola.box(`createCentrifugoServerInfoCreate
|
|
3045
|
+
Path: /cfg/centrifugo/server/info/
|
|
3046
|
+
Method: POST`);
|
|
2544
3047
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
2545
3048
|
import_consola7.consola.error("Validation Issues:");
|
|
2546
3049
|
error.issues.forEach((issue, index) => {
|
|
@@ -2555,9 +3058,9 @@ Method: GET`);
|
|
|
2555
3058
|
try {
|
|
2556
3059
|
const event = new CustomEvent("zod-validation-error", {
|
|
2557
3060
|
detail: {
|
|
2558
|
-
operation: "
|
|
2559
|
-
path: "/cfg/
|
|
2560
|
-
method: "
|
|
3061
|
+
operation: "createCentrifugoServerInfoCreate",
|
|
3062
|
+
path: "/cfg/centrifugo/server/info/",
|
|
3063
|
+
method: "POST",
|
|
2561
3064
|
error,
|
|
2562
3065
|
response,
|
|
2563
3066
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -2573,1832 +3076,1335 @@ Method: GET`);
|
|
|
2573
3076
|
throw error;
|
|
2574
3077
|
}
|
|
2575
3078
|
}
|
|
2576
|
-
__name(
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
this.web_push = this._client.web_push;
|
|
2596
|
-
}
|
|
2597
|
-
static {
|
|
2598
|
-
__name(this, "API");
|
|
2599
|
-
}
|
|
2600
|
-
_loadTokensFromStorage() {
|
|
2601
|
-
this._token = this.storage.getItem(TOKEN_KEY2);
|
|
2602
|
-
this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY2);
|
|
2603
|
-
}
|
|
2604
|
-
_reinitClients() {
|
|
2605
|
-
this._client = new APIClient2(this.baseUrl, {
|
|
2606
|
-
retryConfig: this.options?.retryConfig,
|
|
2607
|
-
loggerConfig: this.options?.loggerConfig
|
|
2608
|
-
});
|
|
2609
|
-
this._injectAuthHeader();
|
|
2610
|
-
this.web_push = this._client.web_push;
|
|
2611
|
-
}
|
|
2612
|
-
_injectAuthHeader() {
|
|
2613
|
-
const originalRequest = this._client.request.bind(this._client);
|
|
2614
|
-
this._client.request = async (method, path, options) => {
|
|
2615
|
-
const token = this.getToken();
|
|
2616
|
-
const mergedOptions = {
|
|
2617
|
-
...options,
|
|
2618
|
-
headers: {
|
|
2619
|
-
...options?.headers || {},
|
|
2620
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
2621
|
-
}
|
|
2622
|
-
};
|
|
2623
|
-
return originalRequest(method, path, mergedOptions);
|
|
2624
|
-
};
|
|
2625
|
-
}
|
|
2626
|
-
/**
|
|
2627
|
-
* Get current JWT token
|
|
2628
|
-
*/
|
|
2629
|
-
getToken() {
|
|
2630
|
-
return this.storage.getItem(TOKEN_KEY2);
|
|
2631
|
-
}
|
|
2632
|
-
/**
|
|
2633
|
-
* Get current refresh token
|
|
2634
|
-
*/
|
|
2635
|
-
getRefreshToken() {
|
|
2636
|
-
return this.storage.getItem(REFRESH_TOKEN_KEY2);
|
|
2637
|
-
}
|
|
2638
|
-
/**
|
|
2639
|
-
* Set JWT token and refresh token
|
|
2640
|
-
* @param token - JWT access token
|
|
2641
|
-
* @param refreshToken - JWT refresh token (optional)
|
|
2642
|
-
*/
|
|
2643
|
-
setToken(token, refreshToken) {
|
|
2644
|
-
this._token = token;
|
|
2645
|
-
this.storage.setItem(TOKEN_KEY2, token);
|
|
2646
|
-
if (refreshToken) {
|
|
2647
|
-
this._refreshToken = refreshToken;
|
|
2648
|
-
this.storage.setItem(REFRESH_TOKEN_KEY2, refreshToken);
|
|
3079
|
+
__name(createCentrifugoServerInfoCreate, "createCentrifugoServerInfoCreate");
|
|
3080
|
+
async function createCentrifugoServerPresenceCreate(data, client) {
|
|
3081
|
+
const api = client || getAPIInstance2();
|
|
3082
|
+
const response = await api.centrifugo_admin_api.centrifugoServerPresenceCreate(data);
|
|
3083
|
+
try {
|
|
3084
|
+
return CentrifugoPresenceResponseSchema.parse(response);
|
|
3085
|
+
} catch (error) {
|
|
3086
|
+
import_consola7.consola.error("\u274C Zod Validation Failed");
|
|
3087
|
+
import_consola7.consola.box(`createCentrifugoServerPresenceCreate
|
|
3088
|
+
Path: /cfg/centrifugo/server/presence/
|
|
3089
|
+
Method: POST`);
|
|
3090
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3091
|
+
import_consola7.consola.error("Validation Issues:");
|
|
3092
|
+
error.issues.forEach((issue, index) => {
|
|
3093
|
+
import_consola7.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3094
|
+
import_consola7.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3095
|
+
if (issue.expected) import_consola7.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3096
|
+
if (issue.received) import_consola7.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3097
|
+
});
|
|
2649
3098
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
*/
|
|
2672
|
-
setBaseUrl(url) {
|
|
2673
|
-
this.baseUrl = url;
|
|
2674
|
-
this._reinitClients();
|
|
2675
|
-
}
|
|
2676
|
-
/**
|
|
2677
|
-
* Get current base URL
|
|
2678
|
-
*/
|
|
2679
|
-
getBaseUrl() {
|
|
2680
|
-
return this.baseUrl;
|
|
3099
|
+
import_consola7.consola.error("Response data:", response);
|
|
3100
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3101
|
+
try {
|
|
3102
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3103
|
+
detail: {
|
|
3104
|
+
operation: "createCentrifugoServerPresenceCreate",
|
|
3105
|
+
path: "/cfg/centrifugo/server/presence/",
|
|
3106
|
+
method: "POST",
|
|
3107
|
+
error,
|
|
3108
|
+
response,
|
|
3109
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3110
|
+
},
|
|
3111
|
+
bubbles: true,
|
|
3112
|
+
cancelable: false
|
|
3113
|
+
});
|
|
3114
|
+
window.dispatchEvent(event);
|
|
3115
|
+
} catch (eventError) {
|
|
3116
|
+
import_consola7.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
throw error;
|
|
2681
3120
|
}
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
3121
|
+
}
|
|
3122
|
+
__name(createCentrifugoServerPresenceCreate, "createCentrifugoServerPresenceCreate");
|
|
3123
|
+
async function createCentrifugoServerPresenceStatsCreate(data, client) {
|
|
3124
|
+
const api = client || getAPIInstance2();
|
|
3125
|
+
const response = await api.centrifugo_admin_api.centrifugoServerPresenceStatsCreate(data);
|
|
3126
|
+
try {
|
|
3127
|
+
return CentrifugoPresenceStatsResponseSchema.parse(response);
|
|
3128
|
+
} catch (error) {
|
|
3129
|
+
import_consola7.consola.error("\u274C Zod Validation Failed");
|
|
3130
|
+
import_consola7.consola.box(`createCentrifugoServerPresenceStatsCreate
|
|
3131
|
+
Path: /cfg/centrifugo/server/presence-stats/
|
|
3132
|
+
Method: POST`);
|
|
3133
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3134
|
+
import_consola7.consola.error("Validation Issues:");
|
|
3135
|
+
error.issues.forEach((issue, index) => {
|
|
3136
|
+
import_consola7.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3137
|
+
import_consola7.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3138
|
+
if (issue.expected) import_consola7.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3139
|
+
if (issue.received) import_consola7.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3140
|
+
});
|
|
3141
|
+
}
|
|
3142
|
+
import_consola7.consola.error("Response data:", response);
|
|
3143
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3144
|
+
try {
|
|
3145
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3146
|
+
detail: {
|
|
3147
|
+
operation: "createCentrifugoServerPresenceStatsCreate",
|
|
3148
|
+
path: "/cfg/centrifugo/server/presence-stats/",
|
|
3149
|
+
method: "POST",
|
|
3150
|
+
error,
|
|
3151
|
+
response,
|
|
3152
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3153
|
+
},
|
|
3154
|
+
bubbles: true,
|
|
3155
|
+
cancelable: false
|
|
3156
|
+
});
|
|
3157
|
+
window.dispatchEvent(event);
|
|
3158
|
+
} catch (eventError) {
|
|
3159
|
+
import_consola7.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
throw error;
|
|
2696
3163
|
}
|
|
2697
|
-
}
|
|
3164
|
+
}
|
|
3165
|
+
__name(createCentrifugoServerPresenceStatsCreate, "createCentrifugoServerPresenceStatsCreate");
|
|
2698
3166
|
|
|
2699
|
-
// src/generated/cfg_centrifugo/
|
|
2700
|
-
var
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
}
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
return response;
|
|
2742
|
-
}
|
|
2743
|
-
/**
|
|
2744
|
-
* Get channel presence
|
|
2745
|
-
*
|
|
2746
|
-
* Returns list of clients currently subscribed to a channel.
|
|
2747
|
-
*/
|
|
2748
|
-
async centrifugoServerPresenceCreate(data) {
|
|
2749
|
-
const response = await this.client.request("POST", "/cfg/centrifugo/server/presence/", { body: data });
|
|
2750
|
-
return response;
|
|
2751
|
-
}
|
|
2752
|
-
/**
|
|
2753
|
-
* Get channel presence statistics
|
|
2754
|
-
*
|
|
2755
|
-
* Returns quick statistics about channel presence (num_clients,
|
|
2756
|
-
* num_users).
|
|
2757
|
-
*/
|
|
2758
|
-
async centrifugoServerPresenceStatsCreate(data) {
|
|
2759
|
-
const response = await this.client.request("POST", "/cfg/centrifugo/server/presence-stats/", { body: data });
|
|
2760
|
-
return response;
|
|
2761
|
-
}
|
|
2762
|
-
};
|
|
2763
|
-
|
|
2764
|
-
// src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts
|
|
2765
|
-
var CentrifugoAuth = class {
|
|
2766
|
-
static {
|
|
2767
|
-
__name(this, "CentrifugoAuth");
|
|
2768
|
-
}
|
|
2769
|
-
constructor(client) {
|
|
2770
|
-
this.client = client;
|
|
2771
|
-
}
|
|
2772
|
-
/**
|
|
2773
|
-
* Get Centrifugo connection token
|
|
2774
|
-
*
|
|
2775
|
-
* Generate JWT token for WebSocket connection to Centrifugo. Token
|
|
2776
|
-
* includes user's allowed channels based on their permissions. Requires
|
|
2777
|
-
* authentication.
|
|
2778
|
-
*/
|
|
2779
|
-
async tokenRetrieve() {
|
|
2780
|
-
const response = await this.client.request("GET", "/cfg/centrifugo/auth/token/");
|
|
2781
|
-
return response;
|
|
3167
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts
|
|
3168
|
+
var import_consola8 = require("consola");
|
|
3169
|
+
async function getCentrifugoAuthTokenRetrieve(client) {
|
|
3170
|
+
const api = client || getAPIInstance2();
|
|
3171
|
+
const response = await api.centrifugo_auth.tokenRetrieve();
|
|
3172
|
+
try {
|
|
3173
|
+
return ConnectionTokenResponseSchema.parse(response);
|
|
3174
|
+
} catch (error) {
|
|
3175
|
+
import_consola8.consola.error("\u274C Zod Validation Failed");
|
|
3176
|
+
import_consola8.consola.box(`getCentrifugoAuthTokenRetrieve
|
|
3177
|
+
Path: /cfg/centrifugo/auth/token/
|
|
3178
|
+
Method: GET`);
|
|
3179
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3180
|
+
import_consola8.consola.error("Validation Issues:");
|
|
3181
|
+
error.issues.forEach((issue, index) => {
|
|
3182
|
+
import_consola8.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3183
|
+
import_consola8.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3184
|
+
if (issue.expected) import_consola8.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3185
|
+
if (issue.received) import_consola8.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3186
|
+
});
|
|
3187
|
+
}
|
|
3188
|
+
import_consola8.consola.error("Response data:", response);
|
|
3189
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3190
|
+
try {
|
|
3191
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3192
|
+
detail: {
|
|
3193
|
+
operation: "getCentrifugoAuthTokenRetrieve",
|
|
3194
|
+
path: "/cfg/centrifugo/auth/token/",
|
|
3195
|
+
method: "GET",
|
|
3196
|
+
error,
|
|
3197
|
+
response,
|
|
3198
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3199
|
+
},
|
|
3200
|
+
bubbles: true,
|
|
3201
|
+
cancelable: false
|
|
3202
|
+
});
|
|
3203
|
+
window.dispatchEvent(event);
|
|
3204
|
+
} catch (eventError) {
|
|
3205
|
+
import_consola8.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
throw error;
|
|
2782
3209
|
}
|
|
2783
|
-
}
|
|
3210
|
+
}
|
|
3211
|
+
__name(getCentrifugoAuthTokenRetrieve, "getCentrifugoAuthTokenRetrieve");
|
|
2784
3212
|
|
|
2785
|
-
// src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring
|
|
2786
|
-
var
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
}
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
3213
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts
|
|
3214
|
+
var import_consola9 = require("consola");
|
|
3215
|
+
async function getCentrifugoMonitorChannelsRetrieve(params, client) {
|
|
3216
|
+
const api = client || getAPIInstance2();
|
|
3217
|
+
const response = await api.centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours);
|
|
3218
|
+
try {
|
|
3219
|
+
return ChannelListSchema.parse(response);
|
|
3220
|
+
} catch (error) {
|
|
3221
|
+
import_consola9.consola.error("\u274C Zod Validation Failed");
|
|
3222
|
+
import_consola9.consola.box(`getCentrifugoMonitorChannelsRetrieve
|
|
3223
|
+
Path: /cfg/centrifugo/monitor/channels/
|
|
3224
|
+
Method: GET`);
|
|
3225
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3226
|
+
import_consola9.consola.error("Validation Issues:");
|
|
3227
|
+
error.issues.forEach((issue, index) => {
|
|
3228
|
+
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3229
|
+
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3230
|
+
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3231
|
+
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3232
|
+
});
|
|
2805
3233
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
let params;
|
|
2826
|
-
if (isParamsObject) {
|
|
2827
|
-
params = args[0];
|
|
2828
|
-
} else {
|
|
2829
|
-
params = { hours: args[0] };
|
|
3234
|
+
import_consola9.consola.error("Response data:", response);
|
|
3235
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3236
|
+
try {
|
|
3237
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3238
|
+
detail: {
|
|
3239
|
+
operation: "getCentrifugoMonitorChannelsRetrieve",
|
|
3240
|
+
path: "/cfg/centrifugo/monitor/channels/",
|
|
3241
|
+
method: "GET",
|
|
3242
|
+
error,
|
|
3243
|
+
response,
|
|
3244
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3245
|
+
},
|
|
3246
|
+
bubbles: true,
|
|
3247
|
+
cancelable: false
|
|
3248
|
+
});
|
|
3249
|
+
window.dispatchEvent(event);
|
|
3250
|
+
} catch (eventError) {
|
|
3251
|
+
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3252
|
+
}
|
|
2830
3253
|
}
|
|
2831
|
-
|
|
2832
|
-
return response;
|
|
3254
|
+
throw error;
|
|
2833
3255
|
}
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
3256
|
+
}
|
|
3257
|
+
__name(getCentrifugoMonitorChannelsRetrieve, "getCentrifugoMonitorChannelsRetrieve");
|
|
3258
|
+
async function getCentrifugoMonitorHealthRetrieve(client) {
|
|
3259
|
+
const api = client || getAPIInstance2();
|
|
3260
|
+
const response = await api.centrifugo_monitoring.centrifugoMonitorHealthRetrieve();
|
|
3261
|
+
try {
|
|
3262
|
+
return CentrifugoHealthCheckSchema.parse(response);
|
|
3263
|
+
} catch (error) {
|
|
3264
|
+
import_consola9.consola.error("\u274C Zod Validation Failed");
|
|
3265
|
+
import_consola9.consola.box(`getCentrifugoMonitorHealthRetrieve
|
|
3266
|
+
Path: /cfg/centrifugo/monitor/health/
|
|
3267
|
+
Method: GET`);
|
|
3268
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3269
|
+
import_consola9.consola.error("Validation Issues:");
|
|
3270
|
+
error.issues.forEach((issue, index) => {
|
|
3271
|
+
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3272
|
+
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3273
|
+
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3274
|
+
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3275
|
+
});
|
|
2847
3276
|
}
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
3277
|
+
import_consola9.consola.error("Response data:", response);
|
|
3278
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3279
|
+
try {
|
|
3280
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3281
|
+
detail: {
|
|
3282
|
+
operation: "getCentrifugoMonitorHealthRetrieve",
|
|
3283
|
+
path: "/cfg/centrifugo/monitor/health/",
|
|
3284
|
+
method: "GET",
|
|
3285
|
+
error,
|
|
3286
|
+
response,
|
|
3287
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3288
|
+
},
|
|
3289
|
+
bubbles: true,
|
|
3290
|
+
cancelable: false
|
|
3291
|
+
});
|
|
3292
|
+
window.dispatchEvent(event);
|
|
3293
|
+
} catch (eventError) {
|
|
3294
|
+
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3295
|
+
}
|
|
2863
3296
|
}
|
|
2864
|
-
|
|
2865
|
-
return response;
|
|
3297
|
+
throw error;
|
|
2866
3298
|
}
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
}
|
|
2887
|
-
/**
|
|
2888
|
-
* Publish with database logging
|
|
2889
|
-
*
|
|
2890
|
-
* Publish message using CentrifugoClient with database logging. This will
|
|
2891
|
-
* create CentrifugoLog records.
|
|
2892
|
-
*/
|
|
2893
|
-
async publishWithLoggingCreate(data) {
|
|
2894
|
-
const response = await this.client.request("POST", "/cfg/centrifugo/testing/publish-with-logging/", { body: data });
|
|
2895
|
-
return response;
|
|
2896
|
-
}
|
|
2897
|
-
/**
|
|
2898
|
-
* Send manual ACK
|
|
2899
|
-
*
|
|
2900
|
-
* Manually send ACK for a message to the wrapper. Pass message_id in
|
|
2901
|
-
* request body.
|
|
2902
|
-
*/
|
|
2903
|
-
async sendAckCreate(data) {
|
|
2904
|
-
const response = await this.client.request("POST", "/cfg/centrifugo/testing/send-ack/", { body: data });
|
|
2905
|
-
return response;
|
|
2906
|
-
}
|
|
2907
|
-
};
|
|
2908
|
-
|
|
2909
|
-
// src/generated/cfg_centrifugo/http.ts
|
|
2910
|
-
var FetchAdapter3 = class {
|
|
2911
|
-
static {
|
|
2912
|
-
__name(this, "FetchAdapter");
|
|
2913
|
-
}
|
|
2914
|
-
async request(request) {
|
|
2915
|
-
const { method, url, headers, body, params, formData } = request;
|
|
2916
|
-
let finalUrl = url;
|
|
2917
|
-
if (params) {
|
|
2918
|
-
const searchParams = new URLSearchParams();
|
|
2919
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
2920
|
-
if (value !== null && value !== void 0) {
|
|
2921
|
-
searchParams.append(key, String(value));
|
|
2922
|
-
}
|
|
3299
|
+
}
|
|
3300
|
+
__name(getCentrifugoMonitorHealthRetrieve, "getCentrifugoMonitorHealthRetrieve");
|
|
3301
|
+
async function getCentrifugoMonitorOverviewRetrieve(params, client) {
|
|
3302
|
+
const api = client || getAPIInstance2();
|
|
3303
|
+
const response = await api.centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours);
|
|
3304
|
+
try {
|
|
3305
|
+
return CentrifugoOverviewStatsSchema.parse(response);
|
|
3306
|
+
} catch (error) {
|
|
3307
|
+
import_consola9.consola.error("\u274C Zod Validation Failed");
|
|
3308
|
+
import_consola9.consola.box(`getCentrifugoMonitorOverviewRetrieve
|
|
3309
|
+
Path: /cfg/centrifugo/monitor/overview/
|
|
3310
|
+
Method: GET`);
|
|
3311
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3312
|
+
import_consola9.consola.error("Validation Issues:");
|
|
3313
|
+
error.issues.forEach((issue, index) => {
|
|
3314
|
+
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3315
|
+
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3316
|
+
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3317
|
+
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
2923
3318
|
});
|
|
2924
|
-
const queryString = searchParams.toString();
|
|
2925
|
-
if (queryString) {
|
|
2926
|
-
finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
|
|
2927
|
-
}
|
|
2928
|
-
}
|
|
2929
|
-
const finalHeaders = { ...headers };
|
|
2930
|
-
let requestBody;
|
|
2931
|
-
if (formData) {
|
|
2932
|
-
requestBody = formData;
|
|
2933
|
-
} else if (body) {
|
|
2934
|
-
finalHeaders["Content-Type"] = "application/json";
|
|
2935
|
-
requestBody = JSON.stringify(body);
|
|
2936
3319
|
}
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
3320
|
+
import_consola9.consola.error("Response data:", response);
|
|
3321
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3322
|
+
try {
|
|
3323
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3324
|
+
detail: {
|
|
3325
|
+
operation: "getCentrifugoMonitorOverviewRetrieve",
|
|
3326
|
+
path: "/cfg/centrifugo/monitor/overview/",
|
|
3327
|
+
method: "GET",
|
|
3328
|
+
error,
|
|
3329
|
+
response,
|
|
3330
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3331
|
+
},
|
|
3332
|
+
bubbles: true,
|
|
3333
|
+
cancelable: false
|
|
3334
|
+
});
|
|
3335
|
+
window.dispatchEvent(event);
|
|
3336
|
+
} catch (eventError) {
|
|
3337
|
+
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3338
|
+
}
|
|
2950
3339
|
}
|
|
2951
|
-
|
|
2952
|
-
response.headers.forEach((value, key) => {
|
|
2953
|
-
responseHeaders[key] = value;
|
|
2954
|
-
});
|
|
2955
|
-
return {
|
|
2956
|
-
data,
|
|
2957
|
-
status: response.status,
|
|
2958
|
-
statusText: response.statusText,
|
|
2959
|
-
headers: responseHeaders
|
|
2960
|
-
};
|
|
2961
|
-
}
|
|
2962
|
-
};
|
|
2963
|
-
|
|
2964
|
-
// src/generated/cfg_centrifugo/errors.ts
|
|
2965
|
-
var APIError3 = class extends Error {
|
|
2966
|
-
constructor(statusCode, statusText, response, url, message) {
|
|
2967
|
-
super(message || `HTTP ${statusCode}: ${statusText}`);
|
|
2968
|
-
this.statusCode = statusCode;
|
|
2969
|
-
this.statusText = statusText;
|
|
2970
|
-
this.response = response;
|
|
2971
|
-
this.url = url;
|
|
2972
|
-
this.name = "APIError";
|
|
2973
|
-
}
|
|
2974
|
-
static {
|
|
2975
|
-
__name(this, "APIError");
|
|
3340
|
+
throw error;
|
|
2976
3341
|
}
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
3342
|
+
}
|
|
3343
|
+
__name(getCentrifugoMonitorOverviewRetrieve, "getCentrifugoMonitorOverviewRetrieve");
|
|
3344
|
+
async function getCentrifugoMonitorPublishesList(params, client) {
|
|
3345
|
+
const api = client || getAPIInstance2();
|
|
3346
|
+
const response = await api.centrifugo_monitoring.centrifugoMonitorPublishesList(params?.channel, params?.page, params?.page_size, params?.status);
|
|
3347
|
+
try {
|
|
3348
|
+
return PaginatedPublishListSchema.parse(response);
|
|
3349
|
+
} catch (error) {
|
|
3350
|
+
import_consola9.consola.error("\u274C Zod Validation Failed");
|
|
3351
|
+
import_consola9.consola.box(`getCentrifugoMonitorPublishesList
|
|
3352
|
+
Path: /cfg/centrifugo/monitor/publishes/
|
|
3353
|
+
Method: GET`);
|
|
3354
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3355
|
+
import_consola9.consola.error("Validation Issues:");
|
|
3356
|
+
error.issues.forEach((issue, index) => {
|
|
3357
|
+
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3358
|
+
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3359
|
+
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3360
|
+
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3361
|
+
});
|
|
2984
3362
|
}
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3363
|
+
import_consola9.consola.error("Response data:", response);
|
|
3364
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3365
|
+
try {
|
|
3366
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3367
|
+
detail: {
|
|
3368
|
+
operation: "getCentrifugoMonitorPublishesList",
|
|
3369
|
+
path: "/cfg/centrifugo/monitor/publishes/",
|
|
3370
|
+
method: "GET",
|
|
3371
|
+
error,
|
|
3372
|
+
response,
|
|
3373
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3374
|
+
},
|
|
3375
|
+
bubbles: true,
|
|
3376
|
+
cancelable: false
|
|
3377
|
+
});
|
|
3378
|
+
window.dispatchEvent(event);
|
|
3379
|
+
} catch (eventError) {
|
|
3380
|
+
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
2998
3381
|
}
|
|
2999
3382
|
}
|
|
3000
|
-
|
|
3383
|
+
throw error;
|
|
3001
3384
|
}
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3385
|
+
}
|
|
3386
|
+
__name(getCentrifugoMonitorPublishesList, "getCentrifugoMonitorPublishesList");
|
|
3387
|
+
async function getCentrifugoMonitorTimelineRetrieve(params, client) {
|
|
3388
|
+
const api = client || getAPIInstance2();
|
|
3389
|
+
const response = await api.centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval);
|
|
3390
|
+
try {
|
|
3391
|
+
return TimelineResponseSchema.parse(response);
|
|
3392
|
+
} catch (error) {
|
|
3393
|
+
import_consola9.consola.error("\u274C Zod Validation Failed");
|
|
3394
|
+
import_consola9.consola.box(`getCentrifugoMonitorTimelineRetrieve
|
|
3395
|
+
Path: /cfg/centrifugo/monitor/timeline/
|
|
3396
|
+
Method: GET`);
|
|
3397
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3398
|
+
import_consola9.consola.error("Validation Issues:");
|
|
3399
|
+
error.issues.forEach((issue, index) => {
|
|
3400
|
+
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3401
|
+
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3402
|
+
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3403
|
+
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3404
|
+
});
|
|
3014
3405
|
}
|
|
3015
|
-
|
|
3016
|
-
if (
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3406
|
+
import_consola9.consola.error("Response data:", response);
|
|
3407
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3408
|
+
try {
|
|
3409
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3410
|
+
detail: {
|
|
3411
|
+
operation: "getCentrifugoMonitorTimelineRetrieve",
|
|
3412
|
+
path: "/cfg/centrifugo/monitor/timeline/",
|
|
3413
|
+
method: "GET",
|
|
3414
|
+
error,
|
|
3415
|
+
response,
|
|
3416
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3417
|
+
},
|
|
3418
|
+
bubbles: true,
|
|
3419
|
+
cancelable: false
|
|
3420
|
+
});
|
|
3421
|
+
window.dispatchEvent(event);
|
|
3422
|
+
} catch (eventError) {
|
|
3423
|
+
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3020
3424
|
}
|
|
3021
3425
|
}
|
|
3022
|
-
|
|
3426
|
+
throw error;
|
|
3023
3427
|
}
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3428
|
+
}
|
|
3429
|
+
__name(getCentrifugoMonitorTimelineRetrieve, "getCentrifugoMonitorTimelineRetrieve");
|
|
3430
|
+
|
|
3431
|
+
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts
|
|
3432
|
+
var import_consola10 = require("consola");
|
|
3433
|
+
async function createCentrifugoTestingPublishTestCreate(data, client) {
|
|
3434
|
+
const api = client || getAPIInstance2();
|
|
3435
|
+
const response = await api.centrifugo_testing.publishTestCreate(data);
|
|
3436
|
+
try {
|
|
3437
|
+
return PublishTestResponseSchema.parse(response);
|
|
3438
|
+
} catch (error) {
|
|
3439
|
+
import_consola10.consola.error("\u274C Zod Validation Failed");
|
|
3440
|
+
import_consola10.consola.box(`createCentrifugoTestingPublishTestCreate
|
|
3441
|
+
Path: /cfg/centrifugo/testing/publish-test/
|
|
3442
|
+
Method: POST`);
|
|
3443
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3444
|
+
import_consola10.consola.error("Validation Issues:");
|
|
3445
|
+
error.issues.forEach((issue, index) => {
|
|
3446
|
+
import_consola10.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3447
|
+
import_consola10.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3448
|
+
if (issue.expected) import_consola10.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3449
|
+
if (issue.received) import_consola10.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3450
|
+
});
|
|
3451
|
+
}
|
|
3452
|
+
import_consola10.consola.error("Response data:", response);
|
|
3453
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3454
|
+
try {
|
|
3455
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3456
|
+
detail: {
|
|
3457
|
+
operation: "createCentrifugoTestingPublishTestCreate",
|
|
3458
|
+
path: "/cfg/centrifugo/testing/publish-test/",
|
|
3459
|
+
method: "POST",
|
|
3460
|
+
error,
|
|
3461
|
+
response,
|
|
3462
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3463
|
+
},
|
|
3464
|
+
bubbles: true,
|
|
3465
|
+
cancelable: false
|
|
3466
|
+
});
|
|
3467
|
+
window.dispatchEvent(event);
|
|
3468
|
+
} catch (eventError) {
|
|
3469
|
+
import_consola10.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
throw error;
|
|
3033
3473
|
}
|
|
3034
|
-
|
|
3035
|
-
|
|
3474
|
+
}
|
|
3475
|
+
__name(createCentrifugoTestingPublishTestCreate, "createCentrifugoTestingPublishTestCreate");
|
|
3476
|
+
async function createCentrifugoTestingPublishWithLoggingCreate(data, client) {
|
|
3477
|
+
const api = client || getAPIInstance2();
|
|
3478
|
+
const response = await api.centrifugo_testing.publishWithLoggingCreate(data);
|
|
3479
|
+
try {
|
|
3480
|
+
return PublishTestResponseSchema.parse(response);
|
|
3481
|
+
} catch (error) {
|
|
3482
|
+
import_consola10.consola.error("\u274C Zod Validation Failed");
|
|
3483
|
+
import_consola10.consola.box(`createCentrifugoTestingPublishWithLoggingCreate
|
|
3484
|
+
Path: /cfg/centrifugo/testing/publish-with-logging/
|
|
3485
|
+
Method: POST`);
|
|
3486
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3487
|
+
import_consola10.consola.error("Validation Issues:");
|
|
3488
|
+
error.issues.forEach((issue, index) => {
|
|
3489
|
+
import_consola10.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3490
|
+
import_consola10.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3491
|
+
if (issue.expected) import_consola10.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3492
|
+
if (issue.received) import_consola10.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3493
|
+
});
|
|
3494
|
+
}
|
|
3495
|
+
import_consola10.consola.error("Response data:", response);
|
|
3496
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3497
|
+
try {
|
|
3498
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3499
|
+
detail: {
|
|
3500
|
+
operation: "createCentrifugoTestingPublishWithLoggingCreate",
|
|
3501
|
+
path: "/cfg/centrifugo/testing/publish-with-logging/",
|
|
3502
|
+
method: "POST",
|
|
3503
|
+
error,
|
|
3504
|
+
response,
|
|
3505
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3506
|
+
},
|
|
3507
|
+
bubbles: true,
|
|
3508
|
+
cancelable: false
|
|
3509
|
+
});
|
|
3510
|
+
window.dispatchEvent(event);
|
|
3511
|
+
} catch (eventError) {
|
|
3512
|
+
import_consola10.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
throw error;
|
|
3036
3516
|
}
|
|
3037
|
-
|
|
3038
|
-
|
|
3517
|
+
}
|
|
3518
|
+
__name(createCentrifugoTestingPublishWithLoggingCreate, "createCentrifugoTestingPublishWithLoggingCreate");
|
|
3519
|
+
async function createCentrifugoTestingSendAckCreate(data, client) {
|
|
3520
|
+
const api = client || getAPIInstance2();
|
|
3521
|
+
const response = await api.centrifugo_testing.sendAckCreate(data);
|
|
3522
|
+
try {
|
|
3523
|
+
return ManualAckResponseSchema.parse(response);
|
|
3524
|
+
} catch (error) {
|
|
3525
|
+
import_consola10.consola.error("\u274C Zod Validation Failed");
|
|
3526
|
+
import_consola10.consola.box(`createCentrifugoTestingSendAckCreate
|
|
3527
|
+
Path: /cfg/centrifugo/testing/send-ack/
|
|
3528
|
+
Method: POST`);
|
|
3529
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3530
|
+
import_consola10.consola.error("Validation Issues:");
|
|
3531
|
+
error.issues.forEach((issue, index) => {
|
|
3532
|
+
import_consola10.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3533
|
+
import_consola10.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3534
|
+
if (issue.expected) import_consola10.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3535
|
+
if (issue.received) import_consola10.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3536
|
+
});
|
|
3537
|
+
}
|
|
3538
|
+
import_consola10.consola.error("Response data:", response);
|
|
3539
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
3540
|
+
try {
|
|
3541
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
3542
|
+
detail: {
|
|
3543
|
+
operation: "createCentrifugoTestingSendAckCreate",
|
|
3544
|
+
path: "/cfg/centrifugo/testing/send-ack/",
|
|
3545
|
+
method: "POST",
|
|
3546
|
+
error,
|
|
3547
|
+
response,
|
|
3548
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3549
|
+
},
|
|
3550
|
+
bubbles: true,
|
|
3551
|
+
cancelable: false
|
|
3552
|
+
});
|
|
3553
|
+
window.dispatchEvent(event);
|
|
3554
|
+
} catch (eventError) {
|
|
3555
|
+
import_consola10.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
throw error;
|
|
3039
3559
|
}
|
|
3040
|
-
}
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3560
|
+
}
|
|
3561
|
+
__name(createCentrifugoTestingSendAckCreate, "createCentrifugoTestingSendAckCreate");
|
|
3562
|
+
|
|
3563
|
+
// src/generated/cfg_centrifugo/index.ts
|
|
3564
|
+
var TOKEN_KEY2 = "auth_token";
|
|
3565
|
+
var REFRESH_TOKEN_KEY2 = "refresh_token";
|
|
3566
|
+
var API2 = class {
|
|
3567
|
+
constructor(baseUrl, options) {
|
|
3568
|
+
this._token = null;
|
|
3569
|
+
this._refreshToken = null;
|
|
3570
|
+
this.baseUrl = baseUrl;
|
|
3571
|
+
this.options = options;
|
|
3572
|
+
const logger = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
|
|
3573
|
+
this.storage = options?.storage || new LocalStorageAdapter2(logger);
|
|
3574
|
+
this._loadTokensFromStorage();
|
|
3575
|
+
this._client = new APIClient2(this.baseUrl, {
|
|
3576
|
+
retryConfig: this.options?.retryConfig,
|
|
3577
|
+
loggerConfig: this.options?.loggerConfig
|
|
3578
|
+
});
|
|
3579
|
+
this._injectAuthHeader();
|
|
3580
|
+
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
3581
|
+
this.centrifugo_auth = this._client.centrifugo_auth;
|
|
3582
|
+
this.centrifugo_monitoring = this._client.centrifugo_monitoring;
|
|
3583
|
+
this.centrifugo_testing = this._client.centrifugo_testing;
|
|
3047
3584
|
}
|
|
3048
3585
|
static {
|
|
3049
|
-
__name(this, "
|
|
3586
|
+
__name(this, "API");
|
|
3050
3587
|
}
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
var import_consola8 = require("consola");
|
|
3055
|
-
var DEFAULT_CONFIG3 = {
|
|
3056
|
-
enabled: process.env.NODE_ENV !== "production",
|
|
3057
|
-
logRequests: true,
|
|
3058
|
-
logResponses: true,
|
|
3059
|
-
logErrors: true,
|
|
3060
|
-
logBodies: true,
|
|
3061
|
-
logHeaders: false
|
|
3062
|
-
};
|
|
3063
|
-
var SENSITIVE_HEADERS3 = [
|
|
3064
|
-
"authorization",
|
|
3065
|
-
"cookie",
|
|
3066
|
-
"set-cookie",
|
|
3067
|
-
"x-api-key",
|
|
3068
|
-
"x-csrf-token"
|
|
3069
|
-
];
|
|
3070
|
-
var APILogger3 = class {
|
|
3071
|
-
static {
|
|
3072
|
-
__name(this, "APILogger");
|
|
3588
|
+
_loadTokensFromStorage() {
|
|
3589
|
+
this._token = this.storage.getItem(TOKEN_KEY2);
|
|
3590
|
+
this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY2);
|
|
3073
3591
|
}
|
|
3074
|
-
|
|
3075
|
-
this.
|
|
3076
|
-
|
|
3077
|
-
|
|
3592
|
+
_reinitClients() {
|
|
3593
|
+
this._client = new APIClient2(this.baseUrl, {
|
|
3594
|
+
retryConfig: this.options?.retryConfig,
|
|
3595
|
+
loggerConfig: this.options?.loggerConfig
|
|
3078
3596
|
});
|
|
3597
|
+
this._injectAuthHeader();
|
|
3598
|
+
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
3599
|
+
this.centrifugo_auth = this._client.centrifugo_auth;
|
|
3600
|
+
this.centrifugo_monitoring = this._client.centrifugo_monitoring;
|
|
3601
|
+
this.centrifugo_testing = this._client.centrifugo_testing;
|
|
3602
|
+
}
|
|
3603
|
+
_injectAuthHeader() {
|
|
3604
|
+
const originalRequest = this._client.request.bind(this._client);
|
|
3605
|
+
this._client.request = async (method, path, options) => {
|
|
3606
|
+
const token = this.getToken();
|
|
3607
|
+
const mergedOptions = {
|
|
3608
|
+
...options,
|
|
3609
|
+
headers: {
|
|
3610
|
+
...options?.headers || {},
|
|
3611
|
+
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
3612
|
+
}
|
|
3613
|
+
};
|
|
3614
|
+
return originalRequest(method, path, mergedOptions);
|
|
3615
|
+
};
|
|
3079
3616
|
}
|
|
3080
3617
|
/**
|
|
3081
|
-
*
|
|
3618
|
+
* Get current JWT token
|
|
3082
3619
|
*/
|
|
3083
|
-
|
|
3084
|
-
this.
|
|
3620
|
+
getToken() {
|
|
3621
|
+
return this.storage.getItem(TOKEN_KEY2);
|
|
3085
3622
|
}
|
|
3086
3623
|
/**
|
|
3087
|
-
*
|
|
3624
|
+
* Get current refresh token
|
|
3088
3625
|
*/
|
|
3089
|
-
|
|
3090
|
-
this.
|
|
3626
|
+
getRefreshToken() {
|
|
3627
|
+
return this.storage.getItem(REFRESH_TOKEN_KEY2);
|
|
3091
3628
|
}
|
|
3092
3629
|
/**
|
|
3093
|
-
*
|
|
3630
|
+
* Set JWT token and refresh token
|
|
3631
|
+
* @param token - JWT access token
|
|
3632
|
+
* @param refreshToken - JWT refresh token (optional)
|
|
3094
3633
|
*/
|
|
3095
|
-
|
|
3096
|
-
this.
|
|
3634
|
+
setToken(token, refreshToken) {
|
|
3635
|
+
this._token = token;
|
|
3636
|
+
this.storage.setItem(TOKEN_KEY2, token);
|
|
3637
|
+
if (refreshToken) {
|
|
3638
|
+
this._refreshToken = refreshToken;
|
|
3639
|
+
this.storage.setItem(REFRESH_TOKEN_KEY2, refreshToken);
|
|
3640
|
+
}
|
|
3641
|
+
this._reinitClients();
|
|
3097
3642
|
}
|
|
3098
3643
|
/**
|
|
3099
|
-
*
|
|
3644
|
+
* Clear all tokens
|
|
3100
3645
|
*/
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
filtered[key] = "***";
|
|
3108
|
-
} else {
|
|
3109
|
-
filtered[key] = headers[key] || "";
|
|
3110
|
-
}
|
|
3111
|
-
});
|
|
3112
|
-
return filtered;
|
|
3646
|
+
clearTokens() {
|
|
3647
|
+
this._token = null;
|
|
3648
|
+
this._refreshToken = null;
|
|
3649
|
+
this.storage.removeItem(TOKEN_KEY2);
|
|
3650
|
+
this.storage.removeItem(REFRESH_TOKEN_KEY2);
|
|
3651
|
+
this._reinitClients();
|
|
3113
3652
|
}
|
|
3114
3653
|
/**
|
|
3115
|
-
*
|
|
3654
|
+
* Check if user is authenticated
|
|
3116
3655
|
*/
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
const { method, url, headers, body } = request;
|
|
3120
|
-
this.consola.start(`${method} ${url}`);
|
|
3121
|
-
if (this.config.logHeaders && headers) {
|
|
3122
|
-
this.consola.debug("Headers:", this.filterHeaders(headers));
|
|
3123
|
-
}
|
|
3124
|
-
if (this.config.logBodies && body) {
|
|
3125
|
-
this.consola.debug("Body:", body);
|
|
3126
|
-
}
|
|
3656
|
+
isAuthenticated() {
|
|
3657
|
+
return !!this.getToken();
|
|
3127
3658
|
}
|
|
3128
3659
|
/**
|
|
3129
|
-
*
|
|
3660
|
+
* Update base URL and reinitialize clients
|
|
3661
|
+
* @param url - New base URL
|
|
3130
3662
|
*/
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
const { status, statusText, data, duration } = response;
|
|
3135
|
-
const statusColor = status >= 500 ? "red" : status >= 400 ? "yellow" : status >= 300 ? "cyan" : "green";
|
|
3136
|
-
this.consola.success(
|
|
3137
|
-
`${method} ${url} ${status} ${statusText} (${duration}ms)`
|
|
3138
|
-
);
|
|
3139
|
-
if (this.config.logBodies && data) {
|
|
3140
|
-
this.consola.debug("Response:", data);
|
|
3141
|
-
}
|
|
3663
|
+
setBaseUrl(url) {
|
|
3664
|
+
this.baseUrl = url;
|
|
3665
|
+
this._reinitClients();
|
|
3142
3666
|
}
|
|
3143
3667
|
/**
|
|
3144
|
-
*
|
|
3668
|
+
* Get current base URL
|
|
3145
3669
|
*/
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
const { method, url } = request;
|
|
3149
|
-
const { message, statusCode, fieldErrors, duration } = error;
|
|
3150
|
-
this.consola.error(
|
|
3151
|
-
`${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
|
|
3152
|
-
);
|
|
3153
|
-
this.consola.error("Message:", message);
|
|
3154
|
-
if (fieldErrors && Object.keys(fieldErrors).length > 0) {
|
|
3155
|
-
this.consola.error("Field Errors:");
|
|
3156
|
-
Object.entries(fieldErrors).forEach(([field, errors]) => {
|
|
3157
|
-
errors.forEach((err) => {
|
|
3158
|
-
this.consola.error(` \u2022 ${field}: ${err}`);
|
|
3159
|
-
});
|
|
3160
|
-
});
|
|
3161
|
-
}
|
|
3670
|
+
getBaseUrl() {
|
|
3671
|
+
return this.baseUrl;
|
|
3162
3672
|
}
|
|
3163
3673
|
/**
|
|
3164
|
-
*
|
|
3674
|
+
* Get OpenAPI schema path
|
|
3675
|
+
* @returns Path to the OpenAPI schema JSON file
|
|
3676
|
+
*
|
|
3677
|
+
* Note: The OpenAPI schema is available in the schema.json file.
|
|
3678
|
+
* You can load it dynamically using:
|
|
3679
|
+
* ```typescript
|
|
3680
|
+
* const schema = await fetch('./schema.json').then(r => r.json());
|
|
3681
|
+
* // or using fs in Node.js:
|
|
3682
|
+
* // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
|
|
3683
|
+
* ```
|
|
3165
3684
|
*/
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
this.consola.info(message, ...args);
|
|
3685
|
+
getSchemaPath() {
|
|
3686
|
+
return "./schema.json";
|
|
3169
3687
|
}
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
this
|
|
3688
|
+
};
|
|
3689
|
+
|
|
3690
|
+
// src/generated/cfg_webpush/webpush__web_push/client.ts
|
|
3691
|
+
var WebPush = class {
|
|
3692
|
+
static {
|
|
3693
|
+
__name(this, "WebPush");
|
|
3176
3694
|
}
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
*/
|
|
3180
|
-
error(message, ...args) {
|
|
3181
|
-
if (!this.config.enabled) return;
|
|
3182
|
-
this.consola.error(message, ...args);
|
|
3695
|
+
constructor(client) {
|
|
3696
|
+
this.client = client;
|
|
3183
3697
|
}
|
|
3184
3698
|
/**
|
|
3185
|
-
*
|
|
3699
|
+
* Send push notification
|
|
3700
|
+
*
|
|
3701
|
+
* Send push notification to all active subscriptions for the authenticated
|
|
3702
|
+
* user.
|
|
3186
3703
|
*/
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3704
|
+
async webpushSendCreate(data) {
|
|
3705
|
+
const response = await this.client.request("POST", "/cfg/webpush/send/", { body: data });
|
|
3706
|
+
return response;
|
|
3190
3707
|
}
|
|
3191
3708
|
/**
|
|
3192
|
-
*
|
|
3709
|
+
* Subscribe to push notifications
|
|
3710
|
+
*
|
|
3711
|
+
* Save push subscription from browser for the authenticated user.
|
|
3193
3712
|
*/
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3713
|
+
async webpushSubscribeCreate(data) {
|
|
3714
|
+
const response = await this.client.request("POST", "/cfg/webpush/subscribe/", { body: data });
|
|
3715
|
+
return response;
|
|
3197
3716
|
}
|
|
3198
3717
|
/**
|
|
3199
|
-
*
|
|
3718
|
+
* Get VAPID public key
|
|
3719
|
+
*
|
|
3720
|
+
* Get VAPID public key for client subscription.
|
|
3200
3721
|
*/
|
|
3201
|
-
|
|
3202
|
-
|
|
3722
|
+
async webpushVapidRetrieve() {
|
|
3723
|
+
const response = await this.client.request("GET", "/cfg/webpush/vapid/");
|
|
3724
|
+
return response;
|
|
3203
3725
|
}
|
|
3204
3726
|
};
|
|
3205
|
-
var defaultLogger3 = new APILogger3();
|
|
3206
3727
|
|
|
3207
|
-
// src/generated/
|
|
3208
|
-
var
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
factor: 2,
|
|
3212
|
-
minTimeout: 1e3,
|
|
3213
|
-
maxTimeout: 6e4,
|
|
3214
|
-
randomize: true,
|
|
3215
|
-
onFailedAttempt: /* @__PURE__ */ __name(() => {
|
|
3216
|
-
}, "onFailedAttempt")
|
|
3217
|
-
};
|
|
3218
|
-
function shouldRetry3(error) {
|
|
3219
|
-
if (error instanceof NetworkError3) {
|
|
3220
|
-
return true;
|
|
3221
|
-
}
|
|
3222
|
-
if (error instanceof APIError3) {
|
|
3223
|
-
const status = error.statusCode;
|
|
3224
|
-
if (status >= 500 && status < 600) {
|
|
3225
|
-
return true;
|
|
3226
|
-
}
|
|
3227
|
-
if (status === 429) {
|
|
3228
|
-
return true;
|
|
3229
|
-
}
|
|
3230
|
-
return false;
|
|
3728
|
+
// src/generated/cfg_webpush/http.ts
|
|
3729
|
+
var FetchAdapter3 = class {
|
|
3730
|
+
static {
|
|
3731
|
+
__name(this, "FetchAdapter");
|
|
3231
3732
|
}
|
|
3232
|
-
|
|
3233
|
-
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
return await fn();
|
|
3241
|
-
} catch (error) {
|
|
3242
|
-
if (!shouldRetry3(error)) {
|
|
3243
|
-
throw new import_p_retry3.AbortError(error);
|
|
3733
|
+
async request(request) {
|
|
3734
|
+
const { method, url, headers, body, params, formData } = request;
|
|
3735
|
+
let finalUrl = url;
|
|
3736
|
+
if (params) {
|
|
3737
|
+
const searchParams = new URLSearchParams();
|
|
3738
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
3739
|
+
if (value !== null && value !== void 0) {
|
|
3740
|
+
searchParams.append(key, String(value));
|
|
3244
3741
|
}
|
|
3245
|
-
|
|
3742
|
+
});
|
|
3743
|
+
const queryString = searchParams.toString();
|
|
3744
|
+
if (queryString) {
|
|
3745
|
+
finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
|
|
3246
3746
|
}
|
|
3247
|
-
},
|
|
3248
|
-
{
|
|
3249
|
-
retries: finalConfig.retries,
|
|
3250
|
-
factor: finalConfig.factor,
|
|
3251
|
-
minTimeout: finalConfig.minTimeout,
|
|
3252
|
-
maxTimeout: finalConfig.maxTimeout,
|
|
3253
|
-
randomize: finalConfig.randomize,
|
|
3254
|
-
onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
|
|
3255
|
-
const pRetryError = error;
|
|
3256
|
-
finalConfig.onFailedAttempt({
|
|
3257
|
-
error: pRetryError,
|
|
3258
|
-
attemptNumber: pRetryError.attemptNumber,
|
|
3259
|
-
retriesLeft: pRetryError.retriesLeft
|
|
3260
|
-
});
|
|
3261
|
-
} : void 0
|
|
3262
|
-
}
|
|
3263
|
-
);
|
|
3264
|
-
}
|
|
3265
|
-
__name(withRetry3, "withRetry");
|
|
3266
|
-
|
|
3267
|
-
// src/generated/cfg_centrifugo/client.ts
|
|
3268
|
-
var APIClient3 = class {
|
|
3269
|
-
constructor(baseUrl, options) {
|
|
3270
|
-
this.logger = null;
|
|
3271
|
-
this.retryConfig = null;
|
|
3272
|
-
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
3273
|
-
this.httpClient = options?.httpClient || new FetchAdapter3();
|
|
3274
|
-
if (options?.loggerConfig !== void 0) {
|
|
3275
|
-
this.logger = new APILogger3(options.loggerConfig);
|
|
3276
|
-
}
|
|
3277
|
-
if (options?.retryConfig !== void 0) {
|
|
3278
|
-
this.retryConfig = options.retryConfig;
|
|
3279
3747
|
}
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
}
|
|
3288
|
-
/**
|
|
3289
|
-
* Get CSRF token from cookies (for SessionAuthentication).
|
|
3290
|
-
*
|
|
3291
|
-
* Returns null if cookie doesn't exist (JWT-only auth).
|
|
3292
|
-
*/
|
|
3293
|
-
getCsrfToken() {
|
|
3294
|
-
const name = "csrftoken";
|
|
3295
|
-
const value = `; ${document.cookie}`;
|
|
3296
|
-
const parts = value.split(`; ${name}=`);
|
|
3297
|
-
if (parts.length === 2) {
|
|
3298
|
-
return parts.pop()?.split(";").shift() || null;
|
|
3748
|
+
const finalHeaders = { ...headers };
|
|
3749
|
+
let requestBody;
|
|
3750
|
+
if (formData) {
|
|
3751
|
+
requestBody = formData;
|
|
3752
|
+
} else if (body) {
|
|
3753
|
+
finalHeaders["Content-Type"] = "application/json";
|
|
3754
|
+
requestBody = JSON.stringify(body);
|
|
3299
3755
|
}
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
* Used by request() method with optional retry logic.
|
|
3325
|
-
*/
|
|
3326
|
-
async _makeRequest(method, path, options) {
|
|
3327
|
-
const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
|
|
3328
|
-
const startTime = Date.now();
|
|
3329
|
-
const headers = {
|
|
3330
|
-
...options?.headers || {}
|
|
3331
|
-
};
|
|
3332
|
-
if (!options?.formData && !headers["Content-Type"]) {
|
|
3333
|
-
headers["Content-Type"] = "application/json";
|
|
3334
|
-
}
|
|
3335
|
-
if (this.logger) {
|
|
3336
|
-
this.logger.logRequest({
|
|
3337
|
-
method,
|
|
3338
|
-
url,
|
|
3339
|
-
headers,
|
|
3340
|
-
body: options?.formData || options?.body,
|
|
3341
|
-
timestamp: startTime
|
|
3342
|
-
});
|
|
3343
|
-
}
|
|
3344
|
-
try {
|
|
3345
|
-
const response = await this.httpClient.request({
|
|
3346
|
-
method,
|
|
3347
|
-
url,
|
|
3348
|
-
headers,
|
|
3349
|
-
params: options?.params,
|
|
3350
|
-
body: options?.body,
|
|
3351
|
-
formData: options?.formData
|
|
3352
|
-
});
|
|
3353
|
-
const duration = Date.now() - startTime;
|
|
3354
|
-
if (response.status >= 400) {
|
|
3355
|
-
const error = new APIError3(
|
|
3356
|
-
response.status,
|
|
3357
|
-
response.statusText,
|
|
3358
|
-
response.data,
|
|
3359
|
-
url
|
|
3360
|
-
);
|
|
3361
|
-
if (this.logger) {
|
|
3362
|
-
this.logger.logError(
|
|
3363
|
-
{
|
|
3364
|
-
method,
|
|
3365
|
-
url,
|
|
3366
|
-
headers,
|
|
3367
|
-
body: options?.formData || options?.body,
|
|
3368
|
-
timestamp: startTime
|
|
3369
|
-
},
|
|
3370
|
-
{
|
|
3371
|
-
message: error.message,
|
|
3372
|
-
statusCode: response.status,
|
|
3373
|
-
duration,
|
|
3374
|
-
timestamp: Date.now()
|
|
3375
|
-
}
|
|
3376
|
-
);
|
|
3377
|
-
}
|
|
3378
|
-
throw error;
|
|
3379
|
-
}
|
|
3380
|
-
if (this.logger) {
|
|
3381
|
-
this.logger.logResponse(
|
|
3382
|
-
{
|
|
3383
|
-
method,
|
|
3384
|
-
url,
|
|
3385
|
-
headers,
|
|
3386
|
-
body: options?.formData || options?.body,
|
|
3387
|
-
timestamp: startTime
|
|
3388
|
-
},
|
|
3389
|
-
{
|
|
3390
|
-
status: response.status,
|
|
3391
|
-
statusText: response.statusText,
|
|
3392
|
-
data: response.data,
|
|
3393
|
-
duration,
|
|
3394
|
-
timestamp: Date.now()
|
|
3395
|
-
}
|
|
3396
|
-
);
|
|
3397
|
-
}
|
|
3398
|
-
return response.data;
|
|
3399
|
-
} catch (error) {
|
|
3400
|
-
const duration = Date.now() - startTime;
|
|
3401
|
-
if (error instanceof APIError3) {
|
|
3402
|
-
throw error;
|
|
3403
|
-
}
|
|
3404
|
-
const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
|
|
3405
|
-
if (this.logger) {
|
|
3406
|
-
if (isCORSError) {
|
|
3407
|
-
this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
|
|
3408
|
-
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
3409
|
-
this.logger.error(` \u2192 Configure security_domains parameter on the server`);
|
|
3410
|
-
} else {
|
|
3411
|
-
this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
|
|
3412
|
-
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
3413
|
-
}
|
|
3414
|
-
}
|
|
3415
|
-
if (typeof window !== "undefined") {
|
|
3416
|
-
try {
|
|
3417
|
-
if (isCORSError) {
|
|
3418
|
-
window.dispatchEvent(new CustomEvent("cors-error", {
|
|
3419
|
-
detail: {
|
|
3420
|
-
url,
|
|
3421
|
-
method,
|
|
3422
|
-
error: error instanceof Error ? error.message : String(error),
|
|
3423
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
3424
|
-
},
|
|
3425
|
-
bubbles: true,
|
|
3426
|
-
cancelable: false
|
|
3427
|
-
}));
|
|
3428
|
-
} else {
|
|
3429
|
-
window.dispatchEvent(new CustomEvent("network-error", {
|
|
3430
|
-
detail: {
|
|
3431
|
-
url,
|
|
3432
|
-
method,
|
|
3433
|
-
error: error instanceof Error ? error.message : String(error),
|
|
3434
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
3435
|
-
},
|
|
3436
|
-
bubbles: true,
|
|
3437
|
-
cancelable: false
|
|
3438
|
-
}));
|
|
3439
|
-
}
|
|
3440
|
-
} catch (eventError) {
|
|
3441
|
-
}
|
|
3442
|
-
}
|
|
3443
|
-
const networkError = error instanceof Error ? new NetworkError3(error.message, url, error) : new NetworkError3("Unknown error", url);
|
|
3444
|
-
if (this.logger) {
|
|
3445
|
-
this.logger.logError(
|
|
3446
|
-
{
|
|
3447
|
-
method,
|
|
3448
|
-
url,
|
|
3449
|
-
headers,
|
|
3450
|
-
body: options?.formData || options?.body,
|
|
3451
|
-
timestamp: startTime
|
|
3452
|
-
},
|
|
3453
|
-
{
|
|
3454
|
-
message: networkError.message,
|
|
3455
|
-
duration,
|
|
3456
|
-
timestamp: Date.now()
|
|
3457
|
-
}
|
|
3458
|
-
);
|
|
3459
|
-
}
|
|
3460
|
-
throw networkError;
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
};
|
|
3464
|
-
|
|
3465
|
-
// src/generated/cfg_centrifugo/storage.ts
|
|
3466
|
-
var LocalStorageAdapter3 = class {
|
|
3467
|
-
static {
|
|
3468
|
-
__name(this, "LocalStorageAdapter");
|
|
3469
|
-
}
|
|
3470
|
-
constructor(logger) {
|
|
3471
|
-
this.logger = logger;
|
|
3472
|
-
}
|
|
3473
|
-
getItem(key) {
|
|
3474
|
-
try {
|
|
3475
|
-
if (typeof window !== "undefined" && window.localStorage) {
|
|
3476
|
-
const value = localStorage.getItem(key);
|
|
3477
|
-
this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
|
|
3478
|
-
return value;
|
|
3479
|
-
}
|
|
3480
|
-
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
3481
|
-
} catch (error) {
|
|
3482
|
-
this.logger?.error("LocalStorage.getItem failed:", error);
|
|
3483
|
-
}
|
|
3484
|
-
return null;
|
|
3485
|
-
}
|
|
3486
|
-
setItem(key, value) {
|
|
3487
|
-
try {
|
|
3488
|
-
if (typeof window !== "undefined" && window.localStorage) {
|
|
3489
|
-
localStorage.setItem(key, value);
|
|
3490
|
-
this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
|
|
3491
|
-
} else {
|
|
3492
|
-
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
3493
|
-
}
|
|
3494
|
-
} catch (error) {
|
|
3495
|
-
this.logger?.error("LocalStorage.setItem failed:", error);
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
removeItem(key) {
|
|
3499
|
-
try {
|
|
3500
|
-
if (typeof window !== "undefined" && window.localStorage) {
|
|
3501
|
-
localStorage.removeItem(key);
|
|
3502
|
-
this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
|
|
3503
|
-
} else {
|
|
3504
|
-
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
3505
|
-
}
|
|
3506
|
-
} catch (error) {
|
|
3507
|
-
this.logger?.error("LocalStorage.removeItem failed:", error);
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
};
|
|
3511
|
-
|
|
3512
|
-
// src/generated/cfg_centrifugo/_utils/schemas/index.ts
|
|
3513
|
-
var schemas_exports3 = {};
|
|
3514
|
-
__export(schemas_exports3, {
|
|
3515
|
-
CentrifugoChannelInfoSchema: () => CentrifugoChannelInfoSchema,
|
|
3516
|
-
CentrifugoChannelsRequestRequestSchema: () => CentrifugoChannelsRequestRequestSchema,
|
|
3517
|
-
CentrifugoChannelsResponseSchema: () => CentrifugoChannelsResponseSchema,
|
|
3518
|
-
CentrifugoChannelsResultSchema: () => CentrifugoChannelsResultSchema,
|
|
3519
|
-
CentrifugoClientInfoSchema: () => CentrifugoClientInfoSchema,
|
|
3520
|
-
CentrifugoErrorSchema: () => CentrifugoErrorSchema,
|
|
3521
|
-
CentrifugoHealthCheckSchema: () => CentrifugoHealthCheckSchema,
|
|
3522
|
-
CentrifugoHistoryRequestRequestSchema: () => CentrifugoHistoryRequestRequestSchema,
|
|
3523
|
-
CentrifugoHistoryResponseSchema: () => CentrifugoHistoryResponseSchema,
|
|
3524
|
-
CentrifugoHistoryResultSchema: () => CentrifugoHistoryResultSchema,
|
|
3525
|
-
CentrifugoInfoResponseSchema: () => CentrifugoInfoResponseSchema,
|
|
3526
|
-
CentrifugoInfoResultSchema: () => CentrifugoInfoResultSchema,
|
|
3527
|
-
CentrifugoMetricsSchema: () => CentrifugoMetricsSchema,
|
|
3528
|
-
CentrifugoNodeInfoSchema: () => CentrifugoNodeInfoSchema,
|
|
3529
|
-
CentrifugoOverviewStatsSchema: () => CentrifugoOverviewStatsSchema,
|
|
3530
|
-
CentrifugoPresenceRequestRequestSchema: () => CentrifugoPresenceRequestRequestSchema,
|
|
3531
|
-
CentrifugoPresenceResponseSchema: () => CentrifugoPresenceResponseSchema,
|
|
3532
|
-
CentrifugoPresenceResultSchema: () => CentrifugoPresenceResultSchema,
|
|
3533
|
-
CentrifugoPresenceStatsRequestRequestSchema: () => CentrifugoPresenceStatsRequestRequestSchema,
|
|
3534
|
-
CentrifugoPresenceStatsResponseSchema: () => CentrifugoPresenceStatsResponseSchema,
|
|
3535
|
-
CentrifugoPresenceStatsResultSchema: () => CentrifugoPresenceStatsResultSchema,
|
|
3536
|
-
CentrifugoProcessSchema: () => CentrifugoProcessSchema,
|
|
3537
|
-
CentrifugoPublicationSchema: () => CentrifugoPublicationSchema,
|
|
3538
|
-
CentrifugoStreamPositionSchema: () => CentrifugoStreamPositionSchema,
|
|
3539
|
-
ChannelListSchema: () => ChannelListSchema,
|
|
3540
|
-
ChannelStatsSchema: () => ChannelStatsSchema,
|
|
3541
|
-
ConnectionTokenResponseSchema: () => ConnectionTokenResponseSchema,
|
|
3542
|
-
ManualAckRequestRequestSchema: () => ManualAckRequestRequestSchema,
|
|
3543
|
-
ManualAckResponseSchema: () => ManualAckResponseSchema,
|
|
3544
|
-
PaginatedPublishListSchema: () => PaginatedPublishListSchema,
|
|
3545
|
-
PublishSchema: () => PublishSchema,
|
|
3546
|
-
PublishTestRequestRequestSchema: () => PublishTestRequestRequestSchema,
|
|
3547
|
-
PublishTestResponseSchema: () => PublishTestResponseSchema,
|
|
3548
|
-
TimelineItemSchema: () => TimelineItemSchema,
|
|
3549
|
-
TimelineResponseSchema: () => TimelineResponseSchema
|
|
3550
|
-
});
|
|
3551
|
-
|
|
3552
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
|
|
3553
|
-
var import_zod25 = require("zod");
|
|
3554
|
-
var CentrifugoChannelInfoSchema = import_zod25.z.object({
|
|
3555
|
-
num_clients: import_zod25.z.int()
|
|
3556
|
-
});
|
|
3557
|
-
|
|
3558
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
|
|
3559
|
-
var import_zod26 = require("zod");
|
|
3560
|
-
var CentrifugoChannelsRequestRequestSchema = import_zod26.z.object({
|
|
3561
|
-
pattern: import_zod26.z.string().nullable().optional()
|
|
3562
|
-
});
|
|
3563
|
-
|
|
3564
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
3565
|
-
var import_zod29 = require("zod");
|
|
3566
|
-
|
|
3567
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
|
|
3568
|
-
var import_zod27 = require("zod");
|
|
3569
|
-
var CentrifugoChannelsResultSchema = import_zod27.z.object({
|
|
3570
|
-
channels: import_zod27.z.record(import_zod27.z.string(), CentrifugoChannelInfoSchema)
|
|
3571
|
-
});
|
|
3572
|
-
|
|
3573
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
|
|
3574
|
-
var import_zod28 = require("zod");
|
|
3575
|
-
var CentrifugoErrorSchema = import_zod28.z.object({
|
|
3576
|
-
code: import_zod28.z.int().optional(),
|
|
3577
|
-
message: import_zod28.z.string().optional()
|
|
3578
|
-
});
|
|
3579
|
-
|
|
3580
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
3581
|
-
var CentrifugoChannelsResponseSchema = import_zod29.z.object({
|
|
3582
|
-
error: CentrifugoErrorSchema.optional(),
|
|
3583
|
-
result: CentrifugoChannelsResultSchema.optional()
|
|
3584
|
-
});
|
|
3585
|
-
|
|
3586
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
|
|
3587
|
-
var import_zod30 = require("zod");
|
|
3588
|
-
var CentrifugoClientInfoSchema = import_zod30.z.object({
|
|
3589
|
-
user: import_zod30.z.string(),
|
|
3590
|
-
client: import_zod30.z.string(),
|
|
3591
|
-
conn_info: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()).nullable().optional(),
|
|
3592
|
-
chan_info: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()).nullable().optional()
|
|
3593
|
-
});
|
|
3594
|
-
|
|
3595
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
|
|
3596
|
-
var import_zod31 = require("zod");
|
|
3597
|
-
var CentrifugoHealthCheckSchema = import_zod31.z.object({
|
|
3598
|
-
status: import_zod31.z.string(),
|
|
3599
|
-
wrapper_url: import_zod31.z.string(),
|
|
3600
|
-
has_api_key: import_zod31.z.boolean(),
|
|
3601
|
-
timestamp: import_zod31.z.string()
|
|
3602
|
-
});
|
|
3603
|
-
|
|
3604
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
3605
|
-
var import_zod33 = require("zod");
|
|
3606
|
-
|
|
3607
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
|
|
3608
|
-
var import_zod32 = require("zod");
|
|
3609
|
-
var CentrifugoStreamPositionSchema = import_zod32.z.object({
|
|
3610
|
-
offset: import_zod32.z.int(),
|
|
3611
|
-
epoch: import_zod32.z.string()
|
|
3612
|
-
});
|
|
3613
|
-
|
|
3614
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
3615
|
-
var CentrifugoHistoryRequestRequestSchema = import_zod33.z.object({
|
|
3616
|
-
channel: import_zod33.z.string(),
|
|
3617
|
-
limit: import_zod33.z.int().nullable().optional(),
|
|
3618
|
-
since: CentrifugoStreamPositionSchema.optional(),
|
|
3619
|
-
reverse: import_zod33.z.boolean().nullable().optional()
|
|
3620
|
-
});
|
|
3621
|
-
|
|
3622
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
3623
|
-
var import_zod36 = require("zod");
|
|
3624
|
-
|
|
3625
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
3626
|
-
var import_zod35 = require("zod");
|
|
3627
|
-
|
|
3628
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
|
|
3629
|
-
var import_zod34 = require("zod");
|
|
3630
|
-
var CentrifugoPublicationSchema = import_zod34.z.object({
|
|
3631
|
-
data: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.any()),
|
|
3632
|
-
info: CentrifugoClientInfoSchema.optional(),
|
|
3633
|
-
offset: import_zod34.z.int(),
|
|
3634
|
-
tags: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.any()).nullable().optional()
|
|
3635
|
-
});
|
|
3636
|
-
|
|
3637
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
3638
|
-
var CentrifugoHistoryResultSchema = import_zod35.z.object({
|
|
3639
|
-
publications: import_zod35.z.array(CentrifugoPublicationSchema),
|
|
3640
|
-
epoch: import_zod35.z.string(),
|
|
3641
|
-
offset: import_zod35.z.int()
|
|
3642
|
-
});
|
|
3643
|
-
|
|
3644
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
3645
|
-
var CentrifugoHistoryResponseSchema = import_zod36.z.object({
|
|
3646
|
-
error: CentrifugoErrorSchema.optional(),
|
|
3647
|
-
result: CentrifugoHistoryResultSchema.optional()
|
|
3648
|
-
});
|
|
3649
|
-
|
|
3650
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
3651
|
-
var import_zod41 = require("zod");
|
|
3652
|
-
|
|
3653
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
3654
|
-
var import_zod40 = require("zod");
|
|
3655
|
-
|
|
3656
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
3657
|
-
var import_zod39 = require("zod");
|
|
3658
|
-
|
|
3659
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
|
|
3660
|
-
var import_zod37 = require("zod");
|
|
3661
|
-
var CentrifugoMetricsSchema = import_zod37.z.object({
|
|
3662
|
-
interval: import_zod37.z.number(),
|
|
3663
|
-
items: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.number())
|
|
3664
|
-
});
|
|
3665
|
-
|
|
3666
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
|
|
3667
|
-
var import_zod38 = require("zod");
|
|
3668
|
-
var CentrifugoProcessSchema = import_zod38.z.object({
|
|
3669
|
-
cpu: import_zod38.z.number(),
|
|
3670
|
-
rss: import_zod38.z.int()
|
|
3671
|
-
});
|
|
3672
|
-
|
|
3673
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
3674
|
-
var CentrifugoNodeInfoSchema = import_zod39.z.object({
|
|
3675
|
-
uid: import_zod39.z.string(),
|
|
3676
|
-
name: import_zod39.z.string(),
|
|
3677
|
-
version: import_zod39.z.string(),
|
|
3678
|
-
num_clients: import_zod39.z.int(),
|
|
3679
|
-
num_users: import_zod39.z.int(),
|
|
3680
|
-
num_channels: import_zod39.z.int(),
|
|
3681
|
-
uptime: import_zod39.z.int(),
|
|
3682
|
-
num_subs: import_zod39.z.int(),
|
|
3683
|
-
metrics: CentrifugoMetricsSchema.optional(),
|
|
3684
|
-
process: CentrifugoProcessSchema.optional()
|
|
3685
|
-
});
|
|
3686
|
-
|
|
3687
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
3688
|
-
var CentrifugoInfoResultSchema = import_zod40.z.object({
|
|
3689
|
-
nodes: import_zod40.z.array(CentrifugoNodeInfoSchema)
|
|
3690
|
-
});
|
|
3691
|
-
|
|
3692
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
3693
|
-
var CentrifugoInfoResponseSchema = import_zod41.z.object({
|
|
3694
|
-
error: CentrifugoErrorSchema.optional(),
|
|
3695
|
-
result: CentrifugoInfoResultSchema.optional()
|
|
3696
|
-
});
|
|
3697
|
-
|
|
3698
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
|
|
3699
|
-
var import_zod42 = require("zod");
|
|
3700
|
-
var CentrifugoOverviewStatsSchema = import_zod42.z.object({
|
|
3701
|
-
total: import_zod42.z.int(),
|
|
3702
|
-
successful: import_zod42.z.int(),
|
|
3703
|
-
failed: import_zod42.z.int(),
|
|
3704
|
-
timeout: import_zod42.z.int(),
|
|
3705
|
-
success_rate: import_zod42.z.number(),
|
|
3706
|
-
avg_duration_ms: import_zod42.z.number(),
|
|
3707
|
-
avg_acks_received: import_zod42.z.number(),
|
|
3708
|
-
period_hours: import_zod42.z.int()
|
|
3709
|
-
});
|
|
3710
|
-
|
|
3711
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
|
|
3712
|
-
var import_zod43 = require("zod");
|
|
3713
|
-
var CentrifugoPresenceRequestRequestSchema = import_zod43.z.object({
|
|
3714
|
-
channel: import_zod43.z.string()
|
|
3715
|
-
});
|
|
3716
|
-
|
|
3717
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
3718
|
-
var import_zod45 = require("zod");
|
|
3719
|
-
|
|
3720
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
|
|
3721
|
-
var import_zod44 = require("zod");
|
|
3722
|
-
var CentrifugoPresenceResultSchema = import_zod44.z.object({
|
|
3723
|
-
presence: import_zod44.z.record(import_zod44.z.string(), CentrifugoClientInfoSchema)
|
|
3724
|
-
});
|
|
3725
|
-
|
|
3726
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
3727
|
-
var CentrifugoPresenceResponseSchema = import_zod45.z.object({
|
|
3728
|
-
error: CentrifugoErrorSchema.optional(),
|
|
3729
|
-
result: CentrifugoPresenceResultSchema.optional()
|
|
3730
|
-
});
|
|
3731
|
-
|
|
3732
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
|
|
3733
|
-
var import_zod46 = require("zod");
|
|
3734
|
-
var CentrifugoPresenceStatsRequestRequestSchema = import_zod46.z.object({
|
|
3735
|
-
channel: import_zod46.z.string()
|
|
3736
|
-
});
|
|
3737
|
-
|
|
3738
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
3739
|
-
var import_zod48 = require("zod");
|
|
3740
|
-
|
|
3741
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
|
|
3742
|
-
var import_zod47 = require("zod");
|
|
3743
|
-
var CentrifugoPresenceStatsResultSchema = import_zod47.z.object({
|
|
3744
|
-
num_clients: import_zod47.z.int(),
|
|
3745
|
-
num_users: import_zod47.z.int()
|
|
3746
|
-
});
|
|
3747
|
-
|
|
3748
|
-
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
3749
|
-
var CentrifugoPresenceStatsResponseSchema = import_zod48.z.object({
|
|
3750
|
-
error: CentrifugoErrorSchema.optional(),
|
|
3751
|
-
result: CentrifugoPresenceStatsResultSchema.optional()
|
|
3752
|
-
});
|
|
3753
|
-
|
|
3754
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
3755
|
-
var import_zod50 = require("zod");
|
|
3756
|
-
|
|
3757
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
|
|
3758
|
-
var import_zod49 = require("zod");
|
|
3759
|
-
var ChannelStatsSchema = import_zod49.z.object({
|
|
3760
|
-
channel: import_zod49.z.string(),
|
|
3761
|
-
total: import_zod49.z.int(),
|
|
3762
|
-
successful: import_zod49.z.int(),
|
|
3763
|
-
failed: import_zod49.z.int(),
|
|
3764
|
-
avg_duration_ms: import_zod49.z.number(),
|
|
3765
|
-
avg_acks: import_zod49.z.number(),
|
|
3766
|
-
last_activity_at: import_zod49.z.string().nullable()
|
|
3767
|
-
});
|
|
3768
|
-
|
|
3769
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
3770
|
-
var ChannelListSchema = import_zod50.z.object({
|
|
3771
|
-
channels: import_zod50.z.array(ChannelStatsSchema),
|
|
3772
|
-
total_channels: import_zod50.z.int()
|
|
3773
|
-
});
|
|
3774
|
-
|
|
3775
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
|
|
3776
|
-
var import_zod51 = require("zod");
|
|
3777
|
-
var ConnectionTokenResponseSchema = import_zod51.z.object({
|
|
3778
|
-
token: import_zod51.z.string(),
|
|
3779
|
-
centrifugo_url: import_zod51.z.string(),
|
|
3780
|
-
expires_at: import_zod51.z.string(),
|
|
3781
|
-
channels: import_zod51.z.array(import_zod51.z.string())
|
|
3782
|
-
});
|
|
3783
|
-
|
|
3784
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
|
|
3785
|
-
var import_zod52 = require("zod");
|
|
3786
|
-
var ManualAckRequestRequestSchema = import_zod52.z.object({
|
|
3787
|
-
message_id: import_zod52.z.string(),
|
|
3788
|
-
client_id: import_zod52.z.string()
|
|
3789
|
-
});
|
|
3790
|
-
|
|
3791
|
-
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
|
|
3792
|
-
var import_zod53 = require("zod");
|
|
3793
|
-
var ManualAckResponseSchema = import_zod53.z.object({
|
|
3794
|
-
success: import_zod53.z.boolean(),
|
|
3795
|
-
message_id: import_zod53.z.string(),
|
|
3796
|
-
error: import_zod53.z.string().nullable().optional()
|
|
3797
|
-
});
|
|
3798
|
-
|
|
3799
|
-
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
3800
|
-
var import_zod55 = require("zod");
|
|
3801
|
-
|
|
3802
|
-
// src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
|
|
3803
|
-
var import_zod54 = require("zod");
|
|
3804
|
-
var PublishSchema = import_zod54.z.object({
|
|
3805
|
-
message_id: import_zod54.z.string(),
|
|
3806
|
-
channel: import_zod54.z.string(),
|
|
3807
|
-
status: import_zod54.z.string(),
|
|
3808
|
-
wait_for_ack: import_zod54.z.boolean(),
|
|
3809
|
-
acks_received: import_zod54.z.int(),
|
|
3810
|
-
acks_expected: import_zod54.z.int().nullable(),
|
|
3811
|
-
duration_ms: import_zod54.z.number().nullable(),
|
|
3812
|
-
created_at: import_zod54.z.iso.datetime(),
|
|
3813
|
-
completed_at: import_zod54.z.iso.datetime().nullable(),
|
|
3814
|
-
error_code: import_zod54.z.string().nullable(),
|
|
3815
|
-
error_message: import_zod54.z.string().nullable()
|
|
3816
|
-
});
|
|
3817
|
-
|
|
3818
|
-
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
3819
|
-
var PaginatedPublishListSchema = import_zod55.z.object({
|
|
3820
|
-
count: import_zod55.z.int(),
|
|
3821
|
-
page: import_zod55.z.int(),
|
|
3822
|
-
pages: import_zod55.z.int(),
|
|
3823
|
-
page_size: import_zod55.z.int(),
|
|
3824
|
-
has_next: import_zod55.z.boolean(),
|
|
3825
|
-
has_previous: import_zod55.z.boolean(),
|
|
3826
|
-
next_page: import_zod55.z.int().nullable().optional(),
|
|
3827
|
-
previous_page: import_zod55.z.int().nullable().optional(),
|
|
3828
|
-
results: import_zod55.z.array(PublishSchema)
|
|
3829
|
-
});
|
|
3830
|
-
|
|
3831
|
-
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
|
|
3832
|
-
var import_zod56 = require("zod");
|
|
3833
|
-
var PublishTestRequestRequestSchema = import_zod56.z.object({
|
|
3834
|
-
channel: import_zod56.z.string(),
|
|
3835
|
-
data: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.any()),
|
|
3836
|
-
wait_for_ack: import_zod56.z.boolean().optional(),
|
|
3837
|
-
ack_timeout: import_zod56.z.int().min(1).max(60).optional()
|
|
3838
|
-
});
|
|
3839
|
-
|
|
3840
|
-
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
|
|
3841
|
-
var import_zod57 = require("zod");
|
|
3842
|
-
var PublishTestResponseSchema = import_zod57.z.object({
|
|
3843
|
-
success: import_zod57.z.boolean(),
|
|
3844
|
-
message_id: import_zod57.z.string(),
|
|
3845
|
-
channel: import_zod57.z.string(),
|
|
3846
|
-
acks_received: import_zod57.z.int().optional(),
|
|
3847
|
-
delivered: import_zod57.z.boolean().optional(),
|
|
3848
|
-
error: import_zod57.z.string().nullable().optional()
|
|
3849
|
-
});
|
|
3850
|
-
|
|
3851
|
-
// src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
|
|
3852
|
-
var import_zod58 = require("zod");
|
|
3853
|
-
var TimelineItemSchema = import_zod58.z.object({
|
|
3854
|
-
timestamp: import_zod58.z.string(),
|
|
3855
|
-
count: import_zod58.z.int(),
|
|
3856
|
-
successful: import_zod58.z.int(),
|
|
3857
|
-
failed: import_zod58.z.int(),
|
|
3858
|
-
timeout: import_zod58.z.int()
|
|
3859
|
-
});
|
|
3860
|
-
|
|
3861
|
-
// src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
|
|
3862
|
-
var import_zod59 = require("zod");
|
|
3863
|
-
var TimelineResponseSchema = import_zod59.z.object({
|
|
3864
|
-
timeline: import_zod59.z.array(TimelineItemSchema),
|
|
3865
|
-
period_hours: import_zod59.z.int(),
|
|
3866
|
-
interval: import_zod59.z.string()
|
|
3867
|
-
});
|
|
3868
|
-
|
|
3869
|
-
// src/generated/cfg_centrifugo/_utils/fetchers/index.ts
|
|
3870
|
-
var fetchers_exports3 = {};
|
|
3871
|
-
__export(fetchers_exports3, {
|
|
3872
|
-
createCentrifugoServerAuthTokenCreate: () => createCentrifugoServerAuthTokenCreate,
|
|
3873
|
-
createCentrifugoServerChannelsCreate: () => createCentrifugoServerChannelsCreate,
|
|
3874
|
-
createCentrifugoServerHistoryCreate: () => createCentrifugoServerHistoryCreate,
|
|
3875
|
-
createCentrifugoServerInfoCreate: () => createCentrifugoServerInfoCreate,
|
|
3876
|
-
createCentrifugoServerPresenceCreate: () => createCentrifugoServerPresenceCreate,
|
|
3877
|
-
createCentrifugoServerPresenceStatsCreate: () => createCentrifugoServerPresenceStatsCreate,
|
|
3878
|
-
createCentrifugoTestingPublishTestCreate: () => createCentrifugoTestingPublishTestCreate,
|
|
3879
|
-
createCentrifugoTestingPublishWithLoggingCreate: () => createCentrifugoTestingPublishWithLoggingCreate,
|
|
3880
|
-
createCentrifugoTestingSendAckCreate: () => createCentrifugoTestingSendAckCreate,
|
|
3881
|
-
getCentrifugoAuthTokenRetrieve: () => getCentrifugoAuthTokenRetrieve,
|
|
3882
|
-
getCentrifugoMonitorChannelsRetrieve: () => getCentrifugoMonitorChannelsRetrieve,
|
|
3883
|
-
getCentrifugoMonitorHealthRetrieve: () => getCentrifugoMonitorHealthRetrieve,
|
|
3884
|
-
getCentrifugoMonitorOverviewRetrieve: () => getCentrifugoMonitorOverviewRetrieve,
|
|
3885
|
-
getCentrifugoMonitorPublishesList: () => getCentrifugoMonitorPublishesList,
|
|
3886
|
-
getCentrifugoMonitorTimelineRetrieve: () => getCentrifugoMonitorTimelineRetrieve
|
|
3887
|
-
});
|
|
3888
|
-
|
|
3889
|
-
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
|
|
3890
|
-
var import_consola9 = require("consola");
|
|
3891
|
-
|
|
3892
|
-
// src/generated/cfg_centrifugo/api-instance.ts
|
|
3893
|
-
var globalAPI3 = null;
|
|
3894
|
-
function getAPIInstance3() {
|
|
3895
|
-
if (!globalAPI3) {
|
|
3896
|
-
throw new Error(
|
|
3897
|
-
'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
|
|
3898
|
-
);
|
|
3756
|
+
const response = await fetch(finalUrl, {
|
|
3757
|
+
method,
|
|
3758
|
+
headers: finalHeaders,
|
|
3759
|
+
body: requestBody,
|
|
3760
|
+
credentials: "include"
|
|
3761
|
+
// Include Django session cookies
|
|
3762
|
+
});
|
|
3763
|
+
let data = null;
|
|
3764
|
+
const contentType = response.headers.get("content-type");
|
|
3765
|
+
if (response.status !== 204 && contentType?.includes("application/json")) {
|
|
3766
|
+
data = await response.json();
|
|
3767
|
+
} else if (response.status !== 204) {
|
|
3768
|
+
data = await response.text();
|
|
3769
|
+
}
|
|
3770
|
+
const responseHeaders = {};
|
|
3771
|
+
response.headers.forEach((value, key) => {
|
|
3772
|
+
responseHeaders[key] = value;
|
|
3773
|
+
});
|
|
3774
|
+
return {
|
|
3775
|
+
data,
|
|
3776
|
+
status: response.status,
|
|
3777
|
+
statusText: response.statusText,
|
|
3778
|
+
headers: responseHeaders
|
|
3779
|
+
};
|
|
3899
3780
|
}
|
|
3900
|
-
|
|
3901
|
-
}
|
|
3902
|
-
__name(getAPIInstance3, "getAPIInstance");
|
|
3781
|
+
};
|
|
3903
3782
|
|
|
3904
|
-
// src/generated/
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
}
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3925
|
-
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3926
|
-
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3927
|
-
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3928
|
-
});
|
|
3783
|
+
// src/generated/cfg_webpush/errors.ts
|
|
3784
|
+
var APIError3 = class extends Error {
|
|
3785
|
+
constructor(statusCode, statusText, response, url, message) {
|
|
3786
|
+
super(message || `HTTP ${statusCode}: ${statusText}`);
|
|
3787
|
+
this.statusCode = statusCode;
|
|
3788
|
+
this.statusText = statusText;
|
|
3789
|
+
this.response = response;
|
|
3790
|
+
this.url = url;
|
|
3791
|
+
this.name = "APIError";
|
|
3792
|
+
}
|
|
3793
|
+
static {
|
|
3794
|
+
__name(this, "APIError");
|
|
3795
|
+
}
|
|
3796
|
+
/**
|
|
3797
|
+
* Get error details from response.
|
|
3798
|
+
* DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
|
|
3799
|
+
*/
|
|
3800
|
+
get details() {
|
|
3801
|
+
if (typeof this.response === "object" && this.response !== null) {
|
|
3802
|
+
return this.response;
|
|
3929
3803
|
}
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
cancelable: false
|
|
3944
|
-
});
|
|
3945
|
-
window.dispatchEvent(event);
|
|
3946
|
-
} catch (eventError) {
|
|
3947
|
-
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3804
|
+
return null;
|
|
3805
|
+
}
|
|
3806
|
+
/**
|
|
3807
|
+
* Get field-specific validation errors from DRF.
|
|
3808
|
+
* Returns: { "field_name": ["error1", "error2"], ... }
|
|
3809
|
+
*/
|
|
3810
|
+
get fieldErrors() {
|
|
3811
|
+
const details = this.details;
|
|
3812
|
+
if (!details) return null;
|
|
3813
|
+
const fieldErrors = {};
|
|
3814
|
+
for (const [key, value] of Object.entries(details)) {
|
|
3815
|
+
if (Array.isArray(value)) {
|
|
3816
|
+
fieldErrors[key] = value;
|
|
3948
3817
|
}
|
|
3949
3818
|
}
|
|
3950
|
-
|
|
3819
|
+
return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;
|
|
3951
3820
|
}
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
return
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
import_consola9.consola.box(`createCentrifugoServerHistoryCreate
|
|
3962
|
-
Path: /cfg/centrifugo/server/history/
|
|
3963
|
-
Method: POST`);
|
|
3964
|
-
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
3965
|
-
import_consola9.consola.error("Validation Issues:");
|
|
3966
|
-
error.issues.forEach((issue, index) => {
|
|
3967
|
-
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
3968
|
-
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
3969
|
-
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
3970
|
-
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
3971
|
-
});
|
|
3821
|
+
/**
|
|
3822
|
+
* Get single error message from DRF.
|
|
3823
|
+
* Checks for "detail", "message", or first field error.
|
|
3824
|
+
*/
|
|
3825
|
+
get errorMessage() {
|
|
3826
|
+
const details = this.details;
|
|
3827
|
+
if (!details) return this.message;
|
|
3828
|
+
if (details.detail) {
|
|
3829
|
+
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
3972
3830
|
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
error,
|
|
3982
|
-
response,
|
|
3983
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
3984
|
-
},
|
|
3985
|
-
bubbles: true,
|
|
3986
|
-
cancelable: false
|
|
3987
|
-
});
|
|
3988
|
-
window.dispatchEvent(event);
|
|
3989
|
-
} catch (eventError) {
|
|
3990
|
-
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
3831
|
+
if (details.message) {
|
|
3832
|
+
return String(details.message);
|
|
3833
|
+
}
|
|
3834
|
+
const fieldErrors = this.fieldErrors;
|
|
3835
|
+
if (fieldErrors) {
|
|
3836
|
+
const firstField = Object.keys(fieldErrors)[0];
|
|
3837
|
+
if (firstField) {
|
|
3838
|
+
return `${firstField}: ${fieldErrors[firstField]?.join(", ")}`;
|
|
3991
3839
|
}
|
|
3992
3840
|
}
|
|
3993
|
-
|
|
3841
|
+
return this.message;
|
|
3994
3842
|
}
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
3843
|
+
// Helper methods for common HTTP status codes
|
|
3844
|
+
get isValidationError() {
|
|
3845
|
+
return this.statusCode === 400;
|
|
3846
|
+
}
|
|
3847
|
+
get isAuthError() {
|
|
3848
|
+
return this.statusCode === 401;
|
|
3849
|
+
}
|
|
3850
|
+
get isPermissionError() {
|
|
3851
|
+
return this.statusCode === 403;
|
|
3852
|
+
}
|
|
3853
|
+
get isNotFoundError() {
|
|
3854
|
+
return this.statusCode === 404;
|
|
3855
|
+
}
|
|
3856
|
+
get isServerError() {
|
|
3857
|
+
return this.statusCode >= 500 && this.statusCode < 600;
|
|
3858
|
+
}
|
|
3859
|
+
};
|
|
3860
|
+
var NetworkError3 = class extends Error {
|
|
3861
|
+
constructor(message, url, originalError) {
|
|
3862
|
+
super(message);
|
|
3863
|
+
this.url = url;
|
|
3864
|
+
this.originalError = originalError;
|
|
3865
|
+
this.name = "NetworkError";
|
|
3866
|
+
}
|
|
3867
|
+
static {
|
|
3868
|
+
__name(this, "NetworkError");
|
|
3869
|
+
}
|
|
3870
|
+
};
|
|
3871
|
+
|
|
3872
|
+
// src/generated/cfg_webpush/logger.ts
|
|
3873
|
+
var import_consola11 = require("consola");
|
|
3874
|
+
var DEFAULT_CONFIG3 = {
|
|
3875
|
+
enabled: process.env.NODE_ENV !== "production",
|
|
3876
|
+
logRequests: true,
|
|
3877
|
+
logResponses: true,
|
|
3878
|
+
logErrors: true,
|
|
3879
|
+
logBodies: true,
|
|
3880
|
+
logHeaders: false
|
|
3881
|
+
};
|
|
3882
|
+
var SENSITIVE_HEADERS3 = [
|
|
3883
|
+
"authorization",
|
|
3884
|
+
"cookie",
|
|
3885
|
+
"set-cookie",
|
|
3886
|
+
"x-api-key",
|
|
3887
|
+
"x-csrf-token"
|
|
3888
|
+
];
|
|
3889
|
+
var APILogger3 = class {
|
|
3890
|
+
static {
|
|
3891
|
+
__name(this, "APILogger");
|
|
3892
|
+
}
|
|
3893
|
+
constructor(config = {}) {
|
|
3894
|
+
this.config = { ...DEFAULT_CONFIG3, ...config };
|
|
3895
|
+
this.consola = config.consola || (0, import_consola11.createConsola)({
|
|
3896
|
+
level: this.config.enabled ? 4 : 0
|
|
3897
|
+
});
|
|
3898
|
+
}
|
|
3899
|
+
/**
|
|
3900
|
+
* Enable logging
|
|
3901
|
+
*/
|
|
3902
|
+
enable() {
|
|
3903
|
+
this.config.enabled = true;
|
|
3904
|
+
}
|
|
3905
|
+
/**
|
|
3906
|
+
* Disable logging
|
|
3907
|
+
*/
|
|
3908
|
+
disable() {
|
|
3909
|
+
this.config.enabled = false;
|
|
3910
|
+
}
|
|
3911
|
+
/**
|
|
3912
|
+
* Update configuration
|
|
3913
|
+
*/
|
|
3914
|
+
setConfig(config) {
|
|
3915
|
+
this.config = { ...this.config, ...config };
|
|
3916
|
+
}
|
|
3917
|
+
/**
|
|
3918
|
+
* Filter sensitive headers
|
|
3919
|
+
*/
|
|
3920
|
+
filterHeaders(headers) {
|
|
3921
|
+
if (!headers) return {};
|
|
3922
|
+
const filtered = {};
|
|
3923
|
+
Object.keys(headers).forEach((key) => {
|
|
3924
|
+
const lowerKey = key.toLowerCase();
|
|
3925
|
+
if (SENSITIVE_HEADERS3.includes(lowerKey)) {
|
|
3926
|
+
filtered[key] = "***";
|
|
3927
|
+
} else {
|
|
3928
|
+
filtered[key] = headers[key] || "";
|
|
4034
3929
|
}
|
|
4035
|
-
}
|
|
4036
|
-
|
|
3930
|
+
});
|
|
3931
|
+
return filtered;
|
|
4037
3932
|
}
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
import_consola9.consola.box(`createCentrifugoServerPresenceCreate
|
|
4048
|
-
Path: /cfg/centrifugo/server/presence/
|
|
4049
|
-
Method: POST`);
|
|
4050
|
-
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4051
|
-
import_consola9.consola.error("Validation Issues:");
|
|
4052
|
-
error.issues.forEach((issue, index) => {
|
|
4053
|
-
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
4054
|
-
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4055
|
-
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4056
|
-
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4057
|
-
});
|
|
3933
|
+
/**
|
|
3934
|
+
* Log request
|
|
3935
|
+
*/
|
|
3936
|
+
logRequest(request) {
|
|
3937
|
+
if (!this.config.enabled || !this.config.logRequests) return;
|
|
3938
|
+
const { method, url, headers, body } = request;
|
|
3939
|
+
this.consola.start(`${method} ${url}`);
|
|
3940
|
+
if (this.config.logHeaders && headers) {
|
|
3941
|
+
this.consola.debug("Headers:", this.filterHeaders(headers));
|
|
4058
3942
|
}
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
try {
|
|
4062
|
-
const event = new CustomEvent("zod-validation-error", {
|
|
4063
|
-
detail: {
|
|
4064
|
-
operation: "createCentrifugoServerPresenceCreate",
|
|
4065
|
-
path: "/cfg/centrifugo/server/presence/",
|
|
4066
|
-
method: "POST",
|
|
4067
|
-
error,
|
|
4068
|
-
response,
|
|
4069
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4070
|
-
},
|
|
4071
|
-
bubbles: true,
|
|
4072
|
-
cancelable: false
|
|
4073
|
-
});
|
|
4074
|
-
window.dispatchEvent(event);
|
|
4075
|
-
} catch (eventError) {
|
|
4076
|
-
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4077
|
-
}
|
|
3943
|
+
if (this.config.logBodies && body) {
|
|
3944
|
+
this.consola.debug("Body:", body);
|
|
4078
3945
|
}
|
|
4079
|
-
throw error;
|
|
4080
3946
|
}
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
import_consola9.consola.error("Validation Issues:");
|
|
4095
|
-
error.issues.forEach((issue, index) => {
|
|
4096
|
-
import_consola9.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
4097
|
-
import_consola9.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4098
|
-
if (issue.expected) import_consola9.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4099
|
-
if (issue.received) import_consola9.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4100
|
-
});
|
|
3947
|
+
/**
|
|
3948
|
+
* Log response
|
|
3949
|
+
*/
|
|
3950
|
+
logResponse(request, response) {
|
|
3951
|
+
if (!this.config.enabled || !this.config.logResponses) return;
|
|
3952
|
+
const { method, url } = request;
|
|
3953
|
+
const { status, statusText, data, duration } = response;
|
|
3954
|
+
const statusColor = status >= 500 ? "red" : status >= 400 ? "yellow" : status >= 300 ? "cyan" : "green";
|
|
3955
|
+
this.consola.success(
|
|
3956
|
+
`${method} ${url} ${status} ${statusText} (${duration}ms)`
|
|
3957
|
+
);
|
|
3958
|
+
if (this.config.logBodies && data) {
|
|
3959
|
+
this.consola.debug("Response:", data);
|
|
4101
3960
|
}
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
3961
|
+
}
|
|
3962
|
+
/**
|
|
3963
|
+
* Log error
|
|
3964
|
+
*/
|
|
3965
|
+
logError(request, error) {
|
|
3966
|
+
if (!this.config.enabled || !this.config.logErrors) return;
|
|
3967
|
+
const { method, url } = request;
|
|
3968
|
+
const { message, statusCode, fieldErrors, duration } = error;
|
|
3969
|
+
this.consola.error(
|
|
3970
|
+
`${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
|
|
3971
|
+
);
|
|
3972
|
+
this.consola.error("Message:", message);
|
|
3973
|
+
if (fieldErrors && Object.keys(fieldErrors).length > 0) {
|
|
3974
|
+
this.consola.error("Field Errors:");
|
|
3975
|
+
Object.entries(fieldErrors).forEach(([field, errors]) => {
|
|
3976
|
+
errors.forEach((err) => {
|
|
3977
|
+
this.consola.error(` \u2022 ${field}: ${err}`);
|
|
4116
3978
|
});
|
|
4117
|
-
|
|
4118
|
-
} catch (eventError) {
|
|
4119
|
-
import_consola9.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4120
|
-
}
|
|
3979
|
+
});
|
|
4121
3980
|
}
|
|
4122
|
-
throw error;
|
|
4123
3981
|
}
|
|
4124
|
-
|
|
4125
|
-
|
|
3982
|
+
/**
|
|
3983
|
+
* Log general info
|
|
3984
|
+
*/
|
|
3985
|
+
info(message, ...args) {
|
|
3986
|
+
if (!this.config.enabled) return;
|
|
3987
|
+
this.consola.info(message, ...args);
|
|
3988
|
+
}
|
|
3989
|
+
/**
|
|
3990
|
+
* Log warning
|
|
3991
|
+
*/
|
|
3992
|
+
warn(message, ...args) {
|
|
3993
|
+
if (!this.config.enabled) return;
|
|
3994
|
+
this.consola.warn(message, ...args);
|
|
3995
|
+
}
|
|
3996
|
+
/**
|
|
3997
|
+
* Log error
|
|
3998
|
+
*/
|
|
3999
|
+
error(message, ...args) {
|
|
4000
|
+
if (!this.config.enabled) return;
|
|
4001
|
+
this.consola.error(message, ...args);
|
|
4002
|
+
}
|
|
4003
|
+
/**
|
|
4004
|
+
* Log debug
|
|
4005
|
+
*/
|
|
4006
|
+
debug(message, ...args) {
|
|
4007
|
+
if (!this.config.enabled) return;
|
|
4008
|
+
this.consola.debug(message, ...args);
|
|
4009
|
+
}
|
|
4010
|
+
/**
|
|
4011
|
+
* Log success
|
|
4012
|
+
*/
|
|
4013
|
+
success(message, ...args) {
|
|
4014
|
+
if (!this.config.enabled) return;
|
|
4015
|
+
this.consola.success(message, ...args);
|
|
4016
|
+
}
|
|
4017
|
+
/**
|
|
4018
|
+
* Create a sub-logger with prefix
|
|
4019
|
+
*/
|
|
4020
|
+
withTag(tag) {
|
|
4021
|
+
return this.consola.withTag(tag);
|
|
4022
|
+
}
|
|
4023
|
+
};
|
|
4024
|
+
var defaultLogger3 = new APILogger3();
|
|
4126
4025
|
|
|
4127
|
-
// src/generated/
|
|
4128
|
-
var
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
});
|
|
4026
|
+
// src/generated/cfg_webpush/retry.ts
|
|
4027
|
+
var import_p_retry3 = __toESM(require("p-retry"), 1);
|
|
4028
|
+
var DEFAULT_RETRY_CONFIG3 = {
|
|
4029
|
+
retries: 3,
|
|
4030
|
+
factor: 2,
|
|
4031
|
+
minTimeout: 1e3,
|
|
4032
|
+
maxTimeout: 6e4,
|
|
4033
|
+
randomize: true,
|
|
4034
|
+
onFailedAttempt: /* @__PURE__ */ __name(() => {
|
|
4035
|
+
}, "onFailedAttempt")
|
|
4036
|
+
};
|
|
4037
|
+
function shouldRetry3(error) {
|
|
4038
|
+
if (error instanceof NetworkError3) {
|
|
4039
|
+
return true;
|
|
4040
|
+
}
|
|
4041
|
+
if (error instanceof APIError3) {
|
|
4042
|
+
const status = error.statusCode;
|
|
4043
|
+
if (status >= 500 && status < 600) {
|
|
4044
|
+
return true;
|
|
4147
4045
|
}
|
|
4148
|
-
|
|
4149
|
-
|
|
4046
|
+
if (status === 429) {
|
|
4047
|
+
return true;
|
|
4048
|
+
}
|
|
4049
|
+
return false;
|
|
4050
|
+
}
|
|
4051
|
+
return true;
|
|
4052
|
+
}
|
|
4053
|
+
__name(shouldRetry3, "shouldRetry");
|
|
4054
|
+
async function withRetry3(fn, config) {
|
|
4055
|
+
const finalConfig = { ...DEFAULT_RETRY_CONFIG3, ...config };
|
|
4056
|
+
return (0, import_p_retry3.default)(
|
|
4057
|
+
async () => {
|
|
4150
4058
|
try {
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
response,
|
|
4158
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4159
|
-
},
|
|
4160
|
-
bubbles: true,
|
|
4161
|
-
cancelable: false
|
|
4162
|
-
});
|
|
4163
|
-
window.dispatchEvent(event);
|
|
4164
|
-
} catch (eventError) {
|
|
4165
|
-
import_consola10.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4059
|
+
return await fn();
|
|
4060
|
+
} catch (error) {
|
|
4061
|
+
if (!shouldRetry3(error)) {
|
|
4062
|
+
throw new import_p_retry3.AbortError(error);
|
|
4063
|
+
}
|
|
4064
|
+
throw error;
|
|
4166
4065
|
}
|
|
4066
|
+
},
|
|
4067
|
+
{
|
|
4068
|
+
retries: finalConfig.retries,
|
|
4069
|
+
factor: finalConfig.factor,
|
|
4070
|
+
minTimeout: finalConfig.minTimeout,
|
|
4071
|
+
maxTimeout: finalConfig.maxTimeout,
|
|
4072
|
+
randomize: finalConfig.randomize,
|
|
4073
|
+
onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
|
|
4074
|
+
const pRetryError = error;
|
|
4075
|
+
finalConfig.onFailedAttempt({
|
|
4076
|
+
error: pRetryError,
|
|
4077
|
+
attemptNumber: pRetryError.attemptNumber,
|
|
4078
|
+
retriesLeft: pRetryError.retriesLeft
|
|
4079
|
+
});
|
|
4080
|
+
} : void 0
|
|
4167
4081
|
}
|
|
4168
|
-
|
|
4169
|
-
}
|
|
4082
|
+
);
|
|
4170
4083
|
}
|
|
4171
|
-
__name(
|
|
4084
|
+
__name(withRetry3, "withRetry");
|
|
4172
4085
|
|
|
4173
|
-
// src/generated/
|
|
4174
|
-
var
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
import_consola11.consola.box(`getCentrifugoMonitorChannelsRetrieve
|
|
4183
|
-
Path: /cfg/centrifugo/monitor/channels/
|
|
4184
|
-
Method: GET`);
|
|
4185
|
-
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4186
|
-
import_consola11.consola.error("Validation Issues:");
|
|
4187
|
-
error.issues.forEach((issue, index) => {
|
|
4188
|
-
import_consola11.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
4189
|
-
import_consola11.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4190
|
-
if (issue.expected) import_consola11.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4191
|
-
if (issue.received) import_consola11.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4192
|
-
});
|
|
4086
|
+
// src/generated/cfg_webpush/client.ts
|
|
4087
|
+
var APIClient3 = class {
|
|
4088
|
+
constructor(baseUrl, options) {
|
|
4089
|
+
this.logger = null;
|
|
4090
|
+
this.retryConfig = null;
|
|
4091
|
+
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
4092
|
+
this.httpClient = options?.httpClient || new FetchAdapter3();
|
|
4093
|
+
if (options?.loggerConfig !== void 0) {
|
|
4094
|
+
this.logger = new APILogger3(options.loggerConfig);
|
|
4193
4095
|
}
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
try {
|
|
4197
|
-
const event = new CustomEvent("zod-validation-error", {
|
|
4198
|
-
detail: {
|
|
4199
|
-
operation: "getCentrifugoMonitorChannelsRetrieve",
|
|
4200
|
-
path: "/cfg/centrifugo/monitor/channels/",
|
|
4201
|
-
method: "GET",
|
|
4202
|
-
error,
|
|
4203
|
-
response,
|
|
4204
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4205
|
-
},
|
|
4206
|
-
bubbles: true,
|
|
4207
|
-
cancelable: false
|
|
4208
|
-
});
|
|
4209
|
-
window.dispatchEvent(event);
|
|
4210
|
-
} catch (eventError) {
|
|
4211
|
-
import_consola11.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4212
|
-
}
|
|
4096
|
+
if (options?.retryConfig !== void 0) {
|
|
4097
|
+
this.retryConfig = options.retryConfig;
|
|
4213
4098
|
}
|
|
4214
|
-
|
|
4099
|
+
this.web_push = new WebPush(this);
|
|
4215
4100
|
}
|
|
4216
|
-
|
|
4217
|
-
__name(
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
if (
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4101
|
+
static {
|
|
4102
|
+
__name(this, "APIClient");
|
|
4103
|
+
}
|
|
4104
|
+
/**
|
|
4105
|
+
* Get CSRF token from cookies (for SessionAuthentication).
|
|
4106
|
+
*
|
|
4107
|
+
* Returns null if cookie doesn't exist (JWT-only auth).
|
|
4108
|
+
*/
|
|
4109
|
+
getCsrfToken() {
|
|
4110
|
+
const name = "csrftoken";
|
|
4111
|
+
const value = `; ${document.cookie}`;
|
|
4112
|
+
const parts = value.split(`; ${name}=`);
|
|
4113
|
+
if (parts.length === 2) {
|
|
4114
|
+
return parts.pop()?.split(";").shift() || null;
|
|
4115
|
+
}
|
|
4116
|
+
return null;
|
|
4117
|
+
}
|
|
4118
|
+
/**
|
|
4119
|
+
* Make HTTP request with Django CSRF and session handling.
|
|
4120
|
+
* Automatically retries on network errors and 5xx server errors.
|
|
4121
|
+
*/
|
|
4122
|
+
async request(method, path, options) {
|
|
4123
|
+
if (this.retryConfig) {
|
|
4124
|
+
return withRetry3(() => this._makeRequest(method, path, options), {
|
|
4125
|
+
...this.retryConfig,
|
|
4126
|
+
onFailedAttempt: /* @__PURE__ */ __name((info) => {
|
|
4127
|
+
if (this.logger) {
|
|
4128
|
+
this.logger.warn(
|
|
4129
|
+
`Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} for ${method} ${path}: ${info.error.message}`
|
|
4130
|
+
);
|
|
4131
|
+
}
|
|
4132
|
+
this.retryConfig?.onFailedAttempt?.(info);
|
|
4133
|
+
}, "onFailedAttempt")
|
|
4235
4134
|
});
|
|
4236
4135
|
}
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4136
|
+
return this._makeRequest(method, path, options);
|
|
4137
|
+
}
|
|
4138
|
+
/**
|
|
4139
|
+
* Internal request method (without retry wrapper).
|
|
4140
|
+
* Used by request() method with optional retry logic.
|
|
4141
|
+
*/
|
|
4142
|
+
async _makeRequest(method, path, options) {
|
|
4143
|
+
const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
|
|
4144
|
+
const startTime = Date.now();
|
|
4145
|
+
const headers = {
|
|
4146
|
+
...options?.headers || {}
|
|
4147
|
+
};
|
|
4148
|
+
if (!options?.formData && !headers["Content-Type"]) {
|
|
4149
|
+
headers["Content-Type"] = "application/json";
|
|
4150
|
+
}
|
|
4151
|
+
if (this.logger) {
|
|
4152
|
+
this.logger.logRequest({
|
|
4153
|
+
method,
|
|
4154
|
+
url,
|
|
4155
|
+
headers,
|
|
4156
|
+
body: options?.formData || options?.body,
|
|
4157
|
+
timestamp: startTime
|
|
4158
|
+
});
|
|
4159
|
+
}
|
|
4160
|
+
try {
|
|
4161
|
+
const response = await this.httpClient.request({
|
|
4162
|
+
method,
|
|
4163
|
+
url,
|
|
4164
|
+
headers,
|
|
4165
|
+
params: options?.params,
|
|
4166
|
+
body: options?.body,
|
|
4167
|
+
formData: options?.formData
|
|
4168
|
+
});
|
|
4169
|
+
const duration = Date.now() - startTime;
|
|
4170
|
+
if (response.status >= 400) {
|
|
4171
|
+
const error = new APIError3(
|
|
4172
|
+
response.status,
|
|
4173
|
+
response.statusText,
|
|
4174
|
+
response.data,
|
|
4175
|
+
url
|
|
4176
|
+
);
|
|
4177
|
+
if (this.logger) {
|
|
4178
|
+
this.logger.logError(
|
|
4179
|
+
{
|
|
4180
|
+
method,
|
|
4181
|
+
url,
|
|
4182
|
+
headers,
|
|
4183
|
+
body: options?.formData || options?.body,
|
|
4184
|
+
timestamp: startTime
|
|
4185
|
+
},
|
|
4186
|
+
{
|
|
4187
|
+
message: error.message,
|
|
4188
|
+
statusCode: response.status,
|
|
4189
|
+
duration,
|
|
4190
|
+
timestamp: Date.now()
|
|
4191
|
+
}
|
|
4192
|
+
);
|
|
4193
|
+
}
|
|
4194
|
+
throw error;
|
|
4195
|
+
}
|
|
4196
|
+
if (this.logger) {
|
|
4197
|
+
this.logger.logResponse(
|
|
4198
|
+
{
|
|
4199
|
+
method,
|
|
4200
|
+
url,
|
|
4201
|
+
headers,
|
|
4202
|
+
body: options?.formData || options?.body,
|
|
4203
|
+
timestamp: startTime
|
|
4248
4204
|
},
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4205
|
+
{
|
|
4206
|
+
status: response.status,
|
|
4207
|
+
statusText: response.statusText,
|
|
4208
|
+
data: response.data,
|
|
4209
|
+
duration,
|
|
4210
|
+
timestamp: Date.now()
|
|
4211
|
+
}
|
|
4212
|
+
);
|
|
4213
|
+
}
|
|
4214
|
+
return response.data;
|
|
4215
|
+
} catch (error) {
|
|
4216
|
+
const duration = Date.now() - startTime;
|
|
4217
|
+
if (error instanceof APIError3) {
|
|
4218
|
+
throw error;
|
|
4219
|
+
}
|
|
4220
|
+
const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
|
|
4221
|
+
if (this.logger) {
|
|
4222
|
+
if (isCORSError) {
|
|
4223
|
+
this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
|
|
4224
|
+
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
4225
|
+
this.logger.error(` \u2192 Configure security_domains parameter on the server`);
|
|
4226
|
+
} else {
|
|
4227
|
+
this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
|
|
4228
|
+
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
4229
|
+
}
|
|
4230
|
+
}
|
|
4231
|
+
if (typeof window !== "undefined") {
|
|
4232
|
+
try {
|
|
4233
|
+
if (isCORSError) {
|
|
4234
|
+
window.dispatchEvent(new CustomEvent("cors-error", {
|
|
4235
|
+
detail: {
|
|
4236
|
+
url,
|
|
4237
|
+
method,
|
|
4238
|
+
error: error instanceof Error ? error.message : String(error),
|
|
4239
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
4240
|
+
},
|
|
4241
|
+
bubbles: true,
|
|
4242
|
+
cancelable: false
|
|
4243
|
+
}));
|
|
4244
|
+
} else {
|
|
4245
|
+
window.dispatchEvent(new CustomEvent("network-error", {
|
|
4246
|
+
detail: {
|
|
4247
|
+
url,
|
|
4248
|
+
method,
|
|
4249
|
+
error: error instanceof Error ? error.message : String(error),
|
|
4250
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
4251
|
+
},
|
|
4252
|
+
bubbles: true,
|
|
4253
|
+
cancelable: false
|
|
4254
|
+
}));
|
|
4255
|
+
}
|
|
4256
|
+
} catch (eventError) {
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
const networkError = error instanceof Error ? new NetworkError3(error.message, url, error) : new NetworkError3("Unknown error", url);
|
|
4260
|
+
if (this.logger) {
|
|
4261
|
+
this.logger.logError(
|
|
4262
|
+
{
|
|
4263
|
+
method,
|
|
4264
|
+
url,
|
|
4265
|
+
headers,
|
|
4266
|
+
body: options?.formData || options?.body,
|
|
4267
|
+
timestamp: startTime
|
|
4268
|
+
},
|
|
4269
|
+
{
|
|
4270
|
+
message: networkError.message,
|
|
4271
|
+
duration,
|
|
4272
|
+
timestamp: Date.now()
|
|
4273
|
+
}
|
|
4274
|
+
);
|
|
4255
4275
|
}
|
|
4276
|
+
throw networkError;
|
|
4256
4277
|
}
|
|
4257
|
-
throw error;
|
|
4258
4278
|
}
|
|
4259
|
-
}
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
import_consola11.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4276
|
-
if (issue.expected) import_consola11.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4277
|
-
if (issue.received) import_consola11.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4278
|
-
});
|
|
4279
|
-
}
|
|
4280
|
-
import_consola11.consola.error("Response data:", response);
|
|
4281
|
-
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
4282
|
-
try {
|
|
4283
|
-
const event = new CustomEvent("zod-validation-error", {
|
|
4284
|
-
detail: {
|
|
4285
|
-
operation: "getCentrifugoMonitorOverviewRetrieve",
|
|
4286
|
-
path: "/cfg/centrifugo/monitor/overview/",
|
|
4287
|
-
method: "GET",
|
|
4288
|
-
error,
|
|
4289
|
-
response,
|
|
4290
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4291
|
-
},
|
|
4292
|
-
bubbles: true,
|
|
4293
|
-
cancelable: false
|
|
4294
|
-
});
|
|
4295
|
-
window.dispatchEvent(event);
|
|
4296
|
-
} catch (eventError) {
|
|
4297
|
-
import_consola11.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4279
|
+
};
|
|
4280
|
+
|
|
4281
|
+
// src/generated/cfg_webpush/storage.ts
|
|
4282
|
+
var LocalStorageAdapter3 = class {
|
|
4283
|
+
static {
|
|
4284
|
+
__name(this, "LocalStorageAdapter");
|
|
4285
|
+
}
|
|
4286
|
+
constructor(logger) {
|
|
4287
|
+
this.logger = logger;
|
|
4288
|
+
}
|
|
4289
|
+
getItem(key) {
|
|
4290
|
+
try {
|
|
4291
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4292
|
+
const value = localStorage.getItem(key);
|
|
4293
|
+
this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
|
|
4294
|
+
return value;
|
|
4298
4295
|
}
|
|
4296
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
4297
|
+
} catch (error) {
|
|
4298
|
+
this.logger?.error("LocalStorage.getItem failed:", error);
|
|
4299
4299
|
}
|
|
4300
|
-
|
|
4300
|
+
return null;
|
|
4301
4301
|
}
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
} catch (error) {
|
|
4310
|
-
import_consola11.consola.error("\u274C Zod Validation Failed");
|
|
4311
|
-
import_consola11.consola.box(`getCentrifugoMonitorPublishesList
|
|
4312
|
-
Path: /cfg/centrifugo/monitor/publishes/
|
|
4313
|
-
Method: GET`);
|
|
4314
|
-
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4315
|
-
import_consola11.consola.error("Validation Issues:");
|
|
4316
|
-
error.issues.forEach((issue, index) => {
|
|
4317
|
-
import_consola11.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
4318
|
-
import_consola11.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4319
|
-
if (issue.expected) import_consola11.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4320
|
-
if (issue.received) import_consola11.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4321
|
-
});
|
|
4322
|
-
}
|
|
4323
|
-
import_consola11.consola.error("Response data:", response);
|
|
4324
|
-
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
4325
|
-
try {
|
|
4326
|
-
const event = new CustomEvent("zod-validation-error", {
|
|
4327
|
-
detail: {
|
|
4328
|
-
operation: "getCentrifugoMonitorPublishesList",
|
|
4329
|
-
path: "/cfg/centrifugo/monitor/publishes/",
|
|
4330
|
-
method: "GET",
|
|
4331
|
-
error,
|
|
4332
|
-
response,
|
|
4333
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4334
|
-
},
|
|
4335
|
-
bubbles: true,
|
|
4336
|
-
cancelable: false
|
|
4337
|
-
});
|
|
4338
|
-
window.dispatchEvent(event);
|
|
4339
|
-
} catch (eventError) {
|
|
4340
|
-
import_consola11.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4302
|
+
setItem(key, value) {
|
|
4303
|
+
try {
|
|
4304
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4305
|
+
localStorage.setItem(key, value);
|
|
4306
|
+
this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
|
|
4307
|
+
} else {
|
|
4308
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
4341
4309
|
}
|
|
4310
|
+
} catch (error) {
|
|
4311
|
+
this.logger?.error("LocalStorage.setItem failed:", error);
|
|
4342
4312
|
}
|
|
4343
|
-
throw error;
|
|
4344
4313
|
}
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
} catch (error) {
|
|
4353
|
-
import_consola11.consola.error("\u274C Zod Validation Failed");
|
|
4354
|
-
import_consola11.consola.box(`getCentrifugoMonitorTimelineRetrieve
|
|
4355
|
-
Path: /cfg/centrifugo/monitor/timeline/
|
|
4356
|
-
Method: GET`);
|
|
4357
|
-
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4358
|
-
import_consola11.consola.error("Validation Issues:");
|
|
4359
|
-
error.issues.forEach((issue, index) => {
|
|
4360
|
-
import_consola11.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
4361
|
-
import_consola11.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
4362
|
-
if (issue.expected) import_consola11.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
4363
|
-
if (issue.received) import_consola11.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
4364
|
-
});
|
|
4365
|
-
}
|
|
4366
|
-
import_consola11.consola.error("Response data:", response);
|
|
4367
|
-
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
4368
|
-
try {
|
|
4369
|
-
const event = new CustomEvent("zod-validation-error", {
|
|
4370
|
-
detail: {
|
|
4371
|
-
operation: "getCentrifugoMonitorTimelineRetrieve",
|
|
4372
|
-
path: "/cfg/centrifugo/monitor/timeline/",
|
|
4373
|
-
method: "GET",
|
|
4374
|
-
error,
|
|
4375
|
-
response,
|
|
4376
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
4377
|
-
},
|
|
4378
|
-
bubbles: true,
|
|
4379
|
-
cancelable: false
|
|
4380
|
-
});
|
|
4381
|
-
window.dispatchEvent(event);
|
|
4382
|
-
} catch (eventError) {
|
|
4383
|
-
import_consola11.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
4314
|
+
removeItem(key) {
|
|
4315
|
+
try {
|
|
4316
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4317
|
+
localStorage.removeItem(key);
|
|
4318
|
+
this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
|
|
4319
|
+
} else {
|
|
4320
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
4384
4321
|
}
|
|
4322
|
+
} catch (error) {
|
|
4323
|
+
this.logger?.error("LocalStorage.removeItem failed:", error);
|
|
4385
4324
|
}
|
|
4386
|
-
throw error;
|
|
4387
4325
|
}
|
|
4388
|
-
}
|
|
4389
|
-
__name(getCentrifugoMonitorTimelineRetrieve, "getCentrifugoMonitorTimelineRetrieve");
|
|
4326
|
+
};
|
|
4390
4327
|
|
|
4391
|
-
// src/generated/
|
|
4328
|
+
// src/generated/cfg_webpush/_utils/schemas/index.ts
|
|
4329
|
+
var schemas_exports3 = {};
|
|
4330
|
+
__export(schemas_exports3, {
|
|
4331
|
+
SendPushRequestRequestSchema: () => SendPushRequestRequestSchema,
|
|
4332
|
+
SendPushResponseSchema: () => SendPushResponseSchema,
|
|
4333
|
+
SubscribeRequestRequestSchema: () => SubscribeRequestRequestSchema,
|
|
4334
|
+
SubscribeResponseSchema: () => SubscribeResponseSchema,
|
|
4335
|
+
VapidPublicKeyResponseSchema: () => VapidPublicKeyResponseSchema
|
|
4336
|
+
});
|
|
4337
|
+
|
|
4338
|
+
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
4339
|
+
var import_zod55 = require("zod");
|
|
4340
|
+
var SendPushRequestRequestSchema = import_zod55.z.object({
|
|
4341
|
+
title: import_zod55.z.string().min(1).max(255),
|
|
4342
|
+
body: import_zod55.z.string().min(1),
|
|
4343
|
+
icon: import_zod55.z.url().nullable().optional(),
|
|
4344
|
+
url: import_zod55.z.url().nullable().optional()
|
|
4345
|
+
});
|
|
4346
|
+
|
|
4347
|
+
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
4348
|
+
var import_zod56 = require("zod");
|
|
4349
|
+
var SendPushResponseSchema = import_zod56.z.object({
|
|
4350
|
+
success: import_zod56.z.boolean(),
|
|
4351
|
+
sent_to: import_zod56.z.int()
|
|
4352
|
+
});
|
|
4353
|
+
|
|
4354
|
+
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
4355
|
+
var import_zod57 = require("zod");
|
|
4356
|
+
var SubscribeRequestRequestSchema = import_zod57.z.object({
|
|
4357
|
+
endpoint: import_zod57.z.url(),
|
|
4358
|
+
keys: import_zod57.z.record(import_zod57.z.string(), import_zod57.z.string().min(1))
|
|
4359
|
+
});
|
|
4360
|
+
|
|
4361
|
+
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
4362
|
+
var import_zod58 = require("zod");
|
|
4363
|
+
var SubscribeResponseSchema = import_zod58.z.object({
|
|
4364
|
+
success: import_zod58.z.boolean(),
|
|
4365
|
+
subscription_id: import_zod58.z.int(),
|
|
4366
|
+
created: import_zod58.z.boolean()
|
|
4367
|
+
});
|
|
4368
|
+
|
|
4369
|
+
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
4370
|
+
var import_zod59 = require("zod");
|
|
4371
|
+
var VapidPublicKeyResponseSchema = import_zod59.z.object({
|
|
4372
|
+
publicKey: import_zod59.z.string()
|
|
4373
|
+
});
|
|
4374
|
+
|
|
4375
|
+
// src/generated/cfg_webpush/_utils/fetchers/index.ts
|
|
4376
|
+
var fetchers_exports3 = {};
|
|
4377
|
+
__export(fetchers_exports3, {
|
|
4378
|
+
createWebpushSendCreate: () => createWebpushSendCreate,
|
|
4379
|
+
createWebpushSubscribeCreate: () => createWebpushSubscribeCreate,
|
|
4380
|
+
getWebpushVapidRetrieve: () => getWebpushVapidRetrieve
|
|
4381
|
+
});
|
|
4382
|
+
|
|
4383
|
+
// src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
|
|
4392
4384
|
var import_consola12 = require("consola");
|
|
4393
|
-
|
|
4385
|
+
|
|
4386
|
+
// src/generated/cfg_webpush/api-instance.ts
|
|
4387
|
+
var globalAPI3 = null;
|
|
4388
|
+
function getAPIInstance3() {
|
|
4389
|
+
if (!globalAPI3) {
|
|
4390
|
+
throw new Error(
|
|
4391
|
+
'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
|
|
4392
|
+
);
|
|
4393
|
+
}
|
|
4394
|
+
return globalAPI3;
|
|
4395
|
+
}
|
|
4396
|
+
__name(getAPIInstance3, "getAPIInstance");
|
|
4397
|
+
|
|
4398
|
+
// src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
|
|
4399
|
+
async function createWebpushSendCreate(data, client) {
|
|
4394
4400
|
const api = client || getAPIInstance3();
|
|
4395
|
-
const response = await api.
|
|
4401
|
+
const response = await api.web_push.webpushSendCreate(data);
|
|
4396
4402
|
try {
|
|
4397
|
-
return
|
|
4403
|
+
return SendPushResponseSchema.parse(response);
|
|
4398
4404
|
} catch (error) {
|
|
4399
4405
|
import_consola12.consola.error("\u274C Zod Validation Failed");
|
|
4400
|
-
import_consola12.consola.box(`
|
|
4401
|
-
Path: /cfg/
|
|
4406
|
+
import_consola12.consola.box(`createWebpushSendCreate
|
|
4407
|
+
Path: /cfg/webpush/send/
|
|
4402
4408
|
Method: POST`);
|
|
4403
4409
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4404
4410
|
import_consola12.consola.error("Validation Issues:");
|
|
@@ -4414,8 +4420,8 @@ Method: POST`);
|
|
|
4414
4420
|
try {
|
|
4415
4421
|
const event = new CustomEvent("zod-validation-error", {
|
|
4416
4422
|
detail: {
|
|
4417
|
-
operation: "
|
|
4418
|
-
path: "/cfg/
|
|
4423
|
+
operation: "createWebpushSendCreate",
|
|
4424
|
+
path: "/cfg/webpush/send/",
|
|
4419
4425
|
method: "POST",
|
|
4420
4426
|
error,
|
|
4421
4427
|
response,
|
|
@@ -4432,16 +4438,16 @@ Method: POST`);
|
|
|
4432
4438
|
throw error;
|
|
4433
4439
|
}
|
|
4434
4440
|
}
|
|
4435
|
-
__name(
|
|
4436
|
-
async function
|
|
4441
|
+
__name(createWebpushSendCreate, "createWebpushSendCreate");
|
|
4442
|
+
async function createWebpushSubscribeCreate(data, client) {
|
|
4437
4443
|
const api = client || getAPIInstance3();
|
|
4438
|
-
const response = await api.
|
|
4444
|
+
const response = await api.web_push.webpushSubscribeCreate(data);
|
|
4439
4445
|
try {
|
|
4440
|
-
return
|
|
4446
|
+
return SubscribeResponseSchema.parse(response);
|
|
4441
4447
|
} catch (error) {
|
|
4442
4448
|
import_consola12.consola.error("\u274C Zod Validation Failed");
|
|
4443
|
-
import_consola12.consola.box(`
|
|
4444
|
-
Path: /cfg/
|
|
4449
|
+
import_consola12.consola.box(`createWebpushSubscribeCreate
|
|
4450
|
+
Path: /cfg/webpush/subscribe/
|
|
4445
4451
|
Method: POST`);
|
|
4446
4452
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4447
4453
|
import_consola12.consola.error("Validation Issues:");
|
|
@@ -4457,8 +4463,8 @@ Method: POST`);
|
|
|
4457
4463
|
try {
|
|
4458
4464
|
const event = new CustomEvent("zod-validation-error", {
|
|
4459
4465
|
detail: {
|
|
4460
|
-
operation: "
|
|
4461
|
-
path: "/cfg/
|
|
4466
|
+
operation: "createWebpushSubscribeCreate",
|
|
4467
|
+
path: "/cfg/webpush/subscribe/",
|
|
4462
4468
|
method: "POST",
|
|
4463
4469
|
error,
|
|
4464
4470
|
response,
|
|
@@ -4475,17 +4481,17 @@ Method: POST`);
|
|
|
4475
4481
|
throw error;
|
|
4476
4482
|
}
|
|
4477
4483
|
}
|
|
4478
|
-
__name(
|
|
4479
|
-
async function
|
|
4484
|
+
__name(createWebpushSubscribeCreate, "createWebpushSubscribeCreate");
|
|
4485
|
+
async function getWebpushVapidRetrieve(client) {
|
|
4480
4486
|
const api = client || getAPIInstance3();
|
|
4481
|
-
const response = await api.
|
|
4487
|
+
const response = await api.web_push.webpushVapidRetrieve();
|
|
4482
4488
|
try {
|
|
4483
|
-
return
|
|
4489
|
+
return VapidPublicKeyResponseSchema.parse(response);
|
|
4484
4490
|
} catch (error) {
|
|
4485
4491
|
import_consola12.consola.error("\u274C Zod Validation Failed");
|
|
4486
|
-
import_consola12.consola.box(`
|
|
4487
|
-
Path: /cfg/
|
|
4488
|
-
Method:
|
|
4492
|
+
import_consola12.consola.box(`getWebpushVapidRetrieve
|
|
4493
|
+
Path: /cfg/webpush/vapid/
|
|
4494
|
+
Method: GET`);
|
|
4489
4495
|
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
4490
4496
|
import_consola12.consola.error("Validation Issues:");
|
|
4491
4497
|
error.issues.forEach((issue, index) => {
|
|
@@ -4500,9 +4506,9 @@ Method: POST`);
|
|
|
4500
4506
|
try {
|
|
4501
4507
|
const event = new CustomEvent("zod-validation-error", {
|
|
4502
4508
|
detail: {
|
|
4503
|
-
operation: "
|
|
4504
|
-
path: "/cfg/
|
|
4505
|
-
method: "
|
|
4509
|
+
operation: "getWebpushVapidRetrieve",
|
|
4510
|
+
path: "/cfg/webpush/vapid/",
|
|
4511
|
+
method: "GET",
|
|
4506
4512
|
error,
|
|
4507
4513
|
response,
|
|
4508
4514
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -4518,9 +4524,9 @@ Method: POST`);
|
|
|
4518
4524
|
throw error;
|
|
4519
4525
|
}
|
|
4520
4526
|
}
|
|
4521
|
-
__name(
|
|
4527
|
+
__name(getWebpushVapidRetrieve, "getWebpushVapidRetrieve");
|
|
4522
4528
|
|
|
4523
|
-
// src/generated/
|
|
4529
|
+
// src/generated/cfg_webpush/index.ts
|
|
4524
4530
|
var TOKEN_KEY3 = "auth_token";
|
|
4525
4531
|
var REFRESH_TOKEN_KEY3 = "refresh_token";
|
|
4526
4532
|
var API3 = class {
|
|
@@ -4537,10 +4543,7 @@ var API3 = class {
|
|
|
4537
4543
|
loggerConfig: this.options?.loggerConfig
|
|
4538
4544
|
});
|
|
4539
4545
|
this._injectAuthHeader();
|
|
4540
|
-
this.
|
|
4541
|
-
this.centrifugo_auth = this._client.centrifugo_auth;
|
|
4542
|
-
this.centrifugo_monitoring = this._client.centrifugo_monitoring;
|
|
4543
|
-
this.centrifugo_testing = this._client.centrifugo_testing;
|
|
4546
|
+
this.web_push = this._client.web_push;
|
|
4544
4547
|
}
|
|
4545
4548
|
static {
|
|
4546
4549
|
__name(this, "API");
|
|
@@ -4555,10 +4558,7 @@ var API3 = class {
|
|
|
4555
4558
|
loggerConfig: this.options?.loggerConfig
|
|
4556
4559
|
});
|
|
4557
4560
|
this._injectAuthHeader();
|
|
4558
|
-
this.
|
|
4559
|
-
this.centrifugo_auth = this._client.centrifugo_auth;
|
|
4560
|
-
this.centrifugo_monitoring = this._client.centrifugo_monitoring;
|
|
4561
|
-
this.centrifugo_testing = this._client.centrifugo_testing;
|
|
4561
|
+
this.web_push = this._client.web_push;
|
|
4562
4562
|
}
|
|
4563
4563
|
_injectAuthHeader() {
|
|
4564
4564
|
const originalRequest = this._client.request.bind(this._client);
|
|
@@ -4978,6 +4978,6 @@ var isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === "true";
|
|
|
4978
4978
|
var apiUrl = isStaticBuild ? "" : process.env.NEXT_PUBLIC_API_URL || "";
|
|
4979
4979
|
var storage = new LocalStorageAdapter();
|
|
4980
4980
|
var apiAccounts = new API(apiUrl, { storage });
|
|
4981
|
-
var apiWebPush = new
|
|
4982
|
-
var apiCentrifugo = new
|
|
4981
|
+
var apiWebPush = new API3(apiUrl, { storage });
|
|
4982
|
+
var apiCentrifugo = new API2(apiUrl, { storage });
|
|
4983
4983
|
//# sourceMappingURL=clients.cjs.map
|