shoal-web-sdk 0.0.119 → 0.0.121

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, type UseMutationOptions } from '@tanstack/react-query';
2
2
  import { type Options } from '../sdk.gen';
3
- import type { CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError } from '../types.gen';
3
+ import type { CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchLogsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError } from '../types.gen';
4
4
  export type QueryKey<TOptions extends Options> = [
5
5
  Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
6
6
  _id: string;
@@ -736,6 +736,34 @@ export declare const getProjectOverviewOptions: (options: Options<GetProjectOver
736
736
  [dataTagErrorSymbol]: Error;
737
737
  };
738
738
  };
739
+ export declare const fetchLogsQueryKey: (options: Options<FetchLogsData>) => [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
740
+ _id: string;
741
+ _infinite?: boolean;
742
+ tags?: ReadonlyArray<string>;
743
+ }];
744
+ /**
745
+ * Fetch a series of paginated log entries.
746
+ */
747
+ export declare const fetchLogsOptions: (options: Options<FetchLogsData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").Logs, Error, import("../types.gen").Logs, [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
748
+ _id: string;
749
+ _infinite?: boolean;
750
+ tags?: ReadonlyArray<string>;
751
+ }]>, "queryFn"> & {
752
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").Logs, [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
753
+ _id: string;
754
+ _infinite?: boolean;
755
+ tags?: ReadonlyArray<string>;
756
+ }], never> | undefined;
757
+ } & {
758
+ queryKey: [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
759
+ _id: string;
760
+ _infinite?: boolean;
761
+ tags?: ReadonlyArray<string>;
762
+ }] & {
763
+ [dataTagSymbol]: import("../types.gen").Logs;
764
+ [dataTagErrorSymbol]: Error;
765
+ };
766
+ };
739
767
  /**
740
768
  * Create an environment inside a project.
741
769
  */
@@ -940,3 +968,31 @@ export declare const fetchBillingPricesOptions: (options: Options<FetchBillingPr
940
968
  [dataTagErrorSymbol]: Error;
941
969
  };
942
970
  };
971
+ export declare const listBillingInvoicesQueryKey: (options: Options<ListBillingInvoicesData>) => [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
972
+ _id: string;
973
+ _infinite?: boolean;
974
+ tags?: ReadonlyArray<string>;
975
+ }];
976
+ /**
977
+ * List past invoices for the space, newest first.
978
+ */
979
+ export declare const listBillingInvoicesOptions: (options: Options<ListBillingInvoicesData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").InvoicesResponse, Error, import("../types.gen").InvoicesResponse, [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
980
+ _id: string;
981
+ _infinite?: boolean;
982
+ tags?: ReadonlyArray<string>;
983
+ }]>, "queryFn"> & {
984
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").InvoicesResponse, [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
985
+ _id: string;
986
+ _infinite?: boolean;
987
+ tags?: ReadonlyArray<string>;
988
+ }], never> | undefined;
989
+ } & {
990
+ queryKey: [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
991
+ _id: string;
992
+ _infinite?: boolean;
993
+ tags?: ReadonlyArray<string>;
994
+ }] & {
995
+ [dataTagSymbol]: import("../types.gen").InvoicesResponse;
996
+ [dataTagErrorSymbol]: Error;
997
+ };
998
+ };
@@ -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 { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile } from '../sdk.gen';
4
+ import { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchLogs, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile } 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) {
@@ -793,6 +793,24 @@ export const getProjectOverviewOptions = (options) => {
793
793
  queryKey: getProjectOverviewQueryKey(options)
794
794
  });
795
795
  };
796
+ export const fetchLogsQueryKey = (options) => createQueryKey('fetchLogs', options);
797
+ /**
798
+ * Fetch a series of paginated log entries.
799
+ */
800
+ export const fetchLogsOptions = (options) => {
801
+ return queryOptions({
802
+ queryFn: async ({ queryKey, signal }) => {
803
+ const { data } = await fetchLogs({
804
+ ...options,
805
+ ...queryKey[0],
806
+ signal,
807
+ throwOnError: true
808
+ });
809
+ return data;
810
+ },
811
+ queryKey: fetchLogsQueryKey(options)
812
+ });
813
+ };
796
814
  /**
797
815
  * Create an environment inside a project.
798
816
  */
@@ -1045,3 +1063,21 @@ export const fetchBillingPricesOptions = (options) => {
1045
1063
  queryKey: fetchBillingPricesQueryKey(options)
1046
1064
  });
1047
1065
  };
1066
+ export const listBillingInvoicesQueryKey = (options) => createQueryKey('listBillingInvoices', options);
1067
+ /**
1068
+ * List past invoices for the space, newest first.
1069
+ */
1070
+ export const listBillingInvoicesOptions = (options) => {
1071
+ return queryOptions({
1072
+ queryFn: async ({ queryKey, signal }) => {
1073
+ const { data } = await listBillingInvoices({
1074
+ ...options,
1075
+ ...queryKey[0],
1076
+ signal,
1077
+ throwOnError: true
1078
+ });
1079
+ return data;
1080
+ },
1081
+ queryKey: listBillingInvoicesQueryKey(options)
1082
+ });
1083
+ };
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchBillingPricesData, FetchBillingPricesErrors, FetchBillingPricesResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, FetchNodeM2mData, FetchNodeM2mErrors, FetchNodeM2mResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListPaymentMethodsData, ListPaymentMethodsErrors, ListPaymentMethodsResponses, ListSpaceMemberRolesData, ListSpaceMemberRolesErrors, ListSpaceMemberRolesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RecordCloudUsageData, RecordCloudUsageErrors, RecordCloudUsageResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses } from './types.gen';
2
+ import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchBillingPricesData, FetchBillingPricesErrors, FetchBillingPricesResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, FetchLogsData, FetchLogsErrors, FetchLogsResponses, FetchNodeM2mData, FetchNodeM2mErrors, FetchNodeM2mResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListBillingInvoicesData, ListBillingInvoicesErrors, ListBillingInvoicesResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListPaymentMethodsData, ListPaymentMethodsErrors, ListPaymentMethodsResponses, ListSpaceMemberRolesData, ListSpaceMemberRolesErrors, ListSpaceMemberRolesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RecordCloudUsageData, RecordCloudUsageErrors, RecordCloudUsageResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses } 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
@@ -141,6 +141,10 @@ export declare const createProject: <ThrowOnError extends boolean = false>(optio
141
141
  * Get the project overview.
142
142
  */
143
143
  export declare const getProjectOverview: <ThrowOnError extends boolean = false>(options: Options<GetProjectOverviewData, ThrowOnError>) => import("./client").RequestResult<GetProjectOverviewResponses, GetProjectOverviewErrors, ThrowOnError, "fields">;
144
+ /**
145
+ * Fetch a series of paginated log entries.
146
+ */
147
+ export declare const fetchLogs: <ThrowOnError extends boolean = false>(options: Options<FetchLogsData, ThrowOnError>) => import("./client").RequestResult<FetchLogsResponses, FetchLogsErrors, ThrowOnError, "fields">;
144
148
  /**
145
149
  * Create an environment inside a project.
146
150
  */
@@ -201,3 +205,7 @@ export declare const getBillingUsage: <ThrowOnError extends boolean = false>(opt
201
205
  * Fetch live unit prices for all paid plans from Stripe.
202
206
  */
203
207
  export declare const fetchBillingPrices: <ThrowOnError extends boolean = false>(options: Options<FetchBillingPricesData, ThrowOnError>) => import("./client").RequestResult<FetchBillingPricesResponses, FetchBillingPricesErrors, ThrowOnError, "fields">;
208
+ /**
209
+ * List past invoices for the space, newest first.
210
+ */
211
+ export declare const listBillingInvoices: <ThrowOnError extends boolean = false>(options: Options<ListBillingInvoicesData, ThrowOnError>) => import("./client").RequestResult<ListBillingInvoicesResponses, ListBillingInvoicesErrors, ThrowOnError, "fields">;
@@ -508,6 +508,21 @@ export const getProjectOverview = (options) => {
508
508
  ...options
509
509
  });
510
510
  };
511
+ /**
512
+ * Fetch a series of paginated log entries.
513
+ */
514
+ export const fetchLogs = (options) => {
515
+ return (options.client ?? client).get({
516
+ security: [
517
+ {
518
+ scheme: 'bearer',
519
+ type: 'http'
520
+ }
521
+ ],
522
+ url: '/auth/{spaceHandle}/{projectHandle}/logs',
523
+ ...options
524
+ });
525
+ };
511
526
  /**
512
527
  * Create an environment inside a project.
513
528
  */
@@ -749,3 +764,18 @@ export const fetchBillingPrices = (options) => {
749
764
  ...options
750
765
  });
751
766
  };
767
+ /**
768
+ * List past invoices for the space, newest first.
769
+ */
770
+ export const listBillingInvoices = (options) => {
771
+ return (options.client ?? client).get({
772
+ security: [
773
+ {
774
+ scheme: 'bearer',
775
+ type: 'http'
776
+ }
777
+ ],
778
+ url: '/auth/{spaceHandle}/billing/invoices',
779
+ ...options
780
+ });
781
+ };
@@ -1,6 +1,19 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: 'http://localhost:8080/core-service' | 'https://api-dev.shoalstack.com/core-service' | (string & {});
3
3
  };
4
+ export type LogEntry = {
5
+ id: string;
6
+ timestamp: string;
7
+ projectID: string;
8
+ environmentID: string;
9
+ nodeID: string;
10
+ payload: unknown;
11
+ };
12
+ export type Logs = {
13
+ logs: Array<LogEntry>;
14
+ nextPage?: string;
15
+ limit: unknown;
16
+ };
4
17
  export type PlatformTier = 'free' | 'hobby' | 'pro';
5
18
  export type BillingInterval = 'monthly' | 'annual';
6
19
  export type BillingPlanLookupKey = 'free-monthly' | 'hobby-monthly' | 'hobby-annual' | 'pro-monthly' | 'pro-annual';
@@ -330,7 +343,7 @@ export type ContainerNodeProps = {
330
343
  };
331
344
  export type Region = 'africa-south1' | 'asia-east1' | 'asia-east2' | 'asia-northeast1' | 'asia-northeast2' | 'asia-northeast3' | 'asia-south1' | 'asia-southeast1' | 'asia-southeast2' | 'australia-southeast1' | 'europe-north1' | 'europe-west1' | 'europe-west2' | 'europe-west3' | 'europe-west4' | 'europe-west6' | 'northamerica-northeast1' | 'northamerica-northeast2' | 'southamerica-east1' | 'southamerica-west1' | 'us-central1' | 'us-east1' | 'us-east4' | 'us-west1' | 'us-west2' | 'us-west3' | 'us-west4';
332
345
  export type Cpu = '1' | '2' | '4' | '6' | '8' | '16' | '32';
333
- export type Memory = '128Mi' | '256Mi' | '512Mi' | '1Gi' | '2Gi' | '4Gi' | '8Gi' | '16Gi' | '32Gi';
346
+ export type Memory = '512Mi' | '1Gi' | '2Gi' | '4Gi' | '8Gi' | '16Gi' | '32Gi';
334
347
  export type Ingress = 'INGRESS_TRAFFIC_ALL' | 'INGRESS_TRAFFIC_INTERNAL_ONLY' | 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER';
335
348
  export type CronJobNodeProps = {
336
349
  cronTab?: string;
@@ -402,6 +415,59 @@ export type RecordUsageRequest = {
402
415
  */
403
416
  timestamp?: number;
404
417
  };
418
+ export type Invoice = {
419
+ /**
420
+ * Stripe invoice ID.
421
+ */
422
+ id: string;
423
+ /**
424
+ * Human-readable invoice number (e.g. "INV-0001").
425
+ */
426
+ number: string;
427
+ /**
428
+ * Invoice status (paid, open, void, draft, uncollectible).
429
+ */
430
+ status: string;
431
+ /**
432
+ * Total amount due in the smallest currency unit (e.g. cents).
433
+ */
434
+ amountDue: number;
435
+ /**
436
+ * Amount already paid in the smallest currency unit.
437
+ */
438
+ amountPaid: number;
439
+ /**
440
+ * ISO 4217 currency code (e.g. "usd").
441
+ */
442
+ currency: string;
443
+ /**
444
+ * Start of the billing period this invoice covers.
445
+ */
446
+ periodStart: string;
447
+ /**
448
+ * End of the billing period this invoice covers.
449
+ */
450
+ periodEnd: string;
451
+ /**
452
+ * When the invoice was created.
453
+ */
454
+ created: string;
455
+ /**
456
+ * URL to download the invoice PDF.
457
+ */
458
+ invoicePdfUrl: string;
459
+ /**
460
+ * URL to the Stripe-hosted invoice page.
461
+ */
462
+ hostedInvoiceUrl: string;
463
+ };
464
+ export type InvoicesResponse = {
465
+ invoices: Array<Invoice>;
466
+ /**
467
+ * Pass this as `starting_after` in the next request to fetch the next page. Absent when there are no more pages.
468
+ */
469
+ nextPageToken?: string;
470
+ };
405
471
  export type PlanPriceResponse = {
406
472
  /**
407
473
  * Plan code (e.g. "hobby-monthly", "pro-annual").
@@ -420,6 +486,14 @@ export type PlanPriceResponse = {
420
486
  */
421
487
  interval: string;
422
488
  };
489
+ /**
490
+ * The from time to start querying logs from.
491
+ */
492
+ export type FromTime = string;
493
+ /**
494
+ * The to time to start querying logs to.
495
+ */
496
+ export type ToTime = string;
423
497
  /**
424
498
  * Expiry query.
425
499
  */
@@ -432,6 +506,14 @@ export type NodeUuid = string;
432
506
  * An invite UUID.
433
507
  */
434
508
  export type InviteUuid = string;
509
+ /**
510
+ * The environment UUID.
511
+ */
512
+ export type EnvironmentId = string;
513
+ /**
514
+ * The node UUID.
515
+ */
516
+ export type NodeId = string;
435
517
  /**
436
518
  * A version UUID.
437
519
  */
@@ -472,6 +554,10 @@ export type Page = number;
472
554
  * Page size (max 100).
473
555
  */
474
556
  export type Limit = number;
557
+ /**
558
+ * The next page token for paginated results from the log service.
559
+ */
560
+ export type LogServiceNextPageToken = string;
475
561
  /**
476
562
  * Opaque pagination token returned by the previous response.
477
563
  */
@@ -480,6 +566,10 @@ export type NextPageToken = string;
480
566
  * Connected app key code reference from Kinde.
481
567
  */
482
568
  export type KeyCodeRef = string;
569
+ /**
570
+ * Optional callback URL override for the connected app flow. Ignored when an empty string is provided.
571
+ */
572
+ export type OverrideCallbackUrl = string;
483
573
  /**
484
574
  * Identity ID to delete.
485
575
  */
@@ -852,6 +942,10 @@ export type GetConnectedAppUrlData = {
852
942
  * Connected app key code reference from Kinde.
853
943
  */
854
944
  key_code_ref: string;
945
+ /**
946
+ * Optional callback URL override for the connected app flow. Ignored when an empty string is provided.
947
+ */
948
+ override_callback_url?: string;
855
949
  };
856
950
  url: '/auth/account/connected-app-url';
857
951
  };
@@ -1729,6 +1823,64 @@ export type GetProjectOverviewResponses = {
1729
1823
  200: ProjectOverview;
1730
1824
  };
1731
1825
  export type GetProjectOverviewResponse = GetProjectOverviewResponses[keyof GetProjectOverviewResponses];
1826
+ export type FetchLogsData = {
1827
+ body?: never;
1828
+ path: {
1829
+ /**
1830
+ * The space handle. This must be globally unique.
1831
+ */
1832
+ spaceHandle: string;
1833
+ /**
1834
+ * A project name. This must be unique to a space.
1835
+ */
1836
+ projectHandle: string;
1837
+ };
1838
+ query: {
1839
+ /**
1840
+ * The environment UUID.
1841
+ */
1842
+ environment: string;
1843
+ /**
1844
+ * The node UUID.
1845
+ */
1846
+ node: string;
1847
+ /**
1848
+ * The from time to start querying logs from.
1849
+ */
1850
+ from?: string;
1851
+ /**
1852
+ * The to time to start querying logs to.
1853
+ */
1854
+ to?: string;
1855
+ /**
1856
+ * Page size (max 100).
1857
+ */
1858
+ limit?: number;
1859
+ /**
1860
+ * The next page token for paginated results from the log service.
1861
+ */
1862
+ token?: string;
1863
+ };
1864
+ url: '/auth/{spaceHandle}/{projectHandle}/logs';
1865
+ };
1866
+ export type FetchLogsErrors = {
1867
+ /**
1868
+ * Bad request.
1869
+ */
1870
+ 400: ErrorResponse;
1871
+ /**
1872
+ * Unexpected error.
1873
+ */
1874
+ 500: ErrorResponse;
1875
+ };
1876
+ export type FetchLogsError = FetchLogsErrors[keyof FetchLogsErrors];
1877
+ export type FetchLogsResponses = {
1878
+ /**
1879
+ * Paginated log entries matching query
1880
+ */
1881
+ 200: Logs;
1882
+ };
1883
+ export type FetchLogsResponse = FetchLogsResponses[keyof FetchLogsResponses];
1732
1884
  export type CreateEnvironmentData = {
1733
1885
  body: CreateEnvironment;
1734
1886
  path: {
@@ -2327,3 +2479,41 @@ export type FetchBillingPricesResponses = {
2327
2479
  200: Array<PlanPriceResponse>;
2328
2480
  };
2329
2481
  export type FetchBillingPricesResponse = FetchBillingPricesResponses[keyof FetchBillingPricesResponses];
2482
+ export type ListBillingInvoicesData = {
2483
+ body?: never;
2484
+ path: {
2485
+ /**
2486
+ * The space handle. This must be globally unique.
2487
+ */
2488
+ spaceHandle: string;
2489
+ };
2490
+ query?: {
2491
+ /**
2492
+ * Invoice ID to start after (cursor for next page, taken from `next_page_token`).
2493
+ */
2494
+ starting_after?: string;
2495
+ };
2496
+ url: '/auth/{spaceHandle}/billing/invoices';
2497
+ };
2498
+ export type ListBillingInvoicesErrors = {
2499
+ /**
2500
+ * Unauthorised user.
2501
+ */
2502
+ 401: ErrorResponse;
2503
+ /**
2504
+ * Invalid credentials.
2505
+ */
2506
+ 403: ErrorResponse;
2507
+ /**
2508
+ * Unexpected error.
2509
+ */
2510
+ 500: ErrorResponse;
2511
+ };
2512
+ export type ListBillingInvoicesError = ListBillingInvoicesErrors[keyof ListBillingInvoicesErrors];
2513
+ export type ListBillingInvoicesResponses = {
2514
+ /**
2515
+ * A page of invoices.
2516
+ */
2517
+ 200: InvoicesResponse;
2518
+ };
2519
+ export type ListBillingInvoicesResponse = ListBillingInvoicesResponses[keyof ListBillingInvoicesResponses];
@@ -1,4 +1,24 @@
1
1
  import { z } from 'zod';
2
+ export declare const zLogEntry: z.ZodObject<{
3
+ id: z.ZodString;
4
+ timestamp: z.ZodISODateTime;
5
+ projectID: z.ZodString;
6
+ environmentID: z.ZodString;
7
+ nodeID: z.ZodString;
8
+ payload: z.ZodUnknown;
9
+ }, z.core.$strip>;
10
+ export declare const zLogs: z.ZodObject<{
11
+ logs: z.ZodArray<z.ZodObject<{
12
+ id: z.ZodString;
13
+ timestamp: z.ZodISODateTime;
14
+ projectID: z.ZodString;
15
+ environmentID: z.ZodString;
16
+ nodeID: z.ZodString;
17
+ payload: z.ZodUnknown;
18
+ }, z.core.$strip>>;
19
+ nextPage: z.ZodOptional<z.ZodString>;
20
+ limit: z.ZodUnknown;
21
+ }, z.core.$strip>;
2
22
  export declare const zPlatformTier: z.ZodEnum<{
3
23
  free: "free";
4
24
  hobby: "hobby";
@@ -495,8 +515,6 @@ export declare const zCpu: z.ZodEnum<{
495
515
  32: "32";
496
516
  }>;
497
517
  export declare const zMemory: z.ZodEnum<{
498
- "128Mi": "128Mi";
499
- "256Mi": "256Mi";
500
518
  "512Mi": "512Mi";
501
519
  "1Gi": "1Gi";
502
520
  "2Gi": "2Gi";
@@ -551,8 +569,6 @@ export declare const zContainerNodeProps: z.ZodObject<{
551
569
  32: "32";
552
570
  }>;
553
571
  memory: z.ZodEnum<{
554
- "128Mi": "128Mi";
555
- "256Mi": "256Mi";
556
572
  "512Mi": "512Mi";
557
573
  "1Gi": "1Gi";
558
574
  "2Gi": "2Gi";
@@ -682,8 +698,6 @@ export declare const zNode: z.ZodObject<{
682
698
  32: "32";
683
699
  }>;
684
700
  memory: z.ZodEnum<{
685
- "128Mi": "128Mi";
686
- "256Mi": "256Mi";
687
701
  "512Mi": "512Mi";
688
702
  "1Gi": "1Gi";
689
703
  "2Gi": "2Gi";
@@ -826,8 +840,6 @@ export declare const zNodes: z.ZodObject<{
826
840
  32: "32";
827
841
  }>;
828
842
  memory: z.ZodEnum<{
829
- "128Mi": "128Mi";
830
- "256Mi": "256Mi";
831
843
  "512Mi": "512Mi";
832
844
  "1Gi": "1Gi";
833
845
  "2Gi": "2Gi";
@@ -972,8 +984,6 @@ export declare const zGraph: z.ZodObject<{
972
984
  32: "32";
973
985
  }>;
974
986
  memory: z.ZodEnum<{
975
- "128Mi": "128Mi";
976
- "256Mi": "256Mi";
977
987
  "512Mi": "512Mi";
978
988
  "1Gi": "1Gi";
979
989
  "2Gi": "2Gi";
@@ -1073,12 +1083,49 @@ export declare const zRecordUsageRequest: z.ZodObject<{
1073
1083
  quantity: z.ZodCoercedBigInt<unknown>;
1074
1084
  timestamp: z.ZodOptional<z.ZodCoercedBigInt<unknown>>;
1075
1085
  }, z.core.$strip>;
1086
+ export declare const zInvoice: z.ZodObject<{
1087
+ id: z.ZodString;
1088
+ number: z.ZodString;
1089
+ status: z.ZodString;
1090
+ amountDue: z.ZodCoercedBigInt<unknown>;
1091
+ amountPaid: z.ZodCoercedBigInt<unknown>;
1092
+ currency: z.ZodString;
1093
+ periodStart: z.ZodISODateTime;
1094
+ periodEnd: z.ZodISODateTime;
1095
+ created: z.ZodISODateTime;
1096
+ invoicePdfUrl: z.ZodString;
1097
+ hostedInvoiceUrl: z.ZodString;
1098
+ }, z.core.$strip>;
1099
+ export declare const zInvoicesResponse: z.ZodObject<{
1100
+ invoices: z.ZodArray<z.ZodObject<{
1101
+ id: z.ZodString;
1102
+ number: z.ZodString;
1103
+ status: z.ZodString;
1104
+ amountDue: z.ZodCoercedBigInt<unknown>;
1105
+ amountPaid: z.ZodCoercedBigInt<unknown>;
1106
+ currency: z.ZodString;
1107
+ periodStart: z.ZodISODateTime;
1108
+ periodEnd: z.ZodISODateTime;
1109
+ created: z.ZodISODateTime;
1110
+ invoicePdfUrl: z.ZodString;
1111
+ hostedInvoiceUrl: z.ZodString;
1112
+ }, z.core.$strip>>;
1113
+ nextPageToken: z.ZodOptional<z.ZodString>;
1114
+ }, z.core.$strip>;
1076
1115
  export declare const zPlanPriceResponse: z.ZodObject<{
1077
1116
  code: z.ZodString;
1078
1117
  unit_amount_cents: z.ZodCoercedBigInt<unknown>;
1079
1118
  currency: z.ZodString;
1080
1119
  interval: z.ZodString;
1081
1120
  }, z.core.$strip>;
1121
+ /**
1122
+ * The from time to start querying logs from.
1123
+ */
1124
+ export declare const zFromTime: z.ZodISODateTime;
1125
+ /**
1126
+ * The to time to start querying logs to.
1127
+ */
1128
+ export declare const zToTime: z.ZodISODateTime;
1082
1129
  /**
1083
1130
  * Expiry query.
1084
1131
  */
@@ -1091,6 +1138,14 @@ export declare const zNodeUuid: z.ZodUUID;
1091
1138
  * An invite UUID.
1092
1139
  */
1093
1140
  export declare const zInviteUuid: z.ZodUUID;
1141
+ /**
1142
+ * The environment UUID.
1143
+ */
1144
+ export declare const zEnvironmentId: z.ZodUUID;
1145
+ /**
1146
+ * The node UUID.
1147
+ */
1148
+ export declare const zNodeId: z.ZodUUID;
1094
1149
  /**
1095
1150
  * A version UUID.
1096
1151
  */
@@ -1131,6 +1186,10 @@ export declare const zPage: z.ZodDefault<z.ZodInt>;
1131
1186
  * Page size (max 100).
1132
1187
  */
1133
1188
  export declare const zLimit: z.ZodDefault<z.ZodInt>;
1189
+ /**
1190
+ * The next page token for paginated results from the log service.
1191
+ */
1192
+ export declare const zLogServiceNextPageToken: z.ZodString;
1134
1193
  /**
1135
1194
  * Opaque pagination token returned by the previous response.
1136
1195
  */
@@ -1139,6 +1198,10 @@ export declare const zNextPageToken: z.ZodString;
1139
1198
  * Connected app key code reference from Kinde.
1140
1199
  */
1141
1200
  export declare const zKeyCodeRef: z.ZodString;
1201
+ /**
1202
+ * Optional callback URL override for the connected app flow. Ignored when an empty string is provided.
1203
+ */
1204
+ export declare const zOverrideCallbackUrl: z.ZodString;
1142
1205
  /**
1143
1206
  * Identity ID to delete.
1144
1207
  */
@@ -1269,8 +1332,6 @@ export declare const zFetchGraphM2mResponse: z.ZodObject<{
1269
1332
  32: "32";
1270
1333
  }>;
1271
1334
  memory: z.ZodEnum<{
1272
- "128Mi": "128Mi";
1273
- "256Mi": "256Mi";
1274
1335
  "512Mi": "512Mi";
1275
1336
  "1Gi": "1Gi";
1276
1337
  "2Gi": "2Gi";
@@ -1415,8 +1476,6 @@ export declare const zUpdateGraphM2mData: z.ZodObject<{
1415
1476
  32: "32";
1416
1477
  }>;
1417
1478
  memory: z.ZodEnum<{
1418
- "128Mi": "128Mi";
1419
- "256Mi": "256Mi";
1420
1479
  "512Mi": "512Mi";
1421
1480
  "1Gi": "1Gi";
1422
1481
  "2Gi": "2Gi";
@@ -1575,8 +1634,6 @@ export declare const zFetchNodeM2mResponse: z.ZodObject<{
1575
1634
  32: "32";
1576
1635
  }>;
1577
1636
  memory: z.ZodEnum<{
1578
- "128Mi": "128Mi";
1579
- "256Mi": "256Mi";
1580
1637
  "512Mi": "512Mi";
1581
1638
  "1Gi": "1Gi";
1582
1639
  "2Gi": "2Gi";
@@ -1714,6 +1771,7 @@ export declare const zGetConnectedAppUrlData: z.ZodObject<{
1714
1771
  path: z.ZodOptional<z.ZodNever>;
1715
1772
  query: z.ZodObject<{
1716
1773
  key_code_ref: z.ZodString;
1774
+ override_callback_url: z.ZodOptional<z.ZodString>;
1717
1775
  }, z.core.$strip>;
1718
1776
  }, z.core.$strip>;
1719
1777
  /**
@@ -2160,6 +2218,36 @@ export declare const zGetProjectOverviewResponse: z.ZodObject<{
2160
2218
  versions: z.ZodInt;
2161
2219
  }, z.core.$strip>>;
2162
2220
  }, z.core.$strip>;
2221
+ export declare const zFetchLogsData: z.ZodObject<{
2222
+ body: z.ZodOptional<z.ZodNever>;
2223
+ path: z.ZodObject<{
2224
+ spaceHandle: z.ZodString;
2225
+ projectHandle: z.ZodString;
2226
+ }, z.core.$strip>;
2227
+ query: z.ZodObject<{
2228
+ environment: z.ZodUUID;
2229
+ node: z.ZodUUID;
2230
+ from: z.ZodOptional<z.ZodISODateTime>;
2231
+ to: z.ZodOptional<z.ZodISODateTime>;
2232
+ limit: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
2233
+ token: z.ZodOptional<z.ZodString>;
2234
+ }, z.core.$strip>;
2235
+ }, z.core.$strip>;
2236
+ /**
2237
+ * Paginated log entries matching query
2238
+ */
2239
+ export declare const zFetchLogsResponse: z.ZodObject<{
2240
+ logs: z.ZodArray<z.ZodObject<{
2241
+ id: z.ZodString;
2242
+ timestamp: z.ZodISODateTime;
2243
+ projectID: z.ZodString;
2244
+ environmentID: z.ZodString;
2245
+ nodeID: z.ZodString;
2246
+ payload: z.ZodUnknown;
2247
+ }, z.core.$strip>>;
2248
+ nextPage: z.ZodOptional<z.ZodString>;
2249
+ limit: z.ZodUnknown;
2250
+ }, z.core.$strip>;
2163
2251
  export declare const zCreateEnvironmentData: z.ZodObject<{
2164
2252
  body: z.ZodObject<{
2165
2253
  name: z.ZodString;
@@ -2309,8 +2397,6 @@ export declare const zGetGraphOverviewResponse: z.ZodObject<{
2309
2397
  32: "32";
2310
2398
  }>;
2311
2399
  memory: z.ZodEnum<{
2312
- "128Mi": "128Mi";
2313
- "256Mi": "256Mi";
2314
2400
  "512Mi": "512Mi";
2315
2401
  "1Gi": "1Gi";
2316
2402
  "2Gi": "2Gi";
@@ -2455,8 +2541,6 @@ export declare const zUpdateGraphStateData: z.ZodObject<{
2455
2541
  32: "32";
2456
2542
  }>;
2457
2543
  memory: z.ZodEnum<{
2458
- "128Mi": "128Mi";
2459
- "256Mi": "256Mi";
2460
2544
  "512Mi": "512Mi";
2461
2545
  "1Gi": "1Gi";
2462
2546
  "2Gi": "2Gi";
@@ -2678,3 +2762,31 @@ export declare const zFetchBillingPricesResponse: z.ZodArray<z.ZodObject<{
2678
2762
  currency: z.ZodString;
2679
2763
  interval: z.ZodString;
2680
2764
  }, z.core.$strip>>;
2765
+ export declare const zListBillingInvoicesData: z.ZodObject<{
2766
+ body: z.ZodOptional<z.ZodNever>;
2767
+ path: z.ZodObject<{
2768
+ spaceHandle: z.ZodString;
2769
+ }, z.core.$strip>;
2770
+ query: z.ZodOptional<z.ZodObject<{
2771
+ starting_after: z.ZodOptional<z.ZodString>;
2772
+ }, z.core.$strip>>;
2773
+ }, z.core.$strip>;
2774
+ /**
2775
+ * A page of invoices.
2776
+ */
2777
+ export declare const zListBillingInvoicesResponse: z.ZodObject<{
2778
+ invoices: z.ZodArray<z.ZodObject<{
2779
+ id: z.ZodString;
2780
+ number: z.ZodString;
2781
+ status: z.ZodString;
2782
+ amountDue: z.ZodCoercedBigInt<unknown>;
2783
+ amountPaid: z.ZodCoercedBigInt<unknown>;
2784
+ currency: z.ZodString;
2785
+ periodStart: z.ZodISODateTime;
2786
+ periodEnd: z.ZodISODateTime;
2787
+ created: z.ZodISODateTime;
2788
+ invoicePdfUrl: z.ZodString;
2789
+ hostedInvoiceUrl: z.ZodString;
2790
+ }, z.core.$strip>>;
2791
+ nextPageToken: z.ZodOptional<z.ZodString>;
2792
+ }, z.core.$strip>;
@@ -1,5 +1,18 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { z } from 'zod';
3
+ export const zLogEntry = z.object({
4
+ id: z.string(),
5
+ timestamp: z.iso.datetime(),
6
+ projectID: z.string(),
7
+ environmentID: z.string(),
8
+ nodeID: z.string(),
9
+ payload: z.unknown()
10
+ });
11
+ export const zLogs = z.object({
12
+ logs: z.array(zLogEntry),
13
+ nextPage: z.optional(z.string()),
14
+ limit: z.unknown()
15
+ });
3
16
  export const zPlatformTier = z.enum([
4
17
  'free',
5
18
  'hobby',
@@ -345,8 +358,6 @@ export const zCpu = z.enum([
345
358
  '32'
346
359
  ]);
347
360
  export const zMemory = z.enum([
348
- '128Mi',
349
- '256Mi',
350
361
  '512Mi',
351
362
  '1Gi',
352
363
  '2Gi',
@@ -478,12 +489,37 @@ export const zRecordUsageRequest = z.object({
478
489
  quantity: z.coerce.bigint(),
479
490
  timestamp: z.optional(z.coerce.bigint())
480
491
  });
492
+ export const zInvoice = z.object({
493
+ id: z.string(),
494
+ number: z.string(),
495
+ status: z.string(),
496
+ amountDue: z.coerce.bigint(),
497
+ amountPaid: z.coerce.bigint(),
498
+ currency: z.string(),
499
+ periodStart: z.iso.datetime(),
500
+ periodEnd: z.iso.datetime(),
501
+ created: z.iso.datetime(),
502
+ invoicePdfUrl: z.string(),
503
+ hostedInvoiceUrl: z.string()
504
+ });
505
+ export const zInvoicesResponse = z.object({
506
+ invoices: z.array(zInvoice),
507
+ nextPageToken: z.optional(z.string())
508
+ });
481
509
  export const zPlanPriceResponse = z.object({
482
510
  code: z.string(),
483
511
  unit_amount_cents: z.coerce.bigint(),
484
512
  currency: z.string(),
485
513
  interval: z.string()
486
514
  });
515
+ /**
516
+ * The from time to start querying logs from.
517
+ */
518
+ export const zFromTime = z.iso.datetime();
519
+ /**
520
+ * The to time to start querying logs to.
521
+ */
522
+ export const zToTime = z.iso.datetime();
487
523
  /**
488
524
  * Expiry query.
489
525
  */
@@ -496,6 +532,14 @@ export const zNodeUuid = z.uuid();
496
532
  * An invite UUID.
497
533
  */
498
534
  export const zInviteUuid = z.uuid();
535
+ /**
536
+ * The environment UUID.
537
+ */
538
+ export const zEnvironmentId = z.uuid();
539
+ /**
540
+ * The node UUID.
541
+ */
542
+ export const zNodeId = z.uuid();
499
543
  /**
500
544
  * A version UUID.
501
545
  */
@@ -536,6 +580,10 @@ export const zPage = z.int().gte(1).default(1);
536
580
  * Page size (max 100).
537
581
  */
538
582
  export const zLimit = z.int().gte(1).lte(100).default(10);
583
+ /**
584
+ * The next page token for paginated results from the log service.
585
+ */
586
+ export const zLogServiceNextPageToken = z.string();
539
587
  /**
540
588
  * Opaque pagination token returned by the previous response.
541
589
  */
@@ -544,6 +592,10 @@ export const zNextPageToken = z.string();
544
592
  * Connected app key code reference from Kinde.
545
593
  */
546
594
  export const zKeyCodeRef = z.string();
595
+ /**
596
+ * Optional callback URL override for the connected app flow. Ignored when an empty string is provided.
597
+ */
598
+ export const zOverrideCallbackUrl = z.string();
547
599
  /**
548
600
  * Identity ID to delete.
549
601
  */
@@ -654,7 +706,8 @@ export const zGetConnectedAppUrlData = z.object({
654
706
  body: z.optional(z.never()),
655
707
  path: z.optional(z.never()),
656
708
  query: z.object({
657
- key_code_ref: z.string()
709
+ key_code_ref: z.string(),
710
+ override_callback_url: z.optional(z.string())
658
711
  })
659
712
  });
660
713
  /**
@@ -889,6 +942,25 @@ export const zGetProjectOverviewData = z.object({
889
942
  * Project overview.
890
943
  */
891
944
  export const zGetProjectOverviewResponse = zProjectOverview;
945
+ export const zFetchLogsData = z.object({
946
+ body: z.optional(z.never()),
947
+ path: z.object({
948
+ spaceHandle: z.string(),
949
+ projectHandle: z.string()
950
+ }),
951
+ query: z.object({
952
+ environment: z.uuid(),
953
+ node: z.uuid(),
954
+ from: z.optional(z.iso.datetime()),
955
+ to: z.optional(z.iso.datetime()),
956
+ limit: z.optional(z.int().gte(1).lte(100)).default(10),
957
+ token: z.optional(z.string())
958
+ })
959
+ });
960
+ /**
961
+ * Paginated log entries matching query
962
+ */
963
+ export const zFetchLogsResponse = zLogs;
892
964
  export const zCreateEnvironmentData = z.object({
893
965
  body: zCreateEnvironment,
894
966
  path: z.object({
@@ -1054,3 +1126,16 @@ export const zFetchBillingPricesData = z.object({
1054
1126
  * A list of plan prices.
1055
1127
  */
1056
1128
  export const zFetchBillingPricesResponse = z.array(zPlanPriceResponse);
1129
+ export const zListBillingInvoicesData = z.object({
1130
+ body: z.optional(z.never()),
1131
+ path: z.object({
1132
+ spaceHandle: z.string()
1133
+ }),
1134
+ query: z.optional(z.object({
1135
+ starting_after: z.optional(z.string())
1136
+ }))
1137
+ });
1138
+ /**
1139
+ * A page of invoices.
1140
+ */
1141
+ export const zListBillingInvoicesResponse = zInvoicesResponse;
@@ -1,6 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { GetSuccessResponse } from "../util";
3
- import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData } from "../../sdk/types.gen";
3
+ import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, FetchLogsData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData } from "../../sdk/types.gen";
4
4
  export declare const useGetServiceHealth: (options?: Omit<GetServiceHealthData, "url"> & {
5
5
  enabled?: boolean;
6
6
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").HealthResponse | undefined, Error>;
@@ -125,6 +125,9 @@ export declare const useCreateProject: (config?: {
125
125
  export declare const useGetProjectOverview: (options: Omit<GetProjectOverviewData, "url"> & {
126
126
  enabled?: boolean;
127
127
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").ProjectOverview | undefined, Error>;
128
+ export declare const useFetchLogs: (options: Omit<FetchLogsData, "url"> & {
129
+ enabled?: boolean;
130
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Logs | undefined, Error>;
128
131
  export declare const useCreateEnvironment: (config?: {
129
132
  onSuccess?: (data: GetSuccessResponse<CreateEnvironmentResponses>) => void;
130
133
  onError?: Parameters<typeof useMutation>["0"]["onError"];
@@ -188,3 +191,6 @@ export declare const useGetBillingUsage: (options: Omit<GetBillingUsageData, "ur
188
191
  export declare const useFetchBillingPrices: (options: Omit<FetchBillingPricesData, "url"> & {
189
192
  enabled?: boolean;
190
193
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").PlanPriceResponse[] | undefined, Error>;
194
+ export declare const useListBillingInvoices: (options: Omit<ListBillingInvoicesData, "url"> & {
195
+ enabled?: boolean;
196
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").InvoicesResponse | undefined, Error>;
@@ -2,7 +2,7 @@
2
2
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
3
3
  import { isPromise } from "../util";
4
4
  import { useToken } from "../../provider/token-provider";
5
- import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, requestSignedUploadUrl, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, fetchLogs, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, requestSignedUploadUrl, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices } from "../../sdk/sdk.gen";
6
6
  export const useGetServiceHealth = (options) => {
7
7
  const token = useToken();
8
8
  let { enabled, ...rest } = options || { enabled: true };
@@ -647,6 +647,27 @@ export const useGetProjectOverview = (options) => {
647
647
  staleTime: 600000
648
648
  });
649
649
  };
650
+ export const useFetchLogs = (options) => {
651
+ const token = useToken();
652
+ let { enabled, ...rest } = options || { enabled: true };
653
+ const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/logs" };
654
+ const funcer = async () => {
655
+ const auth = isPromise(token) ? (await token) || "" : token || "";
656
+ if (isPromise(token) && !token)
657
+ return;
658
+ const res = await fetchLogs({ ...opts, ...rest, auth });
659
+ return res.data;
660
+ };
661
+ if (!token)
662
+ enabled = false;
663
+ return useQuery({
664
+ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, "logs", options.query ?? {}],
665
+ queryFn: funcer,
666
+ enabled,
667
+ retry: false,
668
+ staleTime: 600000
669
+ });
670
+ };
650
671
  export const useCreateEnvironment = (config) => {
651
672
  const token = useToken();
652
673
  const queryClient = useQueryClient();
@@ -944,3 +965,24 @@ export const useFetchBillingPrices = (options) => {
944
965
  staleTime: 600000
945
966
  });
946
967
  };
968
+ export const useListBillingInvoices = (options) => {
969
+ const token = useToken();
970
+ let { enabled, ...rest } = options || { enabled: true };
971
+ const opts = { throwOnError: true, url: "/auth/{spaceHandle}/billing/invoices" };
972
+ const funcer = async () => {
973
+ const auth = isPromise(token) ? (await token) || "" : token || "";
974
+ if (isPromise(token) && !token)
975
+ return;
976
+ const res = await listBillingInvoices({ ...opts, ...rest, auth });
977
+ return res.data;
978
+ };
979
+ if (!token)
980
+ enabled = false;
981
+ return useQuery({
982
+ queryKey: [options?.path?.spaceHandle, "billing", "invoices", options.query ?? {}],
983
+ queryFn: funcer,
984
+ enabled,
985
+ retry: false,
986
+ staleTime: 600000
987
+ });
988
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.119",
3
+ "version": "0.0.121",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",