shoal-web-sdk 0.0.102 → 0.0.104

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, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError, UploadNodeSourceZipData, UploadNodeSourceZipError, UploadNodeSourceZipResponse } 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, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, 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;
@@ -472,6 +472,34 @@ export declare const getSpaceOverviewOptions: (options: Options<GetSpaceOverview
472
472
  [dataTagErrorSymbol]: Error;
473
473
  };
474
474
  };
475
+ export declare const getSpaceOrgCodeQueryKey: (options: Options<GetSpaceOrgCodeData>) => [Pick<Options<GetSpaceOrgCodeData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
476
+ _id: string;
477
+ _infinite?: boolean;
478
+ tags?: ReadonlyArray<string>;
479
+ }];
480
+ /**
481
+ * The space organisation code.
482
+ */
483
+ export declare const getSpaceOrgCodeOptions: (options: Options<GetSpaceOrgCodeData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").SpaceOrgCodeResponse, Error, import("../types.gen").SpaceOrgCodeResponse, [Pick<Options<GetSpaceOrgCodeData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
484
+ _id: string;
485
+ _infinite?: boolean;
486
+ tags?: ReadonlyArray<string>;
487
+ }]>, "queryFn"> & {
488
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").SpaceOrgCodeResponse, [Pick<Options<GetSpaceOrgCodeData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
489
+ _id: string;
490
+ _infinite?: boolean;
491
+ tags?: ReadonlyArray<string>;
492
+ }], never> | undefined;
493
+ } & {
494
+ queryKey: [Pick<Options<GetSpaceOrgCodeData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
495
+ _id: string;
496
+ _infinite?: boolean;
497
+ tags?: ReadonlyArray<string>;
498
+ }] & {
499
+ [dataTagSymbol]: import("../types.gen").SpaceOrgCodeResponse;
500
+ [dataTagErrorSymbol]: Error;
501
+ };
502
+ };
475
503
  export declare const fetchKindeOrganisationBillingAgreementsQueryKey: (options: Options<FetchKindeOrganisationBillingAgreementsData>) => [Pick<Options<FetchKindeOrganisationBillingAgreementsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
476
504
  _id: string;
477
505
  _infinite?: boolean;
@@ -744,13 +772,34 @@ export declare const updateGraphStateMutation: (options?: Partial<Options<Update
744
772
  * Trigger a deployment for a version inside an environment.
745
773
  */
746
774
  export declare const deployVersionMutation: (options?: Partial<Options<DeployVersionData>>) => UseMutationOptions<unknown, DeployVersionError, Options<DeployVersionData>>;
775
+ export declare const requestSignedUploadUrlQueryKey: (options: Options<RequestSignedUploadUrlData>) => [Pick<Options<RequestSignedUploadUrlData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
776
+ _id: string;
777
+ _infinite?: boolean;
778
+ tags?: ReadonlyArray<string>;
779
+ }];
747
780
  /**
748
- * Upload a source code ZIP for a node in a graph version.
749
- *
750
- * Uploads a single ZIP file (max 5 MB, .zip only) associated with a node in a project/env/version.
751
- *
781
+ * Request a signed upload URL to upload source code zip files.
752
782
  */
753
- export declare const uploadNodeSourceZipMutation: (options?: Partial<Options<UploadNodeSourceZipData>>) => UseMutationOptions<UploadNodeSourceZipResponse, UploadNodeSourceZipError, Options<UploadNodeSourceZipData>>;
783
+ export declare const requestSignedUploadUrlOptions: (options: Options<RequestSignedUploadUrlData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").SignedUrlUploadResponse, Error, import("../types.gen").SignedUrlUploadResponse, [Pick<Options<RequestSignedUploadUrlData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
784
+ _id: string;
785
+ _infinite?: boolean;
786
+ tags?: ReadonlyArray<string>;
787
+ }]>, "queryFn"> & {
788
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").SignedUrlUploadResponse, [Pick<Options<RequestSignedUploadUrlData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
789
+ _id: string;
790
+ _infinite?: boolean;
791
+ tags?: ReadonlyArray<string>;
792
+ }], never> | undefined;
793
+ } & {
794
+ queryKey: [Pick<Options<RequestSignedUploadUrlData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
795
+ _id: string;
796
+ _infinite?: boolean;
797
+ tags?: ReadonlyArray<string>;
798
+ }] & {
799
+ [dataTagSymbol]: import("../types.gen").SignedUrlUploadResponse;
800
+ [dataTagErrorSymbol]: Error;
801
+ };
802
+ };
754
803
  export declare const getBillingPlanQueryKey: (options: Options<GetBillingPlanData>) => [Pick<Options<GetBillingPlanData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
755
804
  _id: string;
756
805
  _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 { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphState, updateUsername, updateUserProfile, uploadNodeSourceZip } from '../sdk.gen';
4
+ import { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, 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) {
@@ -533,6 +533,24 @@ export const getSpaceOverviewOptions = (options) => {
533
533
  queryKey: getSpaceOverviewQueryKey(options)
534
534
  });
535
535
  };
536
+ export const getSpaceOrgCodeQueryKey = (options) => createQueryKey('getSpaceOrgCode', options);
537
+ /**
538
+ * The space organisation code.
539
+ */
540
+ export const getSpaceOrgCodeOptions = (options) => {
541
+ return queryOptions({
542
+ queryFn: async ({ queryKey, signal }) => {
543
+ const { data } = await getSpaceOrgCode({
544
+ ...options,
545
+ ...queryKey[0],
546
+ signal,
547
+ throwOnError: true
548
+ });
549
+ return data;
550
+ },
551
+ queryKey: getSpaceOrgCodeQueryKey(options)
552
+ });
553
+ };
536
554
  export const fetchKindeOrganisationBillingAgreementsQueryKey = (options) => createQueryKey('fetchKindeOrganisationBillingAgreements', options);
537
555
  /**
538
556
  * The space billing agreements.
@@ -825,24 +843,23 @@ export const deployVersionMutation = (options) => {
825
843
  };
826
844
  return mutationOptions;
827
845
  };
846
+ export const requestSignedUploadUrlQueryKey = (options) => createQueryKey('requestSignedUploadUrl', options);
828
847
  /**
829
- * Upload a source code ZIP for a node in a graph version.
830
- *
831
- * Uploads a single ZIP file (max 5 MB, .zip only) associated with a node in a project/env/version.
832
- *
848
+ * Request a signed upload URL to upload source code zip files.
833
849
  */
834
- export const uploadNodeSourceZipMutation = (options) => {
835
- const mutationOptions = {
836
- mutationFn: async (fnOptions) => {
837
- const { data } = await uploadNodeSourceZip({
850
+ export const requestSignedUploadUrlOptions = (options) => {
851
+ return queryOptions({
852
+ queryFn: async ({ queryKey, signal }) => {
853
+ const { data } = await requestSignedUploadUrl({
838
854
  ...options,
839
- ...fnOptions,
855
+ ...queryKey[0],
856
+ signal,
840
857
  throwOnError: true
841
858
  });
842
859
  return data;
843
- }
844
- };
845
- return mutationOptions;
860
+ },
861
+ queryKey: requestSignedUploadUrlQueryKey(options)
862
+ });
846
863
  };
847
864
  export const getBillingPlanQueryKey = (options) => createQueryKey('getBillingPlan', options);
848
865
  /**
@@ -1,5 +1,5 @@
1
- import { type Client, type Options as Options2, type 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, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, 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, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses, UploadNodeSourceZipData, UploadNodeSourceZipErrors, UploadNodeSourceZipResponses } from './types.gen';
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, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, 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, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, 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
@@ -93,6 +93,10 @@ export declare const rejectSpaceInvite: <ThrowOnError extends boolean = false>(o
93
93
  * The space overview.
94
94
  */
95
95
  export declare const getSpaceOverview: <ThrowOnError extends boolean = false>(options: Options<GetSpaceOverviewData, ThrowOnError>) => import("./client").RequestResult<GetSpaceOverviewResponses, GetSpaceOverviewErrors, ThrowOnError, "fields">;
96
+ /**
97
+ * The space organisation code.
98
+ */
99
+ export declare const getSpaceOrgCode: <ThrowOnError extends boolean = false>(options: Options<GetSpaceOrgCodeData, ThrowOnError>) => import("./client").RequestResult<GetSpaceOrgCodeResponses, GetSpaceOrgCodeErrors, ThrowOnError, "fields">;
96
100
  /**
97
101
  * The space billing agreements.
98
102
  */
@@ -150,12 +154,9 @@ export declare const updateGraphState: <ThrowOnError extends boolean = false>(op
150
154
  */
151
155
  export declare const deployVersion: <ThrowOnError extends boolean = false>(options: Options<DeployVersionData, ThrowOnError>) => import("./client").RequestResult<DeployVersionResponses, DeployVersionErrors, ThrowOnError, "fields">;
152
156
  /**
153
- * Upload a source code ZIP for a node in a graph version.
154
- *
155
- * Uploads a single ZIP file (max 5 MB, .zip only) associated with a node in a project/env/version.
156
- *
157
+ * Request a signed upload URL to upload source code zip files.
157
158
  */
158
- export declare const uploadNodeSourceZip: <ThrowOnError extends boolean = false>(options: Options<UploadNodeSourceZipData, ThrowOnError>) => import("./client").RequestResult<UploadNodeSourceZipResponses, UploadNodeSourceZipErrors, ThrowOnError, "fields">;
159
+ export declare const requestSignedUploadUrl: <ThrowOnError extends boolean = false>(options: Options<RequestSignedUploadUrlData, ThrowOnError>) => import("./client").RequestResult<RequestSignedUploadUrlResponses, RequestSignedUploadUrlErrors, ThrowOnError, "fields">;
159
160
  /**
160
161
  * Get the current billing plan for a space.
161
162
  */
@@ -1,5 +1,4 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- import { formDataBodySerializer } from './client';
3
2
  import { client } from './client.gen';
4
3
  /**
5
4
  * Get service health.
@@ -317,6 +316,21 @@ export const getSpaceOverview = (options) => {
317
316
  ...options
318
317
  });
319
318
  };
319
+ /**
320
+ * The space organisation code.
321
+ */
322
+ export const getSpaceOrgCode = (options) => {
323
+ return (options.client ?? client).get({
324
+ security: [
325
+ {
326
+ scheme: 'bearer',
327
+ type: 'http'
328
+ }
329
+ ],
330
+ url: '/auth/{spaceHandle}/org-code',
331
+ ...options
332
+ });
333
+ };
320
334
  /**
321
335
  * The space billing agreements.
322
336
  */
@@ -544,26 +558,18 @@ export const deployVersion = (options) => {
544
558
  });
545
559
  };
546
560
  /**
547
- * Upload a source code ZIP for a node in a graph version.
548
- *
549
- * Uploads a single ZIP file (max 5 MB, .zip only) associated with a node in a project/env/version.
550
- *
561
+ * Request a signed upload URL to upload source code zip files.
551
562
  */
552
- export const uploadNodeSourceZip = (options) => {
553
- return (options.client ?? client).post({
554
- ...formDataBodySerializer,
563
+ export const requestSignedUploadUrl = (options) => {
564
+ return (options.client ?? client).get({
555
565
  security: [
556
566
  {
557
567
  scheme: 'bearer',
558
568
  type: 'http'
559
569
  }
560
570
  ],
561
- url: '/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/source-zip',
562
- ...options,
563
- headers: {
564
- 'Content-Type': null,
565
- ...options.headers
566
- }
571
+ url: '/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/signed-upload-url',
572
+ ...options
567
573
  });
568
574
  };
569
575
  /**
@@ -60,6 +60,9 @@ export type SpaceOverview = {
60
60
  handle: string;
61
61
  projects: Array<ProjectOverview>;
62
62
  };
63
+ export type SpaceOrgCodeResponse = {
64
+ orgCode: string;
65
+ };
63
66
  export type EnvironmentOverview = {
64
67
  id: string;
65
68
  name: string;
@@ -343,20 +346,9 @@ export type ProxyNodeProps = {
343
346
  export type VmNodeProps = {
344
347
  os?: string;
345
348
  };
346
- export type NodeSourceUploadResponse = {
347
- fileName: string;
348
- /**
349
- * File size in bytes.
350
- */
351
- size: number;
352
- /**
353
- * The GCS path within the bucket.
354
- */
355
- bucketPath: string;
356
- /**
357
- * The MIME type of the file.
358
- */
359
- contentType?: string;
349
+ export type SignedUrlUploadResponse = {
350
+ signedUrl: string;
351
+ expiration: string;
360
352
  };
361
353
  export type BillingPlan = {
362
354
  tier: 'free' | 'hobby' | 'pro';
@@ -387,6 +379,10 @@ export type BillingUsage = {
387
379
  * Expiry query.
388
380
  */
389
381
  export type Expired = boolean;
382
+ /**
383
+ * The node ID this source ZIP is associated with.
384
+ */
385
+ export type NodeUuid = string;
390
386
  /**
391
387
  * An invite UUID.
392
388
  */
@@ -1185,6 +1181,43 @@ export type GetSpaceOverviewResponses = {
1185
1181
  200: SpaceOverview;
1186
1182
  };
1187
1183
  export type GetSpaceOverviewResponse = GetSpaceOverviewResponses[keyof GetSpaceOverviewResponses];
1184
+ export type GetSpaceOrgCodeData = {
1185
+ body?: never;
1186
+ path: {
1187
+ /**
1188
+ * The space handle. This must be globally unique.
1189
+ */
1190
+ spaceHandle: string;
1191
+ };
1192
+ query?: never;
1193
+ url: '/auth/{spaceHandle}/org-code';
1194
+ };
1195
+ export type GetSpaceOrgCodeErrors = {
1196
+ /**
1197
+ * Unauthorised user.
1198
+ */
1199
+ 401: ErrorResponse;
1200
+ /**
1201
+ * Invalid credentials.
1202
+ */
1203
+ 403: ErrorResponse;
1204
+ /**
1205
+ * Related content not found.
1206
+ */
1207
+ 404: ErrorResponse;
1208
+ /**
1209
+ * Unexpected error.
1210
+ */
1211
+ 500: ErrorResponse;
1212
+ };
1213
+ export type GetSpaceOrgCodeError = GetSpaceOrgCodeErrors[keyof GetSpaceOrgCodeErrors];
1214
+ export type GetSpaceOrgCodeResponses = {
1215
+ /**
1216
+ * The organisation code for this space.
1217
+ */
1218
+ 200: SpaceOrgCodeResponse;
1219
+ };
1220
+ export type GetSpaceOrgCodeResponse = GetSpaceOrgCodeResponses[keyof GetSpaceOrgCodeResponses];
1188
1221
  export type FetchKindeOrganisationBillingAgreementsData = {
1189
1222
  body?: never;
1190
1223
  path: {
@@ -1797,13 +1830,8 @@ export type DeployVersionResponses = {
1797
1830
  */
1798
1831
  202: unknown;
1799
1832
  };
1800
- export type UploadNodeSourceZipData = {
1801
- body: {
1802
- /**
1803
- * The ZIP file to upload (max 5 MB, .zip only).
1804
- */
1805
- file: Blob | File;
1806
- };
1833
+ export type RequestSignedUploadUrlData = {
1834
+ body?: never;
1807
1835
  path: {
1808
1836
  /**
1809
1837
  * The space handle. This must be globally unique.
@@ -1827,11 +1855,11 @@ export type UploadNodeSourceZipData = {
1827
1855
  nodeUUID: string;
1828
1856
  };
1829
1857
  query?: never;
1830
- url: '/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/source-zip';
1858
+ url: '/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/signed-upload-url';
1831
1859
  };
1832
- export type UploadNodeSourceZipErrors = {
1860
+ export type RequestSignedUploadUrlErrors = {
1833
1861
  /**
1834
- * Invalid request parameters or invalid ZIP file.
1862
+ * Invalid request parameters.
1835
1863
  */
1836
1864
  400: ErrorResponse;
1837
1865
  /**
@@ -1842,23 +1870,19 @@ export type UploadNodeSourceZipErrors = {
1842
1870
  * Invalid credentials.
1843
1871
  */
1844
1872
  403: ErrorResponse;
1845
- /**
1846
- * Uploaded file is too large.
1847
- */
1848
- 413: ErrorResponse;
1849
1873
  /**
1850
1874
  * Unexpected error.
1851
1875
  */
1852
1876
  500: ErrorResponse;
1853
1877
  };
1854
- export type UploadNodeSourceZipError = UploadNodeSourceZipErrors[keyof UploadNodeSourceZipErrors];
1855
- export type UploadNodeSourceZipResponses = {
1878
+ export type RequestSignedUploadUrlError = RequestSignedUploadUrlErrors[keyof RequestSignedUploadUrlErrors];
1879
+ export type RequestSignedUploadUrlResponses = {
1856
1880
  /**
1857
- * Source ZIP uploaded successfully.
1881
+ * A successfully generated signed url.
1858
1882
  */
1859
- 201: NodeSourceUploadResponse;
1883
+ 200: SignedUrlUploadResponse;
1860
1884
  };
1861
- export type UploadNodeSourceZipResponse = UploadNodeSourceZipResponses[keyof UploadNodeSourceZipResponses];
1885
+ export type RequestSignedUploadUrlResponse = RequestSignedUploadUrlResponses[keyof RequestSignedUploadUrlResponses];
1862
1886
  export type GetBillingPlanData = {
1863
1887
  body?: never;
1864
1888
  path: {
@@ -77,6 +77,9 @@ export declare const zCreateEnvironment: z.ZodObject<{
77
77
  handle: z.ZodString;
78
78
  description: z.ZodOptional<z.ZodString>;
79
79
  }, z.core.$strip>;
80
+ export declare const zSpaceOrgCodeResponse: z.ZodObject<{
81
+ orgCode: z.ZodString;
82
+ }, z.core.$strip>;
80
83
  export declare const zEnvironmentOverview: z.ZodObject<{
81
84
  id: z.ZodUUID;
82
85
  name: z.ZodString;
@@ -1004,11 +1007,9 @@ export declare const zGraph: z.ZodObject<{
1004
1007
  }, z.core.$strip>>]>>;
1005
1008
  }, z.core.$strip>>;
1006
1009
  }, z.core.$strip>;
1007
- export declare const zNodeSourceUploadResponse: z.ZodObject<{
1008
- fileName: z.ZodString;
1009
- size: z.ZodCoercedBigInt<unknown>;
1010
- bucketPath: z.ZodString;
1011
- contentType: z.ZodOptional<z.ZodString>;
1010
+ export declare const zSignedUrlUploadResponse: z.ZodObject<{
1011
+ signedUrl: z.ZodString;
1012
+ expiration: z.ZodISODateTime;
1012
1013
  }, z.core.$strip>;
1013
1014
  export declare const zBillingPlan: z.ZodObject<{
1014
1015
  tier: z.ZodEnum<{
@@ -1050,6 +1051,10 @@ export declare const zBillingUsage: z.ZodObject<{
1050
1051
  * Expiry query.
1051
1052
  */
1052
1053
  export declare const zExpired: z.ZodBoolean;
1054
+ /**
1055
+ * The node ID this source ZIP is associated with.
1056
+ */
1057
+ export declare const zNodeUuid: z.ZodUUID;
1053
1058
  /**
1054
1059
  * An invite UUID.
1055
1060
  */
@@ -1619,6 +1624,19 @@ export declare const zGetSpaceOverviewResponse: z.ZodObject<{
1619
1624
  }, z.core.$strip>>;
1620
1625
  }, z.core.$strip>>;
1621
1626
  }, z.core.$strip>;
1627
+ export declare const zGetSpaceOrgCodeData: z.ZodObject<{
1628
+ body: z.ZodOptional<z.ZodNever>;
1629
+ path: z.ZodObject<{
1630
+ spaceHandle: z.ZodString;
1631
+ }, z.core.$strip>;
1632
+ query: z.ZodOptional<z.ZodNever>;
1633
+ }, z.core.$strip>;
1634
+ /**
1635
+ * The organisation code for this space.
1636
+ */
1637
+ export declare const zGetSpaceOrgCodeResponse: z.ZodObject<{
1638
+ orgCode: z.ZodString;
1639
+ }, z.core.$strip>;
1622
1640
  export declare const zFetchKindeOrganisationBillingAgreementsData: z.ZodObject<{
1623
1641
  body: z.ZodOptional<z.ZodNever>;
1624
1642
  path: z.ZodObject<{
@@ -2170,10 +2188,8 @@ export declare const zDeployVersionData: z.ZodObject<{
2170
2188
  }, z.core.$strip>;
2171
2189
  query: z.ZodOptional<z.ZodNever>;
2172
2190
  }, z.core.$strip>;
2173
- export declare const zUploadNodeSourceZipData: z.ZodObject<{
2174
- body: z.ZodObject<{
2175
- file: z.ZodString;
2176
- }, z.core.$strip>;
2191
+ export declare const zRequestSignedUploadUrlData: z.ZodObject<{
2192
+ body: z.ZodOptional<z.ZodNever>;
2177
2193
  path: z.ZodObject<{
2178
2194
  spaceHandle: z.ZodString;
2179
2195
  projectHandle: z.ZodString;
@@ -2184,13 +2200,11 @@ export declare const zUploadNodeSourceZipData: z.ZodObject<{
2184
2200
  query: z.ZodOptional<z.ZodNever>;
2185
2201
  }, z.core.$strip>;
2186
2202
  /**
2187
- * Source ZIP uploaded successfully.
2203
+ * A successfully generated signed url.
2188
2204
  */
2189
- export declare const zUploadNodeSourceZipResponse: z.ZodObject<{
2190
- fileName: z.ZodString;
2191
- size: z.ZodCoercedBigInt<unknown>;
2192
- bucketPath: z.ZodString;
2193
- contentType: z.ZodOptional<z.ZodString>;
2205
+ export declare const zRequestSignedUploadUrlResponse: z.ZodObject<{
2206
+ signedUrl: z.ZodString;
2207
+ expiration: z.ZodISODateTime;
2194
2208
  }, z.core.$strip>;
2195
2209
  export declare const zGetBillingPlanData: z.ZodObject<{
2196
2210
  body: z.ZodOptional<z.ZodNever>;
@@ -56,6 +56,9 @@ export const zCreateEnvironment = z.object({
56
56
  handle: z.string(),
57
57
  description: z.optional(z.string())
58
58
  });
59
+ export const zSpaceOrgCodeResponse = z.object({
60
+ orgCode: z.string()
61
+ });
59
62
  export const zEnvironmentOverview = z.object({
60
63
  id: z.uuid(),
61
64
  name: z.string(),
@@ -423,11 +426,9 @@ export const zGraph = z.object({
423
426
  versionUUID: z.uuid(),
424
427
  nodes: z.array(zNode)
425
428
  });
426
- export const zNodeSourceUploadResponse = z.object({
427
- fileName: z.string(),
428
- size: z.coerce.bigint(),
429
- bucketPath: z.string(),
430
- contentType: z.optional(z.string())
429
+ export const zSignedUrlUploadResponse = z.object({
430
+ signedUrl: z.string(),
431
+ expiration: z.iso.datetime()
431
432
  });
432
433
  export const zBillingPlan = z.object({
433
434
  tier: z.enum([
@@ -469,6 +470,10 @@ export const zBillingUsage = z.object({
469
470
  * Expiry query.
470
471
  */
471
472
  export const zExpired = z.boolean();
473
+ /**
474
+ * The node ID this source ZIP is associated with.
475
+ */
476
+ export const zNodeUuid = z.uuid();
472
477
  /**
473
478
  * An invite UUID.
474
479
  */
@@ -735,6 +740,17 @@ export const zGetSpaceOverviewData = z.object({
735
740
  * A summary of the users space they are in.
736
741
  */
737
742
  export const zGetSpaceOverviewResponse = zSpaceOverview;
743
+ export const zGetSpaceOrgCodeData = z.object({
744
+ body: z.optional(z.never()),
745
+ path: z.object({
746
+ spaceHandle: z.string()
747
+ }),
748
+ query: z.optional(z.never())
749
+ });
750
+ /**
751
+ * The organisation code for this space.
752
+ */
753
+ export const zGetSpaceOrgCodeResponse = zSpaceOrgCodeResponse;
738
754
  export const zFetchKindeOrganisationBillingAgreementsData = z.object({
739
755
  body: z.optional(z.never()),
740
756
  path: z.object({
@@ -895,10 +911,8 @@ export const zDeployVersionData = z.object({
895
911
  }),
896
912
  query: z.optional(z.never())
897
913
  });
898
- export const zUploadNodeSourceZipData = z.object({
899
- body: z.object({
900
- file: z.string()
901
- }),
914
+ export const zRequestSignedUploadUrlData = z.object({
915
+ body: z.optional(z.never()),
902
916
  path: z.object({
903
917
  spaceHandle: z.string(),
904
918
  projectHandle: z.string(),
@@ -909,9 +923,9 @@ export const zUploadNodeSourceZipData = z.object({
909
923
  query: z.optional(z.never())
910
924
  });
911
925
  /**
912
- * Source ZIP uploaded successfully.
926
+ * A successfully generated signed url.
913
927
  */
914
- export const zUploadNodeSourceZipResponse = zNodeSourceUploadResponse;
928
+ export const zRequestSignedUploadUrlResponse = zSignedUrlUploadResponse;
915
929
  export const zGetBillingPlanData = z.object({
916
930
  body: z.optional(z.never()),
917
931
  path: z.object({
@@ -1,6 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { GetSuccessResponse } from "../util";
3
- import { GetServiceHealthData, FetchGraphM2mData, 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, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, UploadNodeSourceZipData, UploadNodeSourceZipResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData } from "../../sdk/types.gen";
3
+ import { GetServiceHealthData, FetchGraphM2mData, 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, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData } 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>;
@@ -79,6 +79,9 @@ export declare const useRejectSpaceInvite: (config?: {
79
79
  export declare const useGetSpaceOverview: (options: Omit<GetSpaceOverviewData, "url"> & {
80
80
  enabled?: boolean;
81
81
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpaceOverview | undefined, Error>;
82
+ export declare const useGetSpaceOrgCode: (options: Omit<GetSpaceOrgCodeData, "url"> & {
83
+ enabled?: boolean;
84
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpaceOrgCodeResponse | undefined, Error>;
82
85
  export declare const useFetchKindeOrganisationBillingAgreements: (options: Omit<FetchKindeOrganisationBillingAgreementsData, "url"> & {
83
86
  enabled?: boolean;
84
87
  }) => import("@tanstack/react-query").UseQueryResult<unknown, Error>;
@@ -135,11 +138,9 @@ export declare const useDeployVersion: (config?: {
135
138
  onError?: Parameters<typeof useMutation>["0"]["onError"];
136
139
  retry?: boolean;
137
140
  }) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<DeployVersionData, "url">, unknown>;
138
- export declare const useUploadNodeSourceZip: (config?: {
139
- onSuccess?: (data: GetSuccessResponse<UploadNodeSourceZipResponses>) => void;
140
- onError?: Parameters<typeof useMutation>["0"]["onError"];
141
- retry?: boolean;
142
- }) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").NodeSourceUploadResponse | undefined, unknown, Omit<UploadNodeSourceZipData, "url">, unknown>;
141
+ export declare const useRequestSignedUploadUrl: (options: Omit<RequestSignedUploadUrlData, "url"> & {
142
+ enabled?: boolean;
143
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SignedUrlUploadResponse | undefined, Error>;
143
144
  export declare const useGetBillingPlan: (options: Omit<GetBillingPlanData, "url"> & {
144
145
  enabled?: boolean;
145
146
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").BillingPlan | 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, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, uploadNodeSourceZip, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, fetchGraphM2M, 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, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage } from "../../sdk/sdk.gen";
6
6
  export const useGetServiceHealth = (options) => {
7
7
  const token = useToken();
8
8
  let { enabled, ...rest } = options || { enabled: true };
@@ -405,6 +405,27 @@ export const useGetSpaceOverview = (options) => {
405
405
  staleTime: 600000
406
406
  });
407
407
  };
408
+ export const useGetSpaceOrgCode = (options) => {
409
+ const token = useToken();
410
+ let { enabled, ...rest } = options || { enabled: true };
411
+ const opts = { throwOnError: true, url: "/auth/{spaceHandle}/org-code" };
412
+ const funcer = async () => {
413
+ const auth = isPromise(token) ? (await token) || "" : token || "";
414
+ if (isPromise(token) && !token)
415
+ return;
416
+ const res = await getSpaceOrgCode({ ...opts, ...rest, auth });
417
+ return res.data;
418
+ };
419
+ if (!token)
420
+ enabled = false;
421
+ return useQuery({
422
+ queryKey: [options?.path?.spaceHandle, "org-code", options.query ?? {}],
423
+ queryFn: funcer,
424
+ enabled,
425
+ retry: false,
426
+ staleTime: 600000
427
+ });
428
+ };
408
429
  export const useFetchKindeOrganisationBillingAgreements = (options) => {
409
430
  const token = useToken();
410
431
  let { enabled, ...rest } = options || { enabled: true };
@@ -685,23 +706,25 @@ export const useDeployVersion = (config) => {
685
706
  retry: config?.retry
686
707
  });
687
708
  };
688
- export const useUploadNodeSourceZip = (config) => {
709
+ export const useRequestSignedUploadUrl = (options) => {
689
710
  const token = useToken();
690
- const queryClient = useQueryClient();
691
- const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/source-zip" };
692
- const funcer = async (options) => {
711
+ let { enabled, ...rest } = options || { enabled: true };
712
+ const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/graph/nodes/{nodeUUID}/signed-upload-url" };
713
+ const funcer = async () => {
693
714
  const auth = isPromise(token) ? (await token) || "" : token || "";
694
- const res = await uploadNodeSourceZip({ ...opts, ...options, auth });
695
- return res?.data;
715
+ if (isPromise(token) && !token)
716
+ return;
717
+ const res = await requestSignedUploadUrl({ ...opts, ...rest, auth });
718
+ return res.data;
696
719
  };
697
- return useMutation({
698
- mutationFn: funcer,
699
- onSuccess: (res, options, c, ctx) => {
700
- queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, options?.path?.version, "graph", "nodes", options?.path?.nodeUUID, "source-zip"] });
701
- config?.onSuccess && config.onSuccess(res);
702
- },
703
- onError: config?.onError,
704
- retry: config?.retry
720
+ if (!token)
721
+ enabled = false;
722
+ return useQuery({
723
+ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, options?.path?.version, "graph", "nodes", options?.path?.nodeUUID, "signed-upload-url", options.query ?? {}],
724
+ queryFn: funcer,
725
+ enabled,
726
+ retry: false,
727
+ staleTime: 600000
705
728
  });
706
729
  };
707
730
  export const useGetBillingPlan = (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",