shoal-web-sdk 0.0.103 → 0.0.105

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, RequestSignedUploadUrlData, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, 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, 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;
@@ -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, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphState, updateUsername, updateUserProfile } 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.
@@ -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, 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, 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';
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
  */
@@ -316,6 +316,21 @@ export const getSpaceOverview = (options) => {
316
316
  ...options
317
317
  });
318
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
+ };
319
334
  /**
320
335
  * The space billing agreements.
321
336
  */
@@ -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;
@@ -1178,6 +1181,43 @@ export type GetSpaceOverviewResponses = {
1178
1181
  200: SpaceOverview;
1179
1182
  };
1180
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];
1181
1221
  export type FetchKindeOrganisationBillingAgreementsData = {
1182
1222
  body?: never;
1183
1223
  path: {
@@ -1730,6 +1770,10 @@ export type UpdateGraphStateErrors = {
1730
1770
  * Related content not found.
1731
1771
  */
1732
1772
  404: ErrorResponse;
1773
+ /**
1774
+ * Unprocessable graph state.
1775
+ */
1776
+ 422: ErrorResponse;
1733
1777
  /**
1734
1778
  * Unexpected error.
1735
1779
  */
@@ -1778,6 +1822,10 @@ export type DeployVersionErrors = {
1778
1822
  * Related content not found.
1779
1823
  */
1780
1824
  404: ErrorResponse;
1825
+ /**
1826
+ * Unprocessable entity.
1827
+ */
1828
+ 422: ErrorResponse;
1781
1829
  /**
1782
1830
  * Unexpected error.
1783
1831
  */
@@ -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;
@@ -1621,6 +1624,19 @@ export declare const zGetSpaceOverviewResponse: z.ZodObject<{
1621
1624
  }, z.core.$strip>>;
1622
1625
  }, z.core.$strip>>;
1623
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>;
1624
1640
  export declare const zFetchKindeOrganisationBillingAgreementsData: z.ZodObject<{
1625
1641
  body: z.ZodOptional<z.ZodNever>;
1626
1642
  path: z.ZodObject<{
@@ -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(),
@@ -737,6 +740,17 @@ export const zGetSpaceOverviewData = z.object({
737
740
  * A summary of the users space they are in.
738
741
  */
739
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;
740
754
  export const zFetchKindeOrganisationBillingAgreementsData = z.object({
741
755
  body: z.optional(z.never()),
742
756
  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, RequestSignedUploadUrlData, 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>;
@@ -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, requestSignedUploadUrl, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.103",
3
+ "version": "0.0.105",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",