shoal-web-sdk 0.0.130 → 0.0.132

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 { BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceError, BootstrapOnboardingWorkspaceResponse2, 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, 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, VersionStatusData } from '../types.gen';
3
+ import type { BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceError, BootstrapOnboardingWorkspaceResponse2, 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, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsError, 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, VersionStatusData } from '../types.gen';
4
4
  export type QueryKey<TOptions extends Options> = [
5
5
  Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
6
6
  _id: string;
@@ -416,6 +416,10 @@ export declare const listUserSpacesInfiniteOptions: (options?: Options<ListUserS
416
416
  * Create a default onboarding workspace, project, and main environment.
417
417
  */
418
418
  export declare const bootstrapOnboardingWorkspaceMutation: (options?: Partial<Options<BootstrapOnboardingWorkspaceData>>) => UseMutationOptions<BootstrapOnboardingWorkspaceResponse2, BootstrapOnboardingWorkspaceError, Options<BootstrapOnboardingWorkspaceData>>;
419
+ /**
420
+ * Record analytics data captured during the onboarding flow.
421
+ */
422
+ export declare const recordOnboardingAnalyticsMutation: (options?: Partial<Options<RecordOnboardingAnalyticsData>>) => UseMutationOptions<unknown, RecordOnboardingAnalyticsError, Options<RecordOnboardingAnalyticsData>>;
419
423
  /**
420
424
  * Create a space.
421
425
  */
@@ -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 { bootstrapOnboardingWorkspace, 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, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile, versionStatus } from '../sdk.gen';
4
+ import { bootstrapOnboardingWorkspace, 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, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, recordOnboardingAnalytics, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile, versionStatus } 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) {
@@ -472,6 +472,22 @@ export const bootstrapOnboardingWorkspaceMutation = (options) => {
472
472
  };
473
473
  return mutationOptions;
474
474
  };
475
+ /**
476
+ * Record analytics data captured during the onboarding flow.
477
+ */
478
+ export const recordOnboardingAnalyticsMutation = (options) => {
479
+ const mutationOptions = {
480
+ mutationFn: async (fnOptions) => {
481
+ const { data } = await recordOnboardingAnalytics({
482
+ ...options,
483
+ ...fnOptions,
484
+ throwOnError: true
485
+ });
486
+ return data;
487
+ }
488
+ };
489
+ return mutationOptions;
490
+ };
475
491
  /**
476
492
  * Create a space.
477
493
  */
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceErrors, BootstrapOnboardingWorkspaceResponses, 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, 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, VersionStatusData, VersionStatusErrors, VersionStatusResponses } from './types.gen';
2
+ import type { BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceErrors, BootstrapOnboardingWorkspaceResponses, 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, 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, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsErrors, RecordOnboardingAnalyticsResponses, 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, VersionStatusData, VersionStatusErrors, VersionStatusResponses } 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
@@ -85,6 +85,10 @@ export declare const listUserSpaces: <ThrowOnError extends boolean = false>(opti
85
85
  * Create a default onboarding workspace, project, and main environment.
86
86
  */
87
87
  export declare const bootstrapOnboardingWorkspace: <ThrowOnError extends boolean = false>(options: Options<BootstrapOnboardingWorkspaceData, ThrowOnError>) => import("./client").RequestResult<BootstrapOnboardingWorkspaceResponses, BootstrapOnboardingWorkspaceErrors, ThrowOnError, "fields">;
88
+ /**
89
+ * Record analytics data captured during the onboarding flow.
90
+ */
91
+ export declare const recordOnboardingAnalytics: <ThrowOnError extends boolean = false>(options: Options<RecordOnboardingAnalyticsData, ThrowOnError>) => import("./client").RequestResult<RecordOnboardingAnalyticsResponses, RecordOnboardingAnalyticsErrors, ThrowOnError, "fields">;
88
92
  /**
89
93
  * Create a space.
90
94
  */
@@ -290,6 +290,25 @@ export const bootstrapOnboardingWorkspace = (options) => {
290
290
  }
291
291
  });
292
292
  };
293
+ /**
294
+ * Record analytics data captured during the onboarding flow.
295
+ */
296
+ export const recordOnboardingAnalytics = (options) => {
297
+ return (options.client ?? client).post({
298
+ security: [
299
+ {
300
+ scheme: 'bearer',
301
+ type: 'http'
302
+ }
303
+ ],
304
+ url: '/auth/onboarding/analytics',
305
+ ...options,
306
+ headers: {
307
+ 'Content-Type': 'application/json',
308
+ ...options.headers
309
+ }
310
+ });
311
+ };
293
312
  /**
294
313
  * Create a space.
295
314
  */
@@ -63,6 +63,20 @@ export type CreateEnvironment = {
63
63
  handle: string;
64
64
  description?: string;
65
65
  };
66
+ export type OnboardingAnalytics = {
67
+ /**
68
+ * The user's occupational role.
69
+ */
70
+ occupation?: string;
71
+ /**
72
+ * The size of the user's company or team.
73
+ */
74
+ companySize?: string;
75
+ /**
76
+ * How the user heard about Shoal.
77
+ */
78
+ referralSource?: string;
79
+ };
66
80
  export type BootstrapOnboardingWorkspace = {
67
81
  /**
68
82
  * Seed value used to derive default onboarding names and handles.
@@ -351,7 +365,7 @@ export type ContainerNodeProps = {
351
365
  minInstances?: number;
352
366
  concurrency?: number;
353
367
  allowUnauthenticated?: boolean;
354
- uri: string;
368
+ uri?: string;
355
369
  installationId?: string;
356
370
  env?: {
357
371
  [key: string]: string;
@@ -1246,6 +1260,37 @@ export type BootstrapOnboardingWorkspaceResponses = {
1246
1260
  201: BootstrapOnboardingWorkspaceResponse;
1247
1261
  };
1248
1262
  export type BootstrapOnboardingWorkspaceResponse2 = BootstrapOnboardingWorkspaceResponses[keyof BootstrapOnboardingWorkspaceResponses];
1263
+ export type RecordOnboardingAnalyticsData = {
1264
+ body: OnboardingAnalytics;
1265
+ path?: never;
1266
+ query?: never;
1267
+ url: '/auth/onboarding/analytics';
1268
+ };
1269
+ export type RecordOnboardingAnalyticsErrors = {
1270
+ /**
1271
+ * Bad request.
1272
+ */
1273
+ 400: ErrorResponse;
1274
+ /**
1275
+ * Unauthorised user.
1276
+ */
1277
+ 401: ErrorResponse;
1278
+ /**
1279
+ * Invalid credentials.
1280
+ */
1281
+ 403: ErrorResponse;
1282
+ /**
1283
+ * Unexpected error.
1284
+ */
1285
+ 500: ErrorResponse;
1286
+ };
1287
+ export type RecordOnboardingAnalyticsError = RecordOnboardingAnalyticsErrors[keyof RecordOnboardingAnalyticsErrors];
1288
+ export type RecordOnboardingAnalyticsResponses = {
1289
+ /**
1290
+ * Analytics data recorded.
1291
+ */
1292
+ 202: unknown;
1293
+ };
1249
1294
  export type CreateSpaceData = {
1250
1295
  body: CreateSpace;
1251
1296
  path?: never;
@@ -115,6 +115,11 @@ export declare const zCreateEnvironment: z.ZodObject<{
115
115
  handle: z.ZodString;
116
116
  description: z.ZodOptional<z.ZodString>;
117
117
  }, z.core.$strip>;
118
+ export declare const zOnboardingAnalytics: z.ZodObject<{
119
+ occupation: z.ZodOptional<z.ZodString>;
120
+ companySize: z.ZodOptional<z.ZodString>;
121
+ referralSource: z.ZodOptional<z.ZodString>;
122
+ }, z.core.$strip>;
118
123
  export declare const zBootstrapOnboardingWorkspace: z.ZodObject<{
119
124
  seed: z.ZodString;
120
125
  }, z.core.$strip>;
@@ -635,7 +640,7 @@ export declare const zContainerNodeProps: z.ZodObject<{
635
640
  minInstances: z.ZodOptional<z.ZodInt>;
636
641
  concurrency: z.ZodOptional<z.ZodInt>;
637
642
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
638
- uri: z.ZodString;
643
+ uri: z.ZodOptional<z.ZodString>;
639
644
  installationId: z.ZodOptional<z.ZodString>;
640
645
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
641
646
  }, z.core.$strip>;
@@ -764,7 +769,7 @@ export declare const zNode: z.ZodObject<{
764
769
  minInstances: z.ZodOptional<z.ZodInt>;
765
770
  concurrency: z.ZodOptional<z.ZodInt>;
766
771
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
767
- uri: z.ZodString;
772
+ uri: z.ZodOptional<z.ZodString>;
768
773
  installationId: z.ZodOptional<z.ZodString>;
769
774
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
770
775
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -918,7 +923,7 @@ export declare const zNodes: z.ZodObject<{
918
923
  minInstances: z.ZodOptional<z.ZodInt>;
919
924
  concurrency: z.ZodOptional<z.ZodInt>;
920
925
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
921
- uri: z.ZodString;
926
+ uri: z.ZodOptional<z.ZodString>;
922
927
  installationId: z.ZodOptional<z.ZodString>;
923
928
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
924
929
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1074,7 +1079,7 @@ export declare const zGraph: z.ZodObject<{
1074
1079
  minInstances: z.ZodOptional<z.ZodInt>;
1075
1080
  concurrency: z.ZodOptional<z.ZodInt>;
1076
1081
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
1077
- uri: z.ZodString;
1082
+ uri: z.ZodOptional<z.ZodString>;
1078
1083
  installationId: z.ZodOptional<z.ZodString>;
1079
1084
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1080
1085
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1422,7 +1427,7 @@ export declare const zFetchGraphM2mResponse: z.ZodObject<{
1422
1427
  minInstances: z.ZodOptional<z.ZodInt>;
1423
1428
  concurrency: z.ZodOptional<z.ZodInt>;
1424
1429
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
1425
- uri: z.ZodString;
1430
+ uri: z.ZodOptional<z.ZodString>;
1426
1431
  installationId: z.ZodOptional<z.ZodString>;
1427
1432
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1428
1433
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1578,7 +1583,7 @@ export declare const zUpdateGraphM2mData: z.ZodObject<{
1578
1583
  minInstances: z.ZodOptional<z.ZodInt>;
1579
1584
  concurrency: z.ZodOptional<z.ZodInt>;
1580
1585
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
1581
- uri: z.ZodString;
1586
+ uri: z.ZodOptional<z.ZodString>;
1582
1587
  installationId: z.ZodOptional<z.ZodString>;
1583
1588
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1584
1589
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1748,7 +1753,7 @@ export declare const zFetchNodeM2mResponse: z.ZodObject<{
1748
1753
  minInstances: z.ZodOptional<z.ZodInt>;
1749
1754
  concurrency: z.ZodOptional<z.ZodInt>;
1750
1755
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
1751
- uri: z.ZodString;
1756
+ uri: z.ZodOptional<z.ZodString>;
1752
1757
  installationId: z.ZodOptional<z.ZodString>;
1753
1758
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1754
1759
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -2042,6 +2047,15 @@ export declare const zBootstrapOnboardingWorkspaceResponse2: z.ZodObject<{
2042
2047
  handle: z.ZodString;
2043
2048
  }, z.core.$strip>;
2044
2049
  }, z.core.$strip>;
2050
+ export declare const zRecordOnboardingAnalyticsData: z.ZodObject<{
2051
+ body: z.ZodObject<{
2052
+ occupation: z.ZodOptional<z.ZodString>;
2053
+ companySize: z.ZodOptional<z.ZodString>;
2054
+ referralSource: z.ZodOptional<z.ZodString>;
2055
+ }, z.core.$strip>;
2056
+ path: z.ZodOptional<z.ZodNever>;
2057
+ query: z.ZodOptional<z.ZodNever>;
2058
+ }, z.core.$strip>;
2045
2059
  export declare const zCreateSpaceData: z.ZodObject<{
2046
2060
  body: z.ZodObject<{
2047
2061
  name: z.ZodString;
@@ -2520,7 +2534,7 @@ export declare const zGetGraphOverviewResponse: z.ZodObject<{
2520
2534
  minInstances: z.ZodOptional<z.ZodInt>;
2521
2535
  concurrency: z.ZodOptional<z.ZodInt>;
2522
2536
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
2523
- uri: z.ZodString;
2537
+ uri: z.ZodOptional<z.ZodString>;
2524
2538
  installationId: z.ZodOptional<z.ZodString>;
2525
2539
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2526
2540
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -2676,7 +2690,7 @@ export declare const zUpdateGraphStateData: z.ZodObject<{
2676
2690
  minInstances: z.ZodOptional<z.ZodInt>;
2677
2691
  concurrency: z.ZodOptional<z.ZodInt>;
2678
2692
  allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
2679
- uri: z.ZodString;
2693
+ uri: z.ZodOptional<z.ZodString>;
2680
2694
  installationId: z.ZodOptional<z.ZodString>;
2681
2695
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2682
2696
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -85,6 +85,11 @@ export const zCreateEnvironment = z.object({
85
85
  handle: z.string(),
86
86
  description: z.optional(z.string())
87
87
  });
88
+ export const zOnboardingAnalytics = z.object({
89
+ occupation: z.optional(z.string()),
90
+ companySize: z.optional(z.string()),
91
+ referralSource: z.optional(z.string())
92
+ });
88
93
  export const zBootstrapOnboardingWorkspace = z.object({
89
94
  seed: z.string()
90
95
  });
@@ -408,7 +413,7 @@ export const zContainerNodeProps = z.object({
408
413
  minInstances: z.optional(z.int()),
409
414
  concurrency: z.optional(z.int()),
410
415
  allowUnauthenticated: z.optional(z.boolean()),
411
- uri: z.string(),
416
+ uri: z.optional(z.string()),
412
417
  installationId: z.optional(z.string()),
413
418
  env: z.optional(z.record(z.string(), z.string()))
414
419
  });
@@ -802,6 +807,11 @@ export const zBootstrapOnboardingWorkspaceData = z.object({
802
807
  * Successfully bootstrapped onboarding resources.
803
808
  */
804
809
  export const zBootstrapOnboardingWorkspaceResponse2 = zBootstrapOnboardingWorkspaceResponse;
810
+ export const zRecordOnboardingAnalyticsData = z.object({
811
+ body: zOnboardingAnalytics,
812
+ path: z.optional(z.never()),
813
+ query: z.optional(z.never())
814
+ });
805
815
  export const zCreateSpaceData = z.object({
806
816
  body: zCreateSpace,
807
817
  path: z.optional(z.never()),
@@ -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, BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceResponses, 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, VersionStatusData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData } 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, BootstrapOnboardingWorkspaceData, BootstrapOnboardingWorkspaceResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, 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, VersionStatusData, 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>;
@@ -71,6 +71,11 @@ export declare const useBootstrapOnboardingWorkspace: (config?: {
71
71
  onError?: Parameters<typeof useMutation>["0"]["onError"];
72
72
  retry?: boolean;
73
73
  }) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").BootstrapOnboardingWorkspaceResponse | undefined, unknown, Omit<BootstrapOnboardingWorkspaceData, "url">, unknown>;
74
+ export declare const useRecordOnboardingAnalytics: (config?: {
75
+ onSuccess?: (data: GetSuccessResponse<RecordOnboardingAnalyticsResponses>) => void;
76
+ onError?: Parameters<typeof useMutation>["0"]["onError"];
77
+ retry?: boolean;
78
+ }) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<RecordOnboardingAnalyticsData, "url">, unknown>;
74
79
  export declare const useCreateSpace: (config?: {
75
80
  onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>) => void;
76
81
  onError?: Parameters<typeof useMutation>["0"]["onError"];
@@ -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, bootstrapOnboardingWorkspace, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, versionStatus, requestSignedUploadUrl, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, bootstrapOnboardingWorkspace, recordOnboardingAnalytics, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, versionStatus, 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 };
@@ -365,6 +365,25 @@ export const useBootstrapOnboardingWorkspace = (config) => {
365
365
  retry: config?.retry
366
366
  });
367
367
  };
368
+ export const useRecordOnboardingAnalytics = (config) => {
369
+ const token = useToken();
370
+ const queryClient = useQueryClient();
371
+ const opts = { throwOnError: true, url: "/auth/onboarding/analytics" };
372
+ const funcer = async (options) => {
373
+ const auth = isPromise(token) ? (await token) || "" : token || "";
374
+ const res = await recordOnboardingAnalytics({ ...opts, ...options, auth });
375
+ return res?.data;
376
+ };
377
+ return useMutation({
378
+ mutationFn: funcer,
379
+ onSuccess: (res, options, c, ctx) => {
380
+ queryClient.invalidateQueries({ queryKey: ["onboarding", "analytics"] });
381
+ config?.onSuccess && config.onSuccess(res);
382
+ },
383
+ onError: config?.onError,
384
+ retry: config?.retry
385
+ });
386
+ };
368
387
  export const useCreateSpace = (config) => {
369
388
  const token = useToken();
370
389
  const queryClient = useQueryClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",