@connectedxm/admin 3.4.6 → 3.4.7
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.cjs +3 -2
- package/dist/index.d.cts +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22569,9 +22569,10 @@ var useConnectedMutation = (mutation, options, permission) => {
|
|
|
22569
22569
|
});
|
|
22570
22570
|
},
|
|
22571
22571
|
...options,
|
|
22572
|
-
onError: (error, variables, context) => {
|
|
22572
|
+
onError: (error, variables, onMutateResult, context) => {
|
|
22573
22573
|
if (onMutationError) onMutationError(error, variables, context);
|
|
22574
|
-
if (options?.onError)
|
|
22574
|
+
if (options?.onError)
|
|
22575
|
+
options.onError(error, variables, onMutateResult, context);
|
|
22575
22576
|
}
|
|
22576
22577
|
});
|
|
22577
22578
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as axios from 'axios';
|
|
|
2
2
|
import { AxiosError, AxiosInstance } from 'axios';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { QueryClient, QueryKey, InfiniteData, UseQueryOptions, UseInfiniteQueryOptions, Updater, SetDataOptions, UseMutationOptions
|
|
5
|
+
import { QueryClient, QueryKey, InfiniteData, UseQueryOptions, UseInfiniteQueryOptions, Updater, SetDataOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
|
|
8
8
|
interface ConnectedXMResponse<TData> {
|
|
@@ -281,6 +281,7 @@ interface AccountAddress extends BaseAccountAddress {
|
|
|
281
281
|
}
|
|
282
282
|
interface BaseAPILog {
|
|
283
283
|
id: string;
|
|
284
|
+
login: BaseLogin | null;
|
|
284
285
|
account: BaseAccount | null;
|
|
285
286
|
user: BaseUser | null;
|
|
286
287
|
source: "admin" | "client";
|
|
@@ -1707,6 +1708,7 @@ interface BasePaymentLineItem {
|
|
|
1707
1708
|
discount: number;
|
|
1708
1709
|
deferred: number;
|
|
1709
1710
|
salesTax: number;
|
|
1711
|
+
refundedSalesTax: number;
|
|
1710
1712
|
paymentId: number;
|
|
1711
1713
|
taxCode: string | null;
|
|
1712
1714
|
taxIncluded: boolean;
|
|
@@ -3844,23 +3846,25 @@ interface ImportCreateInputs {
|
|
|
3844
3846
|
type?: ImportType | null;
|
|
3845
3847
|
}
|
|
3846
3848
|
interface BaseActivityEntityInput {
|
|
3847
|
-
type: ActivityEntityType;
|
|
3849
|
+
type: keyof typeof ActivityEntityType;
|
|
3848
3850
|
startIndex: number;
|
|
3849
3851
|
endIndex: number;
|
|
3850
3852
|
marks: ("bold" | "italic" | "underline" | "strike")[];
|
|
3851
3853
|
}
|
|
3852
3854
|
interface MentionInputs extends BaseActivityEntityInput {
|
|
3853
|
-
type:
|
|
3854
|
-
|
|
3855
|
-
}
|
|
3856
|
-
interface LinkInputs extends BaseActivityEntityInput {
|
|
3857
|
-
type: ActivityEntityType.link;
|
|
3855
|
+
type: "mention";
|
|
3856
|
+
username: string;
|
|
3858
3857
|
}
|
|
3859
3858
|
interface InterestInputs extends BaseActivityEntityInput {
|
|
3860
|
-
type:
|
|
3859
|
+
type: "interest";
|
|
3860
|
+
interest: string;
|
|
3861
|
+
}
|
|
3862
|
+
interface LinkInputs extends BaseActivityEntityInput {
|
|
3863
|
+
type: "link";
|
|
3864
|
+
href: string;
|
|
3861
3865
|
}
|
|
3862
3866
|
interface SegmentInputs extends BaseActivityEntityInput {
|
|
3863
|
-
type:
|
|
3867
|
+
type: "segment";
|
|
3864
3868
|
}
|
|
3865
3869
|
type ActivityEntityInputs = MentionInputs | LinkInputs | InterestInputs | SegmentInputs;
|
|
3866
3870
|
interface ActivityCreateInputs {
|
|
@@ -3876,6 +3880,7 @@ interface ActivityCreateInputs {
|
|
|
3876
3880
|
createdAt?: string | null;
|
|
3877
3881
|
}
|
|
3878
3882
|
interface ActivityUpdateInputs {
|
|
3883
|
+
accountId?: string | null;
|
|
3879
3884
|
message?: string | null;
|
|
3880
3885
|
entities?: ActivityEntityInputs[] | null;
|
|
3881
3886
|
moderation?: keyof typeof ModerationStatus | null;
|
|
@@ -17170,7 +17175,7 @@ interface MutationParams {
|
|
|
17170
17175
|
}
|
|
17171
17176
|
interface ConnectedXMMutationOptions<TResponseData, TMutationParams> extends UseMutationOptions<TResponseData, AxiosError<TResponseData>, TMutationParams> {
|
|
17172
17177
|
}
|
|
17173
|
-
declare const useConnectedMutation: <TMutationParams extends MutationParams, TResponseData extends ConnectedXMResponse<any>>(mutation:
|
|
17178
|
+
declare const useConnectedMutation: <TMutationParams extends MutationParams, TResponseData extends ConnectedXMResponse<any>>(mutation: (params: TMutationParams) => Promise<TResponseData>, options?: Omit<ConnectedXMMutationOptions<TResponseData, Omit<TMutationParams, "queryClient" | "adminApiParams">>, "mutationFn">, permission?: {
|
|
17174
17179
|
domain: PermissionDomain | PermissionDomain[];
|
|
17175
17180
|
type: PermissionType | PermissionType[];
|
|
17176
17181
|
}) => _tanstack_react_query.UseMutationResult<TResponseData, AxiosError<TResponseData, any>, Omit<TMutationParams, "queryClient" | "adminApiParams">, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as axios from 'axios';
|
|
|
2
2
|
import { AxiosError, AxiosInstance } from 'axios';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { QueryClient, QueryKey, InfiniteData, UseQueryOptions, UseInfiniteQueryOptions, Updater, SetDataOptions, UseMutationOptions
|
|
5
|
+
import { QueryClient, QueryKey, InfiniteData, UseQueryOptions, UseInfiniteQueryOptions, Updater, SetDataOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
|
|
8
8
|
interface ConnectedXMResponse<TData> {
|
|
@@ -281,6 +281,7 @@ interface AccountAddress extends BaseAccountAddress {
|
|
|
281
281
|
}
|
|
282
282
|
interface BaseAPILog {
|
|
283
283
|
id: string;
|
|
284
|
+
login: BaseLogin | null;
|
|
284
285
|
account: BaseAccount | null;
|
|
285
286
|
user: BaseUser | null;
|
|
286
287
|
source: "admin" | "client";
|
|
@@ -1707,6 +1708,7 @@ interface BasePaymentLineItem {
|
|
|
1707
1708
|
discount: number;
|
|
1708
1709
|
deferred: number;
|
|
1709
1710
|
salesTax: number;
|
|
1711
|
+
refundedSalesTax: number;
|
|
1710
1712
|
paymentId: number;
|
|
1711
1713
|
taxCode: string | null;
|
|
1712
1714
|
taxIncluded: boolean;
|
|
@@ -3844,23 +3846,25 @@ interface ImportCreateInputs {
|
|
|
3844
3846
|
type?: ImportType | null;
|
|
3845
3847
|
}
|
|
3846
3848
|
interface BaseActivityEntityInput {
|
|
3847
|
-
type: ActivityEntityType;
|
|
3849
|
+
type: keyof typeof ActivityEntityType;
|
|
3848
3850
|
startIndex: number;
|
|
3849
3851
|
endIndex: number;
|
|
3850
3852
|
marks: ("bold" | "italic" | "underline" | "strike")[];
|
|
3851
3853
|
}
|
|
3852
3854
|
interface MentionInputs extends BaseActivityEntityInput {
|
|
3853
|
-
type:
|
|
3854
|
-
|
|
3855
|
-
}
|
|
3856
|
-
interface LinkInputs extends BaseActivityEntityInput {
|
|
3857
|
-
type: ActivityEntityType.link;
|
|
3855
|
+
type: "mention";
|
|
3856
|
+
username: string;
|
|
3858
3857
|
}
|
|
3859
3858
|
interface InterestInputs extends BaseActivityEntityInput {
|
|
3860
|
-
type:
|
|
3859
|
+
type: "interest";
|
|
3860
|
+
interest: string;
|
|
3861
|
+
}
|
|
3862
|
+
interface LinkInputs extends BaseActivityEntityInput {
|
|
3863
|
+
type: "link";
|
|
3864
|
+
href: string;
|
|
3861
3865
|
}
|
|
3862
3866
|
interface SegmentInputs extends BaseActivityEntityInput {
|
|
3863
|
-
type:
|
|
3867
|
+
type: "segment";
|
|
3864
3868
|
}
|
|
3865
3869
|
type ActivityEntityInputs = MentionInputs | LinkInputs | InterestInputs | SegmentInputs;
|
|
3866
3870
|
interface ActivityCreateInputs {
|
|
@@ -3876,6 +3880,7 @@ interface ActivityCreateInputs {
|
|
|
3876
3880
|
createdAt?: string | null;
|
|
3877
3881
|
}
|
|
3878
3882
|
interface ActivityUpdateInputs {
|
|
3883
|
+
accountId?: string | null;
|
|
3879
3884
|
message?: string | null;
|
|
3880
3885
|
entities?: ActivityEntityInputs[] | null;
|
|
3881
3886
|
moderation?: keyof typeof ModerationStatus | null;
|
|
@@ -17170,7 +17175,7 @@ interface MutationParams {
|
|
|
17170
17175
|
}
|
|
17171
17176
|
interface ConnectedXMMutationOptions<TResponseData, TMutationParams> extends UseMutationOptions<TResponseData, AxiosError<TResponseData>, TMutationParams> {
|
|
17172
17177
|
}
|
|
17173
|
-
declare const useConnectedMutation: <TMutationParams extends MutationParams, TResponseData extends ConnectedXMResponse<any>>(mutation:
|
|
17178
|
+
declare const useConnectedMutation: <TMutationParams extends MutationParams, TResponseData extends ConnectedXMResponse<any>>(mutation: (params: TMutationParams) => Promise<TResponseData>, options?: Omit<ConnectedXMMutationOptions<TResponseData, Omit<TMutationParams, "queryClient" | "adminApiParams">>, "mutationFn">, permission?: {
|
|
17174
17179
|
domain: PermissionDomain | PermissionDomain[];
|
|
17175
17180
|
type: PermissionType | PermissionType[];
|
|
17176
17181
|
}) => _tanstack_react_query.UseMutationResult<TResponseData, AxiosError<TResponseData, any>, Omit<TMutationParams, "queryClient" | "adminApiParams">, unknown>;
|
package/dist/index.js
CHANGED
|
@@ -19448,9 +19448,10 @@ var useConnectedMutation = (mutation, options, permission) => {
|
|
|
19448
19448
|
});
|
|
19449
19449
|
},
|
|
19450
19450
|
...options,
|
|
19451
|
-
onError: (error, variables, context) => {
|
|
19451
|
+
onError: (error, variables, onMutateResult, context) => {
|
|
19452
19452
|
if (onMutationError) onMutationError(error, variables, context);
|
|
19453
|
-
if (options?.onError)
|
|
19453
|
+
if (options?.onError)
|
|
19454
|
+
options.onError(error, variables, onMutateResult, context);
|
|
19454
19455
|
}
|
|
19455
19456
|
});
|
|
19456
19457
|
};
|