shoal-web-sdk 1.0.142 → 1.0.144

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.
@@ -1,6 +1,6 @@
1
1
  import { type InfiniteData } from '@tanstack/react-query';
2
2
  import { type Options } from '../sdk.gen';
3
- import type { GetTenantSummaryData, ListActorActivityData, ListAuditBreakdownData, ListAuditsData, ListCostBreakdownData, ListCostOrganisationsData, ListDeploymentBreakdownData, ListDeploymentOrganisationsData, ListDeploymentsData, ListSignUpBreakdownData, ListTenantsData, ListUsersData } from '../types.gen';
3
+ import type { GetOverviewData, GetTenantSummaryData, ListActorActivityData, ListAuditBreakdownData, ListAuditsData, ListCostBreakdownData, ListCostOrganisationsData, ListDeploymentBreakdownData, ListDeploymentOrganisationsData, ListDeploymentsData, ListLiveRoutesData, ListSignUpBreakdownData, ListTenantsData, ListUsersData } from '../types.gen';
4
4
  export type QueryKey<TOptions extends Options> = [
5
5
  Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
6
6
  _id: string;
@@ -70,6 +70,103 @@ export declare const listTenantsInfiniteOptions: (options?: Options<ListTenantsD
70
70
  [dataTagErrorSymbol]: import("../types.gen")._Error;
71
71
  };
72
72
  };
73
+ export declare const getOverviewQueryKey: (options?: Options<GetOverviewData>) => [Pick<Options<GetOverviewData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
74
+ _id: string;
75
+ _infinite?: boolean;
76
+ tags?: ReadonlyArray<string>;
77
+ }];
78
+ /**
79
+ * Get the dashboard overview
80
+ *
81
+ * Returns sign-ups, deployments, audit events and spend for the window, the same totals
82
+ * for the window of equal length just before it (omitted when `from` is not set), daily
83
+ * totals within the window, and the tenant summary. Replaces one request per series.
84
+ *
85
+ */
86
+ export declare const getOverviewOptions: (options?: Options<GetOverviewData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").Overview, Error, import("../types.gen").Overview, [Pick<Options<GetOverviewData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
87
+ _id: string;
88
+ _infinite?: boolean;
89
+ tags?: ReadonlyArray<string>;
90
+ }]>, "queryFn"> & {
91
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").Overview, [Pick<Options<GetOverviewData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
92
+ _id: string;
93
+ _infinite?: boolean;
94
+ tags?: ReadonlyArray<string>;
95
+ }], never> | undefined;
96
+ } & {
97
+ queryKey: [Pick<Options<GetOverviewData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
98
+ _id: string;
99
+ _infinite?: boolean;
100
+ tags?: ReadonlyArray<string>;
101
+ }] & {
102
+ [dataTagSymbol]: import("../types.gen").Overview;
103
+ [dataTagErrorSymbol]: Error;
104
+ };
105
+ };
106
+ export declare const listLiveRoutesQueryKey: (options?: Options<ListLiveRoutesData>) => [Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
107
+ _id: string;
108
+ _infinite?: boolean;
109
+ tags?: ReadonlyArray<string>;
110
+ }];
111
+ /**
112
+ * List live subdomains and paths
113
+ *
114
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
115
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
116
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
117
+ * to limit the list to one space.
118
+ *
119
+ */
120
+ export declare const listLiveRoutesOptions: (options?: Options<ListLiveRoutesData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").PaginatedLiveEnvironments, Error, import("../types.gen").PaginatedLiveEnvironments, [Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
121
+ _id: string;
122
+ _infinite?: boolean;
123
+ tags?: ReadonlyArray<string>;
124
+ }]>, "queryFn"> & {
125
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").PaginatedLiveEnvironments, [Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
126
+ _id: string;
127
+ _infinite?: boolean;
128
+ tags?: ReadonlyArray<string>;
129
+ }], never> | undefined;
130
+ } & {
131
+ queryKey: [Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
132
+ _id: string;
133
+ _infinite?: boolean;
134
+ tags?: ReadonlyArray<string>;
135
+ }] & {
136
+ [dataTagSymbol]: import("../types.gen").PaginatedLiveEnvironments;
137
+ [dataTagErrorSymbol]: Error;
138
+ };
139
+ };
140
+ export declare const listLiveRoutesInfiniteQueryKey: (options?: Options<ListLiveRoutesData>) => QueryKey<Options<ListLiveRoutesData>>;
141
+ /**
142
+ * List live subdomains and paths
143
+ *
144
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
145
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
146
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
147
+ * to limit the list to one space.
148
+ *
149
+ */
150
+ export declare const listLiveRoutesInfiniteOptions: (options?: Options<ListLiveRoutesData>) => import("@tanstack/react-query").UseInfiniteQueryOptions<import("../types.gen").PaginatedLiveEnvironments, import("../types.gen")._Error, InfiniteData<import("../types.gen").PaginatedLiveEnvironments, unknown>, QueryKey<Options<ListLiveRoutesData>>, number | Pick<Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
151
+ _id: string;
152
+ _infinite?: boolean;
153
+ tags?: ReadonlyArray<string>;
154
+ }, "query" | "body" | "headers" | "path">> & {
155
+ initialData: InfiniteData<import("../types.gen").PaginatedLiveEnvironments, number | Pick<Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
156
+ _id: string;
157
+ _infinite?: boolean;
158
+ tags?: ReadonlyArray<string>;
159
+ }, "query" | "body" | "headers" | "path">> | (() => InfiniteData<import("../types.gen").PaginatedLiveEnvironments, number | Pick<Pick<Options<ListLiveRoutesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
160
+ _id: string;
161
+ _infinite?: boolean;
162
+ tags?: ReadonlyArray<string>;
163
+ }, "query" | "body" | "headers" | "path">>) | undefined;
164
+ } & {
165
+ queryKey: QueryKey<Options<ListLiveRoutesData>> & {
166
+ [dataTagSymbol]: InfiniteData<import("../types.gen").PaginatedLiveEnvironments, unknown>;
167
+ [dataTagErrorSymbol]: import("../types.gen")._Error;
168
+ };
169
+ };
73
170
  export declare const getTenantSummaryQueryKey: (options?: Options<GetTenantSummaryData>) => [Pick<Options<GetTenantSummaryData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
74
171
  _id: string;
75
172
  _infinite?: boolean;
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { infiniteQueryOptions, queryOptions } from '@tanstack/react-query';
3
3
  import { client } from '../client.gen';
4
- import { getTenantSummary, listActorActivity, listAuditBreakdown, listAudits, listCostBreakdown, listCostOrganisations, listDeploymentBreakdown, listDeploymentOrganisations, listDeployments, listSignUpBreakdown, listTenants, listUsers } from '../sdk.gen';
4
+ import { getOverview, getTenantSummary, listActorActivity, listAuditBreakdown, listAudits, listCostBreakdown, listCostOrganisations, listDeploymentBreakdown, listDeploymentOrganisations, listDeployments, listLiveRoutes, listSignUpBreakdown, listTenants, listUsers } from '../sdk.gen';
5
5
  const createQueryKey = (id, options, infinite, tags) => {
6
6
  const params = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl };
7
7
  if (infinite) {
@@ -111,6 +111,86 @@ export const listTenantsInfiniteOptions = (options) => {
111
111
  queryKey: listTenantsInfiniteQueryKey(options)
112
112
  });
113
113
  };
114
+ export const getOverviewQueryKey = (options) => createQueryKey('getOverview', options);
115
+ /**
116
+ * Get the dashboard overview
117
+ *
118
+ * Returns sign-ups, deployments, audit events and spend for the window, the same totals
119
+ * for the window of equal length just before it (omitted when `from` is not set), daily
120
+ * totals within the window, and the tenant summary. Replaces one request per series.
121
+ *
122
+ */
123
+ export const getOverviewOptions = (options) => {
124
+ return queryOptions({
125
+ queryFn: async ({ queryKey, signal }) => {
126
+ const { data } = await getOverview({
127
+ ...options,
128
+ ...queryKey[0],
129
+ signal,
130
+ throwOnError: true
131
+ });
132
+ return data;
133
+ },
134
+ queryKey: getOverviewQueryKey(options)
135
+ });
136
+ };
137
+ export const listLiveRoutesQueryKey = (options) => createQueryKey('listLiveRoutes', options);
138
+ /**
139
+ * List live subdomains and paths
140
+ *
141
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
142
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
143
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
144
+ * to limit the list to one space.
145
+ *
146
+ */
147
+ export const listLiveRoutesOptions = (options) => {
148
+ return queryOptions({
149
+ queryFn: async ({ queryKey, signal }) => {
150
+ const { data } = await listLiveRoutes({
151
+ ...options,
152
+ ...queryKey[0],
153
+ signal,
154
+ throwOnError: true
155
+ });
156
+ return data;
157
+ },
158
+ queryKey: listLiveRoutesQueryKey(options)
159
+ });
160
+ };
161
+ export const listLiveRoutesInfiniteQueryKey = (options) => createQueryKey('listLiveRoutes', options, true);
162
+ /**
163
+ * List live subdomains and paths
164
+ *
165
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
166
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
167
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
168
+ * to limit the list to one space.
169
+ *
170
+ */
171
+ export const listLiveRoutesInfiniteOptions = (options) => {
172
+ return infiniteQueryOptions(
173
+ // @ts-ignore
174
+ {
175
+ queryFn: async ({ pageParam, queryKey, signal }) => {
176
+ // @ts-ignore
177
+ const page = typeof pageParam === 'object' ? pageParam : {
178
+ query: {
179
+ page: pageParam
180
+ }
181
+ };
182
+ const params = createInfiniteParams(queryKey, page);
183
+ const { data } = await listLiveRoutes({
184
+ ...options,
185
+ ...params,
186
+ signal,
187
+ throwOnError: true
188
+ });
189
+ return data;
190
+ },
191
+ queryKey: listLiveRoutesInfiniteQueryKey(options)
192
+ });
193
+ };
114
194
  export const getTenantSummaryQueryKey = (options) => createQueryKey('getTenantSummary', options);
115
195
  /**
116
196
  * Summarise tenants
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { GetTenantSummaryData, GetTenantSummaryErrors, GetTenantSummaryResponses, ListActorActivityData, ListActorActivityErrors, ListActorActivityResponses, ListAuditBreakdownData, ListAuditBreakdownErrors, ListAuditBreakdownResponses, ListAuditsData, ListAuditsErrors, ListAuditsResponses, ListCostBreakdownData, ListCostBreakdownErrors, ListCostBreakdownResponses, ListCostOrganisationsData, ListCostOrganisationsErrors, ListCostOrganisationsResponses, ListDeploymentBreakdownData, ListDeploymentBreakdownErrors, ListDeploymentBreakdownResponses, ListDeploymentOrganisationsData, ListDeploymentOrganisationsErrors, ListDeploymentOrganisationsResponses, ListDeploymentsData, ListDeploymentsErrors, ListDeploymentsResponses, ListSignUpBreakdownData, ListSignUpBreakdownErrors, ListSignUpBreakdownResponses, ListTenantsData, ListTenantsErrors, ListTenantsResponses, ListUsersData, ListUsersErrors, ListUsersResponses } from './types.gen';
2
+ import type { GetOverviewData, GetOverviewErrors, GetOverviewResponses, GetTenantSummaryData, GetTenantSummaryErrors, GetTenantSummaryResponses, ListActorActivityData, ListActorActivityErrors, ListActorActivityResponses, ListAuditBreakdownData, ListAuditBreakdownErrors, ListAuditBreakdownResponses, ListAuditsData, ListAuditsErrors, ListAuditsResponses, ListCostBreakdownData, ListCostBreakdownErrors, ListCostBreakdownResponses, ListCostOrganisationsData, ListCostOrganisationsErrors, ListCostOrganisationsResponses, ListDeploymentBreakdownData, ListDeploymentBreakdownErrors, ListDeploymentBreakdownResponses, ListDeploymentOrganisationsData, ListDeploymentOrganisationsErrors, ListDeploymentOrganisationsResponses, ListDeploymentsData, ListDeploymentsErrors, ListDeploymentsResponses, ListLiveRoutesData, ListLiveRoutesErrors, ListLiveRoutesResponses, ListSignUpBreakdownData, ListSignUpBreakdownErrors, ListSignUpBreakdownResponses, ListTenantsData, ListTenantsErrors, ListTenantsResponses, ListUsersData, ListUsersErrors, ListUsersResponses } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -22,6 +22,25 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
22
22
  *
23
23
  */
24
24
  export declare const listTenants: <ThrowOnError extends boolean = false>(options?: Options<ListTenantsData, ThrowOnError>) => import("./client").RequestResult<ListTenantsResponses, ListTenantsErrors, ThrowOnError, "fields">;
25
+ /**
26
+ * Get the dashboard overview
27
+ *
28
+ * Returns sign-ups, deployments, audit events and spend for the window, the same totals
29
+ * for the window of equal length just before it (omitted when `from` is not set), daily
30
+ * totals within the window, and the tenant summary. Replaces one request per series.
31
+ *
32
+ */
33
+ export declare const getOverview: <ThrowOnError extends boolean = false>(options?: Options<GetOverviewData, ThrowOnError>) => import("./client").RequestResult<GetOverviewResponses, GetOverviewErrors, ThrowOnError, "fields">;
34
+ /**
35
+ * List live subdomains and paths
36
+ *
37
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
38
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
39
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
40
+ * to limit the list to one space.
41
+ *
42
+ */
43
+ export declare const listLiveRoutes: <ThrowOnError extends boolean = false>(options?: Options<ListLiveRoutesData, ThrowOnError>) => import("./client").RequestResult<ListLiveRoutesResponses, ListLiveRoutesErrors, ThrowOnError, "fields">;
25
44
  /**
26
45
  * Summarise tenants
27
46
  *
@@ -20,6 +20,47 @@ export const listTenants = (options) => {
20
20
  ...options
21
21
  });
22
22
  };
23
+ /**
24
+ * Get the dashboard overview
25
+ *
26
+ * Returns sign-ups, deployments, audit events and spend for the window, the same totals
27
+ * for the window of equal length just before it (omitted when `from` is not set), daily
28
+ * totals within the window, and the tenant summary. Replaces one request per series.
29
+ *
30
+ */
31
+ export const getOverview = (options) => {
32
+ return (options?.client ?? client).get({
33
+ security: [
34
+ {
35
+ scheme: 'bearer',
36
+ type: 'http'
37
+ }
38
+ ],
39
+ url: '/insights-engine/overview',
40
+ ...options
41
+ });
42
+ };
43
+ /**
44
+ * List live subdomains and paths
45
+ *
46
+ * Returns a page of environments, most recently deployed first, each with the proxy and VM
47
+ * subdomains and the route paths of its latest succeeded deployment. Environments that never
48
+ * deployed successfully, or whose live version has no proxy or VM, are omitted. Pass `org`
49
+ * to limit the list to one space.
50
+ *
51
+ */
52
+ export const listLiveRoutes = (options) => {
53
+ return (options?.client ?? client).get({
54
+ security: [
55
+ {
56
+ scheme: 'bearer',
57
+ type: 'http'
58
+ }
59
+ ],
60
+ url: '/insights-engine/routes',
61
+ ...options
62
+ });
63
+ };
23
64
  /**
24
65
  * Summarise tenants
25
66
  *
@@ -492,6 +492,73 @@ export type TenantSummary = {
492
492
  transitions: Array<PlanTransition>;
493
493
  cohort: TenantCohort;
494
494
  };
495
+ export type OverviewTotals = {
496
+ signUps: number;
497
+ deployments: number;
498
+ succeededDeployments: number;
499
+ nodes: number;
500
+ audits: number;
501
+ cost: Cost;
502
+ };
503
+ export type OverviewDay = OverviewTotals & {
504
+ timestamp: string;
505
+ };
506
+ /**
507
+ * Totals for the window and for the window of the same length just before it, daily totals within the window, and the tenant summary. Each source is read once across both windows.
508
+ */
509
+ export type Overview = {
510
+ current: OverviewTotals;
511
+ previous?: OverviewTotals;
512
+ /**
513
+ * Oldest day first. Days with no activity are omitted.
514
+ */
515
+ daily: Array<OverviewDay>;
516
+ tenants: TenantSummary;
517
+ };
518
+ export type LivePath = {
519
+ path: string;
520
+ /**
521
+ * The path the target receives instead, empty when not rewritten.
522
+ */
523
+ rewrite: string;
524
+ targetName: string;
525
+ targetType: string;
526
+ };
527
+ /**
528
+ * A proxy or VM node in the live version and the subdomain it serves. The frontend builds the hostname from the label and the proxy or VM domain of the environment it runs in.
529
+ */
530
+ export type LiveSubdomain = {
531
+ nodeName: string;
532
+ nodeType: 'proxy' | 'vm';
533
+ /**
534
+ * The subdomain label, empty when none is claimed.
535
+ */
536
+ label: string;
537
+ /**
538
+ * The active customer domain fronting the subdomain, empty when there is none.
539
+ */
540
+ customDomain: string;
541
+ paths: Array<LivePath>;
542
+ };
543
+ /**
544
+ * The subdomains and paths served by an environment's latest succeeded deployment.
545
+ */
546
+ export type LiveEnvironment = {
547
+ orgId: string;
548
+ spaceName: string;
549
+ environmentId: string;
550
+ environmentHandle: string;
551
+ projectHandle: string;
552
+ /**
553
+ * The environment's latest succeeded deployment.
554
+ */
555
+ deploymentId: string;
556
+ deployedAt: string;
557
+ subdomains: Array<LiveSubdomain>;
558
+ };
559
+ export type PaginatedLiveEnvironments = PaginatedResponse & {
560
+ data: Array<LiveEnvironment>;
561
+ };
495
562
  export type CostEnvironment = {
496
563
  id: string;
497
564
  handle: string;
@@ -689,6 +756,76 @@ export type ListTenantsResponses = {
689
756
  200: PaginatedTenants;
690
757
  };
691
758
  export type ListTenantsResponse = ListTenantsResponses[keyof ListTenantsResponses];
759
+ export type GetOverviewData = {
760
+ body?: never;
761
+ path?: never;
762
+ query?: {
763
+ /**
764
+ * Start of the reporting window. Unbounded when omitted.
765
+ */
766
+ from?: string;
767
+ /**
768
+ * End of the reporting window. Unbounded when omitted.
769
+ */
770
+ to?: string;
771
+ };
772
+ url: '/insights-engine/overview';
773
+ };
774
+ export type GetOverviewErrors = {
775
+ /**
776
+ * The request was rejected as invalid.
777
+ */
778
+ 400: _Error;
779
+ /**
780
+ * The service is not healthy.
781
+ */
782
+ 500: _Error;
783
+ };
784
+ export type GetOverviewError = GetOverviewErrors[keyof GetOverviewErrors];
785
+ export type GetOverviewResponses = {
786
+ /**
787
+ * The overview.
788
+ */
789
+ 200: Overview;
790
+ };
791
+ export type GetOverviewResponse = GetOverviewResponses[keyof GetOverviewResponses];
792
+ export type ListLiveRoutesData = {
793
+ body?: never;
794
+ path?: never;
795
+ query?: {
796
+ /**
797
+ * An organisation id.
798
+ */
799
+ org?: string;
800
+ /**
801
+ * 1-based page index.
802
+ */
803
+ page?: number;
804
+ /**
805
+ * Items per page, clamped server side to at most 5000.
806
+ */
807
+ limit?: number;
808
+ };
809
+ url: '/insights-engine/routes';
810
+ };
811
+ export type ListLiveRoutesErrors = {
812
+ /**
813
+ * The request was rejected as invalid.
814
+ */
815
+ 400: _Error;
816
+ /**
817
+ * The service is not healthy.
818
+ */
819
+ 500: _Error;
820
+ };
821
+ export type ListLiveRoutesError = ListLiveRoutesErrors[keyof ListLiveRoutesErrors];
822
+ export type ListLiveRoutesResponses = {
823
+ /**
824
+ * A page of environments and their live routes.
825
+ */
826
+ 200: PaginatedLiveEnvironments;
827
+ };
828
+ export type ListLiveRoutesResponse = ListLiveRoutesResponses[keyof ListLiveRoutesResponses];
692
829
  export type GetTenantSummaryData = {
693
830
  body?: never;
694
831
  path?: never;