shoal-web-sdk 1.0.84 → 1.0.86
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.
- package/dist/sdk/@tanstack/react-query.gen.d.ts +15 -43
- package/dist/sdk/@tanstack/react-query.gen.js +11 -29
- package/dist/sdk/billing/@tanstack/react-query.gen.d.ts +50 -3
- package/dist/sdk/billing/@tanstack/react-query.gen.js +64 -3
- package/dist/sdk/billing/sdk.gen.d.ts +26 -3
- package/dist/sdk/billing/sdk.gen.js +74 -10
- package/dist/sdk/billing/types.gen.d.ts +161 -10
- package/dist/sdk/billing/zod.gen.d.ts +803 -13
- package/dist/sdk/billing/zod.gen.js +84 -3
- package/dist/sdk/sdk.gen.d.ts +3 -7
- package/dist/sdk/sdk.gen.js +3 -22
- package/dist/sdk/types.gen.d.ts +28 -61
- package/dist/sdk/zod.gen.d.ts +32 -37
- package/dist/sdk/zod.gen.js +19 -19
- package/dist/tanstack-codegen/generated/billing.d.ts +224 -1
- package/dist/tanstack-codegen/generated/billing.js +77 -17
- package/dist/tanstack-codegen/generated/generated.d.ts +21 -228
- package/dist/tanstack-codegen/generated/generated.js +5 -27
- package/package.json +1 -1
|
@@ -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 { CheckSubdomainUniquenessData, CloneEnvironmentData, CloneEnvironmentError, CloneEnvironmentResponse, CreateApiKeyData, CreateApiKeyError, CreateApiKeyResponse2, CreateBlueprintData, CreateBlueprintError, CreateBlueprintResponse, CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateEnvironmentVariableData, CreateEnvironmentVariableError, CreateFeatureRequestData, CreateFeatureRequestError, CreateNeonBranchData, CreateNeonBranchError, CreateNeonBranchResponse, CreateNeonDatabaseData, CreateNeonDatabaseError, CreateNeonDatabaseResponse, CreateNeonProjectData, CreateNeonProjectError, CreateNeonProjectM2mData, CreateNeonProjectM2mError, CreateNeonProjectM2mResponse, CreateNeonProjectResponse, CreateNodeCredentialData, CreateNodeCredentialError, CreateNodeCredentialResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSecretData, CreateSecretError, CreateSecretM2mData, CreateSecretM2mError, CreateSecretM2mResponse, CreateSecretResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeleteBlueprintData, DeleteBlueprintError, DeleteBlueprintResponse, DeleteEnvironmentData, DeleteEnvironmentError, DeleteEnvironmentM2mData, DeleteEnvironmentM2mError, DeleteEnvironmentM2mResponse, DeleteEnvironmentResponse, DeleteEnvironmentVariableData, DeleteEnvironmentVariableError, DeleteEnvironmentVariableResponse, DeleteNeonDatabaseData, DeleteNeonDatabaseError, DeleteNeonDatabaseResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchMongoOrganizationsData, FetchMongoOrganizationTierData, FetchMongoRegionsData, FetchNeonConnectionUriData, FetchNeonOrganizationsData, FetchNeonRegionsData, FetchNodeM2mData, GetApiKeysData, GetBillingPlanData, GetBillingUsageData, GetBlueprintData, GetBlueprintM2mData, GetConnectedAppUrlData,
|
|
3
|
+
import type { CheckSubdomainUniquenessData, CloneEnvironmentData, CloneEnvironmentError, CloneEnvironmentResponse, CreateApiKeyData, CreateApiKeyError, CreateApiKeyResponse2, CreateBlueprintData, CreateBlueprintError, CreateBlueprintResponse, CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateEnvironmentVariableData, CreateEnvironmentVariableError, CreateFeatureRequestData, CreateFeatureRequestError, CreateNeonBranchData, CreateNeonBranchError, CreateNeonBranchResponse, CreateNeonDatabaseData, CreateNeonDatabaseError, CreateNeonDatabaseResponse, CreateNeonProjectData, CreateNeonProjectError, CreateNeonProjectM2mData, CreateNeonProjectM2mError, CreateNeonProjectM2mResponse, CreateNeonProjectResponse, CreateNodeCredentialData, CreateNodeCredentialError, CreateNodeCredentialResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSecretData, CreateSecretError, CreateSecretM2mData, CreateSecretM2mError, CreateSecretM2mResponse, CreateSecretResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeleteBlueprintData, DeleteBlueprintError, DeleteBlueprintResponse, DeleteEnvironmentData, DeleteEnvironmentError, DeleteEnvironmentM2mData, DeleteEnvironmentM2mError, DeleteEnvironmentM2mResponse, DeleteEnvironmentResponse, DeleteEnvironmentVariableData, DeleteEnvironmentVariableError, DeleteEnvironmentVariableResponse, DeleteNeonDatabaseData, DeleteNeonDatabaseError, DeleteNeonDatabaseResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchMongoOrganizationsData, FetchMongoOrganizationTierData, FetchMongoRegionsData, FetchNeonConnectionUriData, FetchNeonOrganizationsData, FetchNeonRegionsData, FetchNodeM2mData, GetApiKeysData, GetBillingPlanData, GetBillingUsageData, GetBlueprintData, GetBlueprintM2mData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetEnvironmentVariablesData, GetEnvironmentVariablesM2mData, GetEnvironmentVersionsData, GetFeatureFlagsData, GetGraphOverviewData, GetNodeEnvironmentVariablesData, GetProjectEnvironmentsData, GetProjectOverviewData, GetPublicInviteData, GetSecretValueData, GetServiceHealthData, GetSoftDeletedEnvironmentsM2mData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetSpacePropertiesData, GetSpaceStatsData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, GetVersionData, GetVersionM2mData, ImportBlueprintData, ImportBlueprintError, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListMongoClustersData, ListMongoProjectsData, ListNeonBranchesData, ListNeonDatabasesData, ListNeonProjectsData, ListNeonRolesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, LookupApiKeyData, NukeEnvironmentM2mData, NukeEnvironmentM2mError, NukeEnvironmentM2mResponse, PingNodeData, PreviewBlueprintData, RecordCloudUsageData, RecordCloudUsageError, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedDownloadUrlData, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeApiKeyData, RevokeApiKeyError, RevokeApiKeyResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, SetEnvironmentGcpProjectIdData, SetEnvironmentGcpProjectIdError, SetSpacePropertyData, SetSpacePropertyError, UpdateBillingPlanData, UpdateBillingPlanError, UpdateBlueprintData, UpdateBlueprintError, UpdateBlueprintResponse, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateDeploymentStatusM2mData, UpdateDeploymentStatusM2mError, UpdateEnvironmentVariableData, UpdateEnvironmentVariableError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateNodeM2mData, UpdateNodeM2mError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError, ViewBlueprintsData, ViewBlueprintsM2mData } from '../types.gen';
|
|
4
4
|
export type QueryKey<TOptions extends Options> = [
|
|
5
5
|
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
6
6
|
_id: string;
|
|
@@ -36,55 +36,55 @@ export declare const getServiceHealthOptions: (options?: Options<GetServiceHealt
|
|
|
36
36
|
[dataTagErrorSymbol]: Error;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
export declare const
|
|
39
|
+
export declare const getSoftDeletedEnvironmentsM2mQueryKey: (options?: Options<GetSoftDeletedEnvironmentsM2mData>) => [Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
40
40
|
_id: string;
|
|
41
41
|
_infinite?: boolean;
|
|
42
42
|
tags?: ReadonlyArray<string>;
|
|
43
43
|
}];
|
|
44
44
|
/**
|
|
45
|
-
* Get paginated environments,
|
|
45
|
+
* Get paginated environments that are scheduled for deletion and whose deletion schedule has already elapsed, oldest schedule first. Each entry carries the project and owning organisation it belongs to, so it can be purged without a further lookup.
|
|
46
46
|
*/
|
|
47
|
-
export declare const
|
|
47
|
+
export declare const getSoftDeletedEnvironmentsM2mOptions: (options?: Options<GetSoftDeletedEnvironmentsM2mData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").PaginatedSoftDeletedEnvironments, Error, import("../types.gen").PaginatedSoftDeletedEnvironments, [Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
48
48
|
_id: string;
|
|
49
49
|
_infinite?: boolean;
|
|
50
50
|
tags?: ReadonlyArray<string>;
|
|
51
51
|
}]>, "queryFn"> & {
|
|
52
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").
|
|
52
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").PaginatedSoftDeletedEnvironments, [Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
53
53
|
_id: string;
|
|
54
54
|
_infinite?: boolean;
|
|
55
55
|
tags?: ReadonlyArray<string>;
|
|
56
56
|
}], never> | undefined;
|
|
57
57
|
} & {
|
|
58
|
-
queryKey: [Pick<Options<
|
|
58
|
+
queryKey: [Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
59
59
|
_id: string;
|
|
60
60
|
_infinite?: boolean;
|
|
61
61
|
tags?: ReadonlyArray<string>;
|
|
62
62
|
}] & {
|
|
63
|
-
[dataTagSymbol]: import("../types.gen").
|
|
63
|
+
[dataTagSymbol]: import("../types.gen").PaginatedSoftDeletedEnvironments;
|
|
64
64
|
[dataTagErrorSymbol]: Error;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
export declare const
|
|
67
|
+
export declare const getSoftDeletedEnvironmentsM2mInfiniteQueryKey: (options?: Options<GetSoftDeletedEnvironmentsM2mData>) => QueryKey<Options<GetSoftDeletedEnvironmentsM2mData>>;
|
|
68
68
|
/**
|
|
69
|
-
* Get paginated environments,
|
|
69
|
+
* Get paginated environments that are scheduled for deletion and whose deletion schedule has already elapsed, oldest schedule first. Each entry carries the project and owning organisation it belongs to, so it can be purged without a further lookup.
|
|
70
70
|
*/
|
|
71
|
-
export declare const
|
|
71
|
+
export declare const getSoftDeletedEnvironmentsM2mInfiniteOptions: (options?: Options<GetSoftDeletedEnvironmentsM2mData>) => import("@tanstack/react-query").UseInfiniteQueryOptions<import("../types.gen").PaginatedSoftDeletedEnvironments, import("../types.gen").ErrorResponse, InfiniteData<import("../types.gen").PaginatedSoftDeletedEnvironments, unknown>, QueryKey<Options<GetSoftDeletedEnvironmentsM2mData>>, number | Pick<Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
72
72
|
_id: string;
|
|
73
73
|
_infinite?: boolean;
|
|
74
74
|
tags?: ReadonlyArray<string>;
|
|
75
75
|
}, "query" | "body" | "headers" | "path">> & {
|
|
76
|
-
initialData: InfiniteData<import("../types.gen").
|
|
76
|
+
initialData: InfiniteData<import("../types.gen").PaginatedSoftDeletedEnvironments, number | Pick<Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
77
77
|
_id: string;
|
|
78
78
|
_infinite?: boolean;
|
|
79
79
|
tags?: ReadonlyArray<string>;
|
|
80
|
-
}, "query" | "body" | "headers" | "path">> | (() => InfiniteData<import("../types.gen").
|
|
80
|
+
}, "query" | "body" | "headers" | "path">> | (() => InfiniteData<import("../types.gen").PaginatedSoftDeletedEnvironments, number | Pick<Pick<Options<GetSoftDeletedEnvironmentsM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
81
81
|
_id: string;
|
|
82
82
|
_infinite?: boolean;
|
|
83
83
|
tags?: ReadonlyArray<string>;
|
|
84
84
|
}, "query" | "body" | "headers" | "path">>) | undefined;
|
|
85
85
|
} & {
|
|
86
|
-
queryKey: QueryKey<Options<
|
|
87
|
-
[dataTagSymbol]: InfiniteData<import("../types.gen").
|
|
86
|
+
queryKey: QueryKey<Options<GetSoftDeletedEnvironmentsM2mData>> & {
|
|
87
|
+
[dataTagSymbol]: InfiniteData<import("../types.gen").PaginatedSoftDeletedEnvironments, unknown>;
|
|
88
88
|
[dataTagErrorSymbol]: import("../types.gen").ErrorResponse;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
@@ -114,39 +114,11 @@ export declare const getEnvironmentVariablesM2mOptions: (options: Options<GetEnv
|
|
|
114
114
|
[dataTagErrorSymbol]: Error;
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
export declare const getEnvironmentMetadataM2mQueryKey: (options: Options<GetEnvironmentMetadataM2mData>) => [Pick<Options<GetEnvironmentMetadataM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
118
|
-
_id: string;
|
|
119
|
-
_infinite?: boolean;
|
|
120
|
-
tags?: ReadonlyArray<string>;
|
|
121
|
-
}];
|
|
122
|
-
/**
|
|
123
|
-
* Get the project and owning organisation an environment belongs to.
|
|
124
|
-
*/
|
|
125
|
-
export declare const getEnvironmentMetadataM2mOptions: (options: Options<GetEnvironmentMetadataM2mData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").EnvironmentMetadata, Error, import("../types.gen").EnvironmentMetadata, [Pick<Options<GetEnvironmentMetadataM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
126
|
-
_id: string;
|
|
127
|
-
_infinite?: boolean;
|
|
128
|
-
tags?: ReadonlyArray<string>;
|
|
129
|
-
}]>, "queryFn"> & {
|
|
130
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").EnvironmentMetadata, [Pick<Options<GetEnvironmentMetadataM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
131
|
-
_id: string;
|
|
132
|
-
_infinite?: boolean;
|
|
133
|
-
tags?: ReadonlyArray<string>;
|
|
134
|
-
}], never> | undefined;
|
|
135
|
-
} & {
|
|
136
|
-
queryKey: [Pick<Options<GetEnvironmentMetadataM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
137
|
-
_id: string;
|
|
138
|
-
_infinite?: boolean;
|
|
139
|
-
tags?: ReadonlyArray<string>;
|
|
140
|
-
}] & {
|
|
141
|
-
[dataTagSymbol]: import("../types.gen").EnvironmentMetadata;
|
|
142
|
-
[dataTagErrorSymbol]: Error;
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
117
|
export declare const setEnvironmentGcpProjectIdMutation: (options?: Partial<Options<SetEnvironmentGcpProjectIdData>>) => UseMutationOptions<unknown, SetEnvironmentGcpProjectIdError, Options<SetEnvironmentGcpProjectIdData>>;
|
|
146
118
|
/**
|
|
147
119
|
* Permanently delete an environment that is scheduled for deletion and whose deletion schedule has elapsed.
|
|
148
120
|
*/
|
|
149
|
-
export declare const nukeEnvironmentM2mMutation: (options?: Partial<Options<NukeEnvironmentM2mData>>) => UseMutationOptions<
|
|
121
|
+
export declare const nukeEnvironmentM2mMutation: (options?: Partial<Options<NukeEnvironmentM2mData>>) => UseMutationOptions<NukeEnvironmentM2mResponse, NukeEnvironmentM2mError, Options<NukeEnvironmentM2mData>>;
|
|
150
122
|
export declare const getVersionM2mQueryKey: (options: Options<GetVersionM2mData>) => [Pick<Options<GetVersionM2mData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
151
123
|
_id: string;
|
|
152
124
|
_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 { checkSubdomainUniqueness, cloneEnvironment, createApiKey, createBlueprint, createEnvironment, createEnvironmentVariable, createFeatureRequest, createNeonBranch, createNeonDatabase, createNeonProject, createNeonProjectM2M, createNodeCredential, createProject, createSecret, createSecretM2M, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deleteBlueprint, deleteEnvironment, deleteEnvironmentM2M, deleteEnvironmentVariable, deleteNeonDatabase, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchMongoOrganizations, fetchMongoOrganizationTier, fetchMongoRegions, fetchNeonConnectionUri, fetchNeonOrganizations, fetchNeonRegions, fetchNodeM2M, getApiKeys, getBillingPlan, getBillingUsage, getBlueprint, getBlueprintM2M, getConnectedAppUrl,
|
|
4
|
+
import { checkSubdomainUniqueness, cloneEnvironment, createApiKey, createBlueprint, createEnvironment, createEnvironmentVariable, createFeatureRequest, createNeonBranch, createNeonDatabase, createNeonProject, createNeonProjectM2M, createNodeCredential, createProject, createSecret, createSecretM2M, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deleteBlueprint, deleteEnvironment, deleteEnvironmentM2M, deleteEnvironmentVariable, deleteNeonDatabase, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchMongoOrganizations, fetchMongoOrganizationTier, fetchMongoRegions, fetchNeonConnectionUri, fetchNeonOrganizations, fetchNeonRegions, fetchNodeM2M, getApiKeys, getBillingPlan, getBillingUsage, getBlueprint, getBlueprintM2M, getConnectedAppUrl, getEnvironmentOverview, getEnvironmentVariables, getEnvironmentVariablesM2M, getEnvironmentVersions, getFeatureFlags, getGraphOverview, getNodeEnvironmentVariables, getProjectEnvironments, getProjectOverview, getPublicInvite, getSecretValue, getServiceHealth, getSoftDeletedEnvironmentsM2M, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getSpaceProperties, getSpaceStats, getUserIdentities, getUserInvites, getUserProfile, getVersion, getVersionM2M, importBlueprint, joinSpace, leaveSpace, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listMongoClusters, listMongoProjects, listNeonBranches, listNeonDatabases, listNeonProjects, listNeonRoles, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, lookupApiKey, nukeEnvironmentM2M, pingNode, previewBlueprint, recordCloudUsage, recordOnboardingAnalytics, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedDownloadUrl, requestSignedUploadUrl, revokeApiKey, revokeSpaceInvite, setDefaultPaymentMethod, setEnvironmentGcpProjectId, setSpaceProperty, updateBillingPlan, updateBlueprint, updateConnectedAppToken, updateDeploymentStatusM2M, updateEnvironmentVariable, updateGraphM2M, updateGraphState, updateNodeM2M, updateUsername, updateUserProfile, viewBlueprints, viewBlueprintsM2M } 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) {
|
|
@@ -44,14 +44,14 @@ export const getServiceHealthOptions = (options) => {
|
|
|
44
44
|
queryKey: getServiceHealthQueryKey(options)
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
export const
|
|
47
|
+
export const getSoftDeletedEnvironmentsM2mQueryKey = (options) => createQueryKey('getSoftDeletedEnvironmentsM2M', options);
|
|
48
48
|
/**
|
|
49
|
-
* Get paginated environments,
|
|
49
|
+
* Get paginated environments that are scheduled for deletion and whose deletion schedule has already elapsed, oldest schedule first. Each entry carries the project and owning organisation it belongs to, so it can be purged without a further lookup.
|
|
50
50
|
*/
|
|
51
|
-
export const
|
|
51
|
+
export const getSoftDeletedEnvironmentsM2mOptions = (options) => {
|
|
52
52
|
return queryOptions({
|
|
53
53
|
queryFn: async ({ queryKey, signal }) => {
|
|
54
|
-
const { data } = await
|
|
54
|
+
const { data } = await getSoftDeletedEnvironmentsM2M({
|
|
55
55
|
...options,
|
|
56
56
|
...queryKey[0],
|
|
57
57
|
signal,
|
|
@@ -59,7 +59,7 @@ export const getEnvironmentsM2mOptions = (options) => {
|
|
|
59
59
|
});
|
|
60
60
|
return data;
|
|
61
61
|
},
|
|
62
|
-
queryKey:
|
|
62
|
+
queryKey: getSoftDeletedEnvironmentsM2mQueryKey(options)
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
const createInfiniteParams = (queryKey, page) => {
|
|
@@ -92,11 +92,11 @@ const createInfiniteParams = (queryKey, page) => {
|
|
|
92
92
|
}
|
|
93
93
|
return params;
|
|
94
94
|
};
|
|
95
|
-
export const
|
|
95
|
+
export const getSoftDeletedEnvironmentsM2mInfiniteQueryKey = (options) => createQueryKey('getSoftDeletedEnvironmentsM2M', options, true);
|
|
96
96
|
/**
|
|
97
|
-
* Get paginated environments,
|
|
97
|
+
* Get paginated environments that are scheduled for deletion and whose deletion schedule has already elapsed, oldest schedule first. Each entry carries the project and owning organisation it belongs to, so it can be purged without a further lookup.
|
|
98
98
|
*/
|
|
99
|
-
export const
|
|
99
|
+
export const getSoftDeletedEnvironmentsM2mInfiniteOptions = (options) => {
|
|
100
100
|
return infiniteQueryOptions(
|
|
101
101
|
// @ts-ignore
|
|
102
102
|
{
|
|
@@ -108,7 +108,7 @@ export const getEnvironmentsM2mInfiniteOptions = (options) => {
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
const params = createInfiniteParams(queryKey, page);
|
|
111
|
-
const { data } = await
|
|
111
|
+
const { data } = await getSoftDeletedEnvironmentsM2M({
|
|
112
112
|
...options,
|
|
113
113
|
...params,
|
|
114
114
|
signal,
|
|
@@ -116,7 +116,7 @@ export const getEnvironmentsM2mInfiniteOptions = (options) => {
|
|
|
116
116
|
});
|
|
117
117
|
return data;
|
|
118
118
|
},
|
|
119
|
-
queryKey:
|
|
119
|
+
queryKey: getSoftDeletedEnvironmentsM2mInfiniteQueryKey(options)
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
export const deleteEnvironmentM2mMutation = (options) => {
|
|
@@ -147,24 +147,6 @@ export const getEnvironmentVariablesM2mOptions = (options) => {
|
|
|
147
147
|
queryKey: getEnvironmentVariablesM2mQueryKey(options)
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
export const getEnvironmentMetadataM2mQueryKey = (options) => createQueryKey('getEnvironmentMetadataM2M', options);
|
|
151
|
-
/**
|
|
152
|
-
* Get the project and owning organisation an environment belongs to.
|
|
153
|
-
*/
|
|
154
|
-
export const getEnvironmentMetadataM2mOptions = (options) => {
|
|
155
|
-
return queryOptions({
|
|
156
|
-
queryFn: async ({ queryKey, signal }) => {
|
|
157
|
-
const { data } = await getEnvironmentMetadataM2M({
|
|
158
|
-
...options,
|
|
159
|
-
...queryKey[0],
|
|
160
|
-
signal,
|
|
161
|
-
throwOnError: true
|
|
162
|
-
});
|
|
163
|
-
return data;
|
|
164
|
-
},
|
|
165
|
-
queryKey: getEnvironmentMetadataM2mQueryKey(options)
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
150
|
export const setEnvironmentGcpProjectIdMutation = (options) => {
|
|
169
151
|
const mutationOptions = {
|
|
170
152
|
mutationFn: async (fnOptions) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UseMutationOptions } from '@tanstack/react-query';
|
|
2
2
|
import { type Options } from '../sdk.gen';
|
|
3
|
-
import type { CreateCustomerData, CreateCustomerError, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, DeletePaymentMethodData, DeletePaymentMethodError, DeletePaymentMethodResponse, GetCustomerData, GetInvoicesData, GetPlansData, UpdateDefaultPaymentMethodData, UpdateDefaultPaymentMethodError, UpdateDefaultPaymentMethodResponse, UpdatePlanData, UpdatePlanError } from '../types.gen';
|
|
3
|
+
import type { CreateCustomerData, CreateCustomerError, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, DeletePaymentMethodData, DeletePaymentMethodError, DeletePaymentMethodResponse, GetCustomerData, GetInvoicesData, GetPlansData, M2mCreateCustomerData, M2mCreateCustomerError, M2mGetCustomerData, M2mUpdatePlanData, M2mUpdatePlanError, UpdateDefaultPaymentMethodData, UpdateDefaultPaymentMethodError, UpdateDefaultPaymentMethodResponse, UpdatePlanData, UpdatePlanError } from '../types.gen';
|
|
4
4
|
export type QueryKey<TOptions extends Options> = [
|
|
5
5
|
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
6
6
|
_id: string;
|
|
@@ -46,6 +46,8 @@ export declare const getCustomerQueryKey: (options?: Options<GetCustomerData>) =
|
|
|
46
46
|
tags?: ReadonlyArray<string>;
|
|
47
47
|
}];
|
|
48
48
|
/**
|
|
49
|
+
* Fetch all related customer information.
|
|
50
|
+
*
|
|
49
51
|
* Returns the account's current (and pending, if any) plan plus renewal/schedule dates, fetched live
|
|
50
52
|
* from the Stripe subscription rather than only the Account record — a customer can be grandfathered
|
|
51
53
|
* onto a price that no longer matches plan-configuration.yaml, so Stripe's subscription metadata is
|
|
@@ -73,14 +75,18 @@ export declare const getCustomerOptions: (options?: Options<GetCustomerData>) =>
|
|
|
73
75
|
};
|
|
74
76
|
};
|
|
75
77
|
/**
|
|
76
|
-
* Creates a stripe customer with a stripe subscription
|
|
78
|
+
* Creates a stripe customer with a stripe subscription
|
|
79
|
+
*
|
|
80
|
+
* This instantiates an account record in our database with
|
|
77
81
|
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
78
82
|
* webhook is received.
|
|
79
83
|
*
|
|
80
84
|
*/
|
|
81
85
|
export declare const createCustomerMutation: (options?: Partial<Options<CreateCustomerData>>) => UseMutationOptions<unknown, CreateCustomerError, Options<CreateCustomerData>>;
|
|
82
86
|
/**
|
|
83
|
-
* Creates a Stripe SetupIntent
|
|
87
|
+
* Creates a Stripe SetupIntent.
|
|
88
|
+
*
|
|
89
|
+
* Lets the client collect and tokenise a card without charging it.
|
|
84
90
|
*/
|
|
85
91
|
export declare const createSetupIntentMutation: (options?: Partial<Options<CreateSetupIntentData>>) => UseMutationOptions<CreateSetupIntentResponse, CreateSetupIntentError, Options<CreateSetupIntentData>>;
|
|
86
92
|
/**
|
|
@@ -119,3 +125,44 @@ export declare const getInvoicesOptions: (options?: Options<GetInvoicesData>) =>
|
|
|
119
125
|
[dataTagErrorSymbol]: Error;
|
|
120
126
|
};
|
|
121
127
|
};
|
|
128
|
+
export declare const m2mGetCustomerQueryKey: (options: Options<M2mGetCustomerData>) => [Pick<Options<M2mGetCustomerData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
129
|
+
_id: string;
|
|
130
|
+
_infinite?: boolean;
|
|
131
|
+
tags?: ReadonlyArray<string>;
|
|
132
|
+
}];
|
|
133
|
+
/**
|
|
134
|
+
* Fetch all related customer information for a given org.
|
|
135
|
+
*/
|
|
136
|
+
export declare const m2mGetCustomerOptions: (options: Options<M2mGetCustomerData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").CustomerResponse, Error, import("../types.gen").CustomerResponse, [Pick<Options<M2mGetCustomerData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
137
|
+
_id: string;
|
|
138
|
+
_infinite?: boolean;
|
|
139
|
+
tags?: ReadonlyArray<string>;
|
|
140
|
+
}]>, "queryFn"> & {
|
|
141
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").CustomerResponse, [Pick<Options<M2mGetCustomerData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
142
|
+
_id: string;
|
|
143
|
+
_infinite?: boolean;
|
|
144
|
+
tags?: ReadonlyArray<string>;
|
|
145
|
+
}], never> | undefined;
|
|
146
|
+
} & {
|
|
147
|
+
queryKey: [Pick<Options<M2mGetCustomerData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
148
|
+
_id: string;
|
|
149
|
+
_infinite?: boolean;
|
|
150
|
+
tags?: ReadonlyArray<string>;
|
|
151
|
+
}] & {
|
|
152
|
+
[dataTagSymbol]: import("../types.gen").CustomerResponse;
|
|
153
|
+
[dataTagErrorSymbol]: Error;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Creates a stripe customer with a stripe subscription.
|
|
158
|
+
*
|
|
159
|
+
* This instantiates an account record in our database with
|
|
160
|
+
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
161
|
+
* webhook is received.
|
|
162
|
+
*
|
|
163
|
+
*/
|
|
164
|
+
export declare const m2mCreateCustomerMutation: (options?: Partial<Options<M2mCreateCustomerData>>) => UseMutationOptions<unknown, M2mCreateCustomerError, Options<M2mCreateCustomerData>>;
|
|
165
|
+
/**
|
|
166
|
+
* Returns a list of available pricing plans.
|
|
167
|
+
*/
|
|
168
|
+
export declare const m2mUpdatePlanMutation: (options?: Partial<Options<M2mUpdatePlanData>>) => UseMutationOptions<unknown, M2mUpdatePlanError, Options<M2mUpdatePlanData>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
import { client } from '../client.gen';
|
|
4
|
-
import { createCustomer, createSetupIntent, deletePaymentMethod, getCustomer, getInvoices, getPlans, updateDefaultPaymentMethod, updatePlan } from '../sdk.gen';
|
|
4
|
+
import { createCustomer, createSetupIntent, deletePaymentMethod, getCustomer, getInvoices, getPlans, m2mCreateCustomer, m2mGetCustomer, m2mUpdatePlan, updateDefaultPaymentMethod, updatePlan } 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) {
|
|
@@ -62,6 +62,8 @@ export const updatePlanMutation = (options) => {
|
|
|
62
62
|
};
|
|
63
63
|
export const getCustomerQueryKey = (options) => createQueryKey('getCustomer', options);
|
|
64
64
|
/**
|
|
65
|
+
* Fetch all related customer information.
|
|
66
|
+
*
|
|
65
67
|
* Returns the account's current (and pending, if any) plan plus renewal/schedule dates, fetched live
|
|
66
68
|
* from the Stripe subscription rather than only the Account record — a customer can be grandfathered
|
|
67
69
|
* onto a price that no longer matches plan-configuration.yaml, so Stripe's subscription metadata is
|
|
@@ -83,7 +85,9 @@ export const getCustomerOptions = (options) => {
|
|
|
83
85
|
});
|
|
84
86
|
};
|
|
85
87
|
/**
|
|
86
|
-
* Creates a stripe customer with a stripe subscription
|
|
88
|
+
* Creates a stripe customer with a stripe subscription
|
|
89
|
+
*
|
|
90
|
+
* This instantiates an account record in our database with
|
|
87
91
|
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
88
92
|
* webhook is received.
|
|
89
93
|
*
|
|
@@ -102,7 +106,9 @@ export const createCustomerMutation = (options) => {
|
|
|
102
106
|
return mutationOptions;
|
|
103
107
|
};
|
|
104
108
|
/**
|
|
105
|
-
* Creates a Stripe SetupIntent
|
|
109
|
+
* Creates a Stripe SetupIntent.
|
|
110
|
+
*
|
|
111
|
+
* Lets the client collect and tokenise a card without charging it.
|
|
106
112
|
*/
|
|
107
113
|
export const createSetupIntentMutation = (options) => {
|
|
108
114
|
const mutationOptions = {
|
|
@@ -167,3 +173,58 @@ export const getInvoicesOptions = (options) => {
|
|
|
167
173
|
queryKey: getInvoicesQueryKey(options)
|
|
168
174
|
});
|
|
169
175
|
};
|
|
176
|
+
export const m2mGetCustomerQueryKey = (options) => createQueryKey('m2mGetCustomer', options);
|
|
177
|
+
/**
|
|
178
|
+
* Fetch all related customer information for a given org.
|
|
179
|
+
*/
|
|
180
|
+
export const m2mGetCustomerOptions = (options) => {
|
|
181
|
+
return queryOptions({
|
|
182
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
183
|
+
const { data } = await m2mGetCustomer({
|
|
184
|
+
...options,
|
|
185
|
+
...queryKey[0],
|
|
186
|
+
signal,
|
|
187
|
+
throwOnError: true
|
|
188
|
+
});
|
|
189
|
+
return data;
|
|
190
|
+
},
|
|
191
|
+
queryKey: m2mGetCustomerQueryKey(options)
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Creates a stripe customer with a stripe subscription.
|
|
196
|
+
*
|
|
197
|
+
* This instantiates an account record in our database with
|
|
198
|
+
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
199
|
+
* webhook is received.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
export const m2mCreateCustomerMutation = (options) => {
|
|
203
|
+
const mutationOptions = {
|
|
204
|
+
mutationFn: async (fnOptions) => {
|
|
205
|
+
const { data } = await m2mCreateCustomer({
|
|
206
|
+
...options,
|
|
207
|
+
...fnOptions,
|
|
208
|
+
throwOnError: true
|
|
209
|
+
});
|
|
210
|
+
return data;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
return mutationOptions;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Returns a list of available pricing plans.
|
|
217
|
+
*/
|
|
218
|
+
export const m2mUpdatePlanMutation = (options) => {
|
|
219
|
+
const mutationOptions = {
|
|
220
|
+
mutationFn: async (fnOptions) => {
|
|
221
|
+
const { data } = await m2mUpdatePlan({
|
|
222
|
+
...options,
|
|
223
|
+
...fnOptions,
|
|
224
|
+
throwOnError: true
|
|
225
|
+
});
|
|
226
|
+
return data;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
return mutationOptions;
|
|
230
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, Options as Options2, TDataShape } from './client';
|
|
2
|
-
import type { CreateCustomerData, CreateCustomerErrors, CreateCustomerResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, DeletePaymentMethodData, DeletePaymentMethodErrors, DeletePaymentMethodResponses, GetCustomerData, GetCustomerErrors, GetCustomerResponses, GetInvoicesData, GetInvoicesErrors, GetInvoicesResponses, GetPlansData, GetPlansErrors, GetPlansResponses, UpdateDefaultPaymentMethodData, UpdateDefaultPaymentMethodErrors, UpdateDefaultPaymentMethodResponses, UpdatePlanData, UpdatePlanErrors, UpdatePlanResponses } from './types.gen';
|
|
2
|
+
import type { CreateCustomerData, CreateCustomerErrors, CreateCustomerResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, DeletePaymentMethodData, DeletePaymentMethodErrors, DeletePaymentMethodResponses, GetCustomerData, GetCustomerErrors, GetCustomerResponses, GetInvoicesData, GetInvoicesErrors, GetInvoicesResponses, GetPlansData, GetPlansErrors, GetPlansResponses, M2mCreateCustomerData, M2mCreateCustomerErrors, M2mCreateCustomerResponses, M2mGetCustomerData, M2mGetCustomerErrors, M2mGetCustomerResponses, M2mUpdatePlanData, M2mUpdatePlanErrors, M2mUpdatePlanResponses, UpdateDefaultPaymentMethodData, UpdateDefaultPaymentMethodErrors, UpdateDefaultPaymentMethodResponses, UpdatePlanData, UpdatePlanErrors, UpdatePlanResponses } 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
|
|
@@ -22,6 +22,8 @@ export declare const getPlans: <ThrowOnError extends boolean = false>(options?:
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const updatePlan: <ThrowOnError extends boolean = false>(options: Options<UpdatePlanData, ThrowOnError>) => import("./client").RequestResult<UpdatePlanResponses, UpdatePlanErrors, ThrowOnError, "fields">;
|
|
24
24
|
/**
|
|
25
|
+
* Fetch all related customer information.
|
|
26
|
+
*
|
|
25
27
|
* Returns the account's current (and pending, if any) plan plus renewal/schedule dates, fetched live
|
|
26
28
|
* from the Stripe subscription rather than only the Account record — a customer can be grandfathered
|
|
27
29
|
* onto a price that no longer matches plan-configuration.yaml, so Stripe's subscription metadata is
|
|
@@ -30,14 +32,18 @@ export declare const updatePlan: <ThrowOnError extends boolean = false>(options:
|
|
|
30
32
|
*/
|
|
31
33
|
export declare const getCustomer: <ThrowOnError extends boolean = false>(options?: Options<GetCustomerData, ThrowOnError>) => import("./client").RequestResult<GetCustomerResponses, GetCustomerErrors, ThrowOnError, "fields">;
|
|
32
34
|
/**
|
|
33
|
-
* Creates a stripe customer with a stripe subscription
|
|
35
|
+
* Creates a stripe customer with a stripe subscription
|
|
36
|
+
*
|
|
37
|
+
* This instantiates an account record in our database with
|
|
34
38
|
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
35
39
|
* webhook is received.
|
|
36
40
|
*
|
|
37
41
|
*/
|
|
38
42
|
export declare const createCustomer: <ThrowOnError extends boolean = false>(options: Options<CreateCustomerData, ThrowOnError>) => import("./client").RequestResult<CreateCustomerResponses, CreateCustomerErrors, ThrowOnError, "fields">;
|
|
39
43
|
/**
|
|
40
|
-
* Creates a Stripe SetupIntent
|
|
44
|
+
* Creates a Stripe SetupIntent.
|
|
45
|
+
*
|
|
46
|
+
* Lets the client collect and tokenise a card without charging it.
|
|
41
47
|
*/
|
|
42
48
|
export declare const createSetupIntent: <ThrowOnError extends boolean = false>(options?: Options<CreateSetupIntentData, ThrowOnError>) => import("./client").RequestResult<CreateSetupIntentResponses, CreateSetupIntentErrors, ThrowOnError, "fields">;
|
|
43
49
|
/**
|
|
@@ -52,3 +58,20 @@ export declare const updateDefaultPaymentMethod: <ThrowOnError extends boolean =
|
|
|
52
58
|
* Returns a page of the customer's invoices. This response is paginated.
|
|
53
59
|
*/
|
|
54
60
|
export declare const getInvoices: <ThrowOnError extends boolean = false>(options?: Options<GetInvoicesData, ThrowOnError>) => import("./client").RequestResult<GetInvoicesResponses, GetInvoicesErrors, ThrowOnError, "fields">;
|
|
61
|
+
/**
|
|
62
|
+
* Fetch all related customer information for a given org.
|
|
63
|
+
*/
|
|
64
|
+
export declare const m2mGetCustomer: <ThrowOnError extends boolean = false>(options: Options<M2mGetCustomerData, ThrowOnError>) => import("./client").RequestResult<M2mGetCustomerResponses, M2mGetCustomerErrors, ThrowOnError, "fields">;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a stripe customer with a stripe subscription.
|
|
67
|
+
*
|
|
68
|
+
* This instantiates an account record in our database with
|
|
69
|
+
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
70
|
+
* webhook is received.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export declare const m2mCreateCustomer: <ThrowOnError extends boolean = false>(options: Options<M2mCreateCustomerData, ThrowOnError>) => import("./client").RequestResult<M2mCreateCustomerResponses, M2mCreateCustomerErrors, ThrowOnError, "fields">;
|
|
74
|
+
/**
|
|
75
|
+
* Returns a list of available pricing plans.
|
|
76
|
+
*/
|
|
77
|
+
export declare const m2mUpdatePlan: <ThrowOnError extends boolean = false>(options: Options<M2mUpdatePlanData, ThrowOnError>) => import("./client").RequestResult<M2mUpdatePlanResponses, M2mUpdatePlanErrors, ThrowOnError, "fields">;
|
|
@@ -11,7 +11,7 @@ export const getPlans = (options) => {
|
|
|
11
11
|
type: 'http'
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
url: '/
|
|
14
|
+
url: '/api/v1/plans',
|
|
15
15
|
...options
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -26,7 +26,7 @@ export const updatePlan = (options) => {
|
|
|
26
26
|
type: 'http'
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
|
-
url: '/
|
|
29
|
+
url: '/api/v1/plan',
|
|
30
30
|
...options,
|
|
31
31
|
headers: {
|
|
32
32
|
'Content-Type': 'application/json',
|
|
@@ -35,6 +35,8 @@ export const updatePlan = (options) => {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
+
* Fetch all related customer information.
|
|
39
|
+
*
|
|
38
40
|
* Returns the account's current (and pending, if any) plan plus renewal/schedule dates, fetched live
|
|
39
41
|
* from the Stripe subscription rather than only the Account record — a customer can be grandfathered
|
|
40
42
|
* onto a price that no longer matches plan-configuration.yaml, so Stripe's subscription metadata is
|
|
@@ -49,12 +51,14 @@ export const getCustomer = (options) => {
|
|
|
49
51
|
type: 'http'
|
|
50
52
|
}
|
|
51
53
|
],
|
|
52
|
-
url: '/
|
|
54
|
+
url: '/api/v1/customer',
|
|
53
55
|
...options
|
|
54
56
|
});
|
|
55
57
|
};
|
|
56
58
|
/**
|
|
57
|
-
* Creates a stripe customer with a stripe subscription
|
|
59
|
+
* Creates a stripe customer with a stripe subscription
|
|
60
|
+
*
|
|
61
|
+
* This instantiates an account record in our database with
|
|
58
62
|
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
59
63
|
* webhook is received.
|
|
60
64
|
*
|
|
@@ -67,7 +71,7 @@ export const createCustomer = (options) => {
|
|
|
67
71
|
type: 'http'
|
|
68
72
|
}
|
|
69
73
|
],
|
|
70
|
-
url: '/
|
|
74
|
+
url: '/api/v1/customer',
|
|
71
75
|
...options,
|
|
72
76
|
headers: {
|
|
73
77
|
'Content-Type': 'application/json',
|
|
@@ -76,7 +80,9 @@ export const createCustomer = (options) => {
|
|
|
76
80
|
});
|
|
77
81
|
};
|
|
78
82
|
/**
|
|
79
|
-
* Creates a Stripe SetupIntent
|
|
83
|
+
* Creates a Stripe SetupIntent.
|
|
84
|
+
*
|
|
85
|
+
* Lets the client collect and tokenise a card without charging it.
|
|
80
86
|
*/
|
|
81
87
|
export const createSetupIntent = (options) => {
|
|
82
88
|
return (options?.client ?? client).post({
|
|
@@ -86,7 +92,7 @@ export const createSetupIntent = (options) => {
|
|
|
86
92
|
type: 'http'
|
|
87
93
|
}
|
|
88
94
|
],
|
|
89
|
-
url: '/
|
|
95
|
+
url: '/api/v1/setup-intent',
|
|
90
96
|
...options
|
|
91
97
|
});
|
|
92
98
|
};
|
|
@@ -101,7 +107,7 @@ export const deletePaymentMethod = (options) => {
|
|
|
101
107
|
type: 'http'
|
|
102
108
|
}
|
|
103
109
|
],
|
|
104
|
-
url: '/
|
|
110
|
+
url: '/api/v1/payment-method/{id}',
|
|
105
111
|
...options
|
|
106
112
|
});
|
|
107
113
|
};
|
|
@@ -116,7 +122,7 @@ export const updateDefaultPaymentMethod = (options) => {
|
|
|
116
122
|
type: 'http'
|
|
117
123
|
}
|
|
118
124
|
],
|
|
119
|
-
url: '/
|
|
125
|
+
url: '/api/v1/payment-method/{id}',
|
|
120
126
|
...options
|
|
121
127
|
});
|
|
122
128
|
};
|
|
@@ -131,7 +137,65 @@ export const getInvoices = (options) => {
|
|
|
131
137
|
type: 'http'
|
|
132
138
|
}
|
|
133
139
|
],
|
|
134
|
-
url: '/
|
|
140
|
+
url: '/api/v1/invoices',
|
|
141
|
+
...options
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Fetch all related customer information for a given org.
|
|
146
|
+
*/
|
|
147
|
+
export const m2mGetCustomer = (options) => {
|
|
148
|
+
return (options.client ?? client).get({
|
|
149
|
+
security: [
|
|
150
|
+
{
|
|
151
|
+
scheme: 'bearer',
|
|
152
|
+
type: 'http'
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
url: '/m2m/v1/customer/{org}',
|
|
135
156
|
...options
|
|
136
157
|
});
|
|
137
158
|
};
|
|
159
|
+
/**
|
|
160
|
+
* Creates a stripe customer with a stripe subscription.
|
|
161
|
+
*
|
|
162
|
+
* This instantiates an account record in our database with
|
|
163
|
+
* the account status set to "onboarding". This status is changed to active, once a a stripe update subscription
|
|
164
|
+
* webhook is received.
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
export const m2mCreateCustomer = (options) => {
|
|
168
|
+
return (options.client ?? client).post({
|
|
169
|
+
security: [
|
|
170
|
+
{
|
|
171
|
+
scheme: 'bearer',
|
|
172
|
+
type: 'http'
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
url: '/m2m/v1/customer/{org}',
|
|
176
|
+
...options,
|
|
177
|
+
headers: {
|
|
178
|
+
'Content-Type': 'application/json',
|
|
179
|
+
...options.headers
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Returns a list of available pricing plans.
|
|
185
|
+
*/
|
|
186
|
+
export const m2mUpdatePlan = (options) => {
|
|
187
|
+
return (options.client ?? client).patch({
|
|
188
|
+
security: [
|
|
189
|
+
{
|
|
190
|
+
scheme: 'bearer',
|
|
191
|
+
type: 'http'
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
url: '/m2m/v1/plan/{org}',
|
|
195
|
+
...options,
|
|
196
|
+
headers: {
|
|
197
|
+
'Content-Type': 'application/json',
|
|
198
|
+
...options.headers
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
};
|