@outseta/react 0.3.0 → 0.3.2
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/index.js +6 -3
- package/package.json +2 -2
- package/src/generated/activity/activity.ts +34 -7
- package/src/generated/billing/billing.ts +111 -84
- package/src/generated/crm/crm.ts +109 -80
- package/src/generated/email/email.ts +48 -21
- package/src/generated/outsetaAPI.schemas.ts +236 -2
- package/src/generated/public/public.ts +748 -0
- package/src/generated/support/support.ts +34 -7
package/dist/index.js
CHANGED
|
@@ -977,18 +977,21 @@ var useDealDeleteDeal = (options) => {
|
|
|
977
977
|
const mutationOptions = getDealDeleteDealMutationOptions(options);
|
|
978
978
|
return useMutation3(mutationOptions);
|
|
979
979
|
};
|
|
980
|
-
var registrationRegisterAccount = (options, signal) => {
|
|
980
|
+
var registrationRegisterAccount = (account, options, signal) => {
|
|
981
981
|
return customFetch({
|
|
982
982
|
url: `/api/v1/crm/registrations`,
|
|
983
983
|
method: "POST",
|
|
984
|
+
headers: { "Content-Type": "application/json" },
|
|
985
|
+
data: account,
|
|
984
986
|
signal
|
|
985
987
|
}, options);
|
|
986
988
|
};
|
|
987
989
|
var getRegistrationRegisterAccountMutationOptions = (options) => {
|
|
988
990
|
const mutationKey = ["registrationRegisterAccount"];
|
|
989
991
|
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
|
|
990
|
-
const mutationFn = () => {
|
|
991
|
-
|
|
992
|
+
const mutationFn = (props) => {
|
|
993
|
+
const { data } = props ?? {};
|
|
994
|
+
return registrationRegisterAccount(data, requestOptions);
|
|
992
995
|
};
|
|
993
996
|
return { mutationFn, ...mutationOptions };
|
|
994
997
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outseta/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "React hooks and components for the Outseta API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tanstack/react-query": "^5.0.0",
|
|
22
|
-
"@outseta/api-client": "0.3.
|
|
22
|
+
"@outseta/api-client": "0.3.2"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -21,6 +21,33 @@ import type {
|
|
|
21
21
|
|
|
22
22
|
import { customFetch } from '../../mutator';
|
|
23
23
|
|
|
24
|
+
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
|
|
25
|
+
type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <
|
|
26
|
+
T,
|
|
27
|
+
>() => T extends Y ? 1 : 2
|
|
28
|
+
? A
|
|
29
|
+
: B;
|
|
30
|
+
|
|
31
|
+
type WritableKeys<T> = {
|
|
32
|
+
[P in keyof T]-?: IfEquals<
|
|
33
|
+
{ [Q in P]: T[P] },
|
|
34
|
+
{ -readonly [Q in P]: T[P] },
|
|
35
|
+
P
|
|
36
|
+
>;
|
|
37
|
+
}[keyof T];
|
|
38
|
+
|
|
39
|
+
type UnionToIntersection<U> =
|
|
40
|
+
(U extends any ? (k: U)=>void : never) extends ((k: infer I)=>void) ? I : never;
|
|
41
|
+
type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never;
|
|
42
|
+
|
|
43
|
+
type Writable<T> = Pick<T, WritableKeys<T>>;
|
|
44
|
+
type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
|
|
45
|
+
[P in keyof Writable<T>]: T[P] extends object
|
|
46
|
+
? NonReadonly<NonNullable<T[P]>>
|
|
47
|
+
: T[P];
|
|
48
|
+
} : DistributeReadOnlyOverUnions<T>;
|
|
49
|
+
|
|
50
|
+
|
|
24
51
|
|
|
25
52
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
26
53
|
|
|
@@ -108,7 +135,7 @@ value specified for the campaign.
|
|
|
108
135
|
* @summary Record a custom event associated to an account, person or deal.
|
|
109
136
|
*/
|
|
110
137
|
export const activityAddCustomActivity = (
|
|
111
|
-
activityAddCustomActivityBody: ActivityAddCustomActivityBody
|
|
138
|
+
activityAddCustomActivityBody: NonReadonly<ActivityAddCustomActivityBody>,
|
|
112
139
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
113
140
|
) => {
|
|
114
141
|
|
|
@@ -125,8 +152,8 @@ export const activityAddCustomActivity = (
|
|
|
125
152
|
|
|
126
153
|
|
|
127
154
|
export const getActivityAddCustomActivityMutationOptions = <TError = void,
|
|
128
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: ActivityAddCustomActivityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
129
|
-
): UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: ActivityAddCustomActivityBody}, TContext> => {
|
|
155
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: NonReadonly<ActivityAddCustomActivityBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
156
|
+
): UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: NonReadonly<ActivityAddCustomActivityBody>}, TContext> => {
|
|
130
157
|
|
|
131
158
|
const mutationKey = ['activityAddCustomActivity'];
|
|
132
159
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
@@ -138,7 +165,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
138
165
|
|
|
139
166
|
|
|
140
167
|
|
|
141
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof activityAddCustomActivity>>, {data: ActivityAddCustomActivityBody}> = (props) => {
|
|
168
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof activityAddCustomActivity>>, {data: NonReadonly<ActivityAddCustomActivityBody>}> = (props) => {
|
|
142
169
|
const {data} = props ?? {};
|
|
143
170
|
|
|
144
171
|
return activityAddCustomActivity(data,requestOptions)
|
|
@@ -150,18 +177,18 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
150
177
|
return { mutationFn, ...mutationOptions }}
|
|
151
178
|
|
|
152
179
|
export type ActivityAddCustomActivityMutationResult = NonNullable<Awaited<ReturnType<typeof activityAddCustomActivity>>>
|
|
153
|
-
export type ActivityAddCustomActivityMutationBody = ActivityAddCustomActivityBody
|
|
180
|
+
export type ActivityAddCustomActivityMutationBody = NonReadonly<ActivityAddCustomActivityBody>
|
|
154
181
|
export type ActivityAddCustomActivityMutationError = void
|
|
155
182
|
|
|
156
183
|
/**
|
|
157
184
|
* @summary Record a custom event associated to an account, person or deal.
|
|
158
185
|
*/
|
|
159
186
|
export const useActivityAddCustomActivity = <TError = void,
|
|
160
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: ActivityAddCustomActivityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
187
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activityAddCustomActivity>>, TError,{data: NonReadonly<ActivityAddCustomActivityBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
161
188
|
): UseMutationResult<
|
|
162
189
|
Awaited<ReturnType<typeof activityAddCustomActivity>>,
|
|
163
190
|
TError,
|
|
164
|
-
{data: ActivityAddCustomActivityBody},
|
|
191
|
+
{data: NonReadonly<ActivityAddCustomActivityBody>},
|
|
165
192
|
TContext
|
|
166
193
|
> => {
|
|
167
194
|
|