@outseta/api-client 0.3.39 → 0.3.41
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 +173 -1
- package/package.json +1 -1
- package/src/generated/attribute/attribute.ts +17 -8
- package/src/generated/crm/crm.ts +241 -1
- package/src/generated/email/email.ts +240 -0
- package/src/generated/models/accountAllOf.ts +3 -0
- package/src/generated/models/accountWebhookEntity.ts +3 -0
- package/src/generated/models/accountWebhookEntityCurrentStripeProductInstancesItem.ts +85 -0
- package/src/generated/models/accountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode.ts +13 -0
- package/src/generated/models/articleAddTagToEntityBody.ts +7 -0
- package/src/generated/models/articleAllOf.ts +3 -0
- package/src/generated/models/articleGetAllArticlesParams.ts +8 -0
- package/src/generated/models/articleGetTagsForEntity200.ts +8 -0
- package/src/generated/models/articleGetTagsForEntityParams.ts +14 -0
- package/src/generated/models/articleSetTagsForEntityBody.ts +7 -0
- package/src/generated/models/campaignAddTagToEntityBody.ts +7 -0
- package/src/generated/models/campaignGetAllBroadcastEmailsParams.ts +8 -0
- package/src/generated/models/campaignGetTagsForEntity200.ts +8 -0
- package/src/generated/models/campaignGetTagsForEntityParams.ts +14 -0
- package/src/generated/models/campaignSetTagsForEntityBody.ts +7 -0
- package/src/generated/models/crmSettingsAllOf.ts +0 -1
- package/src/generated/models/entityType.ts +2 -1
- package/src/generated/models/index.ts +14 -0
- package/src/generated/models/segmentAddTagToEntityBody.ts +7 -0
- package/src/generated/models/segmentGetTagsForEntity200.ts +8 -0
- package/src/generated/models/segmentGetTagsForEntityParams.ts +14 -0
- package/src/generated/models/segmentSetTagsForEntityBody.ts +7 -0
- package/src/generated/models/stripeProductAllOf.ts +2 -0
- package/src/generated/models/supportSettingsAllOf.ts +2 -0
- package/src/generated/support/support.ts +240 -0
package/dist/index.js
CHANGED
|
@@ -674,6 +674,53 @@ var registrationRegisterAccount = async (account, options) => {
|
|
|
674
674
|
body: JSON.stringify(account)
|
|
675
675
|
});
|
|
676
676
|
};
|
|
677
|
+
var getSegmentAddTagToEntityUrl = (entityUid) => {
|
|
678
|
+
return `/api/v1/crm/segments/${entityUid}/tags`;
|
|
679
|
+
};
|
|
680
|
+
var segmentAddTagToEntity = async (entityUid, segmentAddTagToEntityBody, options) => {
|
|
681
|
+
return customFetch(getSegmentAddTagToEntityUrl(entityUid), {
|
|
682
|
+
...options,
|
|
683
|
+
method: "POST",
|
|
684
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
685
|
+
body: JSON.stringify(segmentAddTagToEntityBody)
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
var getSegmentGetTagsForEntityUrl = (entityUid, params) => {
|
|
689
|
+
const normalizedParams = new URLSearchParams;
|
|
690
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
691
|
+
if (value !== undefined) {
|
|
692
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
const stringifiedParams = normalizedParams.toString();
|
|
696
|
+
return stringifiedParams.length > 0 ? `/api/v1/crm/segments/${entityUid}/tags?${stringifiedParams}` : `/api/v1/crm/segments/${entityUid}/tags`;
|
|
697
|
+
};
|
|
698
|
+
var segmentGetTagsForEntity = async (entityUid, params, options) => {
|
|
699
|
+
return customFetch(getSegmentGetTagsForEntityUrl(entityUid, params), {
|
|
700
|
+
...options,
|
|
701
|
+
method: "GET"
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
var getSegmentSetTagsForEntityUrl = (entityUid) => {
|
|
705
|
+
return `/api/v1/crm/segments/${entityUid}/tags`;
|
|
706
|
+
};
|
|
707
|
+
var segmentSetTagsForEntity = async (entityUid, segmentSetTagsForEntityBody, options) => {
|
|
708
|
+
return customFetch(getSegmentSetTagsForEntityUrl(entityUid), {
|
|
709
|
+
...options,
|
|
710
|
+
method: "PUT",
|
|
711
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
712
|
+
body: JSON.stringify(segmentSetTagsForEntityBody)
|
|
713
|
+
});
|
|
714
|
+
};
|
|
715
|
+
var getSegmentRemoveTagFromEntityUrl = (entityUid, tagUid) => {
|
|
716
|
+
return `/api/v1/crm/segments/${entityUid}/tags/${tagUid}`;
|
|
717
|
+
};
|
|
718
|
+
var segmentRemoveTagFromEntity = async (entityUid, tagUid, options) => {
|
|
719
|
+
return customFetch(getSegmentRemoveTagFromEntityUrl(entityUid, tagUid), {
|
|
720
|
+
...options,
|
|
721
|
+
method: "DELETE"
|
|
722
|
+
});
|
|
723
|
+
};
|
|
677
724
|
var getAccountGetAllAccountsUrl = (params) => {
|
|
678
725
|
const normalizedParams = new URLSearchParams;
|
|
679
726
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -1099,6 +1146,53 @@ var campaignSendTestCampaignEmail = async (campaignSendTestCampaignEmailBody, op
|
|
|
1099
1146
|
body: JSON.stringify(campaignSendTestCampaignEmailBody)
|
|
1100
1147
|
});
|
|
1101
1148
|
};
|
|
1149
|
+
var getCampaignAddTagToEntityUrl = (entityUid) => {
|
|
1150
|
+
return `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`;
|
|
1151
|
+
};
|
|
1152
|
+
var campaignAddTagToEntity = async (entityUid, campaignAddTagToEntityBody, options) => {
|
|
1153
|
+
return customFetch(getCampaignAddTagToEntityUrl(entityUid), {
|
|
1154
|
+
...options,
|
|
1155
|
+
method: "POST",
|
|
1156
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1157
|
+
body: JSON.stringify(campaignAddTagToEntityBody)
|
|
1158
|
+
});
|
|
1159
|
+
};
|
|
1160
|
+
var getCampaignGetTagsForEntityUrl = (entityUid, params) => {
|
|
1161
|
+
const normalizedParams = new URLSearchParams;
|
|
1162
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1163
|
+
if (value !== undefined) {
|
|
1164
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1168
|
+
return stringifiedParams.length > 0 ? `/api/v1/email/campaigns/broadcasts/${entityUid}/tags?${stringifiedParams}` : `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`;
|
|
1169
|
+
};
|
|
1170
|
+
var campaignGetTagsForEntity = async (entityUid, params, options) => {
|
|
1171
|
+
return customFetch(getCampaignGetTagsForEntityUrl(entityUid, params), {
|
|
1172
|
+
...options,
|
|
1173
|
+
method: "GET"
|
|
1174
|
+
});
|
|
1175
|
+
};
|
|
1176
|
+
var getCampaignSetTagsForEntityUrl = (entityUid) => {
|
|
1177
|
+
return `/api/v1/email/campaigns/broadcasts/${entityUid}/tags`;
|
|
1178
|
+
};
|
|
1179
|
+
var campaignSetTagsForEntity = async (entityUid, campaignSetTagsForEntityBody, options) => {
|
|
1180
|
+
return customFetch(getCampaignSetTagsForEntityUrl(entityUid), {
|
|
1181
|
+
...options,
|
|
1182
|
+
method: "PUT",
|
|
1183
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1184
|
+
body: JSON.stringify(campaignSetTagsForEntityBody)
|
|
1185
|
+
});
|
|
1186
|
+
};
|
|
1187
|
+
var getCampaignRemoveTagFromEntityUrl = (entityUid, tagUid) => {
|
|
1188
|
+
return `/api/v1/email/campaigns/broadcasts/${entityUid}/tags/${tagUid}`;
|
|
1189
|
+
};
|
|
1190
|
+
var campaignRemoveTagFromEntity = async (entityUid, tagUid, options) => {
|
|
1191
|
+
return customFetch(getCampaignRemoveTagFromEntityUrl(entityUid, tagUid), {
|
|
1192
|
+
...options,
|
|
1193
|
+
method: "DELETE"
|
|
1194
|
+
});
|
|
1195
|
+
};
|
|
1102
1196
|
var getEmailListGetAllEmailListsUrl = (params) => {
|
|
1103
1197
|
const normalizedParams = new URLSearchParams;
|
|
1104
1198
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -1300,6 +1394,53 @@ var articleGetArticle = async (articleUid, options) => {
|
|
|
1300
1394
|
method: "GET"
|
|
1301
1395
|
});
|
|
1302
1396
|
};
|
|
1397
|
+
var getArticleAddTagToEntityUrl = (entityUid) => {
|
|
1398
|
+
return `/api/v1/support/articles/${entityUid}/tags`;
|
|
1399
|
+
};
|
|
1400
|
+
var articleAddTagToEntity = async (entityUid, articleAddTagToEntityBody, options) => {
|
|
1401
|
+
return customFetch(getArticleAddTagToEntityUrl(entityUid), {
|
|
1402
|
+
...options,
|
|
1403
|
+
method: "POST",
|
|
1404
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1405
|
+
body: JSON.stringify(articleAddTagToEntityBody)
|
|
1406
|
+
});
|
|
1407
|
+
};
|
|
1408
|
+
var getArticleGetTagsForEntityUrl = (entityUid, params) => {
|
|
1409
|
+
const normalizedParams = new URLSearchParams;
|
|
1410
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1411
|
+
if (value !== undefined) {
|
|
1412
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1416
|
+
return stringifiedParams.length > 0 ? `/api/v1/support/articles/${entityUid}/tags?${stringifiedParams}` : `/api/v1/support/articles/${entityUid}/tags`;
|
|
1417
|
+
};
|
|
1418
|
+
var articleGetTagsForEntity = async (entityUid, params, options) => {
|
|
1419
|
+
return customFetch(getArticleGetTagsForEntityUrl(entityUid, params), {
|
|
1420
|
+
...options,
|
|
1421
|
+
method: "GET"
|
|
1422
|
+
});
|
|
1423
|
+
};
|
|
1424
|
+
var getArticleSetTagsForEntityUrl = (entityUid) => {
|
|
1425
|
+
return `/api/v1/support/articles/${entityUid}/tags`;
|
|
1426
|
+
};
|
|
1427
|
+
var articleSetTagsForEntity = async (entityUid, articleSetTagsForEntityBody, options) => {
|
|
1428
|
+
return customFetch(getArticleSetTagsForEntityUrl(entityUid), {
|
|
1429
|
+
...options,
|
|
1430
|
+
method: "PUT",
|
|
1431
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1432
|
+
body: JSON.stringify(articleSetTagsForEntityBody)
|
|
1433
|
+
});
|
|
1434
|
+
};
|
|
1435
|
+
var getArticleRemoveTagFromEntityUrl = (entityUid, tagUid) => {
|
|
1436
|
+
return `/api/v1/support/articles/${entityUid}/tags/${tagUid}`;
|
|
1437
|
+
};
|
|
1438
|
+
var articleRemoveTagFromEntity = async (entityUid, tagUid, options) => {
|
|
1439
|
+
return customFetch(getArticleRemoveTagFromEntityUrl(entityUid, tagUid), {
|
|
1440
|
+
...options,
|
|
1441
|
+
method: "DELETE"
|
|
1442
|
+
});
|
|
1443
|
+
};
|
|
1303
1444
|
var getCategoryGetAllCategoriesUrl = (params) => {
|
|
1304
1445
|
const normalizedParams = new URLSearchParams;
|
|
1305
1446
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -1350,6 +1491,11 @@ var AccountWebhookEntityAccountStage = {
|
|
|
1350
1491
|
Paused: 9,
|
|
1351
1492
|
Created: 10
|
|
1352
1493
|
};
|
|
1494
|
+
// src/generated/models/accountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode.ts
|
|
1495
|
+
var AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode = {
|
|
1496
|
+
Individual: 1,
|
|
1497
|
+
Team: 2
|
|
1498
|
+
};
|
|
1353
1499
|
// src/generated/models/accountWebhookEntityCurrentSubscriptionBillingRenewalTerm.ts
|
|
1354
1500
|
var AccountWebhookEntityCurrentSubscriptionBillingRenewalTerm = {
|
|
1355
1501
|
Monthly: 1,
|
|
@@ -1728,7 +1874,8 @@ var EntityType = {
|
|
|
1728
1874
|
AddOn: 9,
|
|
1729
1875
|
Task: 10,
|
|
1730
1876
|
Segment: 11,
|
|
1731
|
-
Broadcast: 12
|
|
1877
|
+
Broadcast: 12,
|
|
1878
|
+
Article: 13
|
|
1732
1879
|
};
|
|
1733
1880
|
// src/generated/models/lineItemType.ts
|
|
1734
1881
|
var LineItemType = {
|
|
@@ -1950,6 +2097,7 @@ export {
|
|
|
1950
2097
|
AccountRegistrationMode,
|
|
1951
2098
|
AccountStage,
|
|
1952
2099
|
AccountWebhookEntityAccountStage,
|
|
2100
|
+
AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode,
|
|
1953
2101
|
AccountWebhookEntityCurrentSubscriptionBillingRenewalTerm,
|
|
1954
2102
|
AccountWebhookEntityCurrentSubscriptionDiscountCouponSubscriptionsItemDiscountCouponDuration,
|
|
1955
2103
|
AccountWebhookEntityCurrentSubscriptionLatestInvoiceBillingInvoiceStatus,
|
|
@@ -2030,14 +2178,22 @@ export {
|
|
|
2030
2178
|
activityAddCustomActivity,
|
|
2031
2179
|
activityGetAll,
|
|
2032
2180
|
articleAddArticle,
|
|
2181
|
+
articleAddTagToEntity,
|
|
2033
2182
|
articleGetAllArticles,
|
|
2034
2183
|
articleGetArticle,
|
|
2184
|
+
articleGetTagsForEntity,
|
|
2185
|
+
articleRemoveTagFromEntity,
|
|
2186
|
+
articleSetTagsForEntity,
|
|
2035
2187
|
campaignAddBroadcastEmail,
|
|
2188
|
+
campaignAddTagToEntity,
|
|
2036
2189
|
campaignArchiveBroadcastCampaign,
|
|
2037
2190
|
campaignDeleteBroadcastCampaign,
|
|
2038
2191
|
campaignGetAllBroadcastEmails,
|
|
2039
2192
|
campaignGetBroadcastEmail,
|
|
2193
|
+
campaignGetTagsForEntity,
|
|
2194
|
+
campaignRemoveTagFromEntity,
|
|
2040
2195
|
campaignSendTestCampaignEmail,
|
|
2196
|
+
campaignSetTagsForEntity,
|
|
2041
2197
|
campaignUnscheduleBroadcastEmail,
|
|
2042
2198
|
campaignUpdateBroadcastEmail,
|
|
2043
2199
|
caseAddCase,
|
|
@@ -2094,14 +2250,22 @@ export {
|
|
|
2094
2250
|
getActivityAddCustomActivityUrl,
|
|
2095
2251
|
getActivityGetAllUrl,
|
|
2096
2252
|
getArticleAddArticleUrl,
|
|
2253
|
+
getArticleAddTagToEntityUrl,
|
|
2097
2254
|
getArticleGetAllArticlesUrl,
|
|
2098
2255
|
getArticleGetArticleUrl,
|
|
2256
|
+
getArticleGetTagsForEntityUrl,
|
|
2257
|
+
getArticleRemoveTagFromEntityUrl,
|
|
2258
|
+
getArticleSetTagsForEntityUrl,
|
|
2099
2259
|
getCampaignAddBroadcastEmailUrl,
|
|
2260
|
+
getCampaignAddTagToEntityUrl,
|
|
2100
2261
|
getCampaignArchiveBroadcastCampaignUrl,
|
|
2101
2262
|
getCampaignDeleteBroadcastCampaignUrl,
|
|
2102
2263
|
getCampaignGetAllBroadcastEmailsUrl,
|
|
2103
2264
|
getCampaignGetBroadcastEmailUrl,
|
|
2265
|
+
getCampaignGetTagsForEntityUrl,
|
|
2266
|
+
getCampaignRemoveTagFromEntityUrl,
|
|
2104
2267
|
getCampaignSendTestCampaignEmailUrl,
|
|
2268
|
+
getCampaignSetTagsForEntityUrl,
|
|
2105
2269
|
getCampaignUnscheduleBroadcastEmailUrl,
|
|
2106
2270
|
getCampaignUpdateBroadcastEmailUrl,
|
|
2107
2271
|
getCaseAddCaseUrl,
|
|
@@ -2170,6 +2334,10 @@ export {
|
|
|
2170
2334
|
getPlanGetPlanUrl,
|
|
2171
2335
|
getPlanUpdatePlanUrl,
|
|
2172
2336
|
getRegistrationRegisterAccountUrl,
|
|
2337
|
+
getSegmentAddTagToEntityUrl,
|
|
2338
|
+
getSegmentGetTagsForEntityUrl,
|
|
2339
|
+
getSegmentRemoveTagFromEntityUrl,
|
|
2340
|
+
getSegmentSetTagsForEntityUrl,
|
|
2173
2341
|
getSubscriptionAddDiscountToSubscriptionUrl,
|
|
2174
2342
|
getSubscriptionAddOnAddSubscriptionAddOnPreviewUrl,
|
|
2175
2343
|
getSubscriptionAddOnAddSubscriptionAddOnUrl,
|
|
@@ -2219,6 +2387,10 @@ export {
|
|
|
2219
2387
|
planGetPlan,
|
|
2220
2388
|
planUpdatePlan,
|
|
2221
2389
|
registrationRegisterAccount,
|
|
2390
|
+
segmentAddTagToEntity,
|
|
2391
|
+
segmentGetTagsForEntity,
|
|
2392
|
+
segmentRemoveTagFromEntity,
|
|
2393
|
+
segmentSetTagsForEntity,
|
|
2222
2394
|
subscriptionAddDiscountToSubscription,
|
|
2223
2395
|
subscriptionAddOnAddSubscriptionAddOn,
|
|
2224
2396
|
subscriptionAddOnAddSubscriptionAddOnPreview,
|
package/package.json
CHANGED
|
@@ -40,13 +40,18 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Each tag applies to a single entity type. Pass entityType
|
|
44
|
-
|
|
43
|
+
* Each tag applies to a single entity type. Pass entityType to retrieve the tags for one
|
|
44
|
+
of them, for example entityType=Article for knowledge base article tags.
|
|
45
45
|
|
|
46
|
-
How a tag goes onto a record depends on the entity type.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
How a tag goes onto a record depends on the entity type. Articles, broadcasts and
|
|
47
|
+
segments each take tags on a tags sub-resource of the record:
|
|
48
|
+
|
|
49
|
+
- POST /support/articles/{entityUid}/tags and PUT, GET, DELETE on the same path
|
|
50
|
+
- POST /email/campaigns/broadcasts/{entityUid}/tags and the same for the rest
|
|
51
|
+
- POST /crm/segments/{entityUid}/tags and the same for the rest
|
|
52
|
+
|
|
53
|
+
A support ticket is the exception. It holds its tags in its own CaseTags collection, so
|
|
54
|
+
you add and remove ticket tags with PUT /support/cases/{caseUid}.
|
|
50
55
|
|
|
51
56
|
Name is unique within an entity type. SystemName and SystemDescription identify a
|
|
52
57
|
built-in tag (for example Priority.Urgent) and are set by Outseta.
|
|
@@ -99,8 +104,9 @@ export const tagGetAllTags = async (params?: TagGetAllTagsParams, options?: Requ
|
|
|
99
104
|
|
|
100
105
|
|
|
101
106
|
/**
|
|
102
|
-
* Name and EntityType are required.
|
|
103
|
-
support tickets
|
|
107
|
+
* Name and EntityType are required. EntityType fixes what the tag can go on: 4 (Case) for
|
|
108
|
+
support tickets, 13 (Article) for knowledge base articles, 12 (Broadcast) for broadcast
|
|
109
|
+
emails, 11 (Segment) for segments. TagColor sets the color the tag shows in.
|
|
104
110
|
|
|
105
111
|
Name must be unique within an entity type. If the name already exists for that
|
|
106
112
|
entity type, the existing tag is returned instead of a duplicate, and its color is
|
|
@@ -260,6 +266,9 @@ export const tagUpdateTag = async (tagUid: string | null,
|
|
|
260
266
|
/**
|
|
261
267
|
* The tag is also taken off every record that carries it. For a Case tag, it is
|
|
262
268
|
removed from all support tickets that have it.
|
|
269
|
+
|
|
270
|
+
An Article tag that the knowledge base version filter names cannot be deleted. Take it
|
|
271
|
+
out of the version filter first, then delete it.
|
|
263
272
|
* @summary Delete a tag.
|
|
264
273
|
*/
|
|
265
274
|
export type tagDeleteTagResponse200 = {
|
package/src/generated/crm/crm.ts
CHANGED
|
@@ -23,7 +23,11 @@ import type {
|
|
|
23
23
|
PersonGetAllPeopleParams,
|
|
24
24
|
PersonRequestMagicLinkBody,
|
|
25
25
|
PersonSetTemporaryPasswordBody,
|
|
26
|
-
PersonUpdatePersonBody
|
|
26
|
+
PersonUpdatePersonBody,
|
|
27
|
+
SegmentAddTagToEntityBody,
|
|
28
|
+
SegmentGetTagsForEntity200,
|
|
29
|
+
SegmentGetTagsForEntityParams,
|
|
30
|
+
SegmentSetTagsForEntityBody
|
|
27
31
|
} from '.././models';
|
|
28
32
|
|
|
29
33
|
import { customFetch } from '../../client';
|
|
@@ -353,6 +357,242 @@ export const registrationRegisterAccount = async (account: NonReadonly<Account>,
|
|
|
353
357
|
);}
|
|
354
358
|
|
|
355
359
|
|
|
360
|
+
/**
|
|
361
|
+
* Send the uids of the tags to add. Tags that the record already carries stay on it, and
|
|
362
|
+
naming one of them again changes nothing, so the same request is safe to repeat. To
|
|
363
|
+
replace the whole set instead, use PUT on this same path.
|
|
364
|
+
|
|
365
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
366
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
367
|
+
* @summary Add tags to a record.
|
|
368
|
+
*/
|
|
369
|
+
export type segmentAddTagToEntityResponse200 = {
|
|
370
|
+
data: Blob
|
|
371
|
+
status: 200
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export type segmentAddTagToEntityResponse400 = {
|
|
375
|
+
data: void
|
|
376
|
+
status: 400
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export type segmentAddTagToEntityResponse401 = {
|
|
380
|
+
data: void
|
|
381
|
+
status: 401
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export type segmentAddTagToEntityResponse404 = {
|
|
385
|
+
data: void
|
|
386
|
+
status: 404
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export type segmentAddTagToEntityResponseSuccess = (segmentAddTagToEntityResponse200) & {
|
|
390
|
+
headers: Headers;
|
|
391
|
+
};
|
|
392
|
+
export type segmentAddTagToEntityResponseError = (segmentAddTagToEntityResponse400 | segmentAddTagToEntityResponse401 | segmentAddTagToEntityResponse404) & {
|
|
393
|
+
headers: Headers;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export type segmentAddTagToEntityResponse = (segmentAddTagToEntityResponseSuccess | segmentAddTagToEntityResponseError)
|
|
397
|
+
|
|
398
|
+
export const getSegmentAddTagToEntityUrl = (entityUid: string | null,) => {
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
return `/api/v1/crm/segments/${entityUid}/tags`
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export const segmentAddTagToEntity = async (entityUid: string | null,
|
|
407
|
+
segmentAddTagToEntityBody: SegmentAddTagToEntityBody, options?: RequestInit): Promise<segmentAddTagToEntityResponse> => {
|
|
408
|
+
|
|
409
|
+
return customFetch<segmentAddTagToEntityResponse>(getSegmentAddTagToEntityUrl(entityUid),
|
|
410
|
+
{
|
|
411
|
+
...options,
|
|
412
|
+
method: 'POST',
|
|
413
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
414
|
+
body: JSON.stringify(
|
|
415
|
+
segmentAddTagToEntityBody,)
|
|
416
|
+
}
|
|
417
|
+
);}
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Returns the tags themselves, not the links that hold them. The same tags are also
|
|
422
|
+
available on the record: ask for them with the fields parameter, for example
|
|
423
|
+
fields=Uid,Tags.Uid,Tags.Name,Tags.TagColor. Tags cost an extra query, so the record
|
|
424
|
+
leaves them out unless fields names Tags or is a plain wildcard.
|
|
425
|
+
* @summary Retrieve the tags on a record.
|
|
426
|
+
*/
|
|
427
|
+
export type segmentGetTagsForEntityResponse200 = {
|
|
428
|
+
data: SegmentGetTagsForEntity200
|
|
429
|
+
status: 200
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export type segmentGetTagsForEntityResponse400 = {
|
|
433
|
+
data: void
|
|
434
|
+
status: 400
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export type segmentGetTagsForEntityResponse401 = {
|
|
438
|
+
data: void
|
|
439
|
+
status: 401
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export type segmentGetTagsForEntityResponseSuccess = (segmentGetTagsForEntityResponse200) & {
|
|
443
|
+
headers: Headers;
|
|
444
|
+
};
|
|
445
|
+
export type segmentGetTagsForEntityResponseError = (segmentGetTagsForEntityResponse400 | segmentGetTagsForEntityResponse401) & {
|
|
446
|
+
headers: Headers;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
export type segmentGetTagsForEntityResponse = (segmentGetTagsForEntityResponseSuccess | segmentGetTagsForEntityResponseError)
|
|
450
|
+
|
|
451
|
+
export const getSegmentGetTagsForEntityUrl = (entityUid: string | null,
|
|
452
|
+
params?: SegmentGetTagsForEntityParams,) => {
|
|
453
|
+
const normalizedParams = new URLSearchParams();
|
|
454
|
+
|
|
455
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
456
|
+
|
|
457
|
+
if (value !== undefined) {
|
|
458
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
const stringifiedParams = normalizedParams.toString();
|
|
463
|
+
|
|
464
|
+
return stringifiedParams.length > 0 ? `/api/v1/crm/segments/${entityUid}/tags?${stringifiedParams}` : `/api/v1/crm/segments/${entityUid}/tags`
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export const segmentGetTagsForEntity = async (entityUid: string | null,
|
|
468
|
+
params?: SegmentGetTagsForEntityParams, options?: RequestInit): Promise<segmentGetTagsForEntityResponse> => {
|
|
469
|
+
|
|
470
|
+
return customFetch<segmentGetTagsForEntityResponse>(getSegmentGetTagsForEntityUrl(entityUid,params),
|
|
471
|
+
{
|
|
472
|
+
...options,
|
|
473
|
+
method: 'GET'
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
}
|
|
477
|
+
);}
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Send the full set of tags the record must end with. A tag that the list leaves out is
|
|
482
|
+
taken off the record, and one that the list names is added. Send an empty list to take
|
|
483
|
+
every tag off. To add tags without disturbing the others, use POST on this same path.
|
|
484
|
+
|
|
485
|
+
A tag belongs to one entity type, so use tags whose EntityType matches this record.
|
|
486
|
+
List them with GET /attribute/tags. A uid in the list that names no tag is skipped.
|
|
487
|
+
* @summary Replace the tags on a record.
|
|
488
|
+
*/
|
|
489
|
+
export type segmentSetTagsForEntityResponse200 = {
|
|
490
|
+
data: Blob
|
|
491
|
+
status: 200
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export type segmentSetTagsForEntityResponse400 = {
|
|
495
|
+
data: void
|
|
496
|
+
status: 400
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export type segmentSetTagsForEntityResponse401 = {
|
|
500
|
+
data: void
|
|
501
|
+
status: 401
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export type segmentSetTagsForEntityResponse404 = {
|
|
505
|
+
data: void
|
|
506
|
+
status: 404
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export type segmentSetTagsForEntityResponseSuccess = (segmentSetTagsForEntityResponse200) & {
|
|
510
|
+
headers: Headers;
|
|
511
|
+
};
|
|
512
|
+
export type segmentSetTagsForEntityResponseError = (segmentSetTagsForEntityResponse400 | segmentSetTagsForEntityResponse401 | segmentSetTagsForEntityResponse404) & {
|
|
513
|
+
headers: Headers;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
export type segmentSetTagsForEntityResponse = (segmentSetTagsForEntityResponseSuccess | segmentSetTagsForEntityResponseError)
|
|
517
|
+
|
|
518
|
+
export const getSegmentSetTagsForEntityUrl = (entityUid: string | null,) => {
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
return `/api/v1/crm/segments/${entityUid}/tags`
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export const segmentSetTagsForEntity = async (entityUid: string | null,
|
|
527
|
+
segmentSetTagsForEntityBody: SegmentSetTagsForEntityBody, options?: RequestInit): Promise<segmentSetTagsForEntityResponse> => {
|
|
528
|
+
|
|
529
|
+
return customFetch<segmentSetTagsForEntityResponse>(getSegmentSetTagsForEntityUrl(entityUid),
|
|
530
|
+
{
|
|
531
|
+
...options,
|
|
532
|
+
method: 'PUT',
|
|
533
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
534
|
+
body: JSON.stringify(
|
|
535
|
+
segmentSetTagsForEntityBody,)
|
|
536
|
+
}
|
|
537
|
+
);}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* The tag itself is kept and stays available for other records. If the record does not
|
|
542
|
+
carry the tag, nothing changes and the call still succeeds.
|
|
543
|
+
* @summary Remove one tag from a record.
|
|
544
|
+
*/
|
|
545
|
+
export type segmentRemoveTagFromEntityResponse200 = {
|
|
546
|
+
data: Blob
|
|
547
|
+
status: 200
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export type segmentRemoveTagFromEntityResponse400 = {
|
|
551
|
+
data: void
|
|
552
|
+
status: 400
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
export type segmentRemoveTagFromEntityResponse401 = {
|
|
556
|
+
data: void
|
|
557
|
+
status: 401
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export type segmentRemoveTagFromEntityResponse404 = {
|
|
561
|
+
data: void
|
|
562
|
+
status: 404
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export type segmentRemoveTagFromEntityResponseSuccess = (segmentRemoveTagFromEntityResponse200) & {
|
|
566
|
+
headers: Headers;
|
|
567
|
+
};
|
|
568
|
+
export type segmentRemoveTagFromEntityResponseError = (segmentRemoveTagFromEntityResponse400 | segmentRemoveTagFromEntityResponse401 | segmentRemoveTagFromEntityResponse404) & {
|
|
569
|
+
headers: Headers;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
export type segmentRemoveTagFromEntityResponse = (segmentRemoveTagFromEntityResponseSuccess | segmentRemoveTagFromEntityResponseError)
|
|
573
|
+
|
|
574
|
+
export const getSegmentRemoveTagFromEntityUrl = (entityUid: string | null,
|
|
575
|
+
tagUid: string | null,) => {
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
return `/api/v1/crm/segments/${entityUid}/tags/${tagUid}`
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export const segmentRemoveTagFromEntity = async (entityUid: string | null,
|
|
584
|
+
tagUid: string | null, options?: RequestInit): Promise<segmentRemoveTagFromEntityResponse> => {
|
|
585
|
+
|
|
586
|
+
return customFetch<segmentRemoveTagFromEntityResponse>(getSegmentRemoveTagFromEntityUrl(entityUid,tagUid),
|
|
587
|
+
{
|
|
588
|
+
...options,
|
|
589
|
+
method: 'DELETE'
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
}
|
|
593
|
+
);}
|
|
594
|
+
|
|
595
|
+
|
|
356
596
|
/**
|
|
357
597
|
* Optionally filtered by segment (segmentUid) or search query (q).
|
|
358
598
|
* @summary Retrieve all accounts.
|