shoal-web-sdk 1.0.13 → 1.0.15

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.
@@ -455,6 +455,9 @@ export declare const previewBlueprintQueryKey: (options: Options<PreviewBlueprin
455
455
  _infinite?: boolean;
456
456
  tags?: ReadonlyArray<string>;
457
457
  }];
458
+ /**
459
+ * Preview blueprints
460
+ */
458
461
  export declare const previewBlueprintOptions: (options: Options<PreviewBlueprintData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").Nodes, Error, import("../types.gen").Nodes, [Pick<Options<PreviewBlueprintData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
459
462
  _id: string;
460
463
  _infinite?: boolean;
@@ -480,6 +483,9 @@ export declare const viewBlueprintsQueryKey: (options?: Options<ViewBlueprintsDa
480
483
  _infinite?: boolean;
481
484
  tags?: ReadonlyArray<string>;
482
485
  }];
486
+ /**
487
+ * View all blueprints
488
+ */
483
489
  export declare const viewBlueprintsOptions: (options?: Options<ViewBlueprintsData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").PaginatedBlueprints, Error, import("../types.gen").PaginatedBlueprints, [Pick<Options<ViewBlueprintsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
484
490
  _id: string;
485
491
  _infinite?: boolean;
@@ -501,6 +507,9 @@ export declare const viewBlueprintsOptions: (options?: Options<ViewBlueprintsDat
501
507
  };
502
508
  };
503
509
  export declare const viewBlueprintsInfiniteQueryKey: (options?: Options<ViewBlueprintsData>) => QueryKey<Options<ViewBlueprintsData>>;
510
+ /**
511
+ * View all blueprints
512
+ */
504
513
  export declare const viewBlueprintsInfiniteOptions: (options?: Options<ViewBlueprintsData>) => import("@tanstack/react-query").UseInfiniteQueryOptions<import("../types.gen").PaginatedBlueprints, import("../types.gen").ErrorResponse, InfiniteData<import("../types.gen").PaginatedBlueprints, unknown>, QueryKey<Options<ViewBlueprintsData>>, number | Pick<Pick<Options<ViewBlueprintsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
505
514
  _id: string;
506
515
  _infinite?: boolean;
@@ -533,6 +533,9 @@ export const recordOnboardingAnalyticsMutation = (options) => {
533
533
  return mutationOptions;
534
534
  };
535
535
  export const previewBlueprintQueryKey = (options) => createQueryKey('previewBlueprint', options);
536
+ /**
537
+ * Preview blueprints
538
+ */
536
539
  export const previewBlueprintOptions = (options) => {
537
540
  return queryOptions({
538
541
  queryFn: async ({ queryKey, signal }) => {
@@ -548,6 +551,9 @@ export const previewBlueprintOptions = (options) => {
548
551
  });
549
552
  };
550
553
  export const viewBlueprintsQueryKey = (options) => createQueryKey('viewBlueprints', options);
554
+ /**
555
+ * View all blueprints
556
+ */
551
557
  export const viewBlueprintsOptions = (options) => {
552
558
  return queryOptions({
553
559
  queryFn: async ({ queryKey, signal }) => {
@@ -563,6 +569,9 @@ export const viewBlueprintsOptions = (options) => {
563
569
  });
564
570
  };
565
571
  export const viewBlueprintsInfiniteQueryKey = (options) => createQueryKey('viewBlueprints', options, true);
572
+ /**
573
+ * View all blueprints
574
+ */
566
575
  export const viewBlueprintsInfiniteOptions = (options) => {
567
576
  return infiniteQueryOptions(
568
577
  // @ts-ignore
@@ -95,7 +95,13 @@ export declare const createFeatureRequest: <ThrowOnError extends boolean = false
95
95
  * Record analytics data captured during the onboarding flow.
96
96
  */
97
97
  export declare const recordOnboardingAnalytics: <ThrowOnError extends boolean = false>(options: Options<RecordOnboardingAnalyticsData, ThrowOnError>) => import("./client").RequestResult<RecordOnboardingAnalyticsResponses, RecordOnboardingAnalyticsErrors, ThrowOnError, "fields">;
98
+ /**
99
+ * Preview blueprints
100
+ */
98
101
  export declare const previewBlueprint: <ThrowOnError extends boolean = false>(options: Options<PreviewBlueprintData, ThrowOnError>) => import("./client").RequestResult<PreviewBlueprintResponses, PreviewBlueprintErrors, ThrowOnError, "fields">;
102
+ /**
103
+ * View all blueprints
104
+ */
99
105
  export declare const viewBlueprints: <ThrowOnError extends boolean = false>(options?: Options<ViewBlueprintsData, ThrowOnError>) => import("./client").RequestResult<ViewBlueprintsResponses, ViewBlueprintsErrors, ThrowOnError, "fields">;
100
106
  /**
101
107
  * Retrieve a blueprint record.
@@ -356,6 +356,9 @@ export const recordOnboardingAnalytics = (options) => {
356
356
  }
357
357
  });
358
358
  };
359
+ /**
360
+ * Preview blueprints
361
+ */
359
362
  export const previewBlueprint = (options) => {
360
363
  return (options.client ?? client).get({
361
364
  security: [
@@ -368,6 +371,9 @@ export const previewBlueprint = (options) => {
368
371
  ...options
369
372
  });
370
373
  };
374
+ /**
375
+ * View all blueprints
376
+ */
371
377
  export const viewBlueprints = (options) => {
372
378
  return (options?.client ?? client).get({
373
379
  security: [
@@ -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, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateFeatureRequestData, CreateFeatureRequestResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, GetBlueprintData, CreateSpaceData, CreateSpaceResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, DeleteBlueprintData, DeleteBlueprintResponses, UpdateBlueprintData, UpdateBlueprintResponses, CreateBlueprintData, CreateBlueprintResponses, GetVersionData, ImportBlueprintData, ImportBlueprintResponses, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedDownloadUrlData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData, GetSpacePropertiesData, SetSpacePropertyData, SetSpacePropertyResponses } from "../../sdk/types.gen";
3
+ import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateFeatureRequestData, CreateFeatureRequestResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, PreviewBlueprintData, ViewBlueprintsData, GetBlueprintData, CreateSpaceData, CreateSpaceResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, DeleteBlueprintData, DeleteBlueprintResponses, UpdateBlueprintData, UpdateBlueprintResponses, CreateBlueprintData, CreateBlueprintResponses, GetVersionData, ImportBlueprintData, ImportBlueprintResponses, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedDownloadUrlData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData, GetSpacePropertiesData, SetSpacePropertyData, SetSpacePropertyResponses } 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>;
@@ -111,6 +111,12 @@ export declare const useRecordOnboardingAnalytics: (config?: {
111
111
  data: unknown;
112
112
  headers: Headers;
113
113
  }, unknown, Omit<RecordOnboardingAnalyticsData, "url">, unknown>;
114
+ export declare const usePreviewBlueprint: (options: Omit<PreviewBlueprintData, "url"> & {
115
+ enabled?: boolean;
116
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Nodes | undefined, Error>;
117
+ export declare const useViewBlueprints: (options?: Omit<ViewBlueprintsData, "url"> & {
118
+ enabled?: boolean;
119
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").PaginatedBlueprints | undefined, Error>;
114
120
  export declare const useGetBlueprint: (options: Omit<GetBlueprintData, "url"> & {
115
121
  enabled?: boolean;
116
122
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Blueprint | undefined, Error>;
@@ -2,7 +2,7 @@
2
2
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
3
3
  import { isPromise } from "../util";
4
4
  import { useToken } from "../../provider/token-provider";
5
- import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createFeatureRequest, recordOnboardingAnalytics, getBlueprint, createSpace, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, deleteBlueprint, updateBlueprint, createBlueprint, getVersion, importBlueprint, getGraphOverview, updateGraphState, deployVersion, requestSignedDownloadUrl, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices, getSpaceProperties, setSpaceProperty } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createFeatureRequest, recordOnboardingAnalytics, previewBlueprint, viewBlueprints, getBlueprint, createSpace, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, deleteBlueprint, updateBlueprint, createBlueprint, getVersion, importBlueprint, getGraphOverview, updateGraphState, deployVersion, requestSignedDownloadUrl, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices, getSpaceProperties, setSpaceProperty } from "../../sdk/sdk.gen";
6
6
  export const useGetServiceHealth = (options) => {
7
7
  const token = useToken();
8
8
  let { enabled, ...rest } = options || { enabled: true };
@@ -403,6 +403,48 @@ export const useRecordOnboardingAnalytics = (config) => {
403
403
  retry: config?.retry
404
404
  });
405
405
  };
406
+ export const usePreviewBlueprint = (options) => {
407
+ const token = useToken();
408
+ let { enabled, ...rest } = options || { enabled: true };
409
+ const opts = { throwOnError: true, url: "/blueprints/preview/{blueprint}" };
410
+ const funcer = async () => {
411
+ const auth = isPromise(token) ? (await token) || "" : token || "";
412
+ if (isPromise(token) && !token)
413
+ return;
414
+ const res = await previewBlueprint({ ...opts, ...rest, auth });
415
+ return res.data;
416
+ };
417
+ if (!token)
418
+ enabled = false;
419
+ return useQuery({
420
+ queryKey: ["blueprints", "preview", options?.path?.blueprint, options.query ?? {}],
421
+ queryFn: funcer,
422
+ enabled,
423
+ retry: false,
424
+ staleTime: 600000
425
+ });
426
+ };
427
+ export const useViewBlueprints = (options) => {
428
+ const token = useToken();
429
+ let { enabled, ...rest } = options || { enabled: true };
430
+ const opts = { throwOnError: true, url: "/blueprints/view" };
431
+ const funcer = async () => {
432
+ const auth = isPromise(token) ? (await token) || "" : token || "";
433
+ if (isPromise(token) && !token)
434
+ return;
435
+ const res = await viewBlueprints({ ...opts, ...rest, auth });
436
+ return res.data;
437
+ };
438
+ if (!token)
439
+ enabled = false;
440
+ return useQuery({
441
+ queryKey: ["blueprints", "view", options?.query ?? {}],
442
+ queryFn: funcer,
443
+ enabled,
444
+ retry: false,
445
+ staleTime: 600000
446
+ });
447
+ };
406
448
  export const useGetBlueprint = (options) => {
407
449
  const token = useToken();
408
450
  let { enabled, ...rest } = options || { enabled: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",