@outseta/react 0.4.32 → 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.
@@ -101,7 +101,7 @@ export const TagColor = {
101
101
  } as const;
102
102
 
103
103
  /**
104
- * `0` - None, `1` - Account, `2` - Person, `3` - Deal, `4` - Case, `5` - Invoice, `6` - EmailLog, `7` - Plan, `8` - DiscountCoupon, `9` - AddOn, `10` - Task, `11` - Segment, `12` - Broadcast
104
+ * `0` - None, `1` - Account, `2` - Person, `3` - Deal, `4` - Case, `5` - Invoice, `6` - EmailLog, `7` - Plan, `8` - DiscountCoupon, `9` - AddOn, `10` - Task, `11` - Segment, `12` - Broadcast, `13` - Article
105
105
  */
106
106
  export type EntityType = typeof EntityType[keyof typeof EntityType];
107
107
 
@@ -121,6 +121,7 @@ export const EntityType = {
121
121
  Task: 10,
122
122
  Segment: 11,
123
123
  Broadcast: 12,
124
+ Article: 13,
124
125
  } as const;
125
126
 
126
127
  export type DefinitionAllOf = {
@@ -3211,6 +3212,8 @@ export type ArticleAllOf = {
3211
3212
  * @nullable
3212
3213
  */
3213
3214
  Keywords?: string | null;
3215
+ /** @nullable */
3216
+ Tags?: Tag[] | null;
3214
3217
  };
3215
3218
 
3216
3219
  export type Article = AbstractQcountBean & ArticleAllOf;
@@ -3243,6 +3246,11 @@ export type CategoryAllOf = {
3243
3246
 
3244
3247
  export type Category = AbstractQcountBean & CategoryAllOf;
3245
3248
 
3249
+ export interface TagUidList {
3250
+ /** @nullable */
3251
+ TagUids?: string[] | null;
3252
+ }
3253
+
3246
3254
  export type SupportSettingsAllOf = {
3247
3255
  /** @nullable */
3248
3256
  EmailAddress?: string | null;
@@ -3266,6 +3274,8 @@ export type SupportSettingsAllOf = {
3266
3274
  /** @nullable */
3267
3275
  KnowledgeBaseFooterLinkJSON?: string | null;
3268
3276
  /** @nullable */
3277
+ KnowledgeBaseFilterJSON?: string | null;
3278
+ /** @nullable */
3269
3279
  OfficeHoursJSON?: string | null;
3270
3280
  /** @nullable */
3271
3281
  EmailNotificationForNewTickets?: string | null;
@@ -4378,11 +4388,6 @@ export interface SendTestEmailRequest2 {
4378
4388
  AdditionalRecipients?: string[] | null;
4379
4389
  }
4380
4390
 
4381
- export interface TagUidList {
4382
- /** @nullable */
4383
- TagUids?: string[] | null;
4384
- }
4385
-
4386
4391
  /**
4387
4392
  * @nullable
4388
4393
  */
@@ -9364,6 +9369,14 @@ export type ArticleGetAllArticlesParams = {
9364
9369
  * @nullable
9365
9370
  */
9366
9371
  q?: string | null;
9372
+ /**
9373
+ * Keep only the records that carry one of these tags. Separate several tag uids with commas. The value none keeps the records that carry no tag at all.
9374
+ */
9375
+ tagUid?: string;
9376
+ /**
9377
+ * Keep only the records that carry none of these tags. Separate several tag uids with commas. Combined with tagUid, the two widen the result instead of narrowing it: a record is kept when it matches either one.
9378
+ */
9379
+ withoutTagUid?: string;
9367
9380
  /**
9368
9381
  * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9369
9382
  */
@@ -9384,6 +9397,32 @@ export type ArticleGetAllArticles200 = {
9384
9397
  */
9385
9398
  export type ArticleAddArticleBody = Article | null;
9386
9399
 
9400
+ /**
9401
+ * @nullable
9402
+ */
9403
+ export type ArticleAddTagToEntityBody = TagUidList | null;
9404
+
9405
+ export type ArticleGetTagsForEntityParams = {
9406
+ /**
9407
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9408
+ */
9409
+ limit?: LimitParameter;
9410
+ /**
9411
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
9412
+ */
9413
+ offset?: OffsetParameter;
9414
+ };
9415
+
9416
+ export type ArticleGetTagsForEntity200 = {
9417
+ metadata?: CollectionMetadata;
9418
+ items?: Tag[];
9419
+ };
9420
+
9421
+ /**
9422
+ * @nullable
9423
+ */
9424
+ export type ArticleSetTagsForEntityBody = TagUidList | null;
9425
+
9387
9426
  export type CategoryGetAllCategoriesParams = {
9388
9427
  /**
9389
9428
  * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
@@ -9479,6 +9518,14 @@ export type DripCampaignUpdateDripCampaignMessageBody = DripCampaignMessage | nu
9479
9518
  export type DripCampaignSendTestCampaignEmailBody = SendTestEmailRequest | null;
9480
9519
 
9481
9520
  export type CampaignGetAllBroadcastEmailsParams = {
9521
+ /**
9522
+ * Keep only the records that carry one of these tags. Separate several tag uids with commas. The value none keeps the records that carry no tag at all.
9523
+ */
9524
+ tagUid?: string;
9525
+ /**
9526
+ * Keep only the records that carry none of these tags. Separate several tag uids with commas. Combined with tagUid, the two widen the result instead of narrowing it: a record is kept when it matches either one.
9527
+ */
9528
+ withoutTagUid?: string;
9482
9529
  /**
9483
9530
  * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9484
9531
  */
@@ -9509,6 +9556,32 @@ export type CampaignUpdateBroadcastEmailBody = BroadcastCampaign | null;
9509
9556
  */
9510
9557
  export type CampaignSendTestCampaignEmailBody = SendTestEmailRequest2 | null;
9511
9558
 
9559
+ /**
9560
+ * @nullable
9561
+ */
9562
+ export type CampaignAddTagToEntityBody = TagUidList | null;
9563
+
9564
+ export type CampaignGetTagsForEntityParams = {
9565
+ /**
9566
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9567
+ */
9568
+ limit?: LimitParameter;
9569
+ /**
9570
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
9571
+ */
9572
+ offset?: OffsetParameter;
9573
+ };
9574
+
9575
+ export type CampaignGetTagsForEntity200 = {
9576
+ metadata?: CollectionMetadata;
9577
+ items?: Tag[];
9578
+ };
9579
+
9580
+ /**
9581
+ * @nullable
9582
+ */
9583
+ export type CampaignSetTagsForEntityBody = TagUidList | null;
9584
+
9512
9585
  export type EmailListGetAllEmailListsParams = {
9513
9586
  /**
9514
9587
  * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
@@ -9597,6 +9670,32 @@ export type DealAddDealBody = Deal | null;
9597
9670
  */
9598
9671
  export type DealUpdateDealBody = Deal | null;
9599
9672
 
9673
+ /**
9674
+ * @nullable
9675
+ */
9676
+ export type SegmentAddTagToEntityBody = TagUidList | null;
9677
+
9678
+ export type SegmentGetTagsForEntityParams = {
9679
+ /**
9680
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9681
+ */
9682
+ limit?: LimitParameter;
9683
+ /**
9684
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
9685
+ */
9686
+ offset?: OffsetParameter;
9687
+ };
9688
+
9689
+ export type SegmentGetTagsForEntity200 = {
9690
+ metadata?: CollectionMetadata;
9691
+ items?: Tag[];
9692
+ };
9693
+
9694
+ /**
9695
+ * @nullable
9696
+ */
9697
+ export type SegmentSetTagsForEntityBody = TagUidList | null;
9698
+
9600
9699
  export type AccountGetAllAccountsParams = {
9601
9700
  /**
9602
9701
  * Accounts are filtered based on whether they are associated with the segment
@@ -16,8 +16,12 @@ import type {
16
16
  import type {
17
17
  Article,
18
18
  ArticleAddArticleBody,
19
+ ArticleAddTagToEntityBody,
19
20
  ArticleGetAllArticles200,
20
21
  ArticleGetAllArticlesParams,
22
+ ArticleGetTagsForEntity200,
23
+ ArticleGetTagsForEntityParams,
24
+ ArticleSetTagsForEntityBody,
21
25
  Case,
22
26
  CaseAddCaseBody,
23
27
  CaseAddCaseParams,
@@ -679,6 +683,291 @@ export function useArticleGetArticle<TData = Awaited<ReturnType<typeof articleGe
679
683
 
680
684
 
681
685
  /**
686
+ * Send the uids of the tags to add. Tags that the record already carries stay on it, and
687
+ naming one of them again changes nothing, so the same request is safe to repeat. To
688
+ replace the whole set instead, use PUT on this same path.
689
+
690
+ A tag belongs to one entity type, so use tags whose EntityType matches this record.
691
+ List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
692
+ * @summary Add tags to a record.
693
+ */
694
+ export const articleAddTagToEntity = (
695
+ entityUid: string | null,
696
+ articleAddTagToEntityBody: ArticleAddTagToEntityBody,
697
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
698
+ ) => {
699
+
700
+
701
+ return customFetch<Blob>(
702
+ {url: `/api/v1/support/articles/${entityUid}/tags`, method: 'POST',
703
+ headers: {'Content-Type': 'application/json', },
704
+ data: articleAddTagToEntityBody,
705
+ responseType: 'blob', signal
706
+ },
707
+ options);
708
+ }
709
+
710
+
711
+
712
+ export const getArticleAddTagToEntityMutationOptions = <TError = void,
713
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleAddTagToEntity>>, TError,{entityUid: string | null;data: ArticleAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
714
+ ): UseMutationOptions<Awaited<ReturnType<typeof articleAddTagToEntity>>, TError,{entityUid: string | null;data: ArticleAddTagToEntityBody}, TContext> => {
715
+
716
+ const mutationKey = ['articleAddTagToEntity'];
717
+ const {mutation: mutationOptions, request: requestOptions} = options ?
718
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
719
+ options
720
+ : {...options, mutation: {...options.mutation, mutationKey}}
721
+ : {mutation: { mutationKey, }, request: undefined};
722
+
723
+
724
+
725
+
726
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof articleAddTagToEntity>>, {entityUid: string | null;data: ArticleAddTagToEntityBody}> = (props) => {
727
+ const {entityUid,data} = props ?? {};
728
+
729
+ return articleAddTagToEntity(entityUid,data,requestOptions)
730
+ }
731
+
732
+
733
+
734
+
735
+ return { mutationFn, ...mutationOptions }}
736
+
737
+ export type ArticleAddTagToEntityMutationResult = NonNullable<Awaited<ReturnType<typeof articleAddTagToEntity>>>
738
+ export type ArticleAddTagToEntityMutationBody = ArticleAddTagToEntityBody
739
+ export type ArticleAddTagToEntityMutationError = void
740
+
741
+ /**
742
+ * @summary Add tags to a record.
743
+ */
744
+ export const useArticleAddTagToEntity = <TError = void,
745
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleAddTagToEntity>>, TError,{entityUid: string | null;data: ArticleAddTagToEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
746
+ ): UseMutationResult<
747
+ Awaited<ReturnType<typeof articleAddTagToEntity>>,
748
+ TError,
749
+ {entityUid: string | null;data: ArticleAddTagToEntityBody},
750
+ TContext
751
+ > => {
752
+
753
+ const mutationOptions = getArticleAddTagToEntityMutationOptions(options);
754
+
755
+ return useMutation(mutationOptions);
756
+ }
757
+ /**
758
+ * Returns the tags themselves, not the links that hold them. The same tags are also
759
+ available on the record: ask for them with the fields parameter, for example
760
+ fields=Uid,Tags.Uid,Tags.Name,Tags.TagColor. Tags cost an extra query, so the record
761
+ leaves them out unless fields names Tags or is a plain wildcard.
762
+ * @summary Retrieve the tags on a record.
763
+ */
764
+ export const articleGetTagsForEntity = (
765
+ entityUid: string | null,
766
+ params?: ArticleGetTagsForEntityParams,
767
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
768
+ ) => {
769
+
770
+
771
+ return customFetch<ArticleGetTagsForEntity200>(
772
+ {url: `/api/v1/support/articles/${entityUid}/tags`, method: 'GET',
773
+ params, signal
774
+ },
775
+ options);
776
+ }
777
+
778
+
779
+
780
+
781
+ export const getArticleGetTagsForEntityQueryKey = (entityUid?: string | null,
782
+ params?: ArticleGetTagsForEntityParams,) => {
783
+ return [
784
+ `/api/v1/support/articles/${entityUid}/tags`, ...(params ? [params]: [])
785
+ ] as const;
786
+ }
787
+
788
+
789
+ export const getArticleGetTagsForEntityQueryOptions = <TData = Awaited<ReturnType<typeof articleGetTagsForEntity>>, TError = void>(entityUid: string | null,
790
+ params?: ArticleGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
791
+ ) => {
792
+
793
+ const {query: queryOptions, request: requestOptions} = options ?? {};
794
+
795
+ const queryKey = queryOptions?.queryKey ?? getArticleGetTagsForEntityQueryKey(entityUid,params);
796
+
797
+
798
+
799
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof articleGetTagsForEntity>>> = ({ signal }) => articleGetTagsForEntity(entityUid,params, requestOptions, signal);
800
+
801
+
802
+
803
+
804
+
805
+ return { queryKey, queryFn, enabled: !!(entityUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof articleGetTagsForEntity>>, TError, TData> & { queryKey: QueryKey }
806
+ }
807
+
808
+ export type ArticleGetTagsForEntityQueryResult = NonNullable<Awaited<ReturnType<typeof articleGetTagsForEntity>>>
809
+ export type ArticleGetTagsForEntityQueryError = void
810
+
811
+
812
+ /**
813
+ * @summary Retrieve the tags on a record.
814
+ */
815
+
816
+ export function useArticleGetTagsForEntity<TData = Awaited<ReturnType<typeof articleGetTagsForEntity>>, TError = void>(
817
+ entityUid: string | null,
818
+ params?: ArticleGetTagsForEntityParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetTagsForEntity>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
819
+
820
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
821
+
822
+ const queryOptions = getArticleGetTagsForEntityQueryOptions(entityUid,params,options)
823
+
824
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
825
+
826
+ query.queryKey = queryOptions.queryKey ;
827
+
828
+ return query;
829
+ }
830
+
831
+
832
+
833
+
834
+ /**
835
+ * Send the full set of tags the record must end with. A tag that the list leaves out is
836
+ taken off the record, and one that the list names is added. Send an empty list to take
837
+ every tag off. To add tags without disturbing the others, use POST on this same path.
838
+
839
+ A tag belongs to one entity type, so use tags whose EntityType matches this record.
840
+ List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
841
+ * @summary Replace the tags on a record.
842
+ */
843
+ export const articleSetTagsForEntity = (
844
+ entityUid: string | null,
845
+ articleSetTagsForEntityBody: ArticleSetTagsForEntityBody,
846
+ options?: SecondParameter<typeof customFetch>,) => {
847
+
848
+
849
+ return customFetch<Blob>(
850
+ {url: `/api/v1/support/articles/${entityUid}/tags`, method: 'PUT',
851
+ headers: {'Content-Type': 'application/json', },
852
+ data: articleSetTagsForEntityBody,
853
+ responseType: 'blob'
854
+ },
855
+ options);
856
+ }
857
+
858
+
859
+
860
+ export const getArticleSetTagsForEntityMutationOptions = <TError = void,
861
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleSetTagsForEntity>>, TError,{entityUid: string | null;data: ArticleSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
862
+ ): UseMutationOptions<Awaited<ReturnType<typeof articleSetTagsForEntity>>, TError,{entityUid: string | null;data: ArticleSetTagsForEntityBody}, TContext> => {
863
+
864
+ const mutationKey = ['articleSetTagsForEntity'];
865
+ const {mutation: mutationOptions, request: requestOptions} = options ?
866
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
867
+ options
868
+ : {...options, mutation: {...options.mutation, mutationKey}}
869
+ : {mutation: { mutationKey, }, request: undefined};
870
+
871
+
872
+
873
+
874
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof articleSetTagsForEntity>>, {entityUid: string | null;data: ArticleSetTagsForEntityBody}> = (props) => {
875
+ const {entityUid,data} = props ?? {};
876
+
877
+ return articleSetTagsForEntity(entityUid,data,requestOptions)
878
+ }
879
+
880
+
881
+
882
+
883
+ return { mutationFn, ...mutationOptions }}
884
+
885
+ export type ArticleSetTagsForEntityMutationResult = NonNullable<Awaited<ReturnType<typeof articleSetTagsForEntity>>>
886
+ export type ArticleSetTagsForEntityMutationBody = ArticleSetTagsForEntityBody
887
+ export type ArticleSetTagsForEntityMutationError = void
888
+
889
+ /**
890
+ * @summary Replace the tags on a record.
891
+ */
892
+ export const useArticleSetTagsForEntity = <TError = void,
893
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleSetTagsForEntity>>, TError,{entityUid: string | null;data: ArticleSetTagsForEntityBody}, TContext>, request?: SecondParameter<typeof customFetch>}
894
+ ): UseMutationResult<
895
+ Awaited<ReturnType<typeof articleSetTagsForEntity>>,
896
+ TError,
897
+ {entityUid: string | null;data: ArticleSetTagsForEntityBody},
898
+ TContext
899
+ > => {
900
+
901
+ const mutationOptions = getArticleSetTagsForEntityMutationOptions(options);
902
+
903
+ return useMutation(mutationOptions);
904
+ }
905
+ /**
906
+ * The tag itself is kept and stays available for other records. If the record does not
907
+ carry the tag, nothing changes and the call still succeeds.
908
+ * @summary Remove one tag from a record.
909
+ */
910
+ export const articleRemoveTagFromEntity = (
911
+ entityUid: string | null,
912
+ tagUid: string | null,
913
+ options?: SecondParameter<typeof customFetch>,) => {
914
+
915
+
916
+ return customFetch<Blob>(
917
+ {url: `/api/v1/support/articles/${entityUid}/tags/${tagUid}`, method: 'DELETE',
918
+ responseType: 'blob'
919
+ },
920
+ options);
921
+ }
922
+
923
+
924
+
925
+ export const getArticleRemoveTagFromEntityMutationOptions = <TError = void,
926
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
927
+ ): UseMutationOptions<Awaited<ReturnType<typeof articleRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext> => {
928
+
929
+ const mutationKey = ['articleRemoveTagFromEntity'];
930
+ const {mutation: mutationOptions, request: requestOptions} = options ?
931
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
932
+ options
933
+ : {...options, mutation: {...options.mutation, mutationKey}}
934
+ : {mutation: { mutationKey, }, request: undefined};
935
+
936
+
937
+
938
+
939
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof articleRemoveTagFromEntity>>, {entityUid: string | null;tagUid: string | null}> = (props) => {
940
+ const {entityUid,tagUid} = props ?? {};
941
+
942
+ return articleRemoveTagFromEntity(entityUid,tagUid,requestOptions)
943
+ }
944
+
945
+
946
+
947
+
948
+ return { mutationFn, ...mutationOptions }}
949
+
950
+ export type ArticleRemoveTagFromEntityMutationResult = NonNullable<Awaited<ReturnType<typeof articleRemoveTagFromEntity>>>
951
+
952
+ export type ArticleRemoveTagFromEntityMutationError = void
953
+
954
+ /**
955
+ * @summary Remove one tag from a record.
956
+ */
957
+ export const useArticleRemoveTagFromEntity = <TError = void,
958
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleRemoveTagFromEntity>>, TError,{entityUid: string | null;tagUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
959
+ ): UseMutationResult<
960
+ Awaited<ReturnType<typeof articleRemoveTagFromEntity>>,
961
+ TError,
962
+ {entityUid: string | null;tagUid: string | null},
963
+ TContext
964
+ > => {
965
+
966
+ const mutationOptions = getArticleRemoveTagFromEntityMutationOptions(options);
967
+
968
+ return useMutation(mutationOptions);
969
+ }
970
+ /**
682
971
  * @summary Retrieve all knowledge base categories.
683
972
  */
684
973
  export const categoryGetAllCategories = (