@outseta/react 0.4.33 → 0.4.34
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 +314 -1
- package/package.json +2 -2
- package/src/generated/attribute/attribute.ts +17 -8
- package/src/generated/crm/crm.ts +290 -1
- package/src/generated/email/email.ts +289 -0
- package/src/generated/outsetaAPI.schemas.ts +105 -6
- package/src/generated/support/support.ts +289 -0
package/src/generated/crm/crm.ts
CHANGED
|
@@ -37,7 +37,11 @@ import type {
|
|
|
37
37
|
PersonGetAllPeopleParams,
|
|
38
38
|
PersonRequestMagicLinkBody,
|
|
39
39
|
PersonSetTemporaryPasswordBody,
|
|
40
|
-
PersonUpdatePersonBody
|
|
40
|
+
PersonUpdatePersonBody,
|
|
41
|
+
SegmentAddTagToEntityBody,
|
|
42
|
+
SegmentGetTagsForEntity200,
|
|
43
|
+
SegmentGetTagsForEntityParams,
|
|
44
|
+
SegmentSetTagsForEntityBody
|
|
41
45
|
} from '../outsetaAPI.schemas';
|
|
42
46
|
|
|
43
47
|
import { customFetch } from '../../mutator';
|
|
@@ -473,6 +477,291 @@ export const useRegistrationRegisterAccount = <TError = unknown,
|
|
|
473
477
|
return useMutation(mutationOptions);
|
|
474
478
|
}
|
|
475
479
|
/**
|
|
480
|
+
* Send the uids of the tags to add. Tags that the record already carries stay on it, and
|
|
481
|
+
naming one of them again changes nothing, so the same request is safe to repeat. To
|
|
482
|
+
replace the whole set instead, use PUT on this same path.
|
|
483
|
+
|
|
484
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
485
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
486
|
+
* @summary Add tags to a record.
|
|
487
|
+
*/
|
|
488
|
+
export const segmentAddTagToEntity = (
|
|
489
|
+
entityUid: string | null,
|
|
490
|
+
segmentAddTagToEntityBody: SegmentAddTagToEntityBody,
|
|
491
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
492
|
+
) => {
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
return customFetch<Blob>(
|
|
496
|
+
{url: `/api/v1/crm/segments/${entityUid}/tags`, method: 'POST',
|
|
497
|
+
headers: {'Content-Type': 'application/json', },
|
|
498
|
+
data: segmentAddTagToEntityBody,
|
|
499
|
+
responseType: 'blob', signal
|
|
500
|
+
},
|
|
501
|
+
options);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
export const getSegmentAddTagToEntityMutationOptions = <TError = void,
|
|
507
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentAddTagToEntity>>, TError,{entityUid: string | null;data: SegmentAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
508
|
+
): UseMutationOptions<Awaited<ReturnType<typeof segmentAddTagToEntity>>, TError,{entityUid: string | null;data: SegmentAddTagToEntityBody}, TContext> => {
|
|
509
|
+
|
|
510
|
+
const mutationKey = ['segmentAddTagToEntity'];
|
|
511
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
512
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
513
|
+
options
|
|
514
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
515
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof segmentAddTagToEntity>>, {entityUid: string | null;data: SegmentAddTagToEntityBody}> = (props) => {
|
|
521
|
+
const {entityUid,data} = props ?? {};
|
|
522
|
+
|
|
523
|
+
return segmentAddTagToEntity(entityUid,data,requestOptions)
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
return { mutationFn, ...mutationOptions }}
|
|
530
|
+
|
|
531
|
+
export type SegmentAddTagToEntityMutationResult = NonNullable<Awaited<ReturnType<typeof segmentAddTagToEntity>>>
|
|
532
|
+
export type SegmentAddTagToEntityMutationBody = SegmentAddTagToEntityBody
|
|
533
|
+
export type SegmentAddTagToEntityMutationError = void
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* @summary Add tags to a record.
|
|
537
|
+
*/
|
|
538
|
+
export const useSegmentAddTagToEntity = <TError = void,
|
|
539
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentAddTagToEntity>>, TError,{entityUid: string | null;data: SegmentAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
540
|
+
): UseMutationResult<
|
|
541
|
+
Awaited<ReturnType<typeof segmentAddTagToEntity>>,
|
|
542
|
+
TError,
|
|
543
|
+
{entityUid: string | null;data: SegmentAddTagToEntityBody},
|
|
544
|
+
TContext
|
|
545
|
+
> => {
|
|
546
|
+
|
|
547
|
+
const mutationOptions = getSegmentAddTagToEntityMutationOptions(options);
|
|
548
|
+
|
|
549
|
+
return useMutation(mutationOptions);
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Returns the tags themselves, not the links that hold them. The same tags are also
|
|
553
|
+
available on the record: ask for them with the fields parameter, for example
|
|
554
|
+
fields=Uid,Tags.Uid,Tags.Name,Tags.TagColor. Tags cost an extra query, so the record
|
|
555
|
+
leaves them out unless fields names Tags or is a plain wildcard.
|
|
556
|
+
* @summary Retrieve the tags on a record.
|
|
557
|
+
*/
|
|
558
|
+
export const segmentGetTagsForEntity = (
|
|
559
|
+
entityUid: string | null,
|
|
560
|
+
params?: SegmentGetTagsForEntityParams,
|
|
561
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
562
|
+
) => {
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
return customFetch<SegmentGetTagsForEntity200>(
|
|
566
|
+
{url: `/api/v1/crm/segments/${entityUid}/tags`, method: 'GET',
|
|
567
|
+
params, signal
|
|
568
|
+
},
|
|
569
|
+
options);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
export const getSegmentGetTagsForEntityQueryKey = (entityUid?: string | null,
|
|
576
|
+
params?: SegmentGetTagsForEntityParams,) => {
|
|
577
|
+
return [
|
|
578
|
+
`/api/v1/crm/segments/${entityUid}/tags`, ...(params ? [params]: [])
|
|
579
|
+
] as const;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
export const getSegmentGetTagsForEntityQueryOptions = <TData = Awaited<ReturnType<typeof segmentGetTagsForEntity>>, TError = void>(entityUid: string | null,
|
|
584
|
+
params?: SegmentGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof segmentGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
585
|
+
) => {
|
|
586
|
+
|
|
587
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
588
|
+
|
|
589
|
+
const queryKey = queryOptions?.queryKey ?? getSegmentGetTagsForEntityQueryKey(entityUid,params);
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof segmentGetTagsForEntity>>> = ({ signal }) => segmentGetTagsForEntity(entityUid,params, requestOptions, signal);
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
return { queryKey, queryFn, enabled: !!(entityUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof segmentGetTagsForEntity>>, TError, TData> & { queryKey: QueryKey }
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export type SegmentGetTagsForEntityQueryResult = NonNullable<Awaited<ReturnType<typeof segmentGetTagsForEntity>>>
|
|
603
|
+
export type SegmentGetTagsForEntityQueryError = void
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @summary Retrieve the tags on a record.
|
|
608
|
+
*/
|
|
609
|
+
|
|
610
|
+
export function useSegmentGetTagsForEntity<TData = Awaited<ReturnType<typeof segmentGetTagsForEntity>>, TError = void>(
|
|
611
|
+
entityUid: string | null,
|
|
612
|
+
params?: SegmentGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof segmentGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
613
|
+
|
|
614
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
615
|
+
|
|
616
|
+
const queryOptions = getSegmentGetTagsForEntityQueryOptions(entityUid,params,options)
|
|
617
|
+
|
|
618
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
619
|
+
|
|
620
|
+
query.queryKey = queryOptions.queryKey ;
|
|
621
|
+
|
|
622
|
+
return query;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Send the full set of tags the record must end with. A tag that the list leaves out is
|
|
630
|
+
taken off the record, and one that the list names is added. Send an empty list to take
|
|
631
|
+
every tag off. To add tags without disturbing the others, use POST on this same path.
|
|
632
|
+
|
|
633
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
634
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
635
|
+
* @summary Replace the tags on a record.
|
|
636
|
+
*/
|
|
637
|
+
export const segmentSetTagsForEntity = (
|
|
638
|
+
entityUid: string | null,
|
|
639
|
+
segmentSetTagsForEntityBody: SegmentSetTagsForEntityBody,
|
|
640
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
return customFetch<Blob>(
|
|
644
|
+
{url: `/api/v1/crm/segments/${entityUid}/tags`, method: 'PUT',
|
|
645
|
+
headers: {'Content-Type': 'application/json', },
|
|
646
|
+
data: segmentSetTagsForEntityBody,
|
|
647
|
+
responseType: 'blob'
|
|
648
|
+
},
|
|
649
|
+
options);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
export const getSegmentSetTagsForEntityMutationOptions = <TError = void,
|
|
655
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentSetTagsForEntity>>, TError,{entityUid: string | null;data: SegmentSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
656
|
+
): UseMutationOptions<Awaited<ReturnType<typeof segmentSetTagsForEntity>>, TError,{entityUid: string | null;data: SegmentSetTagsForEntityBody}, TContext> => {
|
|
657
|
+
|
|
658
|
+
const mutationKey = ['segmentSetTagsForEntity'];
|
|
659
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
660
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
661
|
+
options
|
|
662
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
663
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof segmentSetTagsForEntity>>, {entityUid: string | null;data: SegmentSetTagsForEntityBody}> = (props) => {
|
|
669
|
+
const {entityUid,data} = props ?? {};
|
|
670
|
+
|
|
671
|
+
return segmentSetTagsForEntity(entityUid,data,requestOptions)
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
return { mutationFn, ...mutationOptions }}
|
|
678
|
+
|
|
679
|
+
export type SegmentSetTagsForEntityMutationResult = NonNullable<Awaited<ReturnType<typeof segmentSetTagsForEntity>>>
|
|
680
|
+
export type SegmentSetTagsForEntityMutationBody = SegmentSetTagsForEntityBody
|
|
681
|
+
export type SegmentSetTagsForEntityMutationError = void
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* @summary Replace the tags on a record.
|
|
685
|
+
*/
|
|
686
|
+
export const useSegmentSetTagsForEntity = <TError = void,
|
|
687
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentSetTagsForEntity>>, TError,{entityUid: string | null;data: SegmentSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
688
|
+
): UseMutationResult<
|
|
689
|
+
Awaited<ReturnType<typeof segmentSetTagsForEntity>>,
|
|
690
|
+
TError,
|
|
691
|
+
{entityUid: string | null;data: SegmentSetTagsForEntityBody},
|
|
692
|
+
TContext
|
|
693
|
+
> => {
|
|
694
|
+
|
|
695
|
+
const mutationOptions = getSegmentSetTagsForEntityMutationOptions(options);
|
|
696
|
+
|
|
697
|
+
return useMutation(mutationOptions);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* The tag itself is kept and stays available for other records. If the record does not
|
|
701
|
+
carry the tag, nothing changes and the call still succeeds.
|
|
702
|
+
* @summary Remove one tag from a record.
|
|
703
|
+
*/
|
|
704
|
+
export const segmentRemoveTagFromEntity = (
|
|
705
|
+
entityUid: string | null,
|
|
706
|
+
tagUid: string | null,
|
|
707
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
return customFetch<Blob>(
|
|
711
|
+
{url: `/api/v1/crm/segments/${entityUid}/tags/${tagUid}`, method: 'DELETE',
|
|
712
|
+
responseType: 'blob'
|
|
713
|
+
},
|
|
714
|
+
options);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
export const getSegmentRemoveTagFromEntityMutationOptions = <TError = void,
|
|
720
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
721
|
+
): UseMutationOptions<Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext> => {
|
|
722
|
+
|
|
723
|
+
const mutationKey = ['segmentRemoveTagFromEntity'];
|
|
724
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
725
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
726
|
+
options
|
|
727
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
728
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>, {entityUid: string | null;tagUid: string | null}> = (props) => {
|
|
734
|
+
const {entityUid,tagUid} = props ?? {};
|
|
735
|
+
|
|
736
|
+
return segmentRemoveTagFromEntity(entityUid,tagUid,requestOptions)
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
return { mutationFn, ...mutationOptions }}
|
|
743
|
+
|
|
744
|
+
export type SegmentRemoveTagFromEntityMutationResult = NonNullable<Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>>
|
|
745
|
+
|
|
746
|
+
export type SegmentRemoveTagFromEntityMutationError = void
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* @summary Remove one tag from a record.
|
|
750
|
+
*/
|
|
751
|
+
export const useSegmentRemoveTagFromEntity = <TError = void,
|
|
752
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
753
|
+
): UseMutationResult<
|
|
754
|
+
Awaited<ReturnType<typeof segmentRemoveTagFromEntity>>,
|
|
755
|
+
TError,
|
|
756
|
+
{entityUid: string | null;tagUid: string | null},
|
|
757
|
+
TContext
|
|
758
|
+
> => {
|
|
759
|
+
|
|
760
|
+
const mutationOptions = getSegmentRemoveTagFromEntityMutationOptions(options);
|
|
761
|
+
|
|
762
|
+
return useMutation(mutationOptions);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
476
765
|
* Optionally filtered by segment (segmentUid) or search query (q).
|
|
477
766
|
* @summary Retrieve all accounts.
|
|
478
767
|
*/
|
|
@@ -16,9 +16,13 @@ import type {
|
|
|
16
16
|
import type {
|
|
17
17
|
BroadcastCampaign,
|
|
18
18
|
CampaignAddBroadcastEmailBody,
|
|
19
|
+
CampaignAddTagToEntityBody,
|
|
19
20
|
CampaignGetAllBroadcastEmails200,
|
|
20
21
|
CampaignGetAllBroadcastEmailsParams,
|
|
22
|
+
CampaignGetTagsForEntity200,
|
|
23
|
+
CampaignGetTagsForEntityParams,
|
|
21
24
|
CampaignSendTestCampaignEmailBody,
|
|
25
|
+
CampaignSetTagsForEntityBody,
|
|
22
26
|
CampaignUpdateBroadcastEmailBody,
|
|
23
27
|
DripCampaign,
|
|
24
28
|
DripCampaignAddDripCampaignBody,
|
|
@@ -1333,6 +1337,291 @@ export const useCampaignSendTestCampaignEmail = <TError = void,
|
|
|
1333
1337
|
return useMutation(mutationOptions);
|
|
1334
1338
|
}
|
|
1335
1339
|
/**
|
|
1340
|
+
* Send the uids of the tags to add. Tags that the record already carries stay on it, and
|
|
1341
|
+
naming one of them again changes nothing, so the same request is safe to repeat. To
|
|
1342
|
+
replace the whole set instead, use PUT on this same path.
|
|
1343
|
+
|
|
1344
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
1345
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
1346
|
+
* @summary Add tags to a record.
|
|
1347
|
+
*/
|
|
1348
|
+
export const campaignAddTagToEntity = (
|
|
1349
|
+
entityUid: string | null,
|
|
1350
|
+
campaignAddTagToEntityBody: CampaignAddTagToEntityBody,
|
|
1351
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1352
|
+
) => {
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
return customFetch<Blob>(
|
|
1356
|
+
{url: `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`, method: 'POST',
|
|
1357
|
+
headers: {'Content-Type': 'application/json', },
|
|
1358
|
+
data: campaignAddTagToEntityBody,
|
|
1359
|
+
responseType: 'blob', signal
|
|
1360
|
+
},
|
|
1361
|
+
options);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
export const getCampaignAddTagToEntityMutationOptions = <TError = void,
|
|
1367
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignAddTagToEntity>>, TError,{entityUid: string | null;data: CampaignAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1368
|
+
): UseMutationOptions<Awaited<ReturnType<typeof campaignAddTagToEntity>>, TError,{entityUid: string | null;data: CampaignAddTagToEntityBody}, TContext> => {
|
|
1369
|
+
|
|
1370
|
+
const mutationKey = ['campaignAddTagToEntity'];
|
|
1371
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1372
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1373
|
+
options
|
|
1374
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1375
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof campaignAddTagToEntity>>, {entityUid: string | null;data: CampaignAddTagToEntityBody}> = (props) => {
|
|
1381
|
+
const {entityUid,data} = props ?? {};
|
|
1382
|
+
|
|
1383
|
+
return campaignAddTagToEntity(entityUid,data,requestOptions)
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
return { mutationFn, ...mutationOptions }}
|
|
1390
|
+
|
|
1391
|
+
export type CampaignAddTagToEntityMutationResult = NonNullable<Awaited<ReturnType<typeof campaignAddTagToEntity>>>
|
|
1392
|
+
export type CampaignAddTagToEntityMutationBody = CampaignAddTagToEntityBody
|
|
1393
|
+
export type CampaignAddTagToEntityMutationError = void
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* @summary Add tags to a record.
|
|
1397
|
+
*/
|
|
1398
|
+
export const useCampaignAddTagToEntity = <TError = void,
|
|
1399
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignAddTagToEntity>>, TError,{entityUid: string | null;data: CampaignAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1400
|
+
): UseMutationResult<
|
|
1401
|
+
Awaited<ReturnType<typeof campaignAddTagToEntity>>,
|
|
1402
|
+
TError,
|
|
1403
|
+
{entityUid: string | null;data: CampaignAddTagToEntityBody},
|
|
1404
|
+
TContext
|
|
1405
|
+
> => {
|
|
1406
|
+
|
|
1407
|
+
const mutationOptions = getCampaignAddTagToEntityMutationOptions(options);
|
|
1408
|
+
|
|
1409
|
+
return useMutation(mutationOptions);
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns the tags themselves, not the links that hold them. The same tags are also
|
|
1413
|
+
available on the record: ask for them with the fields parameter, for example
|
|
1414
|
+
fields=Uid,Tags.Uid,Tags.Name,Tags.TagColor. Tags cost an extra query, so the record
|
|
1415
|
+
leaves them out unless fields names Tags or is a plain wildcard.
|
|
1416
|
+
* @summary Retrieve the tags on a record.
|
|
1417
|
+
*/
|
|
1418
|
+
export const campaignGetTagsForEntity = (
|
|
1419
|
+
entityUid: string | null,
|
|
1420
|
+
params?: CampaignGetTagsForEntityParams,
|
|
1421
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1422
|
+
) => {
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
return customFetch<CampaignGetTagsForEntity200>(
|
|
1426
|
+
{url: `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`, method: 'GET',
|
|
1427
|
+
params, signal
|
|
1428
|
+
},
|
|
1429
|
+
options);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
export const getCampaignGetTagsForEntityQueryKey = (entityUid?: string | null,
|
|
1436
|
+
params?: CampaignGetTagsForEntityParams,) => {
|
|
1437
|
+
return [
|
|
1438
|
+
`/api/v1/email/campaigns/broadcasts/${entityUid}/tags`, ...(params ? [params]: [])
|
|
1439
|
+
] as const;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
export const getCampaignGetTagsForEntityQueryOptions = <TData = Awaited<ReturnType<typeof campaignGetTagsForEntity>>, TError = void>(entityUid: string | null,
|
|
1444
|
+
params?: CampaignGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof campaignGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1445
|
+
) => {
|
|
1446
|
+
|
|
1447
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1448
|
+
|
|
1449
|
+
const queryKey = queryOptions?.queryKey ?? getCampaignGetTagsForEntityQueryKey(entityUid,params);
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof campaignGetTagsForEntity>>> = ({ signal }) => campaignGetTagsForEntity(entityUid,params, requestOptions, signal);
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
return { queryKey, queryFn, enabled: !!(entityUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof campaignGetTagsForEntity>>, TError, TData> & { queryKey: QueryKey }
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export type CampaignGetTagsForEntityQueryResult = NonNullable<Awaited<ReturnType<typeof campaignGetTagsForEntity>>>
|
|
1463
|
+
export type CampaignGetTagsForEntityQueryError = void
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* @summary Retrieve the tags on a record.
|
|
1468
|
+
*/
|
|
1469
|
+
|
|
1470
|
+
export function useCampaignGetTagsForEntity<TData = Awaited<ReturnType<typeof campaignGetTagsForEntity>>, TError = void>(
|
|
1471
|
+
entityUid: string | null,
|
|
1472
|
+
params?: CampaignGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof campaignGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1473
|
+
|
|
1474
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1475
|
+
|
|
1476
|
+
const queryOptions = getCampaignGetTagsForEntityQueryOptions(entityUid,params,options)
|
|
1477
|
+
|
|
1478
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1479
|
+
|
|
1480
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1481
|
+
|
|
1482
|
+
return query;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Send the full set of tags the record must end with. A tag that the list leaves out is
|
|
1490
|
+
taken off the record, and one that the list names is added. Send an empty list to take
|
|
1491
|
+
every tag off. To add tags without disturbing the others, use POST on this same path.
|
|
1492
|
+
|
|
1493
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
1494
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
1495
|
+
* @summary Replace the tags on a record.
|
|
1496
|
+
*/
|
|
1497
|
+
export const campaignSetTagsForEntity = (
|
|
1498
|
+
entityUid: string | null,
|
|
1499
|
+
campaignSetTagsForEntityBody: CampaignSetTagsForEntityBody,
|
|
1500
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
return customFetch<Blob>(
|
|
1504
|
+
{url: `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`, method: 'PUT',
|
|
1505
|
+
headers: {'Content-Type': 'application/json', },
|
|
1506
|
+
data: campaignSetTagsForEntityBody,
|
|
1507
|
+
responseType: 'blob'
|
|
1508
|
+
},
|
|
1509
|
+
options);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
export const getCampaignSetTagsForEntityMutationOptions = <TError = void,
|
|
1515
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignSetTagsForEntity>>, TError,{entityUid: string | null;data: CampaignSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1516
|
+
): UseMutationOptions<Awaited<ReturnType<typeof campaignSetTagsForEntity>>, TError,{entityUid: string | null;data: CampaignSetTagsForEntityBody}, TContext> => {
|
|
1517
|
+
|
|
1518
|
+
const mutationKey = ['campaignSetTagsForEntity'];
|
|
1519
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1520
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1521
|
+
options
|
|
1522
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1523
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof campaignSetTagsForEntity>>, {entityUid: string | null;data: CampaignSetTagsForEntityBody}> = (props) => {
|
|
1529
|
+
const {entityUid,data} = props ?? {};
|
|
1530
|
+
|
|
1531
|
+
return campaignSetTagsForEntity(entityUid,data,requestOptions)
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
return { mutationFn, ...mutationOptions }}
|
|
1538
|
+
|
|
1539
|
+
export type CampaignSetTagsForEntityMutationResult = NonNullable<Awaited<ReturnType<typeof campaignSetTagsForEntity>>>
|
|
1540
|
+
export type CampaignSetTagsForEntityMutationBody = CampaignSetTagsForEntityBody
|
|
1541
|
+
export type CampaignSetTagsForEntityMutationError = void
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* @summary Replace the tags on a record.
|
|
1545
|
+
*/
|
|
1546
|
+
export const useCampaignSetTagsForEntity = <TError = void,
|
|
1547
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignSetTagsForEntity>>, TError,{entityUid: string | null;data: CampaignSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1548
|
+
): UseMutationResult<
|
|
1549
|
+
Awaited<ReturnType<typeof campaignSetTagsForEntity>>,
|
|
1550
|
+
TError,
|
|
1551
|
+
{entityUid: string | null;data: CampaignSetTagsForEntityBody},
|
|
1552
|
+
TContext
|
|
1553
|
+
> => {
|
|
1554
|
+
|
|
1555
|
+
const mutationOptions = getCampaignSetTagsForEntityMutationOptions(options);
|
|
1556
|
+
|
|
1557
|
+
return useMutation(mutationOptions);
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* The tag itself is kept and stays available for other records. If the record does not
|
|
1561
|
+
carry the tag, nothing changes and the call still succeeds.
|
|
1562
|
+
* @summary Remove one tag from a record.
|
|
1563
|
+
*/
|
|
1564
|
+
export const campaignRemoveTagFromEntity = (
|
|
1565
|
+
entityUid: string | null,
|
|
1566
|
+
tagUid: string | null,
|
|
1567
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
return customFetch<Blob>(
|
|
1571
|
+
{url: `/api/v1/email/campaigns/broadcasts/${entityUid}/tags/${tagUid}`, method: 'DELETE',
|
|
1572
|
+
responseType: 'blob'
|
|
1573
|
+
},
|
|
1574
|
+
options);
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
export const getCampaignRemoveTagFromEntityMutationOptions = <TError = void,
|
|
1580
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1581
|
+
): UseMutationOptions<Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext> => {
|
|
1582
|
+
|
|
1583
|
+
const mutationKey = ['campaignRemoveTagFromEntity'];
|
|
1584
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1585
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1586
|
+
options
|
|
1587
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1588
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>, {entityUid: string | null;tagUid: string | null}> = (props) => {
|
|
1594
|
+
const {entityUid,tagUid} = props ?? {};
|
|
1595
|
+
|
|
1596
|
+
return campaignRemoveTagFromEntity(entityUid,tagUid,requestOptions)
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
return { mutationFn, ...mutationOptions }}
|
|
1603
|
+
|
|
1604
|
+
export type CampaignRemoveTagFromEntityMutationResult = NonNullable<Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>>
|
|
1605
|
+
|
|
1606
|
+
export type CampaignRemoveTagFromEntityMutationError = void
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* @summary Remove one tag from a record.
|
|
1610
|
+
*/
|
|
1611
|
+
export const useCampaignRemoveTagFromEntity = <TError = void,
|
|
1612
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1613
|
+
): UseMutationResult<
|
|
1614
|
+
Awaited<ReturnType<typeof campaignRemoveTagFromEntity>>,
|
|
1615
|
+
TError,
|
|
1616
|
+
{entityUid: string | null;tagUid: string | null},
|
|
1617
|
+
TContext
|
|
1618
|
+
> => {
|
|
1619
|
+
|
|
1620
|
+
const mutationOptions = getCampaignRemoveTagFromEntityMutationOptions(options);
|
|
1621
|
+
|
|
1622
|
+
return useMutation(mutationOptions);
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1336
1625
|
* @summary Retrieve all email lists.
|
|
1337
1626
|
*/
|
|
1338
1627
|
export const emailListGetAllEmailLists = (
|