@kortix/sdk 0.13.31 → 0.13.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +6 -1
- package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
- package/dist/core/auth/session.d.ts.map +1 -1
- package/dist/core/auth/session.js +56 -15
- package/dist/core/auth/session.js.map +1 -1
- package/dist/core/client/kortix.d.ts +7 -0
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +6 -0
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/files/client.d.ts +30 -9
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +71 -29
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/http/api/errors.d.ts +23 -8
- package/dist/core/http/api/errors.d.ts.map +1 -1
- package/dist/core/http/api/errors.js +44 -23
- package/dist/core/http/api/errors.js.map +1 -1
- package/dist/core/http/api-client.d.ts +9 -14
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +35 -87
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/auth.d.ts +12 -15
- package/dist/core/http/auth.d.ts.map +1 -1
- package/dist/core/http/auth.js +24 -68
- package/dist/core/http/auth.js.map +1 -1
- package/dist/core/http/transport.d.ts +46 -0
- package/dist/core/http/transport.d.ts.map +1 -0
- package/dist/core/http/transport.js +135 -0
- package/dist/core/http/transport.js.map +1 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts +35 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/platform-client/instance-admin.d.ts +16 -9
- package/dist/core/rest/platform-client/instance-admin.d.ts.map +1 -1
- package/dist/core/rest/platform-client/instance-admin.js +21 -25
- package/dist/core/rest/platform-client/instance-admin.js.map +1 -1
- package/dist/core/rest/platform-client/invites.d.ts +11 -3
- package/dist/core/rest/platform-client/invites.d.ts.map +1 -1
- package/dist/core/rest/platform-client/invites.js +16 -18
- package/dist/core/rest/platform-client/invites.js.map +1 -1
- package/dist/core/rest/platform-client/shared.d.ts +0 -7
- package/dist/core/rest/platform-client/shared.d.ts.map +1 -1
- package/dist/core/rest/platform-client/shared.js +0 -49
- package/dist/core/rest/platform-client/shared.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +32 -0
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js +27 -0
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/iam.d.ts +21 -0
- package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam.js +9 -0
- package/dist/core/rest/projects-client/iam.js.map +1 -1
- package/dist/core/rest/projects-client/presentations.d.ts +4 -2
- package/dist/core/rest/projects-client/presentations.d.ts.map +1 -1
- package/dist/core/rest/projects-client/presentations.js +14 -6
- package/dist/core/rest/projects-client/presentations.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +16 -10
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +8 -8
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/referrals.d.ts +9 -3
- package/dist/core/rest/projects-client/referrals.d.ts.map +1 -1
- package/dist/core/rest/projects-client/referrals.js +20 -17
- package/dist/core/rest/projects-client/referrals.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +15 -0
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +1 -0
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +4 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +56 -0
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/templates.d.ts +4 -4
- package/dist/core/rest/projects-client/templates.d.ts.map +1 -1
- package/dist/core/rest/projects-client/templates.js +11 -8
- package/dist/core/rest/projects-client/templates.js.map +1 -1
- package/dist/core/session/open-bundle.d.ts +6 -0
- package/dist/core/session/open-bundle.d.ts.map +1 -1
- package/dist/core/session/open-bundle.js +22 -2
- package/dist/core/session/open-bundle.js.map +1 -1
- package/dist/core/session/preview-auth.d.ts +3 -2
- package/dist/core/session/preview-auth.d.ts.map +1 -1
- package/dist/core/session/preview-auth.js +11 -3
- package/dist/core/session/preview-auth.js.map +1 -1
- package/dist/core/session/preview-config.d.ts +5 -0
- package/dist/core/session/preview-config.d.ts.map +1 -1
- package/dist/core/session/preview-config.js +7 -0
- package/dist/core/session/preview-config.js.map +1 -1
- package/dist/core/session/preview-origin-trust.d.ts +24 -0
- package/dist/core/session/preview-origin-trust.d.ts.map +1 -0
- package/dist/core/session/preview-origin-trust.js +100 -0
- package/dist/core/session/preview-origin-trust.js.map +1 -0
- package/dist/core/session/preview.d.ts +7 -1
- package/dist/core/session/preview.d.ts.map +1 -1
- package/dist/core/session/preview.js +10 -2
- package/dist/core/session/preview.js.map +1 -1
- package/dist/core/session-sync/saved-transcript.d.ts +49 -0
- package/dist/core/session-sync/saved-transcript.d.ts.map +1 -0
- package/dist/core/session-sync/saved-transcript.js +40 -0
- package/dist/core/session-sync/saved-transcript.js.map +1 -0
- package/dist/core/session-sync/session-sync-controller.d.ts +24 -3
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +69 -15
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/core/stream/event-stream.d.ts +5 -4
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +34 -8
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/errors.d.ts +7 -0
- package/dist/core/turns/errors.d.ts.map +1 -1
- package/dist/core/turns/errors.js +58 -0
- package/dist/core/turns/errors.js.map +1 -1
- package/dist/core/turns/segments/index.d.ts +1 -0
- package/dist/core/turns/segments/index.d.ts.map +1 -1
- package/dist/core/turns/segments/index.js +1 -0
- package/dist/core/turns/segments/index.js.map +1 -1
- package/dist/core/turns/segments/show-group.d.ts +54 -0
- package/dist/core/turns/segments/show-group.d.ts.map +1 -0
- package/dist/core/turns/segments/show-group.js +108 -0
- package/dist/core/turns/segments/show-group.js.map +1 -0
- package/dist/core/turns/state.d.ts +7 -1
- package/dist/core/turns/state.d.ts.map +1 -1
- package/dist/core/turns/state.js +16 -3
- package/dist/core/turns/state.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +37 -35
- package/dist/kortix.global.js +37 -35
- package/dist/node/auth.d.ts +8 -1
- package/dist/node/auth.d.ts.map +1 -1
- package/dist/node/auth.js +21 -3
- package/dist/node/auth.js.map +1 -1
- package/dist/platform/auth-core.d.ts +0 -5
- package/dist/platform/auth-core.d.ts.map +1 -1
- package/dist/platform/auth-core.js +0 -20
- package/dist/platform/auth-core.js.map +1 -1
- package/dist/react/file-keys.d.ts +15 -7
- package/dist/react/file-keys.d.ts.map +1 -1
- package/dist/react/file-keys.js +15 -7
- package/dist/react/file-keys.js.map +1 -1
- package/dist/react/identity-reset-registry.d.ts +3 -0
- package/dist/react/identity-reset-registry.d.ts.map +1 -0
- package/dist/react/identity-reset-registry.js +22 -0
- package/dist/react/identity-reset-registry.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/query-contracts.d.ts +8 -1
- package/dist/react/query-contracts.d.ts.map +1 -1
- package/dist/react/query-contracts.js +8 -1
- package/dist/react/query-contracts.js.map +1 -1
- package/dist/react/query-keys.d.ts +7 -5
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +9 -5
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/reset-identity-state.d.ts +19 -0
- package/dist/react/reset-identity-state.d.ts.map +1 -0
- package/dist/react/reset-identity-state.js +35 -0
- package/dist/react/reset-identity-state.js.map +1 -0
- package/dist/react/retired-endpoint.d.ts +10 -0
- package/dist/react/retired-endpoint.d.ts.map +1 -0
- package/dist/react/retired-endpoint.js +22 -0
- package/dist/react/retired-endpoint.js.map +1 -0
- package/dist/react/session-stop.d.ts +101 -0
- package/dist/react/session-stop.d.ts.map +1 -0
- package/dist/react/session-stop.js +162 -0
- package/dist/react/session-stop.js.map +1 -0
- package/dist/react/sign-in-with-kortix.d.ts +1 -1
- package/dist/react/use-admin-accounts.d.ts +1 -0
- package/dist/react/use-admin-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.js +3 -10
- package/dist/react/use-admin-accounts.js.map +1 -1
- package/dist/react/use-admin-analytics.d.ts +36 -8
- package/dist/react/use-admin-analytics.d.ts.map +1 -1
- package/dist/react/use-admin-analytics.js +63 -458
- package/dist/react/use-admin-analytics.js.map +1 -1
- package/dist/react/use-admin-billing.d.ts +6 -2
- package/dist/react/use-admin-billing.d.ts.map +1 -1
- package/dist/react/use-admin-billing.js +15 -52
- package/dist/react/use-admin-billing.js.map +1 -1
- package/dist/react/use-admin-feedback.d.ts +10 -1
- package/dist/react/use-admin-feedback.d.ts.map +1 -1
- package/dist/react/use-admin-feedback.js +24 -111
- package/dist/react/use-admin-feedback.js.map +1 -1
- package/dist/react/use-admin-sandboxes.d.ts +13 -5
- package/dist/react/use-admin-sandboxes.d.ts.map +1 -1
- package/dist/react/use-admin-sandboxes.js +20 -104
- package/dist/react/use-admin-sandboxes.js.map +1 -1
- package/dist/react/use-authenticated-preview-url.d.ts.map +1 -1
- package/dist/react/use-authenticated-preview-url.js +7 -1
- package/dist/react/use-authenticated-preview-url.js.map +1 -1
- package/dist/react/use-canonical-opencode-session.d.ts +8 -0
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-canonical-opencode-session.js +1 -0
- package/dist/react/use-canonical-opencode-session.js.map +1 -1
- package/dist/react/use-model-store.d.ts.map +1 -1
- package/dist/react/use-model-store.js +15 -0
- package/dist/react/use-model-store.js.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +46 -35
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-session-send.d.ts +1 -73
- package/dist/react/use-session-send.d.ts.map +1 -1
- package/dist/react/use-session-send.js +6 -146
- package/dist/react/use-session-send.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +8 -0
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +33 -4
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts +3 -0
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +7 -1
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session.d.ts +18 -2
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +51 -34
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-static-file-preview.d.ts.map +1 -1
- package/dist/react/use-static-file-preview.js +2 -1
- package/dist/react/use-static-file-preview.js.map +1 -1
- package/dist/react/use-system-status.d.ts +7 -3
- package/dist/react/use-system-status.d.ts.map +1 -1
- package/dist/react/use-system-status.js +14 -67
- package/dist/react/use-system-status.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-billing.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-billing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-admin-billing.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-billing.ts"],"names":[],"mappings":"AAQA,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,8DAE1D;AAED,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qGAAqG;AACrG,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,8DAEjE;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,2FAE/B;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,iFAE/B"}
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Admin billing hooks. The API removed every `/v1/billing/admin/*` route; credit
|
|
3
|
+
* grants and debits live on the admin accounts routes (`useAdminGrantCredits`,
|
|
4
|
+
* `useAdminDebitCredits`). These hooks stay exported until the next major and
|
|
5
|
+
* fail with `ENDPOINT_RETIRED` without sending a request.
|
|
6
|
+
*/
|
|
7
|
+
import { useRetiredMutation, useRetiredQuery } from './retired-endpoint.js';
|
|
8
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
3
9
|
export function useUserBillingSummary(userId) {
|
|
4
|
-
return
|
|
5
|
-
queryKey: ['admin', 'billing', 'user', userId],
|
|
6
|
-
queryFn: async () => {
|
|
7
|
-
if (!userId)
|
|
8
|
-
return null;
|
|
9
|
-
const response = await backendApi.get(`/billing/admin/user/${userId}/summary`);
|
|
10
|
-
if (response.error) {
|
|
11
|
-
throw new Error(response.error.message);
|
|
12
|
-
}
|
|
13
|
-
return response.data;
|
|
14
|
-
},
|
|
15
|
-
enabled: !!userId,
|
|
16
|
-
});
|
|
10
|
+
return useRetiredQuery('useUserBillingSummary', ['admin', 'billing', 'user', userId], !!userId);
|
|
17
11
|
}
|
|
12
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
18
13
|
export function useAdminUserTransactions(params) {
|
|
19
|
-
return
|
|
20
|
-
queryKey: ['admin', 'billing', 'transactions', params.userId, params.page, params.page_size, params.type_filter],
|
|
21
|
-
queryFn: async () => {
|
|
22
|
-
const searchParams = new URLSearchParams();
|
|
23
|
-
if (params.page)
|
|
24
|
-
searchParams.append('page', params.page.toString());
|
|
25
|
-
if (params.page_size)
|
|
26
|
-
searchParams.append('page_size', params.page_size.toString());
|
|
27
|
-
if (params.type_filter)
|
|
28
|
-
searchParams.append('type_filter', params.type_filter);
|
|
29
|
-
const response = await backendApi.get(`/billing/admin/user/${params.userId}/transactions?${searchParams.toString()}`);
|
|
30
|
-
if (response.error) {
|
|
31
|
-
throw new Error(response.error.message);
|
|
32
|
-
}
|
|
33
|
-
return response.data;
|
|
34
|
-
},
|
|
35
|
-
enabled: !!params.userId,
|
|
36
|
-
staleTime: 30000,
|
|
37
|
-
});
|
|
14
|
+
return useRetiredQuery('useAdminUserTransactions', ['admin', 'billing', 'transactions', params.userId, params.page, params.page_size, params.type_filter], !!params.userId);
|
|
38
15
|
}
|
|
16
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
39
17
|
export function useAdjustCredits() {
|
|
40
|
-
return
|
|
41
|
-
mutationFn: async (request) => {
|
|
42
|
-
const response = await backendApi.post('/billing/admin/credits/adjust', request);
|
|
43
|
-
if (response.error) {
|
|
44
|
-
throw new Error(response.error.message);
|
|
45
|
-
}
|
|
46
|
-
return response.data;
|
|
47
|
-
},
|
|
48
|
-
});
|
|
18
|
+
return useRetiredMutation('useAdjustCredits');
|
|
49
19
|
}
|
|
20
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
50
21
|
export function useProcessRefund() {
|
|
51
|
-
return
|
|
52
|
-
mutationFn: async (request) => {
|
|
53
|
-
const response = await backendApi.post('/billing/admin/refund', request);
|
|
54
|
-
if (response.error) {
|
|
55
|
-
throw new Error(response.error.message);
|
|
56
|
-
}
|
|
57
|
-
return response.data;
|
|
58
|
-
},
|
|
59
|
-
});
|
|
22
|
+
return useRetiredMutation('useProcessRefund');
|
|
60
23
|
}
|
|
61
24
|
//# sourceMappingURL=use-admin-billing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-billing.js","sourceRoot":"","sources":["../../src/react/use-admin-billing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"use-admin-billing.js","sourceRoot":"","sources":["../../src/react/use-admin-billing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAmBzE,qGAAqG;AACrG,MAAM,UAAU,qBAAqB,CAAC,MAAqB;IACzD,OAAO,eAAe,CAAM,uBAAuB,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACvG,CAAC;AASD,qGAAqG;AACrG,MAAM,UAAU,wBAAwB,CAAC,MAAyB;IAChE,OAAO,eAAe,CAAM,0BAA0B,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACnL,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,gBAAgB;IAC9B,OAAO,kBAAkB,CAA+B,kBAAkB,CAAC,CAAC;AAC9E,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,gBAAgB;IAC9B,OAAO,kBAAkB,CAAqB,kBAAkB,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -97,19 +97,28 @@ export interface LLMAnalysisRequest {
|
|
|
97
97
|
days?: number;
|
|
98
98
|
max_feedback?: number;
|
|
99
99
|
}
|
|
100
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
100
101
|
export declare function useAdminFeedbackList(params?: FeedbackListParams): import("@tanstack/react-query").UseQueryResult<FeedbackListResponse, Error>;
|
|
102
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
101
103
|
export declare function useAdminFeedbackStats(): import("@tanstack/react-query").UseQueryResult<FeedbackStats, Error>;
|
|
104
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
102
105
|
export declare function useAdminSentimentSummary(): import("@tanstack/react-query").UseQueryResult<SentimentSummary, Error>;
|
|
106
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
103
107
|
export declare function useAdminFeedbackTimeSeries(days?: number, granularity?: string): import("@tanstack/react-query").UseQueryResult<TimeSeriesPoint[], Error>;
|
|
108
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
104
109
|
export declare function useAdminRatingTrends(days?: number): import("@tanstack/react-query").UseQueryResult<RatingTrends, Error>;
|
|
110
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
105
111
|
export declare function useAdminCriticalFeedback(limit?: number): import("@tanstack/react-query").UseQueryResult<CriticalFeedback[], Error>;
|
|
112
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
106
113
|
export declare function useAdminFeedbackExport(params: {
|
|
107
114
|
rating_filter?: number;
|
|
108
115
|
has_text?: boolean;
|
|
109
116
|
start_date?: string;
|
|
110
117
|
end_date?: string;
|
|
111
118
|
}): import("@tanstack/react-query").UseQueryResult<FeedbackWithUser[], Error>;
|
|
112
|
-
|
|
119
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
120
|
+
export declare function useAdminFeedbackAnalysis(): import("@tanstack/react-query").UseMutationResult<LLMAnalysisResponse, Error, LLMAnalysisRequest>;
|
|
121
|
+
/** @deprecated Invalidates the retired admin feedback queries only. Removed in the next major. */
|
|
113
122
|
export declare function useRefreshFeedbackData(): {
|
|
114
123
|
refreshFeedbackList: (params?: FeedbackListParams) => void;
|
|
115
124
|
refreshFeedbackStats: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-feedback.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-feedback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-admin-feedback.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-feedback.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1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B,EAAE,eAAe,EAAE,CAAC;IACrC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,0BAA0B,EAAE,wBAAwB,EAAE,CAAC;IACvD,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,KAAK,GAAG,UAAU,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,kBAAuB,+EAEnE;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB,yEAEpC;AAED,qGAAqG;AACrG,wBAAgB,wBAAwB,4EAEvC;AAED,qGAAqG;AACrG,wBAAgB,0BAA0B,CAAC,IAAI,GAAE,MAAW,EAAE,WAAW,GAAE,MAAc,4EAExF;AAED,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,MAAW,uEAErD;AAED,qGAAqG;AACrG,wBAAgB,wBAAwB,CAAC,KAAK,GAAE,MAAW,6EAE1D;AAED,qGAAqG;AACrG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,6EAEA;AAED,qGAAqG;AACrG,wBAAgB,wBAAwB,sGAEvC;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB;mCAIH,kBAAkB;;;EAgBpD"}
|
|
@@ -1,130 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Admin feedback hooks. The API removed every `/v1/admin/feedback/*` route.
|
|
3
|
+
* These hooks stay exported until the next major and fail with
|
|
4
|
+
* `ENDPOINT_RETIRED` without sending a request.
|
|
5
|
+
*/
|
|
6
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { useRetiredMutation, useRetiredQuery } from './retired-endpoint.js';
|
|
8
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
3
9
|
export function useAdminFeedbackList(params = {}) {
|
|
4
|
-
return
|
|
5
|
-
queryKey: ['admin', 'feedback', 'list', params],
|
|
6
|
-
queryFn: async () => {
|
|
7
|
-
const searchParams = new URLSearchParams();
|
|
8
|
-
if (params.page)
|
|
9
|
-
searchParams.append('page', params.page.toString());
|
|
10
|
-
if (params.page_size)
|
|
11
|
-
searchParams.append('page_size', params.page_size.toString());
|
|
12
|
-
if (params.rating_filter !== undefined)
|
|
13
|
-
searchParams.append('rating_filter', params.rating_filter.toString());
|
|
14
|
-
if (params.has_text !== undefined)
|
|
15
|
-
searchParams.append('has_text', params.has_text.toString());
|
|
16
|
-
if (params.sort_by)
|
|
17
|
-
searchParams.append('sort_by', params.sort_by);
|
|
18
|
-
if (params.sort_order)
|
|
19
|
-
searchParams.append('sort_order', params.sort_order);
|
|
20
|
-
const response = await backendApi.get(`/admin/feedback/list?${searchParams.toString()}`);
|
|
21
|
-
if (response.error) {
|
|
22
|
-
throw new Error(response.error.message);
|
|
23
|
-
}
|
|
24
|
-
return response.data;
|
|
25
|
-
},
|
|
26
|
-
staleTime: 30000,
|
|
27
|
-
});
|
|
10
|
+
return useRetiredQuery('useAdminFeedbackList', ['admin', 'feedback', 'list', params]);
|
|
28
11
|
}
|
|
12
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
29
13
|
export function useAdminFeedbackStats() {
|
|
30
|
-
return
|
|
31
|
-
queryKey: ['admin', 'feedback', 'stats'],
|
|
32
|
-
queryFn: async () => {
|
|
33
|
-
const response = await backendApi.get('/admin/feedback/stats');
|
|
34
|
-
if (response.error) {
|
|
35
|
-
throw new Error(response.error.message);
|
|
36
|
-
}
|
|
37
|
-
return response.data;
|
|
38
|
-
},
|
|
39
|
-
staleTime: 300000,
|
|
40
|
-
});
|
|
14
|
+
return useRetiredQuery('useAdminFeedbackStats', ['admin', 'feedback', 'stats']);
|
|
41
15
|
}
|
|
16
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
42
17
|
export function useAdminSentimentSummary() {
|
|
43
|
-
return
|
|
44
|
-
queryKey: ['admin', 'feedback', 'sentiment'],
|
|
45
|
-
queryFn: async () => {
|
|
46
|
-
const response = await backendApi.get('/admin/feedback/sentiment');
|
|
47
|
-
if (response.error) {
|
|
48
|
-
throw new Error(response.error.message);
|
|
49
|
-
}
|
|
50
|
-
return response.data;
|
|
51
|
-
},
|
|
52
|
-
staleTime: 300000,
|
|
53
|
-
});
|
|
18
|
+
return useRetiredQuery('useAdminSentimentSummary', ['admin', 'feedback', 'sentiment']);
|
|
54
19
|
}
|
|
20
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
55
21
|
export function useAdminFeedbackTimeSeries(days = 30, granularity = 'day') {
|
|
56
|
-
return
|
|
57
|
-
queryKey: ['admin', 'feedback', 'time-series', days, granularity],
|
|
58
|
-
queryFn: async () => {
|
|
59
|
-
const response = await backendApi.get(`/admin/feedback/time-series?days=${days}&granularity=${granularity}`);
|
|
60
|
-
if (response.error) {
|
|
61
|
-
throw new Error(response.error.message);
|
|
62
|
-
}
|
|
63
|
-
return response.data;
|
|
64
|
-
},
|
|
65
|
-
staleTime: 300000,
|
|
66
|
-
});
|
|
22
|
+
return useRetiredQuery('useAdminFeedbackTimeSeries', ['admin', 'feedback', 'time-series', days, granularity]);
|
|
67
23
|
}
|
|
24
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
68
25
|
export function useAdminRatingTrends(days = 30) {
|
|
69
|
-
return
|
|
70
|
-
queryKey: ['admin', 'feedback', 'rating-trends', days],
|
|
71
|
-
queryFn: async () => {
|
|
72
|
-
const response = await backendApi.get(`/admin/feedback/rating-trends?days=${days}`);
|
|
73
|
-
if (response.error) {
|
|
74
|
-
throw new Error(response.error.message);
|
|
75
|
-
}
|
|
76
|
-
return response.data;
|
|
77
|
-
},
|
|
78
|
-
staleTime: 300000,
|
|
79
|
-
});
|
|
26
|
+
return useRetiredQuery('useAdminRatingTrends', ['admin', 'feedback', 'rating-trends', days]);
|
|
80
27
|
}
|
|
28
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
81
29
|
export function useAdminCriticalFeedback(limit = 20) {
|
|
82
|
-
return
|
|
83
|
-
queryKey: ['admin', 'feedback', 'critical', limit],
|
|
84
|
-
queryFn: async () => {
|
|
85
|
-
const response = await backendApi.get(`/admin/feedback/critical?limit=${limit}`);
|
|
86
|
-
if (response.error) {
|
|
87
|
-
throw new Error(response.error.message);
|
|
88
|
-
}
|
|
89
|
-
return response.data;
|
|
90
|
-
},
|
|
91
|
-
staleTime: 60000,
|
|
92
|
-
});
|
|
30
|
+
return useRetiredQuery('useAdminCriticalFeedback', ['admin', 'feedback', 'critical', limit]);
|
|
93
31
|
}
|
|
32
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
94
33
|
export function useAdminFeedbackExport(params) {
|
|
95
|
-
return
|
|
96
|
-
queryKey: ['admin', 'feedback', 'export', params],
|
|
97
|
-
queryFn: async () => {
|
|
98
|
-
const searchParams = new URLSearchParams();
|
|
99
|
-
if (params.rating_filter !== undefined)
|
|
100
|
-
searchParams.append('rating_filter', params.rating_filter.toString());
|
|
101
|
-
if (params.has_text !== undefined)
|
|
102
|
-
searchParams.append('has_text', params.has_text.toString());
|
|
103
|
-
if (params.start_date)
|
|
104
|
-
searchParams.append('start_date', params.start_date);
|
|
105
|
-
if (params.end_date)
|
|
106
|
-
searchParams.append('end_date', params.end_date);
|
|
107
|
-
const response = await backendApi.get(`/admin/feedback/export?${searchParams.toString()}`);
|
|
108
|
-
if (response.error) {
|
|
109
|
-
throw new Error(response.error.message);
|
|
110
|
-
}
|
|
111
|
-
return response.data;
|
|
112
|
-
},
|
|
113
|
-
enabled: false,
|
|
114
|
-
staleTime: 0,
|
|
115
|
-
});
|
|
34
|
+
return useRetiredQuery('useAdminFeedbackExport', ['admin', 'feedback', 'export', params], false);
|
|
116
35
|
}
|
|
36
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
117
37
|
export function useAdminFeedbackAnalysis() {
|
|
118
|
-
return
|
|
119
|
-
mutationFn: async (request) => {
|
|
120
|
-
const response = await backendApi.post('/admin/feedback/analyze', request);
|
|
121
|
-
if (response.error) {
|
|
122
|
-
throw new Error(response.error.message);
|
|
123
|
-
}
|
|
124
|
-
return response.data;
|
|
125
|
-
},
|
|
126
|
-
});
|
|
38
|
+
return useRetiredMutation('useAdminFeedbackAnalysis');
|
|
127
39
|
}
|
|
40
|
+
/** @deprecated Invalidates the retired admin feedback queries only. Removed in the next major. */
|
|
128
41
|
export function useRefreshFeedbackData() {
|
|
129
42
|
const queryClient = useQueryClient();
|
|
130
43
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-feedback.js","sourceRoot":"","sources":["../../src/react/use-admin-feedback.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"use-admin-feedback.js","sourceRoot":"","sources":["../../src/react/use-admin-feedback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkHzE,qGAAqG;AACrG,MAAM,UAAU,oBAAoB,CAAC,SAA6B,EAAE;IAClE,OAAO,eAAe,CAAuB,sBAAsB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,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AG,cAAc,EAAE,CAAC;IAErC,OAAO;QACL,mBAAmB,EAAE,CAAC,MAA2B,EAAE,EAAE;YACnD,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;aACxC,CAAC,CAAC;QACL,CAAC;QACD,oBAAoB,EAAE,GAAG,EAAE;YACzB,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC;aACzC,CAAC,CAAC;QACL,CAAC;QACD,UAAU,EAAE,GAAG,EAAE;YACf,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -117,8 +117,11 @@ export interface ProviderMachineDetail {
|
|
|
117
117
|
key_path?: string | null;
|
|
118
118
|
} | null;
|
|
119
119
|
}
|
|
120
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
120
121
|
export declare function useAdminSandboxDetail(sandboxId: string | null): import("@tanstack/react-query").UseQueryResult<AdminSandboxDetail, Error>;
|
|
122
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
121
123
|
export declare function useAdminSandboxHealth(sandboxId: string | null, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<AdminSandboxHealth, Error>;
|
|
124
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
122
125
|
export declare function useAdminSandboxHealthBatch(sandboxIds: string[], enabled?: boolean): import("@tanstack/react-query").UseQueryResult<AdminSandboxHealthBatchResponse, Error>;
|
|
123
126
|
export interface ExecResult {
|
|
124
127
|
stdout?: string;
|
|
@@ -127,11 +130,12 @@ export interface ExecResult {
|
|
|
127
130
|
duration_ms?: number;
|
|
128
131
|
error?: string;
|
|
129
132
|
}
|
|
133
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
130
134
|
export declare function useAdminSandboxExec(): import("@tanstack/react-query").UseMutationResult<ExecResult, Error, {
|
|
131
135
|
sandboxId: string;
|
|
132
136
|
command: string;
|
|
133
137
|
timeout?: number;
|
|
134
|
-
}
|
|
138
|
+
}>;
|
|
135
139
|
export interface ProxyTokenResult {
|
|
136
140
|
token: string;
|
|
137
141
|
token_id: string;
|
|
@@ -139,19 +143,23 @@ export interface ProxyTokenResult {
|
|
|
139
143
|
terminal_url: string | null;
|
|
140
144
|
proxy_url: string | null;
|
|
141
145
|
}
|
|
142
|
-
|
|
146
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
147
|
+
export declare function fetchAdminSandboxProxyToken(_sandboxId: string): Promise<ProxyTokenResult>;
|
|
148
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
143
149
|
export declare function useAdminSandboxAction(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
|
|
144
150
|
sandboxId: string;
|
|
145
151
|
action: "reboot" | "stop" | "start";
|
|
146
|
-
}
|
|
152
|
+
}>;
|
|
153
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
147
154
|
export declare function useAdminSandboxRepair(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
|
|
148
155
|
sandboxId: string;
|
|
149
156
|
action: AdminInstanceLayerAction["action"];
|
|
150
157
|
serviceId?: string;
|
|
151
|
-
}
|
|
158
|
+
}>;
|
|
159
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
152
160
|
export declare function useDeleteAdminSandbox(): import("@tanstack/react-query").UseMutationResult<{
|
|
153
161
|
success: boolean;
|
|
154
162
|
sandboxId: string;
|
|
155
|
-
}, Error, string
|
|
163
|
+
}, Error, string>;
|
|
156
164
|
export {};
|
|
157
165
|
//# sourceMappingURL=use-admin-sandboxes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-sandboxes.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-sandboxes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-admin-sandboxes.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-sandboxes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKvE,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,SAAS,GAAG,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC1E,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAA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AAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB;eACkB,MAAM;aAAW,MAAM;cAAY,MAAM;GAC7F;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qGAAqG;AACrG,wBAAsB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE/F;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB;eACa,MAAM;YAAU,QAAQ,GAAG,MAAM,GAAG,OAAO;GAC5F;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB;eACa,MAAM;YAAU,wBAAwB,CAAC,QAAQ,CAAC;gBAAc,MAAM;GACvH;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB;aACE,OAAO;eAAa,MAAM;kBAChE"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import { useQuery
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import { backendApi } from '../core/http/api-client.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const message = error instanceof Error ? error.message : '';
|
|
6
|
-
if (!ADMIN_REVOKED_RE.test(message))
|
|
7
|
-
return intervalMs;
|
|
8
|
-
queryClient.invalidateQueries({ queryKey: ['admin-role'] });
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
function isAdminRevokedError(error) {
|
|
12
|
-
return ADMIN_REVOKED_RE.test(error instanceof Error ? error.message : '');
|
|
13
|
-
}
|
|
3
|
+
import { retiredEndpointError } from '../core/http/api/errors.js';
|
|
4
|
+
import { useRetiredMutation, useRetiredQuery } from './retired-endpoint.js';
|
|
14
5
|
export function useAdminSandboxes(params = {}, options) {
|
|
15
6
|
const { search = '', status = '', provider = '', page = 1, limit = 50 } = params;
|
|
16
7
|
return useQuery({
|
|
@@ -35,111 +26,36 @@ export function useAdminSandboxes(params = {}, options) {
|
|
|
35
26
|
...options,
|
|
36
27
|
});
|
|
37
28
|
}
|
|
29
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
38
30
|
export function useAdminSandboxDetail(sandboxId) {
|
|
39
|
-
|
|
40
|
-
return useQuery({
|
|
41
|
-
queryKey: ['admin', 'sandbox-detail', sandboxId],
|
|
42
|
-
enabled: !!sandboxId,
|
|
43
|
-
queryFn: async () => {
|
|
44
|
-
const response = await backendApi.get(`/admin/api/sandboxes/${sandboxId}`);
|
|
45
|
-
if (response.error)
|
|
46
|
-
throw new Error(response.error.message);
|
|
47
|
-
return response.data;
|
|
48
|
-
},
|
|
49
|
-
refetchInterval: (q) => stopOnAdminRevoked(qc, q.state.error, 10_000),
|
|
50
|
-
retry: (_n, err) => !isAdminRevokedError(err),
|
|
51
|
-
});
|
|
31
|
+
return useRetiredQuery('useAdminSandboxDetail', ['admin', 'sandbox-detail', sandboxId], !!sandboxId);
|
|
52
32
|
}
|
|
33
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
53
34
|
export function useAdminSandboxHealth(sandboxId, enabled = true) {
|
|
54
|
-
|
|
55
|
-
return useQuery({
|
|
56
|
-
queryKey: ['admin', 'sandbox-health', sandboxId],
|
|
57
|
-
enabled: !!sandboxId && enabled,
|
|
58
|
-
queryFn: async () => {
|
|
59
|
-
const response = await backendApi.get(`/admin/api/sandboxes/${sandboxId}/health`);
|
|
60
|
-
if (response.error)
|
|
61
|
-
throw new Error(response.error.message);
|
|
62
|
-
return response.data;
|
|
63
|
-
},
|
|
64
|
-
refetchInterval: (q) => stopOnAdminRevoked(qc, q.state.error, 10_000),
|
|
65
|
-
retry: (_n, err) => !isAdminRevokedError(err),
|
|
66
|
-
});
|
|
35
|
+
return useRetiredQuery('useAdminSandboxHealth', ['admin', 'sandbox-health', sandboxId], !!sandboxId && enabled);
|
|
67
36
|
}
|
|
37
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
68
38
|
export function useAdminSandboxHealthBatch(sandboxIds, enabled = true) {
|
|
69
|
-
|
|
70
|
-
return useQuery({
|
|
71
|
-
queryKey: ['admin', 'sandbox-health-batch', ids],
|
|
72
|
-
enabled: enabled && ids.length > 0,
|
|
73
|
-
queryFn: async () => {
|
|
74
|
-
const response = await backendApi.post('/admin/api/sandboxes/health-batch', { sandboxIds: ids }, { showErrors: false, timeout: 60000 });
|
|
75
|
-
if (response.error)
|
|
76
|
-
throw new Error(response.error.message);
|
|
77
|
-
return response.data ?? { items: [] };
|
|
78
|
-
},
|
|
79
|
-
staleTime: 10_000,
|
|
80
|
-
refetchInterval: 15_000,
|
|
81
|
-
});
|
|
39
|
+
return useRetiredQuery('useAdminSandboxHealthBatch', ['admin', 'sandbox-health-batch', sandboxIds], enabled && sandboxIds.length > 0);
|
|
82
40
|
}
|
|
41
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
83
42
|
export function useAdminSandboxExec() {
|
|
84
|
-
return
|
|
85
|
-
mutationFn: async ({ sandboxId, command, timeout }) => {
|
|
86
|
-
const response = await backendApi.post(`/admin/api/sandboxes/${sandboxId}/exec`, { command, timeout: timeout ?? 60 });
|
|
87
|
-
if (response.error)
|
|
88
|
-
throw new Error(response.error.message);
|
|
89
|
-
return response.data;
|
|
90
|
-
},
|
|
91
|
-
});
|
|
43
|
+
return useRetiredMutation('useAdminSandboxExec');
|
|
92
44
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
throw new Error(response.error.message);
|
|
97
|
-
return response.data;
|
|
45
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
46
|
+
export async function fetchAdminSandboxProxyToken(_sandboxId) {
|
|
47
|
+
throw retiredEndpointError('fetchAdminSandboxProxyToken');
|
|
98
48
|
}
|
|
49
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
99
50
|
export function useAdminSandboxAction() {
|
|
100
|
-
|
|
101
|
-
return useMutation({
|
|
102
|
-
mutationFn: async ({ sandboxId, action }) => {
|
|
103
|
-
const response = await backendApi.post(`/admin/api/sandboxes/${sandboxId}/action`, { action });
|
|
104
|
-
if (response.error)
|
|
105
|
-
throw new Error(response.error.message);
|
|
106
|
-
return response.data;
|
|
107
|
-
},
|
|
108
|
-
onSuccess: (_data, { sandboxId }) => {
|
|
109
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandboxes'] });
|
|
110
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandbox-detail', sandboxId] });
|
|
111
|
-
},
|
|
112
|
-
});
|
|
51
|
+
return useRetiredMutation('useAdminSandboxAction');
|
|
113
52
|
}
|
|
53
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
114
54
|
export function useAdminSandboxRepair() {
|
|
115
|
-
|
|
116
|
-
return useMutation({
|
|
117
|
-
mutationFn: async ({ sandboxId, action, serviceId }) => {
|
|
118
|
-
const response = await backendApi.post(`/admin/api/sandboxes/${sandboxId}/repair`, { action, serviceId });
|
|
119
|
-
if (response.error)
|
|
120
|
-
throw new Error(response.error.message);
|
|
121
|
-
return response.data;
|
|
122
|
-
},
|
|
123
|
-
onSuccess: (_data, { sandboxId }) => {
|
|
124
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandboxes'] });
|
|
125
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandbox-detail', sandboxId] });
|
|
126
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandbox-health', sandboxId] });
|
|
127
|
-
queryClient.invalidateQueries({ queryKey: ['platform', 'sandbox', 'list'] });
|
|
128
|
-
},
|
|
129
|
-
});
|
|
55
|
+
return useRetiredMutation('useAdminSandboxRepair');
|
|
130
56
|
}
|
|
57
|
+
/** @deprecated The API removed this admin route. Fails with `ENDPOINT_RETIRED`, sends no request. */
|
|
131
58
|
export function useDeleteAdminSandbox() {
|
|
132
|
-
|
|
133
|
-
return useMutation({
|
|
134
|
-
mutationFn: async (sandboxId) => {
|
|
135
|
-
const response = await backendApi.delete(`/admin/api/sandboxes/${sandboxId}`);
|
|
136
|
-
if (response.error)
|
|
137
|
-
throw new Error(response.error.message);
|
|
138
|
-
return response.data;
|
|
139
|
-
},
|
|
140
|
-
onSuccess: () => {
|
|
141
|
-
queryClient.invalidateQueries({ queryKey: ['admin', 'sandboxes'] });
|
|
142
|
-
},
|
|
143
|
-
});
|
|
59
|
+
return useRetiredMutation('useDeleteAdminSandbox');
|
|
144
60
|
}
|
|
145
61
|
//# sourceMappingURL=use-admin-sandboxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-sandboxes.js","sourceRoot":"","sources":["../../src/react/use-admin-sandboxes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-admin-sandboxes.js","sourceRoot":"","sources":["../../src/react/use-admin-sandboxes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAsCzE,MAAM,UAAU,iBAAiB,CAC/B,SAA+B,EAAE,EACjC,OAA0D;IAE1D,MAAM,EAAE,MAAM,GAAG,EAAE,EAA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,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;AAC3H,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB,CAAC,SAAwB,EAAE,OAAO,GAAG,IAAI;IAC5E,OAAO,eAAe,CAAqB,uBAAuB,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC;AACtI,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,0BAA0B,CAAC,UAAoB,EAAE,OAAO,GAAG,IAAI;IAC7E,OAAO,eAAe,CAAkC,4BAA4B,EAAE,CAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,OAAO,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzK,CAAC;AAUD,qGAAqG;AACrG,MAAM,UAAU,mBAAmB;IACjC,OAAO,kBAAkB,CAAuE,qBAAqB,CAAC,CAAC;AACzH,CAAC;AAUD,qGAAqG;AACrG,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,UAAkB;IAClE,MAAM,oBAAoB,CAAC,6BAA6B,CAAC,CAAC;AAC5D,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,CAAsE,uBAAuB,CAAC,CAAC;AAC1H,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,CAAiG,uBAAuB,CAAC,CAAC;AACrJ,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,CAAkD,uBAAuB,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-authenticated-preview-url.d.ts","sourceRoot":"","sources":["../../src/react/use-authenticated-preview-url.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-authenticated-preview-url.d.ts","sourceRoot":"","sources":["../../src/react/use-authenticated-preview-url.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAsH5E"}
|
|
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { getAuthToken } from '../core/http/auth.js';
|
|
4
4
|
import { useServerStore } from '../browser/stores/server-store.js';
|
|
5
5
|
import { buildPreviewAuthEndpoint, isSubdomainPreviewUrl, appendPreviewToken, } from '../core/session/preview.js';
|
|
6
|
+
import { shouldAttachPreviewToken } from '../core/session/preview-origin-trust.js';
|
|
6
7
|
import { isInternalLocalhostUrl } from '../core/session/url.js';
|
|
7
8
|
// The preview-proxy auth helpers now live in the SDK (single source of truth,
|
|
8
9
|
// verified against the current `/proxy` + `/v1/p/` surface). Re-exported here so
|
|
@@ -55,8 +56,13 @@ export function useAuthenticatedPreviewUrl(previewUrl) {
|
|
|
55
56
|
// never reaches them, so authenticate the first request with a one-shot
|
|
56
57
|
// ?token. The subdomain proxy validates it, marks the subdomain authed
|
|
57
58
|
// in-memory for sub-resources, and strips the token before forwarding.
|
|
59
|
+
// Only an origin this deployment serves gets the token; any other host
|
|
60
|
+
// with the same label shape is framed bare.
|
|
58
61
|
if (isSubdomainPreviewUrl(previewUrl)) {
|
|
59
|
-
|
|
62
|
+
const trusted = await shouldAttachPreviewToken(previewUrl, { serverUrl });
|
|
63
|
+
if (cancelled)
|
|
64
|
+
return;
|
|
65
|
+
setAuthenticatedUrl(trusted ? appendPreviewToken(previewUrl, token) : previewUrl);
|
|
60
66
|
return;
|
|
61
67
|
}
|
|
62
68
|
const authEndpoint = buildPreviewAuthEndpoint(previewUrl, serverUrl);
|