shoal-web-sdk 1.0.141 → 1.0.143

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 { ListActorActivityData, ListAuditBreakdownData, ListAuditsData, ListCostBreakdownData, ListDeploymentBreakdownData, ListDeploymentOrganisationsData, ListDeploymentsData, ListSignUpBreakdownData, ListTenantsData, ListUsersData } from '../types.gen';
3
+ import type { GetOverviewData, GetTenantSummaryData, ListActorActivityData, ListAuditBreakdownData, ListAuditsData, ListCostBreakdownData, ListCostOrganisationsData, ListDeploymentBreakdownData, ListDeploymentOrganisationsData, ListDeploymentsData, 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,72 @@ 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 getTenantSummaryQueryKey: (options?: Options<GetTenantSummaryData>) => [Pick<Options<GetTenantSummaryData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
107
+ _id: string;
108
+ _infinite?: boolean;
109
+ tags?: ReadonlyArray<string>;
110
+ }];
111
+ /**
112
+ * Summarise tenants
113
+ *
114
+ * Returns counts over every tenant by lifecycle state, plan and scheduled plan change, and
115
+ * the same for tenants created within the window. Reads billing data only, so it is cheap
116
+ * compared with listing tenants.
117
+ *
118
+ */
119
+ export declare const getTenantSummaryOptions: (options?: Options<GetTenantSummaryData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").TenantSummary, Error, import("../types.gen").TenantSummary, [Pick<Options<GetTenantSummaryData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
120
+ _id: string;
121
+ _infinite?: boolean;
122
+ tags?: ReadonlyArray<string>;
123
+ }]>, "queryFn"> & {
124
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").TenantSummary, [Pick<Options<GetTenantSummaryData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
125
+ _id: string;
126
+ _infinite?: boolean;
127
+ tags?: ReadonlyArray<string>;
128
+ }], never> | undefined;
129
+ } & {
130
+ queryKey: [Pick<Options<GetTenantSummaryData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
131
+ _id: string;
132
+ _infinite?: boolean;
133
+ tags?: ReadonlyArray<string>;
134
+ }] & {
135
+ [dataTagSymbol]: import("../types.gen").TenantSummary;
136
+ [dataTagErrorSymbol]: Error;
137
+ };
138
+ };
73
139
  export declare const listUsersQueryKey: (options?: Options<ListUsersData>) => [Pick<Options<ListUsersData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
74
140
  _id: string;
75
141
  _infinite?: boolean;
@@ -580,6 +646,66 @@ export declare const listDeploymentBreakdownInfiniteOptions: (options?: Options<
580
646
  [dataTagErrorSymbol]: import("../types.gen")._Error;
581
647
  };
582
648
  };
649
+ export declare const listCostOrganisationsQueryKey: (options?: Options<ListCostOrganisationsData>) => [Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
650
+ _id: string;
651
+ _infinite?: boolean;
652
+ tags?: ReadonlyArray<string>;
653
+ }];
654
+ /**
655
+ * List spend per space
656
+ *
657
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
658
+ * down by project and environment.
659
+ *
660
+ */
661
+ export declare const listCostOrganisationsOptions: (options?: Options<ListCostOrganisationsData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").PaginatedCostOrganisations, Error, import("../types.gen").PaginatedCostOrganisations, [Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
662
+ _id: string;
663
+ _infinite?: boolean;
664
+ tags?: ReadonlyArray<string>;
665
+ }]>, "queryFn"> & {
666
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").PaginatedCostOrganisations, [Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
667
+ _id: string;
668
+ _infinite?: boolean;
669
+ tags?: ReadonlyArray<string>;
670
+ }], never> | undefined;
671
+ } & {
672
+ queryKey: [Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
673
+ _id: string;
674
+ _infinite?: boolean;
675
+ tags?: ReadonlyArray<string>;
676
+ }] & {
677
+ [dataTagSymbol]: import("../types.gen").PaginatedCostOrganisations;
678
+ [dataTagErrorSymbol]: Error;
679
+ };
680
+ };
681
+ export declare const listCostOrganisationsInfiniteQueryKey: (options?: Options<ListCostOrganisationsData>) => QueryKey<Options<ListCostOrganisationsData>>;
682
+ /**
683
+ * List spend per space
684
+ *
685
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
686
+ * down by project and environment.
687
+ *
688
+ */
689
+ export declare const listCostOrganisationsInfiniteOptions: (options?: Options<ListCostOrganisationsData>) => import("@tanstack/react-query").UseInfiniteQueryOptions<import("../types.gen").PaginatedCostOrganisations, import("../types.gen")._Error, InfiniteData<import("../types.gen").PaginatedCostOrganisations, unknown>, QueryKey<Options<ListCostOrganisationsData>>, number | Pick<Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
690
+ _id: string;
691
+ _infinite?: boolean;
692
+ tags?: ReadonlyArray<string>;
693
+ }, "query" | "body" | "headers" | "path">> & {
694
+ initialData: InfiniteData<import("../types.gen").PaginatedCostOrganisations, number | Pick<Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
695
+ _id: string;
696
+ _infinite?: boolean;
697
+ tags?: ReadonlyArray<string>;
698
+ }, "query" | "body" | "headers" | "path">> | (() => InfiniteData<import("../types.gen").PaginatedCostOrganisations, number | Pick<Pick<Options<ListCostOrganisationsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
699
+ _id: string;
700
+ _infinite?: boolean;
701
+ tags?: ReadonlyArray<string>;
702
+ }, "query" | "body" | "headers" | "path">>) | undefined;
703
+ } & {
704
+ queryKey: QueryKey<Options<ListCostOrganisationsData>> & {
705
+ [dataTagSymbol]: InfiniteData<import("../types.gen").PaginatedCostOrganisations, unknown>;
706
+ [dataTagErrorSymbol]: import("../types.gen")._Error;
707
+ };
708
+ };
583
709
  export declare const listCostBreakdownQueryKey: (options?: Options<ListCostBreakdownData>) => [Pick<Options<ListCostBreakdownData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
584
710
  _id: string;
585
711
  _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 { listActorActivity, listAuditBreakdown, listAudits, listCostBreakdown, listDeploymentBreakdown, listDeploymentOrganisations, listDeployments, listSignUpBreakdown, listTenants, listUsers } from '../sdk.gen';
4
+ import { getOverview, getTenantSummary, listActorActivity, listAuditBreakdown, listAudits, listCostBreakdown, listCostOrganisations, listDeploymentBreakdown, listDeploymentOrganisations, listDeployments, 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,52 @@ 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 getTenantSummaryQueryKey = (options) => createQueryKey('getTenantSummary', options);
138
+ /**
139
+ * Summarise tenants
140
+ *
141
+ * Returns counts over every tenant by lifecycle state, plan and scheduled plan change, and
142
+ * the same for tenants created within the window. Reads billing data only, so it is cheap
143
+ * compared with listing tenants.
144
+ *
145
+ */
146
+ export const getTenantSummaryOptions = (options) => {
147
+ return queryOptions({
148
+ queryFn: async ({ queryKey, signal }) => {
149
+ const { data } = await getTenantSummary({
150
+ ...options,
151
+ ...queryKey[0],
152
+ signal,
153
+ throwOnError: true
154
+ });
155
+ return data;
156
+ },
157
+ queryKey: getTenantSummaryQueryKey(options)
158
+ });
159
+ };
114
160
  export const listUsersQueryKey = (options) => createQueryKey('listUsers', options);
115
161
  /**
116
162
  * List users
@@ -565,6 +611,59 @@ export const listDeploymentBreakdownInfiniteOptions = (options) => {
565
611
  queryKey: listDeploymentBreakdownInfiniteQueryKey(options)
566
612
  });
567
613
  };
614
+ export const listCostOrganisationsQueryKey = (options) => createQueryKey('listCostOrganisations', options);
615
+ /**
616
+ * List spend per space
617
+ *
618
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
619
+ * down by project and environment.
620
+ *
621
+ */
622
+ export const listCostOrganisationsOptions = (options) => {
623
+ return queryOptions({
624
+ queryFn: async ({ queryKey, signal }) => {
625
+ const { data } = await listCostOrganisations({
626
+ ...options,
627
+ ...queryKey[0],
628
+ signal,
629
+ throwOnError: true
630
+ });
631
+ return data;
632
+ },
633
+ queryKey: listCostOrganisationsQueryKey(options)
634
+ });
635
+ };
636
+ export const listCostOrganisationsInfiniteQueryKey = (options) => createQueryKey('listCostOrganisations', options, true);
637
+ /**
638
+ * List spend per space
639
+ *
640
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
641
+ * down by project and environment.
642
+ *
643
+ */
644
+ export const listCostOrganisationsInfiniteOptions = (options) => {
645
+ return infiniteQueryOptions(
646
+ // @ts-ignore
647
+ {
648
+ queryFn: async ({ pageParam, queryKey, signal }) => {
649
+ // @ts-ignore
650
+ const page = typeof pageParam === 'object' ? pageParam : {
651
+ query: {
652
+ page: pageParam
653
+ }
654
+ };
655
+ const params = createInfiniteParams(queryKey, page);
656
+ const { data } = await listCostOrganisations({
657
+ ...options,
658
+ ...params,
659
+ signal,
660
+ throwOnError: true
661
+ });
662
+ return data;
663
+ },
664
+ queryKey: listCostOrganisationsInfiniteQueryKey(options)
665
+ });
666
+ };
568
667
  export const listCostBreakdownQueryKey = (options) => createQueryKey('listCostBreakdown', options);
569
668
  /**
570
669
  * List the daily cost breakdown
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { ListActorActivityData, ListActorActivityErrors, ListActorActivityResponses, ListAuditBreakdownData, ListAuditBreakdownErrors, ListAuditBreakdownResponses, ListAuditsData, ListAuditsErrors, ListAuditsResponses, ListCostBreakdownData, ListCostBreakdownErrors, ListCostBreakdownResponses, 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, 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,24 @@ 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
+ * Summarise tenants
36
+ *
37
+ * Returns counts over every tenant by lifecycle state, plan and scheduled plan change, and
38
+ * the same for tenants created within the window. Reads billing data only, so it is cheap
39
+ * compared with listing tenants.
40
+ *
41
+ */
42
+ export declare const getTenantSummary: <ThrowOnError extends boolean = false>(options?: Options<GetTenantSummaryData, ThrowOnError>) => import("./client").RequestResult<GetTenantSummaryResponses, GetTenantSummaryErrors, ThrowOnError, "fields">;
25
43
  /**
26
44
  * List users
27
45
  *
@@ -101,6 +119,14 @@ export declare const listDeploymentOrganisations: <ThrowOnError extends boolean
101
119
  *
102
120
  */
103
121
  export declare const listDeploymentBreakdown: <ThrowOnError extends boolean = false>(options?: Options<ListDeploymentBreakdownData, ThrowOnError>) => import("./client").RequestResult<ListDeploymentBreakdownResponses, ListDeploymentBreakdownErrors, ThrowOnError, "fields">;
122
+ /**
123
+ * List spend per space
124
+ *
125
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
126
+ * down by project and environment.
127
+ *
128
+ */
129
+ export declare const listCostOrganisations: <ThrowOnError extends boolean = false>(options?: Options<ListCostOrganisationsData, ThrowOnError>) => import("./client").RequestResult<ListCostOrganisationsResponses, ListCostOrganisationsErrors, ThrowOnError, "fields">;
104
130
  /**
105
131
  * List the daily cost breakdown
106
132
  *
@@ -20,6 +20,46 @@ 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
+ * Summarise tenants
45
+ *
46
+ * Returns counts over every tenant by lifecycle state, plan and scheduled plan change, and
47
+ * the same for tenants created within the window. Reads billing data only, so it is cheap
48
+ * compared with listing tenants.
49
+ *
50
+ */
51
+ export const getTenantSummary = (options) => {
52
+ return (options?.client ?? client).get({
53
+ security: [
54
+ {
55
+ scheme: 'bearer',
56
+ type: 'http'
57
+ }
58
+ ],
59
+ url: '/insights-engine/tenants/summary',
60
+ ...options
61
+ });
62
+ };
23
63
  /**
24
64
  * List users
25
65
  *
@@ -187,6 +227,25 @@ export const listDeploymentBreakdown = (options) => {
187
227
  ...options
188
228
  });
189
229
  };
230
+ /**
231
+ * List spend per space
232
+ *
233
+ * Returns a page of spaces with spend within the window, highest spend first, each broken
234
+ * down by project and environment.
235
+ *
236
+ */
237
+ export const listCostOrganisations = (options) => {
238
+ return (options?.client ?? client).get({
239
+ security: [
240
+ {
241
+ scheme: 'bearer',
242
+ type: 'http'
243
+ }
244
+ ],
245
+ url: '/insights-engine/billing/organisations',
246
+ ...options
247
+ });
248
+ };
190
249
  /**
191
250
  * List the daily cost breakdown
192
251
  *
@@ -344,6 +344,7 @@ export type OnboardingAnalytics = {
344
344
  export type UserSignUpBreakdown = {
345
345
  email: string;
346
346
  onboardingAnalytics: OnboardingAnalytics;
347
+ user: User;
347
348
  };
348
349
  /**
349
350
  * A day of sign ups, the users who signed up, and how they answered each onboarding question.
@@ -446,6 +447,105 @@ export type DeploymentOrganisation = {
446
447
  export type PaginatedDeploymentOrganisations = PaginatedResponse & {
447
448
  data: Array<DeploymentOrganisation>;
448
449
  };
450
+ export type CountByKey = {
451
+ [key: string]: number;
452
+ };
453
+ export type PlanTransition = {
454
+ from: string;
455
+ to: string;
456
+ change: 'upgrade' | 'downgrade';
457
+ count: number;
458
+ };
459
+ export type TenantCohortDay = {
460
+ timestamp: string;
461
+ states: CountByKey;
462
+ };
463
+ /**
464
+ * Tenants created within the window.
465
+ */
466
+ export type TenantCohort = {
467
+ total: number;
468
+ states: CountByKey;
469
+ plans: CountByKey;
470
+ /**
471
+ * Tenants that have trialed or are trialing.
472
+ */
473
+ trialed: number;
474
+ trialStates: CountByKey;
475
+ /**
476
+ * Oldest day first, counting tenants by the day they were created.
477
+ */
478
+ daily: Array<TenantCohortDay>;
479
+ };
480
+ /**
481
+ * Counts over every tenant by lifecycle state, plan and scheduled plan change, plus the same for tenants created within the window. Aggregated server side from billing data.
482
+ */
483
+ export type TenantSummary = {
484
+ total: number;
485
+ states: CountByKey;
486
+ plans: CountByKey;
487
+ upgrades: number;
488
+ downgrades: number;
489
+ /**
490
+ * Most common first.
491
+ */
492
+ transitions: Array<PlanTransition>;
493
+ cohort: TenantCohort;
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 CostEnvironment = {
519
+ id: string;
520
+ handle: string;
521
+ gcpProjectId: string;
522
+ cost: Cost;
523
+ };
524
+ export type CostProject = {
525
+ id: string;
526
+ handle: string;
527
+ cost: Cost;
528
+ environments: Array<CostEnvironment>;
529
+ };
530
+ /**
531
+ * Spend of one space within the window, broken down by project and environment. Spend on GCP projects that no current environment claims is reported separately as unattributed.
532
+ */
533
+ export type CostOrganisation = {
534
+ orgId: string;
535
+ name: string;
536
+ currentPlan: string;
537
+ status: string;
538
+ /**
539
+ * Every member uses a platform48.com email.
540
+ */
541
+ internal: boolean;
542
+ cost: Cost;
543
+ unattributed: Cost;
544
+ projects: Array<CostProject>;
545
+ };
546
+ export type PaginatedCostOrganisations = PaginatedResponse & {
547
+ data: Array<CostOrganisation>;
548
+ };
449
549
  export type PaginatedTenants = PaginatedResponse & {
450
550
  data: Array<Tenant>;
451
551
  };
@@ -508,9 +608,9 @@ export type Plan = string;
508
608
  */
509
609
  export type State = 'trialing' | 'converted' | 'paying' | 'trial_to_solo' | 'solo' | 'onboarding' | 'at_risk' | 'churned';
510
610
  /**
511
- * Only tenants whose next billing cycle is on a higher, lower or the same plan.
611
+ * Only tenants whose next billing cycle is on a higher, lower or the same plan. `changed` matches both upgrades and downgrades.
512
612
  */
513
- export type PlanChange = 'upgrade' | 'downgrade' | 'none';
613
+ export type PlanChange = 'upgrade' | 'downgrade' | 'changed' | 'none';
514
614
  /**
515
615
  * Leave out internal accounts, those whose members all use a platform48.com email.
516
616
  */
@@ -584,9 +684,9 @@ export type ListTenantsData = {
584
684
  */
585
685
  state?: 'trialing' | 'converted' | 'paying' | 'trial_to_solo' | 'solo' | 'onboarding' | 'at_risk' | 'churned';
586
686
  /**
587
- * Only tenants whose next billing cycle is on a higher, lower or the same plan.
687
+ * Only tenants whose next billing cycle is on a higher, lower or the same plan. `changed` matches both upgrades and downgrades.
588
688
  */
589
- plan_change?: 'upgrade' | 'downgrade' | 'none';
689
+ plan_change?: 'upgrade' | 'downgrade' | 'changed' | 'none';
590
690
  /**
591
691
  * Leave out internal accounts, those whose members all use a platform48.com email.
592
692
  */
@@ -612,6 +712,76 @@ export type ListTenantsResponses = {
612
712
  200: PaginatedTenants;
613
713
  };
614
714
  export type ListTenantsResponse = ListTenantsResponses[keyof ListTenantsResponses];
715
+ export type GetOverviewData = {
716
+ body?: never;
717
+ path?: never;
718
+ query?: {
719
+ /**
720
+ * Start of the reporting window. Unbounded when omitted.
721
+ */
722
+ from?: string;
723
+ /**
724
+ * End of the reporting window. Unbounded when omitted.
725
+ */
726
+ to?: string;
727
+ };
728
+ url: '/insights-engine/overview';
729
+ };
730
+ export type GetOverviewErrors = {
731
+ /**
732
+ * The request was rejected as invalid.
733
+ */
734
+ 400: _Error;
735
+ /**
736
+ * The service is not healthy.
737
+ */
738
+ 500: _Error;
739
+ };
740
+ export type GetOverviewError = GetOverviewErrors[keyof GetOverviewErrors];
741
+ export type GetOverviewResponses = {
742
+ /**
743
+ * The overview.
744
+ */
745
+ 200: Overview;
746
+ };
747
+ export type GetOverviewResponse = GetOverviewResponses[keyof GetOverviewResponses];
748
+ export type GetTenantSummaryData = {
749
+ body?: never;
750
+ path?: never;
751
+ query?: {
752
+ /**
753
+ * Start of the reporting window. Unbounded when omitted.
754
+ */
755
+ from?: string;
756
+ /**
757
+ * End of the reporting window. Unbounded when omitted.
758
+ */
759
+ to?: string;
760
+ /**
761
+ * Leave out internal accounts, those whose members all use a platform48.com email.
762
+ */
763
+ exclude_internal?: boolean;
764
+ };
765
+ url: '/insights-engine/tenants/summary';
766
+ };
767
+ export type GetTenantSummaryErrors = {
768
+ /**
769
+ * The request was rejected as invalid.
770
+ */
771
+ 400: _Error;
772
+ /**
773
+ * The service is not healthy.
774
+ */
775
+ 500: _Error;
776
+ };
777
+ export type GetTenantSummaryError = GetTenantSummaryErrors[keyof GetTenantSummaryErrors];
778
+ export type GetTenantSummaryResponses = {
779
+ /**
780
+ * The tenant summary.
781
+ */
782
+ 200: TenantSummary;
783
+ };
784
+ export type GetTenantSummaryResponse = GetTenantSummaryResponses[keyof GetTenantSummaryResponses];
615
785
  export type ListUsersData = {
616
786
  body?: never;
617
787
  path?: never;
@@ -1064,6 +1234,47 @@ export type ListDeploymentBreakdownResponses = {
1064
1234
  200: PaginatedDeploymentBreakdown;
1065
1235
  };
1066
1236
  export type ListDeploymentBreakdownResponse = ListDeploymentBreakdownResponses[keyof ListDeploymentBreakdownResponses];
1237
+ export type ListCostOrganisationsData = {
1238
+ body?: never;
1239
+ path?: never;
1240
+ query?: {
1241
+ /**
1242
+ * Start of the reporting window. Unbounded when omitted.
1243
+ */
1244
+ from?: string;
1245
+ /**
1246
+ * End of the reporting window. Unbounded when omitted.
1247
+ */
1248
+ to?: string;
1249
+ /**
1250
+ * 1-based page index.
1251
+ */
1252
+ page?: number;
1253
+ /**
1254
+ * Items per page, clamped server side to at most 5000.
1255
+ */
1256
+ limit?: number;
1257
+ };
1258
+ url: '/insights-engine/billing/organisations';
1259
+ };
1260
+ export type ListCostOrganisationsErrors = {
1261
+ /**
1262
+ * The request was rejected as invalid.
1263
+ */
1264
+ 400: _Error;
1265
+ /**
1266
+ * The service is not healthy.
1267
+ */
1268
+ 500: _Error;
1269
+ };
1270
+ export type ListCostOrganisationsError = ListCostOrganisationsErrors[keyof ListCostOrganisationsErrors];
1271
+ export type ListCostOrganisationsResponses = {
1272
+ /**
1273
+ * A page of spaces and their spend.
1274
+ */
1275
+ 200: PaginatedCostOrganisations;
1276
+ };
1277
+ export type ListCostOrganisationsResponse = ListCostOrganisationsResponses[keyof ListCostOrganisationsResponses];
1067
1278
  export type ListCostBreakdownData = {
1068
1279
  body?: never;
1069
1280
  path?: never;