@pubnio/sdk 0.1.2 → 0.2.1
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 +899 -25
- package/dist/index.d.cts +2114 -180
- package/dist/index.d.ts +2114 -180
- package/dist/index.js +914 -25
- package/dist/internal.cjs +10200 -0
- package/dist/internal.d.cts +26389 -0
- package/dist/internal.d.ts +26389 -0
- package/dist/internal.js +10157 -0
- package/dist/solid.cjs +1171 -29
- package/dist/solid.d.cts +3641 -950
- package/dist/solid.d.ts +3641 -950
- package/dist/solid.js +1189 -32
- package/package.json +11 -1
package/dist/solid.js
CHANGED
|
@@ -1,3 +1,191 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/generated/sdk.gen.ts
|
|
17
|
+
var exports_sdk_gen = {};
|
|
18
|
+
__export(exports_sdk_gen, {
|
|
19
|
+
adsActivateCampaign: () => adsActivateCampaign,
|
|
20
|
+
adsArchiveCampaign: () => adsArchiveCampaign,
|
|
21
|
+
adsAttachAd: () => adsAttachAd,
|
|
22
|
+
adsConnectAccount: () => adsConnectAccount,
|
|
23
|
+
adsConnectApiKeyAccount: () => adsConnectApiKeyAccount,
|
|
24
|
+
adsCreateAdGroup: () => adsCreateAdGroup,
|
|
25
|
+
adsCreateBoost: () => adsCreateBoost,
|
|
26
|
+
adsCreateCampaignPlan: () => adsCreateCampaignPlan,
|
|
27
|
+
adsCreateCreative: () => adsCreateCreative,
|
|
28
|
+
adsDisconnectAccount: () => adsDisconnectAccount,
|
|
29
|
+
adsDuplicateCampaign: () => adsDuplicateCampaign,
|
|
30
|
+
adsGetAd: () => adsGetAd,
|
|
31
|
+
adsGetCampaignPlan: () => adsGetCampaignPlan,
|
|
32
|
+
adsGetCreative: () => adsGetCreative,
|
|
33
|
+
adsGetOperation: () => adsGetOperation,
|
|
34
|
+
adsGetSpendPolicy: () => adsGetSpendPolicy,
|
|
35
|
+
adsGetTree: () => adsGetTree,
|
|
36
|
+
adsListAccounts: () => adsListAccounts,
|
|
37
|
+
adsListAdGroups: () => adsListAdGroups,
|
|
38
|
+
adsListAds: () => adsListAds,
|
|
39
|
+
adsListCampaignPlans: () => adsListCampaignPlans,
|
|
40
|
+
adsListCampaigns: () => adsListCampaigns,
|
|
41
|
+
adsListCreatives: () => adsListCreatives,
|
|
42
|
+
adsListInsights: () => adsListInsights,
|
|
43
|
+
adsListWorkspaceCampaigns: () => adsListWorkspaceCampaigns,
|
|
44
|
+
adsListWorkspaceInsights: () => adsListWorkspaceInsights,
|
|
45
|
+
adsPauseCampaign: () => adsPauseCampaign,
|
|
46
|
+
adsRefreshInsights: () => adsRefreshInsights,
|
|
47
|
+
adsSelectAccount: () => adsSelectAccount,
|
|
48
|
+
adsSetAdGroupBudget: () => adsSetAdGroupBudget,
|
|
49
|
+
adsSetAdGroupStatus: () => adsSetAdGroupStatus,
|
|
50
|
+
adsSetAdStatus: () => adsSetAdStatus,
|
|
51
|
+
adsSetCampaignBudget: () => adsSetCampaignBudget,
|
|
52
|
+
adsSetKillSwitch: () => adsSetKillSwitch,
|
|
53
|
+
adsUpdateSpendPolicy: () => adsUpdateSpendPolicy,
|
|
54
|
+
adsValidateBoost: () => adsValidateBoost,
|
|
55
|
+
adsValidateCampaignPlan: () => adsValidateCampaignPlan,
|
|
56
|
+
analyticsAccountsGet: () => analyticsAccountsGet,
|
|
57
|
+
analyticsAccountsList: () => analyticsAccountsList,
|
|
58
|
+
analyticsCapabilitiesGet: () => analyticsCapabilitiesGet,
|
|
59
|
+
analyticsPostsGet: () => analyticsPostsGet,
|
|
60
|
+
analyticsPostsSeries: () => analyticsPostsSeries,
|
|
61
|
+
analyticsRefreshesCreate: () => analyticsRefreshesCreate,
|
|
62
|
+
analyticsRefreshesGet: () => analyticsRefreshesGet,
|
|
63
|
+
apiKeysCreate: () => apiKeysCreate,
|
|
64
|
+
apiKeysGet: () => apiKeysGet,
|
|
65
|
+
apiKeysList: () => apiKeysList,
|
|
66
|
+
apiKeysRevoke: () => apiKeysRevoke,
|
|
67
|
+
apiKeysUpdate: () => apiKeysUpdate,
|
|
68
|
+
auditActionsList: () => auditActionsList,
|
|
69
|
+
auditGet: () => auditGet,
|
|
70
|
+
auditList: () => auditList,
|
|
71
|
+
billingCheckoutCreate: () => billingCheckoutCreate,
|
|
72
|
+
billingGet: () => billingGet,
|
|
73
|
+
billingLedgerList: () => billingLedgerList,
|
|
74
|
+
billingPlansList: () => billingPlansList,
|
|
75
|
+
billingPortalCreate: () => billingPortalCreate,
|
|
76
|
+
billingSpendControlsUpdate: () => billingSpendControlsUpdate,
|
|
77
|
+
billingUsageGet: () => billingUsageGet,
|
|
78
|
+
capabilitiesCatalog: () => capabilitiesCatalog,
|
|
79
|
+
capabilitiesGet: () => capabilitiesGet,
|
|
80
|
+
capabilitiesList: () => capabilitiesList,
|
|
81
|
+
commentsCreate: () => commentsCreate,
|
|
82
|
+
inboxAttachmentsGet: () => inboxAttachmentsGet,
|
|
83
|
+
inboxCapabilitiesGet: () => inboxCapabilitiesGet,
|
|
84
|
+
inboxCommentsDelete: () => inboxCommentsDelete,
|
|
85
|
+
inboxCommentsGet: () => inboxCommentsGet,
|
|
86
|
+
inboxCommentsList: () => inboxCommentsList,
|
|
87
|
+
inboxCommentsModerate: () => inboxCommentsModerate,
|
|
88
|
+
inboxCommentsReply: () => inboxCommentsReply,
|
|
89
|
+
inboxConversationsGet: () => inboxConversationsGet,
|
|
90
|
+
inboxConversationsList: () => inboxConversationsList,
|
|
91
|
+
inboxConversationsUpdate: () => inboxConversationsUpdate,
|
|
92
|
+
inboxMentionsList: () => inboxMentionsList,
|
|
93
|
+
inboxMentionsReply: () => inboxMentionsReply,
|
|
94
|
+
inboxMessagesList: () => inboxMessagesList,
|
|
95
|
+
inboxMessagesSend: () => inboxMessagesSend,
|
|
96
|
+
inboxReviewsGet: () => inboxReviewsGet,
|
|
97
|
+
inboxReviewsList: () => inboxReviewsList,
|
|
98
|
+
inboxReviewsReply: () => inboxReviewsReply,
|
|
99
|
+
inboxSyncGet: () => inboxSyncGet,
|
|
100
|
+
inboxSyncStart: () => inboxSyncStart,
|
|
101
|
+
inboxUnreadCount: () => inboxUnreadCount,
|
|
102
|
+
integrationsBlueskySession: () => integrationsBlueskySession,
|
|
103
|
+
integrationsConnectionStatus: () => integrationsConnectionStatus,
|
|
104
|
+
integrationsDisconnect: () => integrationsDisconnect,
|
|
105
|
+
integrationsGetAccount: () => integrationsGetAccount,
|
|
106
|
+
integrationsGetInstagramAudio: () => integrationsGetInstagramAudio,
|
|
107
|
+
integrationsInstagramPublishingLimit: () => integrationsInstagramPublishingLimit,
|
|
108
|
+
integrationsList: () => integrationsList,
|
|
109
|
+
integrationsMoveAccount: () => integrationsMoveAccount,
|
|
110
|
+
integrationsPrepareConnection: () => integrationsPrepareConnection,
|
|
111
|
+
integrationsReconnect: () => integrationsReconnect,
|
|
112
|
+
integrationsSearchInstagramAudio: () => integrationsSearchInstagramAudio,
|
|
113
|
+
integrationsSetEnabled: () => integrationsSetEnabled,
|
|
114
|
+
limitsGet: () => limitsGet,
|
|
115
|
+
meInvitesAccept: () => meInvitesAccept,
|
|
116
|
+
meInvitesDecline: () => meInvitesDecline,
|
|
117
|
+
meInvitesList: () => meInvitesList,
|
|
118
|
+
mediaCompleteUpload: () => mediaCompleteUpload,
|
|
119
|
+
mediaDelete: () => mediaDelete,
|
|
120
|
+
mediaDownload: () => mediaDownload,
|
|
121
|
+
mediaGet: () => mediaGet,
|
|
122
|
+
mediaImport: () => mediaImport,
|
|
123
|
+
mediaList: () => mediaList,
|
|
124
|
+
mediaStartUpload: () => mediaStartUpload,
|
|
125
|
+
mediaStatus: () => mediaStatus,
|
|
126
|
+
mediaUpload: () => mediaUpload,
|
|
127
|
+
mediaUploadInline: () => mediaUploadInline,
|
|
128
|
+
mediaUploadPart: () => mediaUploadPart,
|
|
129
|
+
notificationsPreferencesGet: () => notificationsPreferencesGet,
|
|
130
|
+
notificationsPreferencesUpdate: () => notificationsPreferencesUpdate,
|
|
131
|
+
postsAttempts: () => postsAttempts,
|
|
132
|
+
postsCreate: () => postsCreate,
|
|
133
|
+
postsDelete: () => postsDelete,
|
|
134
|
+
postsGet: () => postsGet,
|
|
135
|
+
postsList: () => postsList,
|
|
136
|
+
postsPublish: () => postsPublish,
|
|
137
|
+
postsReconcile: () => postsReconcile,
|
|
138
|
+
postsRetry: () => postsRetry,
|
|
139
|
+
postsUpdate: () => postsUpdate,
|
|
140
|
+
postsValidate: () => postsValidate,
|
|
141
|
+
profileDeactivate: () => profileDeactivate,
|
|
142
|
+
profileGet: () => profileGet,
|
|
143
|
+
profileUpdate: () => profileUpdate,
|
|
144
|
+
profilesArchive: () => profilesArchive,
|
|
145
|
+
profilesCreate: () => profilesCreate,
|
|
146
|
+
profilesGet: () => profilesGet,
|
|
147
|
+
profilesList: () => profilesList,
|
|
148
|
+
profilesUpdate: () => profilesUpdate,
|
|
149
|
+
queuesArchive: () => queuesArchive,
|
|
150
|
+
queuesBlackoutsCreate: () => queuesBlackoutsCreate,
|
|
151
|
+
queuesBlackoutsDelete: () => queuesBlackoutsDelete,
|
|
152
|
+
queuesBlackoutsList: () => queuesBlackoutsList,
|
|
153
|
+
queuesCreate: () => queuesCreate,
|
|
154
|
+
queuesGet: () => queuesGet,
|
|
155
|
+
queuesList: () => queuesList,
|
|
156
|
+
queuesSkipsCreate: () => queuesSkipsCreate,
|
|
157
|
+
queuesSkipsDelete: () => queuesSkipsDelete,
|
|
158
|
+
queuesSkipsList: () => queuesSkipsList,
|
|
159
|
+
queuesSlotsNext: () => queuesSlotsNext,
|
|
160
|
+
queuesSlotsPreview: () => queuesSlotsPreview,
|
|
161
|
+
queuesSlotsReplace: () => queuesSlotsReplace,
|
|
162
|
+
queuesUpdate: () => queuesUpdate,
|
|
163
|
+
scheduleChange: () => scheduleChange,
|
|
164
|
+
scheduleList: () => scheduleList,
|
|
165
|
+
webhooksCreate: () => webhooksCreate,
|
|
166
|
+
webhooksDelete: () => webhooksDelete,
|
|
167
|
+
webhooksEventTypes: () => webhooksEventTypes,
|
|
168
|
+
webhooksGet: () => webhooksGet,
|
|
169
|
+
webhooksGetDelivery: () => webhooksGetDelivery,
|
|
170
|
+
webhooksList: () => webhooksList,
|
|
171
|
+
webhooksListDeliveries: () => webhooksListDeliveries,
|
|
172
|
+
webhooksReplayDelivery: () => webhooksReplayDelivery,
|
|
173
|
+
webhooksTest: () => webhooksTest,
|
|
174
|
+
webhooksUpdate: () => webhooksUpdate,
|
|
175
|
+
workspacesArchive: () => workspacesArchive,
|
|
176
|
+
workspacesCreate: () => workspacesCreate,
|
|
177
|
+
workspacesGet: () => workspacesGet,
|
|
178
|
+
workspacesInvitesCreate: () => workspacesInvitesCreate,
|
|
179
|
+
workspacesInvitesList: () => workspacesInvitesList,
|
|
180
|
+
workspacesInvitesResend: () => workspacesInvitesResend,
|
|
181
|
+
workspacesInvitesRevoke: () => workspacesInvitesRevoke,
|
|
182
|
+
workspacesList: () => workspacesList,
|
|
183
|
+
workspacesMembersList: () => workspacesMembersList,
|
|
184
|
+
workspacesMembersRemove: () => workspacesMembersRemove,
|
|
185
|
+
workspacesMembersUpdateRole: () => workspacesMembersUpdateRole,
|
|
186
|
+
workspacesUpdate: () => workspacesUpdate
|
|
187
|
+
});
|
|
188
|
+
|
|
1
189
|
// src/solid.ts
|
|
2
190
|
import {
|
|
3
191
|
infiniteQueryOptions,
|
|
@@ -189,6 +377,7 @@ var PROVIDERS = [
|
|
|
189
377
|
"linkedin",
|
|
190
378
|
"pinterest",
|
|
191
379
|
"reddit",
|
|
380
|
+
"snapchat",
|
|
192
381
|
"tiktok",
|
|
193
382
|
"threads",
|
|
194
383
|
"x",
|
|
@@ -205,7 +394,8 @@ var ACCOUNT_PROVIDERS = [
|
|
|
205
394
|
"tiktok_ads",
|
|
206
395
|
"linkedin_ads",
|
|
207
396
|
"snapchat_ads",
|
|
208
|
-
"amazon_ads"
|
|
397
|
+
"amazon_ads",
|
|
398
|
+
"openai_ads"
|
|
209
399
|
];
|
|
210
400
|
var AccountProvider = Schema7.Literals(ACCOUNT_PROVIDERS);
|
|
211
401
|
var AmazonAdsRegion = Schema7.Literals(["na", "eu", "fe"]);
|
|
@@ -1305,7 +1495,7 @@ var providerCatalog = {
|
|
|
1305
1495
|
availability: "beta",
|
|
1306
1496
|
authFamily: "bluesky",
|
|
1307
1497
|
accountKinds: ["social_account"],
|
|
1308
|
-
capabilities: { social_account:
|
|
1498
|
+
capabilities: { social_account: messagingCapabilities },
|
|
1309
1499
|
approvalRequired: {},
|
|
1310
1500
|
limited: {}
|
|
1311
1501
|
},
|
|
@@ -1353,9 +1543,16 @@ var providerCatalog = {
|
|
|
1353
1543
|
availability: "upcoming",
|
|
1354
1544
|
authFamily: "reddit",
|
|
1355
1545
|
accountKinds: ["social_account"],
|
|
1356
|
-
capabilities: {
|
|
1357
|
-
|
|
1358
|
-
}
|
|
1546
|
+
capabilities: { social_account: messagingCapabilities },
|
|
1547
|
+
approvalRequired: {},
|
|
1548
|
+
limited: {}
|
|
1549
|
+
},
|
|
1550
|
+
snapchat: {
|
|
1551
|
+
label: "Snapchat",
|
|
1552
|
+
availability: "beta",
|
|
1553
|
+
authFamily: "snapchat",
|
|
1554
|
+
accountKinds: ["social_page"],
|
|
1555
|
+
capabilities: { social_page: ["publish"] },
|
|
1359
1556
|
approvalRequired: {},
|
|
1360
1557
|
limited: {}
|
|
1361
1558
|
},
|
|
@@ -1427,6 +1624,7 @@ var accountProviderCatalog = {
|
|
|
1427
1624
|
linkedin: { ...providerCatalog.linkedin, publishCapable: true },
|
|
1428
1625
|
pinterest: { ...providerCatalog.pinterest, publishCapable: true },
|
|
1429
1626
|
reddit: { ...providerCatalog.reddit, publishCapable: true },
|
|
1627
|
+
snapchat: { ...providerCatalog.snapchat, publishCapable: true },
|
|
1430
1628
|
tiktok: { ...providerCatalog.tiktok, publishCapable: true },
|
|
1431
1629
|
threads: { ...providerCatalog.threads, publishCapable: true },
|
|
1432
1630
|
x: { ...providerCatalog.x, publishCapable: true },
|
|
@@ -1443,7 +1641,8 @@ var accountProviderCatalog = {
|
|
|
1443
1641
|
capabilities: { ad_account: ["ads_read"] },
|
|
1444
1642
|
approvalRequired: {},
|
|
1445
1643
|
limited: {},
|
|
1446
|
-
publishCapable: false
|
|
1644
|
+
publishCapable: false,
|
|
1645
|
+
integrationState: "connectable"
|
|
1447
1646
|
},
|
|
1448
1647
|
google_ads: {
|
|
1449
1648
|
label: "Google Ads",
|
|
@@ -1453,7 +1652,8 @@ var accountProviderCatalog = {
|
|
|
1453
1652
|
capabilities: { ad_account: ["ads_read"] },
|
|
1454
1653
|
approvalRequired: {},
|
|
1455
1654
|
limited: {},
|
|
1456
|
-
publishCapable: false
|
|
1655
|
+
publishCapable: false,
|
|
1656
|
+
integrationState: "connectable"
|
|
1457
1657
|
},
|
|
1458
1658
|
reddit_ads: {
|
|
1459
1659
|
label: "Reddit Ads",
|
|
@@ -1463,7 +1663,8 @@ var accountProviderCatalog = {
|
|
|
1463
1663
|
capabilities: { ad_account: ["ads_read"] },
|
|
1464
1664
|
approvalRequired: {},
|
|
1465
1665
|
limited: {},
|
|
1466
|
-
publishCapable: false
|
|
1666
|
+
publishCapable: false,
|
|
1667
|
+
integrationState: "connectable"
|
|
1467
1668
|
},
|
|
1468
1669
|
pinterest_ads: {
|
|
1469
1670
|
label: "Pinterest Ads",
|
|
@@ -1473,7 +1674,8 @@ var accountProviderCatalog = {
|
|
|
1473
1674
|
capabilities: { ad_account: ["ads_read"] },
|
|
1474
1675
|
approvalRequired: {},
|
|
1475
1676
|
limited: {},
|
|
1476
|
-
publishCapable: false
|
|
1677
|
+
publishCapable: false,
|
|
1678
|
+
integrationState: "connectable"
|
|
1477
1679
|
},
|
|
1478
1680
|
tiktok_ads: {
|
|
1479
1681
|
label: "TikTok Ads",
|
|
@@ -1483,7 +1685,8 @@ var accountProviderCatalog = {
|
|
|
1483
1685
|
capabilities: { ad_account: ["ads_read"] },
|
|
1484
1686
|
approvalRequired: {},
|
|
1485
1687
|
limited: {},
|
|
1486
|
-
publishCapable: false
|
|
1688
|
+
publishCapable: false,
|
|
1689
|
+
integrationState: "connectable"
|
|
1487
1690
|
},
|
|
1488
1691
|
linkedin_ads: {
|
|
1489
1692
|
label: "LinkedIn Ads",
|
|
@@ -1493,7 +1696,8 @@ var accountProviderCatalog = {
|
|
|
1493
1696
|
capabilities: { ad_account: ["ads_read"] },
|
|
1494
1697
|
approvalRequired: {},
|
|
1495
1698
|
limited: {},
|
|
1496
|
-
publishCapable: false
|
|
1699
|
+
publishCapable: false,
|
|
1700
|
+
integrationState: "connectable"
|
|
1497
1701
|
},
|
|
1498
1702
|
snapchat_ads: {
|
|
1499
1703
|
label: "Snapchat Ads",
|
|
@@ -1503,7 +1707,8 @@ var accountProviderCatalog = {
|
|
|
1503
1707
|
capabilities: { ad_account: ["ads_read"] },
|
|
1504
1708
|
approvalRequired: {},
|
|
1505
1709
|
limited: {},
|
|
1506
|
-
publishCapable: false
|
|
1710
|
+
publishCapable: false,
|
|
1711
|
+
integrationState: "connectable"
|
|
1507
1712
|
},
|
|
1508
1713
|
amazon_ads: {
|
|
1509
1714
|
label: "Amazon Ads",
|
|
@@ -1513,7 +1718,19 @@ var accountProviderCatalog = {
|
|
|
1513
1718
|
capabilities: { ad_account: ["ads_read"] },
|
|
1514
1719
|
approvalRequired: {},
|
|
1515
1720
|
limited: {},
|
|
1516
|
-
publishCapable: false
|
|
1721
|
+
publishCapable: false,
|
|
1722
|
+
integrationState: "connectable"
|
|
1723
|
+
},
|
|
1724
|
+
openai_ads: {
|
|
1725
|
+
label: "OpenAI Ads",
|
|
1726
|
+
availability: "beta",
|
|
1727
|
+
authFamily: "openai_ads",
|
|
1728
|
+
accountKinds: ["ad_account"],
|
|
1729
|
+
capabilities: { ad_account: ["ads_read"] },
|
|
1730
|
+
approvalRequired: {},
|
|
1731
|
+
limited: {},
|
|
1732
|
+
publishCapable: false,
|
|
1733
|
+
integrationState: "connectable"
|
|
1517
1734
|
}
|
|
1518
1735
|
};
|
|
1519
1736
|
var capabilityCatalog = PROVIDERS.flatMap((provider) => {
|
|
@@ -1740,6 +1957,13 @@ var AccountDetails = Schema16.Union([
|
|
|
1740
1957
|
kind: Schema16.Literal("account"),
|
|
1741
1958
|
username: Schema16.String
|
|
1742
1959
|
}),
|
|
1960
|
+
Schema16.Struct({
|
|
1961
|
+
provider: Schema16.Literal("snapchat"),
|
|
1962
|
+
kind: Schema16.Literal("public_profile"),
|
|
1963
|
+
profileId: Schema16.String,
|
|
1964
|
+
organizationId: Schema16.optionalKey(Schema16.String),
|
|
1965
|
+
username: Schema16.optionalKey(Schema16.String)
|
|
1966
|
+
}),
|
|
1743
1967
|
Schema16.Struct({
|
|
1744
1968
|
provider: Schema16.Literal("tiktok"),
|
|
1745
1969
|
kind: Schema16.Literal("account"),
|
|
@@ -1888,6 +2112,20 @@ var AccountDetails = Schema16.Union([
|
|
|
1888
2112
|
region: AmazonAdsRegion,
|
|
1889
2113
|
businessId: Schema16.optionalKey(Schema16.String),
|
|
1890
2114
|
managerId: Schema16.optionalKey(Schema16.String)
|
|
2115
|
+
}),
|
|
2116
|
+
Schema16.Struct({
|
|
2117
|
+
provider: Schema16.Literal("openai_ads"),
|
|
2118
|
+
kind: Schema16.Literal("ad_account"),
|
|
2119
|
+
externalId: Schema16.String,
|
|
2120
|
+
currency: Schema16.String.check(Schema16.isPattern(/^[A-Z]{3}$/)),
|
|
2121
|
+
timezone: Schema16.String,
|
|
2122
|
+
status: Schema16.Literals([
|
|
2123
|
+
"active",
|
|
2124
|
+
"disabled",
|
|
2125
|
+
"pending",
|
|
2126
|
+
"closed",
|
|
2127
|
+
"unknown"
|
|
2128
|
+
])
|
|
1891
2129
|
})
|
|
1892
2130
|
]);
|
|
1893
2131
|
var ProviderAccount = Schema16.Struct({
|
|
@@ -1919,7 +2157,8 @@ var AccountRef = Schema17.Struct({ accountId: AccountId });
|
|
|
1919
2157
|
var ConnectionRef = Schema17.Struct({ connectionId: uuid3 });
|
|
1920
2158
|
var ConnectionLaunch = Schema17.Struct({
|
|
1921
2159
|
attemptId: uuid3,
|
|
1922
|
-
url: Schema17.String
|
|
2160
|
+
url: Schema17.String,
|
|
2161
|
+
expiresAt: Schema17.optionalKey(Schema17.String)
|
|
1923
2162
|
});
|
|
1924
2163
|
var OAuthFailureReason = Schema17.Literals([
|
|
1925
2164
|
"provider_error",
|
|
@@ -2132,6 +2371,13 @@ var RedditFeedSettings = Schema18.Struct({
|
|
|
2132
2371
|
thumbnailMediaId: Schema18.optionalKey(MediaId),
|
|
2133
2372
|
firstComment: Schema18.optionalKey(text)
|
|
2134
2373
|
}).annotate({ identifier: "RedditFeedSettings" });
|
|
2374
|
+
var SnapchatStorySettings = Schema18.Struct({
|
|
2375
|
+
contentType: Schema18.optionalKey(Schema18.Literals(["story", "saved_story", "spotlight"])),
|
|
2376
|
+
title: Schema18.optionalKey(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(45))),
|
|
2377
|
+
description: Schema18.optionalKey(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(160))),
|
|
2378
|
+
link: Schema18.optionalKey(MediaUrl),
|
|
2379
|
+
locale: Schema18.optionalKey(Schema18.String.check(Schema18.isPattern(/^[a-z]{2}_[A-Z]{2}$/)))
|
|
2380
|
+
}).annotate({ identifier: "SnapchatStorySettings" });
|
|
2135
2381
|
var YouTubeVideoSettings = Schema18.Struct({
|
|
2136
2382
|
title: Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(100)),
|
|
2137
2383
|
description: Schema18.optionalKey(Schema18.String.check(Schema18.isMaxLength(5000))),
|
|
@@ -2290,6 +2536,13 @@ var PublishTarget = Schema18.Union([
|
|
|
2290
2536
|
...overrides,
|
|
2291
2537
|
settings: RedditFeedSettings
|
|
2292
2538
|
}),
|
|
2539
|
+
Schema18.Struct({
|
|
2540
|
+
accountId: AccountId,
|
|
2541
|
+
provider: Schema18.Literal("snapchat"),
|
|
2542
|
+
placement: Schema18.Literal("story"),
|
|
2543
|
+
...overrides,
|
|
2544
|
+
settings: Schema18.optionalKey(SnapchatStorySettings)
|
|
2545
|
+
}),
|
|
2293
2546
|
Schema18.Struct({
|
|
2294
2547
|
accountId: AccountId,
|
|
2295
2548
|
provider: Schema18.Literal("tiktok"),
|
|
@@ -2321,6 +2574,7 @@ var providerSettings = Schema18.Union([
|
|
|
2321
2574
|
InstagramStorySettings,
|
|
2322
2575
|
LinkedInFeedSettings,
|
|
2323
2576
|
RedditFeedSettings,
|
|
2577
|
+
SnapchatStorySettings,
|
|
2324
2578
|
ThreadsFeedSettings,
|
|
2325
2579
|
XFeedSettings,
|
|
2326
2580
|
YouTubeVideoSettings,
|
|
@@ -2999,6 +3253,7 @@ var InboxReview = Schema21.Struct({
|
|
|
2999
3253
|
providerUpdatedAt: Schema21.NullOr(Schema21.String),
|
|
3000
3254
|
repliedAt: Schema21.NullOr(Schema21.String),
|
|
3001
3255
|
replyText: Schema21.NullOr(Schema21.String),
|
|
3256
|
+
canReply: Schema21.Boolean,
|
|
3002
3257
|
deletedAt: Schema21.NullOr(Schema21.String),
|
|
3003
3258
|
createdAt: Schema21.String
|
|
3004
3259
|
}).annotate({ identifier: "InboxReview" });
|
|
@@ -3136,6 +3391,9 @@ var SendInboxMessage = Schema21.Struct({
|
|
|
3136
3391
|
var ReplyInboxComment = Schema21.Struct({
|
|
3137
3392
|
text: replyText
|
|
3138
3393
|
}).annotate({ identifier: "ReplyInboxComment" });
|
|
3394
|
+
var ReplyInboxReview = Schema21.Struct({
|
|
3395
|
+
text: replyText
|
|
3396
|
+
}).annotate({ identifier: "ReplyInboxReview" });
|
|
3139
3397
|
var UpdateInboxComment = Schema21.Struct({
|
|
3140
3398
|
hidden: Schema21.optionalKey(Schema21.Boolean),
|
|
3141
3399
|
liked: Schema21.optionalKey(Schema21.Boolean)
|
|
@@ -3213,7 +3471,8 @@ var AD_PROVIDERS = [
|
|
|
3213
3471
|
"tiktok_ads",
|
|
3214
3472
|
"linkedin_ads",
|
|
3215
3473
|
"snapchat_ads",
|
|
3216
|
-
"amazon_ads"
|
|
3474
|
+
"amazon_ads",
|
|
3475
|
+
"openai_ads"
|
|
3217
3476
|
];
|
|
3218
3477
|
var AdProvider = Schema23.Literals(AD_PROVIDERS);
|
|
3219
3478
|
var AdAccountState = Schema23.Literals(["available", "selected"]);
|
|
@@ -3308,8 +3567,17 @@ var AdKillSwitchResult = Schema23.Struct({
|
|
|
3308
3567
|
}).annotate({ identifier: "AdKillSwitchResult" });
|
|
3309
3568
|
var AdOperationKind = Schema23.Literals([
|
|
3310
3569
|
"boost.create",
|
|
3570
|
+
"campaign.create",
|
|
3311
3571
|
"campaign.activate",
|
|
3312
|
-
"campaign.pause"
|
|
3572
|
+
"campaign.pause",
|
|
3573
|
+
"campaign.archive",
|
|
3574
|
+
"ad_group.status",
|
|
3575
|
+
"ad_group.create",
|
|
3576
|
+
"ad.status",
|
|
3577
|
+
"ad.attach",
|
|
3578
|
+
"creative.create",
|
|
3579
|
+
"campaign.duplicate",
|
|
3580
|
+
"budget.update"
|
|
3313
3581
|
]);
|
|
3314
3582
|
var AdOperationStatus = Schema23.Literals([
|
|
3315
3583
|
"queued",
|
|
@@ -3386,6 +3654,48 @@ var AdCampaignActivationInput = Schema23.Struct({
|
|
|
3386
3654
|
var AdCampaignPauseInput = Schema23.Struct({
|
|
3387
3655
|
expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
|
|
3388
3656
|
}).annotate({ identifier: "AdCampaignPauseInput" });
|
|
3657
|
+
var AdCampaignArchiveInput = Schema23.Struct({
|
|
3658
|
+
expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
|
|
3659
|
+
}).annotate({ identifier: "AdCampaignArchiveInput" });
|
|
3660
|
+
var AdEntityStatusUpdate = Schema23.Struct({
|
|
3661
|
+
status: Schema23.Literals(["active", "paused", "archived"]),
|
|
3662
|
+
expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
|
|
3663
|
+
}).annotate({ identifier: "AdEntityStatusUpdate" });
|
|
3664
|
+
var AdBudgetUpdateInput = Schema23.Struct({
|
|
3665
|
+
budget: AdBudget,
|
|
3666
|
+
expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
|
|
3667
|
+
}).annotate({ identifier: "AdBudgetUpdateInput" });
|
|
3668
|
+
var AdAttachAdCreative = Schema23.Struct({
|
|
3669
|
+
headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
|
|
3670
|
+
body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
|
|
3671
|
+
callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
|
|
3672
|
+
destinationUrl: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2048))),
|
|
3673
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3674
|
+
}).annotate({ identifier: "AdAttachAdCreative" });
|
|
3675
|
+
var AdAdGroupCreateInput = Schema23.Struct({
|
|
3676
|
+
name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
|
|
3677
|
+
budget: Schema23.optionalKey(AdBudget),
|
|
3678
|
+
targeting: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
|
|
3679
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3680
|
+
}).annotate({ identifier: "AdAdGroupCreateInput" });
|
|
3681
|
+
var AdCreativeCreateInput = Schema23.Struct({
|
|
3682
|
+
actorAccountId: AccountId,
|
|
3683
|
+
mediaId: Schema23.String.check(Schema23.isUUID()),
|
|
3684
|
+
headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
|
|
3685
|
+
body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
|
|
3686
|
+
callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
|
|
3687
|
+
destinationUrl: Schema23.String.check(Schema23.isMaxLength(2048)),
|
|
3688
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3689
|
+
}).annotate({ identifier: "AdCreativeCreateInput" });
|
|
3690
|
+
var AdCampaignDuplicateInput = Schema23.Struct({
|
|
3691
|
+
name: Schema23.optionalKey(Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)))
|
|
3692
|
+
}).annotate({ identifier: "AdCampaignDuplicateInput" });
|
|
3693
|
+
var AdAttachAdInput = Schema23.Struct({
|
|
3694
|
+
name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
|
|
3695
|
+
creativeId: Schema23.optionalKey(AdCreativeId),
|
|
3696
|
+
creative: Schema23.optionalKey(AdAttachAdCreative),
|
|
3697
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3698
|
+
}).annotate({ identifier: "AdAttachAdInput" });
|
|
3389
3699
|
var AdWriteHeaders = Schema23.Struct({
|
|
3390
3700
|
"idempotency-key": IdempotencyKey
|
|
3391
3701
|
});
|
|
@@ -3424,6 +3734,18 @@ var AdConnectLaunch = Schema23.Struct({
|
|
|
3424
3734
|
url: Schema23.String,
|
|
3425
3735
|
status: Schema23.Literal("pending")
|
|
3426
3736
|
}).annotate({ identifier: "AdConnectLaunch" });
|
|
3737
|
+
var AdApiKeyConnectInput = Schema23.Struct({
|
|
3738
|
+
workspaceId: WorkspaceId,
|
|
3739
|
+
provider: Schema23.Literal("openai_ads"),
|
|
3740
|
+
apiKey: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(2048)),
|
|
3741
|
+
accountId: Schema23.optionalKey(AccountId),
|
|
3742
|
+
profileId: Schema23.optionalKey(ProfileId)
|
|
3743
|
+
}).annotate({ identifier: "AdApiKeyConnectInput" });
|
|
3744
|
+
var AdApiKeyConnectResult = Schema23.Struct({
|
|
3745
|
+
provider: Schema23.Literal("openai_ads"),
|
|
3746
|
+
accountId: AccountId,
|
|
3747
|
+
status: Schema23.Literal("connected")
|
|
3748
|
+
}).annotate({ identifier: "AdApiKeyConnectResult" });
|
|
3427
3749
|
var AdAccountRef = Schema23.Struct({
|
|
3428
3750
|
workspaceId: WorkspaceId,
|
|
3429
3751
|
accountId: AccountId
|
|
@@ -3484,6 +3806,128 @@ var AdBoostInput = Schema23.Struct({
|
|
|
3484
3806
|
accountId: AccountId,
|
|
3485
3807
|
...AdBoostDraft.fields
|
|
3486
3808
|
}).annotate({ identifier: "AdBoostInput" });
|
|
3809
|
+
var AdCampaignPlanCapability = Schema23.Literals([
|
|
3810
|
+
"campaign.create",
|
|
3811
|
+
"ad_group.create",
|
|
3812
|
+
"creative.create",
|
|
3813
|
+
"ad.create",
|
|
3814
|
+
"campaign.activate",
|
|
3815
|
+
"campaign.pause",
|
|
3816
|
+
"campaign.archive",
|
|
3817
|
+
"ad_group.activate",
|
|
3818
|
+
"ad_group.pause",
|
|
3819
|
+
"ad_group.archive",
|
|
3820
|
+
"ad.activate",
|
|
3821
|
+
"ad.pause",
|
|
3822
|
+
"ad.archive",
|
|
3823
|
+
"budget.update",
|
|
3824
|
+
"boost.create"
|
|
3825
|
+
]);
|
|
3826
|
+
var AdCampaignPlanProfile = Schema23.Struct({
|
|
3827
|
+
budgetOwner: Schema23.Literals(["campaign", "ad_group", "shared"]),
|
|
3828
|
+
maxAdGroups: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(1))),
|
|
3829
|
+
budgetUnit: Schema23.Literals(["minor", "micros"]),
|
|
3830
|
+
hierarchy: Schema23.Array(Schema23.Literals(["campaign", "ad_group", "creative", "ad"])),
|
|
3831
|
+
actor: Schema23.Literals(["required", "none"]),
|
|
3832
|
+
creative: Schema23.Literals(["separate", "embedded"]),
|
|
3833
|
+
review: Schema23.Literals(["sync", "pending", "async"]),
|
|
3834
|
+
activation: Schema23.Literals(["campaign", "ad_group"])
|
|
3835
|
+
}).annotate({ identifier: "AdCampaignPlanProfile" });
|
|
3836
|
+
var AdCampaignPlanTarget = Schema23.Struct({
|
|
3837
|
+
accountId: AccountId,
|
|
3838
|
+
actorAccountId: Schema23.optionalKey(AccountId),
|
|
3839
|
+
budget: Schema23.optionalKey(AdBudget),
|
|
3840
|
+
schedule: Schema23.optionalKey(AdSchedule),
|
|
3841
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3842
|
+
}).annotate({ identifier: "AdCampaignPlanTarget" });
|
|
3843
|
+
var AdCampaignPlanCreative = Schema23.Struct({
|
|
3844
|
+
headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
|
|
3845
|
+
body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
|
|
3846
|
+
callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
|
|
3847
|
+
destinationUrl: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2048))),
|
|
3848
|
+
media: Schema23.optionalKey(MediaInputs),
|
|
3849
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3850
|
+
}).annotate({ identifier: "AdCampaignPlanCreative" });
|
|
3851
|
+
var AdCampaignPlanAd = Schema23.Struct({
|
|
3852
|
+
name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
|
|
3853
|
+
creative: AdCampaignPlanCreative,
|
|
3854
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3855
|
+
}).annotate({ identifier: "AdCampaignPlanAd" });
|
|
3856
|
+
var AdCampaignPlanAdGroup = Schema23.Struct({
|
|
3857
|
+
name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
|
|
3858
|
+
budget: Schema23.optionalKey(AdBudget),
|
|
3859
|
+
targeting: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
|
|
3860
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
|
|
3861
|
+
ads: Schema23.Array(AdCampaignPlanAd).check(Schema23.isMinLength(1), Schema23.isMaxLength(50))
|
|
3862
|
+
}).annotate({ identifier: "AdCampaignPlanAdGroup" });
|
|
3863
|
+
var AdCampaignPlan = Schema23.Struct({
|
|
3864
|
+
name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
|
|
3865
|
+
objective: AdObjective,
|
|
3866
|
+
budget: Schema23.optionalKey(AdBudget),
|
|
3867
|
+
schedule: Schema23.optionalKey(AdSchedule),
|
|
3868
|
+
targets: Schema23.Array(AdCampaignPlanTarget).check(Schema23.isMinLength(1), Schema23.isMaxLength(50)),
|
|
3869
|
+
adGroups: Schema23.Array(AdCampaignPlanAdGroup).check(Schema23.isMinLength(1), Schema23.isMaxLength(50)),
|
|
3870
|
+
providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
|
|
3871
|
+
}).annotate({ identifier: "AdCampaignPlan" });
|
|
3872
|
+
var AdCampaignPlanTargetValidation = Schema23.Struct({
|
|
3873
|
+
accountId: AccountId,
|
|
3874
|
+
provider: Schema23.optionalKey(AdProvider),
|
|
3875
|
+
name: Schema23.optionalKey(Schema23.String),
|
|
3876
|
+
currency: Schema23.optionalKey(CurrencyCode),
|
|
3877
|
+
budget: Schema23.optionalKey(Schema23.NullOr(AdBudget)),
|
|
3878
|
+
profile: Schema23.optionalKey(AdCampaignPlanProfile),
|
|
3879
|
+
capabilities: Schema23.optionalKey(Schema23.Array(AdCampaignPlanCapability)),
|
|
3880
|
+
issues: Schema23.Array(AdIssue)
|
|
3881
|
+
}).annotate({ identifier: "AdCampaignPlanTargetValidation" });
|
|
3882
|
+
var AdCampaignPlanValidation = Schema23.Struct({
|
|
3883
|
+
valid: Schema23.Boolean,
|
|
3884
|
+
issues: Schema23.Array(AdIssue),
|
|
3885
|
+
targets: Schema23.Array(AdCampaignPlanTargetValidation)
|
|
3886
|
+
}).annotate({ identifier: "AdCampaignPlanValidation" });
|
|
3887
|
+
var AdCampaignPlanStatus = Schema23.Literals([
|
|
3888
|
+
"queued",
|
|
3889
|
+
"creating",
|
|
3890
|
+
"partial",
|
|
3891
|
+
"succeeded",
|
|
3892
|
+
"failed",
|
|
3893
|
+
"unresolved"
|
|
3894
|
+
]);
|
|
3895
|
+
var AdCampaignPlanTargetAccepted = Schema23.Struct({
|
|
3896
|
+
accountId: AccountId,
|
|
3897
|
+
provider: AdProvider,
|
|
3898
|
+
operationId: AdOperationId,
|
|
3899
|
+
status: AdOperationStatus
|
|
3900
|
+
}).annotate({ identifier: "AdCampaignPlanTargetAccepted" });
|
|
3901
|
+
var AdCampaignPlanAccepted = Schema23.Struct({
|
|
3902
|
+
planId: Schema23.String.check(Schema23.isUUID()),
|
|
3903
|
+
status: AdCampaignPlanStatus,
|
|
3904
|
+
targets: Schema23.Array(AdCampaignPlanTargetAccepted)
|
|
3905
|
+
}).annotate({ identifier: "AdCampaignPlanAccepted" });
|
|
3906
|
+
var AdCampaignPlanListRow = Schema23.Struct({
|
|
3907
|
+
planId: Schema23.String.check(Schema23.isUUID()),
|
|
3908
|
+
status: AdCampaignPlanStatus,
|
|
3909
|
+
createdAt: Schema23.String,
|
|
3910
|
+
targets: Schema23.Array(AdCampaignPlanTargetAccepted)
|
|
3911
|
+
}).annotate({ identifier: "AdCampaignPlanListRow" });
|
|
3912
|
+
var AdCampaignPlanList = Schema23.Struct({
|
|
3913
|
+
data: Schema23.Array(AdCampaignPlanListRow),
|
|
3914
|
+
...pageFields
|
|
3915
|
+
}).annotate({ identifier: "AdCampaignPlanList" });
|
|
3916
|
+
var AdCampaignPlanTargetDetail = Schema23.Struct({
|
|
3917
|
+
accountId: AccountId,
|
|
3918
|
+
provider: AdProvider,
|
|
3919
|
+
operationId: AdOperationId,
|
|
3920
|
+
campaignId: Schema23.NullOr(AdCampaignId),
|
|
3921
|
+
status: AdOperationStatus,
|
|
3922
|
+
issues: Schema23.Array(AdIssue)
|
|
3923
|
+
}).annotate({ identifier: "AdCampaignPlanTargetDetail" });
|
|
3924
|
+
var AdCampaignPlanDetail = Schema23.Struct({
|
|
3925
|
+
planId: Schema23.String.check(Schema23.isUUID()),
|
|
3926
|
+
status: AdCampaignPlanStatus,
|
|
3927
|
+
createdAt: Schema23.String,
|
|
3928
|
+
targets: Schema23.Array(AdCampaignPlanTargetDetail),
|
|
3929
|
+
issues: Schema23.Array(AdIssue)
|
|
3930
|
+
}).annotate({ identifier: "AdCampaignPlanDetail" });
|
|
3487
3931
|
var AdCampaign = Schema23.Struct({
|
|
3488
3932
|
id: AdCampaignId,
|
|
3489
3933
|
accountId: AccountId,
|
|
@@ -3618,6 +4062,20 @@ var AdCampaignList = Schema23.Struct({
|
|
|
3618
4062
|
...pageFields,
|
|
3619
4063
|
freshness: AdFreshness
|
|
3620
4064
|
}).annotate({ identifier: "AdCampaignList" });
|
|
4065
|
+
var AdGroupListRow = Schema23.Struct({
|
|
4066
|
+
...AdGroup.fields,
|
|
4067
|
+
insights: Schema23.optionalKey(Schema23.NullOr(AdInsightSummary))
|
|
4068
|
+
}).annotate({ identifier: "AdGroupListRow" });
|
|
4069
|
+
var AdGroupList = Schema23.Struct({
|
|
4070
|
+
data: Schema23.Array(AdGroupListRow),
|
|
4071
|
+
...pageFields,
|
|
4072
|
+
freshness: AdFreshness
|
|
4073
|
+
}).annotate({ identifier: "AdGroupList" });
|
|
4074
|
+
var AdList = Schema23.Struct({
|
|
4075
|
+
data: Schema23.Array(Ad),
|
|
4076
|
+
...pageFields,
|
|
4077
|
+
freshness: AdFreshness
|
|
4078
|
+
}).annotate({ identifier: "AdList" });
|
|
3621
4079
|
var AdCreativeList = Schema23.Struct({
|
|
3622
4080
|
data: Schema23.Array(AdCreative),
|
|
3623
4081
|
...pageFields,
|
|
@@ -3728,6 +4186,7 @@ var WorkspaceEventType = Schema26.Literals([
|
|
|
3728
4186
|
"inbox.review.updated",
|
|
3729
4187
|
"inbox.review.deleted",
|
|
3730
4188
|
"inbox.review.restored",
|
|
4189
|
+
"inbox.review.replied",
|
|
3731
4190
|
"inbox.mention.received",
|
|
3732
4191
|
"inbox.message.sent",
|
|
3733
4192
|
"inbox.message.delivered",
|
|
@@ -3747,12 +4206,14 @@ var WorkspaceEventType = Schema26.Literals([
|
|
|
3747
4206
|
"ads.kill_switch.activated",
|
|
3748
4207
|
"ads.lead.received",
|
|
3749
4208
|
"ads.campaign.status_changed",
|
|
4209
|
+
"ads.ad_group.status_changed",
|
|
3750
4210
|
"ads.ad.status_changed",
|
|
3751
4211
|
"ads.ad_account.status_changed",
|
|
3752
4212
|
"ads.ad.review.approved",
|
|
3753
4213
|
"ads.ad.review.rejected",
|
|
3754
4214
|
"ads.sync.failed",
|
|
3755
4215
|
"ads.sync.recovered",
|
|
4216
|
+
"ads.initial_sync.completed",
|
|
3756
4217
|
"schedule.assignment.changed",
|
|
3757
4218
|
"account.connected",
|
|
3758
4219
|
"account.disconnected",
|
|
@@ -3984,6 +4445,11 @@ var WebhookEvent = Schema27.Union([
|
|
|
3984
4445
|
type: Schema27.Literal("inbox.review.restored"),
|
|
3985
4446
|
data: Schema27.Struct(inboxReviewData)
|
|
3986
4447
|
}),
|
|
4448
|
+
Schema27.Struct({
|
|
4449
|
+
...envelope,
|
|
4450
|
+
type: Schema27.Literal("inbox.review.replied"),
|
|
4451
|
+
data: Schema27.Struct(inboxReviewData)
|
|
4452
|
+
}),
|
|
3987
4453
|
Schema27.Struct({
|
|
3988
4454
|
...envelope,
|
|
3989
4455
|
type: Schema27.Literal("inbox.mention.received"),
|
|
@@ -4141,6 +4607,16 @@ var WebhookEvent = Schema27.Union([
|
|
|
4141
4607
|
status: AdEntityStatus
|
|
4142
4608
|
})
|
|
4143
4609
|
}),
|
|
4610
|
+
Schema27.Struct({
|
|
4611
|
+
...envelope,
|
|
4612
|
+
type: Schema27.Literal("ads.ad_group.status_changed"),
|
|
4613
|
+
data: Schema27.Struct({
|
|
4614
|
+
accountId: AccountId,
|
|
4615
|
+
adGroupId: AdGroupId,
|
|
4616
|
+
provider: AdProvider,
|
|
4617
|
+
status: AdEntityStatus
|
|
4618
|
+
})
|
|
4619
|
+
}),
|
|
4144
4620
|
Schema27.Struct({
|
|
4145
4621
|
...envelope,
|
|
4146
4622
|
type: Schema27.Literal("ads.ad.status_changed"),
|
|
@@ -4194,6 +4670,14 @@ var WebhookEvent = Schema27.Union([
|
|
|
4194
4670
|
provider: AdProvider
|
|
4195
4671
|
})
|
|
4196
4672
|
}),
|
|
4673
|
+
Schema27.Struct({
|
|
4674
|
+
...envelope,
|
|
4675
|
+
type: Schema27.Literal("ads.initial_sync.completed"),
|
|
4676
|
+
data: Schema27.Struct({
|
|
4677
|
+
accountId: AccountId,
|
|
4678
|
+
provider: AdProvider
|
|
4679
|
+
})
|
|
4680
|
+
}),
|
|
4197
4681
|
Schema27.Struct({
|
|
4198
4682
|
...envelope,
|
|
4199
4683
|
type: Schema27.Literal("account.connected"),
|
|
@@ -4986,7 +5470,13 @@ class AdRevisionConflict extends HttpApiError.Problem()("AdRevisionConflict", {
|
|
|
4986
5470
|
status: 409,
|
|
4987
5471
|
title: "Ad resource revision conflict"
|
|
4988
5472
|
}, {
|
|
4989
|
-
resource: Schema28.Literals([
|
|
5473
|
+
resource: Schema28.Literals([
|
|
5474
|
+
"spend_policy",
|
|
5475
|
+
"campaign",
|
|
5476
|
+
"ad_group",
|
|
5477
|
+
"ad",
|
|
5478
|
+
"boost"
|
|
5479
|
+
]),
|
|
4990
5480
|
expectedRevision: Schema28.Int.check(Schema28.isGreaterThanOrEqualTo(0)),
|
|
4991
5481
|
actualRevision: Schema28.Int.check(Schema28.isGreaterThanOrEqualTo(0)),
|
|
4992
5482
|
nextAction: Schema28.String
|
|
@@ -5601,12 +6091,13 @@ import { ProblemDetails } from "effect/http";
|
|
|
5601
6091
|
// package.json
|
|
5602
6092
|
var package_default = {
|
|
5603
6093
|
name: "@pubnio/sdk",
|
|
5604
|
-
version: "0.1
|
|
6094
|
+
version: "0.2.1",
|
|
5605
6095
|
description: "JavaScript and TypeScript client for the PubNio API",
|
|
5606
6096
|
type: "module",
|
|
5607
6097
|
exports: {
|
|
5608
6098
|
".": "./src/index.ts",
|
|
5609
6099
|
"./solid": "./src/solid.ts",
|
|
6100
|
+
"./internal": "./src/internal.ts",
|
|
5610
6101
|
"./package.json": "./package.json"
|
|
5611
6102
|
},
|
|
5612
6103
|
dependencies: {
|
|
@@ -6763,6 +7254,11 @@ var webhooksReplayDelivery = (options) => (options.client ?? client).post({
|
|
|
6763
7254
|
url: "/api/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/replay",
|
|
6764
7255
|
...options
|
|
6765
7256
|
});
|
|
7257
|
+
var webhooksEventTypes = (options) => (options?.client ?? client).get({
|
|
7258
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7259
|
+
url: "/api/v1/webhooks/event-types",
|
|
7260
|
+
...options
|
|
7261
|
+
});
|
|
6766
7262
|
var integrationsList = (options) => (options.client ?? client).get({
|
|
6767
7263
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6768
7264
|
url: "/api/v1/integrations",
|
|
@@ -6791,6 +7287,15 @@ var integrationsPrepareConnection = (options) => (options.client ?? client).post
|
|
|
6791
7287
|
url: "/api/v1/integrations/{provider}/connect",
|
|
6792
7288
|
...options
|
|
6793
7289
|
});
|
|
7290
|
+
var integrationsBlueskySession = (options) => (options.client ?? client).post({
|
|
7291
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7292
|
+
url: "/api/v1/integrations/bluesky/session",
|
|
7293
|
+
...options,
|
|
7294
|
+
headers: {
|
|
7295
|
+
"Content-Type": "application/json",
|
|
7296
|
+
...options.headers
|
|
7297
|
+
}
|
|
7298
|
+
});
|
|
6794
7299
|
var integrationsConnectionStatus = (options) => (options.client ?? client).get({
|
|
6795
7300
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6796
7301
|
url: "/api/v1/integrations/attempts/{attemptId}",
|
|
@@ -6904,6 +7409,15 @@ var mediaGet = (options) => (options.client ?? client).get({
|
|
|
6904
7409
|
url: "/api/v1/media/{mediaId}",
|
|
6905
7410
|
...options
|
|
6906
7411
|
});
|
|
7412
|
+
var mediaUploadInline = (options) => (options.client ?? client).post({
|
|
7413
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7414
|
+
url: "/api/v1/media/inline",
|
|
7415
|
+
...options,
|
|
7416
|
+
headers: {
|
|
7417
|
+
"Content-Type": "application/json",
|
|
7418
|
+
...options.headers
|
|
7419
|
+
}
|
|
7420
|
+
});
|
|
6907
7421
|
var mediaImport = (options) => (options.client ?? client).post({
|
|
6908
7422
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6909
7423
|
url: "/api/v1/media/import",
|
|
@@ -7180,6 +7694,15 @@ var inboxReviewsGet = (options) => (options.client ?? client).get({
|
|
|
7180
7694
|
url: "/api/v1/inbox/reviews/{reviewId}",
|
|
7181
7695
|
...options
|
|
7182
7696
|
});
|
|
7697
|
+
var inboxReviewsReply = (options) => (options.client ?? client).post({
|
|
7698
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7699
|
+
url: "/api/v1/inbox/reviews/{reviewId}/replies",
|
|
7700
|
+
...options,
|
|
7701
|
+
headers: {
|
|
7702
|
+
"Content-Type": "application/json",
|
|
7703
|
+
...options.headers
|
|
7704
|
+
}
|
|
7705
|
+
});
|
|
7183
7706
|
var inboxUnreadCount = (options) => (options.client ?? client).get({
|
|
7184
7707
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7185
7708
|
url: "/api/v1/inbox/unread-count",
|
|
@@ -7209,6 +7732,15 @@ var inboxAttachmentsGet = (options) => (options.client ?? client).get({
|
|
|
7209
7732
|
url: "/api/v1/inbox/attachments/{attachmentId}",
|
|
7210
7733
|
...options
|
|
7211
7734
|
});
|
|
7735
|
+
var commentsCreate = (options) => (options.client ?? client).post({
|
|
7736
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7737
|
+
url: "/api/v1/comments",
|
|
7738
|
+
...options,
|
|
7739
|
+
headers: {
|
|
7740
|
+
"Content-Type": "application/json",
|
|
7741
|
+
...options.headers
|
|
7742
|
+
}
|
|
7743
|
+
});
|
|
7212
7744
|
var postsList = (options) => (options.client ?? client).get({
|
|
7213
7745
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7214
7746
|
url: "/api/v1/posts",
|
|
@@ -7293,6 +7825,48 @@ var adsConnectAccount = (options) => (options.client ?? client).post({
|
|
|
7293
7825
|
...options.headers
|
|
7294
7826
|
}
|
|
7295
7827
|
});
|
|
7828
|
+
var adsConnectApiKeyAccount = (options) => (options.client ?? client).post({
|
|
7829
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7830
|
+
url: "/api/v1/ads/accounts/connect/api-key",
|
|
7831
|
+
...options,
|
|
7832
|
+
headers: {
|
|
7833
|
+
"Content-Type": "application/json",
|
|
7834
|
+
...options.headers
|
|
7835
|
+
}
|
|
7836
|
+
});
|
|
7837
|
+
var adsValidateCampaignPlan = (options) => (options.client ?? client).post({
|
|
7838
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7839
|
+
url: "/api/v1/ads/campaigns/validate",
|
|
7840
|
+
...options,
|
|
7841
|
+
headers: {
|
|
7842
|
+
"Content-Type": "application/json",
|
|
7843
|
+
...options.headers
|
|
7844
|
+
}
|
|
7845
|
+
});
|
|
7846
|
+
var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
|
|
7847
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7848
|
+
url: "/api/v1/ads/campaigns",
|
|
7849
|
+
...options
|
|
7850
|
+
});
|
|
7851
|
+
var adsCreateCampaignPlan = (options) => (options.client ?? client).post({
|
|
7852
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7853
|
+
url: "/api/v1/ads/campaigns",
|
|
7854
|
+
...options,
|
|
7855
|
+
headers: {
|
|
7856
|
+
"Content-Type": "application/json",
|
|
7857
|
+
...options.headers
|
|
7858
|
+
}
|
|
7859
|
+
});
|
|
7860
|
+
var adsListCampaignPlans = (options) => (options.client ?? client).get({
|
|
7861
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7862
|
+
url: "/api/v1/ads/plans",
|
|
7863
|
+
...options
|
|
7864
|
+
});
|
|
7865
|
+
var adsGetCampaignPlan = (options) => (options.client ?? client).get({
|
|
7866
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7867
|
+
url: "/api/v1/ads/plans/{planId}",
|
|
7868
|
+
...options
|
|
7869
|
+
});
|
|
7296
7870
|
var adsSelectAccount = (options) => (options.client ?? client).post({
|
|
7297
7871
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7298
7872
|
url: "/api/v1/ads/accounts/{accountId}/select",
|
|
@@ -7303,11 +7877,6 @@ var adsDisconnectAccount = (options) => (options.client ?? client).post({
|
|
|
7303
7877
|
url: "/api/v1/ads/accounts/{accountId}/disconnect",
|
|
7304
7878
|
...options
|
|
7305
7879
|
});
|
|
7306
|
-
var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
|
|
7307
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
7308
|
-
url: "/api/v1/ads/campaigns",
|
|
7309
|
-
...options
|
|
7310
|
-
});
|
|
7311
7880
|
var adsListCampaigns = (options) => (options.client ?? client).get({
|
|
7312
7881
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7313
7882
|
url: "/api/v1/ads/accounts/{accountId}/campaigns",
|
|
@@ -7318,6 +7887,16 @@ var adsGetTree = (options) => (options.client ?? client).get({
|
|
|
7318
7887
|
url: "/api/v1/ads/tree",
|
|
7319
7888
|
...options
|
|
7320
7889
|
});
|
|
7890
|
+
var adsListAds = (options) => (options.client ?? client).get({
|
|
7891
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7892
|
+
url: "/api/v1/ads/ads",
|
|
7893
|
+
...options
|
|
7894
|
+
});
|
|
7895
|
+
var adsListAdGroups = (options) => (options.client ?? client).get({
|
|
7896
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7897
|
+
url: "/api/v1/ads/ad-groups",
|
|
7898
|
+
...options
|
|
7899
|
+
});
|
|
7321
7900
|
var adsGetAd = (options) => (options.client ?? client).get({
|
|
7322
7901
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7323
7902
|
url: "/api/v1/ads/ads/{adId}",
|
|
@@ -7328,6 +7907,20 @@ var adsListCreatives = (options) => (options.client ?? client).get({
|
|
|
7328
7907
|
url: "/api/v1/ads/creatives",
|
|
7329
7908
|
...options
|
|
7330
7909
|
});
|
|
7910
|
+
var adsCreateCreative = (options) => (options.client ?? client).post({
|
|
7911
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7912
|
+
url: "/api/v1/ads/accounts/{accountId}/creatives",
|
|
7913
|
+
...options,
|
|
7914
|
+
headers: {
|
|
7915
|
+
"Content-Type": "application/json",
|
|
7916
|
+
...options.headers
|
|
7917
|
+
}
|
|
7918
|
+
});
|
|
7919
|
+
var adsGetCreative = (options) => (options.client ?? client).get({
|
|
7920
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7921
|
+
url: "/api/v1/ads/creatives/{creativeId}",
|
|
7922
|
+
...options
|
|
7923
|
+
});
|
|
7331
7924
|
var adsListWorkspaceInsights = (options) => (options.client ?? client).get({
|
|
7332
7925
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7333
7926
|
url: "/api/v1/ads/insights",
|
|
@@ -7407,6 +8000,78 @@ var adsPauseCampaign = (options) => (options.client ?? client).post({
|
|
|
7407
8000
|
...options.headers
|
|
7408
8001
|
}
|
|
7409
8002
|
});
|
|
8003
|
+
var adsArchiveCampaign = (options) => (options.client ?? client).post({
|
|
8004
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8005
|
+
url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/archive",
|
|
8006
|
+
...options,
|
|
8007
|
+
headers: {
|
|
8008
|
+
"Content-Type": "application/json",
|
|
8009
|
+
...options.headers
|
|
8010
|
+
}
|
|
8011
|
+
});
|
|
8012
|
+
var adsDuplicateCampaign = (options) => (options.client ?? client).post({
|
|
8013
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8014
|
+
url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/duplicate",
|
|
8015
|
+
...options,
|
|
8016
|
+
headers: {
|
|
8017
|
+
"Content-Type": "application/json",
|
|
8018
|
+
...options.headers
|
|
8019
|
+
}
|
|
8020
|
+
});
|
|
8021
|
+
var adsSetCampaignBudget = (options) => (options.client ?? client).post({
|
|
8022
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8023
|
+
url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/budget",
|
|
8024
|
+
...options,
|
|
8025
|
+
headers: {
|
|
8026
|
+
"Content-Type": "application/json",
|
|
8027
|
+
...options.headers
|
|
8028
|
+
}
|
|
8029
|
+
});
|
|
8030
|
+
var adsSetAdGroupBudget = (options) => (options.client ?? client).post({
|
|
8031
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8032
|
+
url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/budget",
|
|
8033
|
+
...options,
|
|
8034
|
+
headers: {
|
|
8035
|
+
"Content-Type": "application/json",
|
|
8036
|
+
...options.headers
|
|
8037
|
+
}
|
|
8038
|
+
});
|
|
8039
|
+
var adsSetAdGroupStatus = (options) => (options.client ?? client).post({
|
|
8040
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8041
|
+
url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/status",
|
|
8042
|
+
...options,
|
|
8043
|
+
headers: {
|
|
8044
|
+
"Content-Type": "application/json",
|
|
8045
|
+
...options.headers
|
|
8046
|
+
}
|
|
8047
|
+
});
|
|
8048
|
+
var adsCreateAdGroup = (options) => (options.client ?? client).post({
|
|
8049
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8050
|
+
url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/ad-groups",
|
|
8051
|
+
...options,
|
|
8052
|
+
headers: {
|
|
8053
|
+
"Content-Type": "application/json",
|
|
8054
|
+
...options.headers
|
|
8055
|
+
}
|
|
8056
|
+
});
|
|
8057
|
+
var adsAttachAd = (options) => (options.client ?? client).post({
|
|
8058
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8059
|
+
url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/ads",
|
|
8060
|
+
...options,
|
|
8061
|
+
headers: {
|
|
8062
|
+
"Content-Type": "application/json",
|
|
8063
|
+
...options.headers
|
|
8064
|
+
}
|
|
8065
|
+
});
|
|
8066
|
+
var adsSetAdStatus = (options) => (options.client ?? client).post({
|
|
8067
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8068
|
+
url: "/api/v1/ads/accounts/{accountId}/ads/{adId}/status",
|
|
8069
|
+
...options,
|
|
8070
|
+
headers: {
|
|
8071
|
+
"Content-Type": "application/json",
|
|
8072
|
+
...options.headers
|
|
8073
|
+
}
|
|
8074
|
+
});
|
|
7410
8075
|
var auditList = (options) => (options.client ?? client).get({
|
|
7411
8076
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7412
8077
|
url: "/api/v1/workspaces/{workspaceId}/audit-logs",
|
|
@@ -7758,7 +8423,8 @@ function createPubNioClient({
|
|
|
7758
8423
|
signal: clientSignal,
|
|
7759
8424
|
retries: requestedRetries = defaultRetries,
|
|
7760
8425
|
clientName = "sdk",
|
|
7761
|
-
clientVersion = package_default.version
|
|
8426
|
+
clientVersion = package_default.version,
|
|
8427
|
+
onRuntime
|
|
7762
8428
|
}) {
|
|
7763
8429
|
const timeoutMs = checkedTimeout(requestedTimeoutMs, "timeoutMs");
|
|
7764
8430
|
const retries = checkedRetries(requestedRetries);
|
|
@@ -7813,6 +8479,7 @@ function createPubNioClient({
|
|
|
7813
8479
|
throw invalidResponse();
|
|
7814
8480
|
});
|
|
7815
8481
|
}
|
|
8482
|
+
onRuntime?.({ client, transport, decode });
|
|
7816
8483
|
async function poll(read, done, { timeoutMs: waitTimeoutMs = 60000, signal } = {}) {
|
|
7817
8484
|
const timeoutMs = checkedTimeout(waitTimeoutMs, "timeoutMs");
|
|
7818
8485
|
const deadline = performance.now() + timeoutMs;
|
|
@@ -8285,27 +8952,75 @@ function createPubNioClient({
|
|
|
8285
8952
|
},
|
|
8286
8953
|
...transport()
|
|
8287
8954
|
}));
|
|
8288
|
-
const
|
|
8955
|
+
const listAdGroups = (options = {}) => decode(AdGroupList, adsListAdGroups({
|
|
8289
8956
|
client,
|
|
8290
8957
|
query: {
|
|
8291
8958
|
workspaceId,
|
|
8292
8959
|
accountId: options.accountId,
|
|
8293
8960
|
campaignId: options.campaignId,
|
|
8961
|
+
provider: options.provider,
|
|
8962
|
+
status: options.status,
|
|
8963
|
+
from: options.from,
|
|
8964
|
+
to: options.to,
|
|
8294
8965
|
cursor: options.cursor,
|
|
8295
8966
|
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
8296
8967
|
},
|
|
8297
8968
|
...transport()
|
|
8298
8969
|
}));
|
|
8299
|
-
const
|
|
8970
|
+
const listAds = (options = {}) => decode(AdList, adsListAds({
|
|
8300
8971
|
client,
|
|
8301
8972
|
query: {
|
|
8302
8973
|
workspaceId,
|
|
8303
8974
|
accountId: options.accountId,
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8975
|
+
campaignId: options.campaignId,
|
|
8976
|
+
adGroupId: options.adGroupId,
|
|
8977
|
+
provider: options.provider,
|
|
8978
|
+
status: options.status,
|
|
8979
|
+
from: options.from,
|
|
8980
|
+
to: options.to,
|
|
8981
|
+
cursor: options.cursor,
|
|
8982
|
+
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
8983
|
+
},
|
|
8984
|
+
...transport()
|
|
8985
|
+
}));
|
|
8986
|
+
const listAdTree = (options = {}) => decode(AdTree, adsGetTree({
|
|
8987
|
+
client,
|
|
8988
|
+
query: {
|
|
8989
|
+
workspaceId,
|
|
8990
|
+
accountId: options.accountId,
|
|
8991
|
+
campaignId: options.campaignId,
|
|
8992
|
+
cursor: options.cursor,
|
|
8993
|
+
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
8994
|
+
},
|
|
8995
|
+
...transport()
|
|
8996
|
+
}));
|
|
8997
|
+
const listAdCreatives = (options = {}) => decode(AdCreativeList, adsListCreatives({
|
|
8998
|
+
client,
|
|
8999
|
+
query: {
|
|
9000
|
+
workspaceId,
|
|
9001
|
+
accountId: options.accountId,
|
|
9002
|
+
adId: options.adId,
|
|
9003
|
+
cursor: options.cursor,
|
|
9004
|
+
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
9005
|
+
},
|
|
9006
|
+
...transport()
|
|
9007
|
+
}));
|
|
9008
|
+
const createAdCreative = (accountId, input, options = {}) => {
|
|
9009
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9010
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateCreative({
|
|
9011
|
+
client,
|
|
9012
|
+
path: { accountId },
|
|
9013
|
+
query: { workspaceId },
|
|
9014
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9015
|
+
body: input,
|
|
9016
|
+
...transport()
|
|
9017
|
+
})));
|
|
9018
|
+
};
|
|
9019
|
+
const getAdCreative = (creativeId) => decode(AdCreative, adsGetCreative({
|
|
9020
|
+
client,
|
|
9021
|
+
path: { creativeId },
|
|
9022
|
+
query: { workspaceId },
|
|
9023
|
+
...transport()
|
|
8309
9024
|
}));
|
|
8310
9025
|
const listAdInsights = (options = {}) => decode(AdInsightList, adsListWorkspaceInsights({
|
|
8311
9026
|
client,
|
|
@@ -8374,6 +9089,68 @@ function createPubNioClient({
|
|
|
8374
9089
|
body: input,
|
|
8375
9090
|
...transport()
|
|
8376
9091
|
}));
|
|
9092
|
+
const mutableCampaignPlan = (plan) => ({
|
|
9093
|
+
...plan,
|
|
9094
|
+
...plan.budget ? { budget: { ...plan.budget } } : {},
|
|
9095
|
+
...plan.schedule ? { schedule: { ...plan.schedule } } : {},
|
|
9096
|
+
...plan.providerSettings ? { providerSettings: { ...plan.providerSettings } } : {},
|
|
9097
|
+
targets: plan.targets.map((target) => ({
|
|
9098
|
+
...target,
|
|
9099
|
+
...target.budget ? { budget: { ...target.budget } } : {},
|
|
9100
|
+
...target.schedule ? { schedule: { ...target.schedule } } : {},
|
|
9101
|
+
...target.providerSettings ? { providerSettings: { ...target.providerSettings } } : {}
|
|
9102
|
+
})),
|
|
9103
|
+
adGroups: plan.adGroups.map((group) => ({
|
|
9104
|
+
...group,
|
|
9105
|
+
...group.budget ? { budget: { ...group.budget } } : {},
|
|
9106
|
+
...group.targeting ? { targeting: { ...group.targeting } } : {},
|
|
9107
|
+
...group.providerSettings ? { providerSettings: { ...group.providerSettings } } : {},
|
|
9108
|
+
ads: group.ads.map((ad) => ({
|
|
9109
|
+
...ad,
|
|
9110
|
+
...ad.providerSettings ? { providerSettings: { ...ad.providerSettings } } : {},
|
|
9111
|
+
creative: {
|
|
9112
|
+
...ad.creative.headline !== undefined ? { headline: ad.creative.headline } : {},
|
|
9113
|
+
...ad.creative.body !== undefined ? { body: ad.creative.body } : {},
|
|
9114
|
+
...ad.creative.callToAction !== undefined ? { callToAction: ad.creative.callToAction } : {},
|
|
9115
|
+
...ad.creative.destinationUrl !== undefined ? { destinationUrl: ad.creative.destinationUrl } : {},
|
|
9116
|
+
...ad.creative.media ? { media: ad.creative.media.map((item) => ({ ...item })) } : {},
|
|
9117
|
+
...ad.creative.providerSettings ? { providerSettings: { ...ad.creative.providerSettings } } : {}
|
|
9118
|
+
}
|
|
9119
|
+
}))
|
|
9120
|
+
}))
|
|
9121
|
+
});
|
|
9122
|
+
const validateAdCampaignPlan = (input) => decode(AdCampaignPlanValidation, adsValidateCampaignPlan({
|
|
9123
|
+
client,
|
|
9124
|
+
query: { workspaceId },
|
|
9125
|
+
body: mutableCampaignPlan(input),
|
|
9126
|
+
...transport()
|
|
9127
|
+
}));
|
|
9128
|
+
const createAdCampaignPlan = (input, options = {}) => {
|
|
9129
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9130
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdCampaignPlanAccepted, adsCreateCampaignPlan({
|
|
9131
|
+
client,
|
|
9132
|
+
query: { workspaceId },
|
|
9133
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9134
|
+
body: mutableCampaignPlan(input),
|
|
9135
|
+
...transport()
|
|
9136
|
+
})));
|
|
9137
|
+
};
|
|
9138
|
+
const listAdCampaignPlans = (options = {}) => decode(AdCampaignPlanList, adsListCampaignPlans({
|
|
9139
|
+
client,
|
|
9140
|
+
query: {
|
|
9141
|
+
workspaceId,
|
|
9142
|
+
status: options.status,
|
|
9143
|
+
cursor: options.cursor,
|
|
9144
|
+
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
9145
|
+
},
|
|
9146
|
+
...transport()
|
|
9147
|
+
}));
|
|
9148
|
+
const readAdCampaignPlan = (planId) => decode(AdCampaignPlanDetail, adsGetCampaignPlan({
|
|
9149
|
+
client,
|
|
9150
|
+
path: { planId },
|
|
9151
|
+
query: { workspaceId },
|
|
9152
|
+
...transport()
|
|
9153
|
+
}));
|
|
8377
9154
|
const createAdBoost = (accountId, input, options = {}) => {
|
|
8378
9155
|
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
8379
9156
|
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateBoost({
|
|
@@ -8407,6 +9184,94 @@ function createPubNioClient({
|
|
|
8407
9184
|
...transport()
|
|
8408
9185
|
})));
|
|
8409
9186
|
};
|
|
9187
|
+
const duplicateAdCampaign = (accountId, campaignId, input, options = {}) => {
|
|
9188
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9189
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsDuplicateCampaign({
|
|
9190
|
+
client,
|
|
9191
|
+
path: { accountId, campaignId },
|
|
9192
|
+
query: { workspaceId },
|
|
9193
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9194
|
+
body: input,
|
|
9195
|
+
...transport()
|
|
9196
|
+
})));
|
|
9197
|
+
};
|
|
9198
|
+
const archiveAdCampaign = (accountId, campaignId, input, options = {}) => {
|
|
9199
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9200
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsArchiveCampaign({
|
|
9201
|
+
client,
|
|
9202
|
+
path: { accountId, campaignId },
|
|
9203
|
+
query: { workspaceId },
|
|
9204
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9205
|
+
body: input,
|
|
9206
|
+
...transport()
|
|
9207
|
+
})));
|
|
9208
|
+
};
|
|
9209
|
+
const setCampaignBudget = (accountId, campaignId, input, options = {}) => {
|
|
9210
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9211
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetCampaignBudget({
|
|
9212
|
+
client,
|
|
9213
|
+
path: { accountId, campaignId },
|
|
9214
|
+
query: { workspaceId },
|
|
9215
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9216
|
+
body: input,
|
|
9217
|
+
...transport()
|
|
9218
|
+
})));
|
|
9219
|
+
};
|
|
9220
|
+
const createAdGroup = (accountId, campaignId, input, options = {}) => {
|
|
9221
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9222
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateAdGroup({
|
|
9223
|
+
client,
|
|
9224
|
+
path: { accountId, campaignId },
|
|
9225
|
+
query: { workspaceId },
|
|
9226
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9227
|
+
body: input,
|
|
9228
|
+
...transport()
|
|
9229
|
+
})));
|
|
9230
|
+
};
|
|
9231
|
+
const attachAd = (accountId, adGroupId, input, options = {}) => {
|
|
9232
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9233
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsAttachAd({
|
|
9234
|
+
client,
|
|
9235
|
+
path: { accountId, adGroupId },
|
|
9236
|
+
query: { workspaceId },
|
|
9237
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9238
|
+
body: input,
|
|
9239
|
+
...transport()
|
|
9240
|
+
})));
|
|
9241
|
+
};
|
|
9242
|
+
const setAdGroupBudget = (accountId, adGroupId, input, options = {}) => {
|
|
9243
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9244
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupBudget({
|
|
9245
|
+
client,
|
|
9246
|
+
path: { accountId, adGroupId },
|
|
9247
|
+
query: { workspaceId },
|
|
9248
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9249
|
+
body: input,
|
|
9250
|
+
...transport()
|
|
9251
|
+
})));
|
|
9252
|
+
};
|
|
9253
|
+
const setAdGroupStatus = (accountId, adGroupId, input, options = {}) => {
|
|
9254
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9255
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupStatus({
|
|
9256
|
+
client,
|
|
9257
|
+
path: { accountId, adGroupId },
|
|
9258
|
+
query: { workspaceId },
|
|
9259
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9260
|
+
body: input,
|
|
9261
|
+
...transport()
|
|
9262
|
+
})));
|
|
9263
|
+
};
|
|
9264
|
+
const setAdStatus = (accountId, adId, input, options = {}) => {
|
|
9265
|
+
const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
|
|
9266
|
+
return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdStatus({
|
|
9267
|
+
client,
|
|
9268
|
+
path: { accountId, adId },
|
|
9269
|
+
query: { workspaceId },
|
|
9270
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
9271
|
+
body: input,
|
|
9272
|
+
...transport()
|
|
9273
|
+
})));
|
|
9274
|
+
};
|
|
8410
9275
|
return {
|
|
8411
9276
|
workspaceId,
|
|
8412
9277
|
posts: {
|
|
@@ -8973,6 +9838,11 @@ function createPubNioClient({
|
|
|
8973
9838
|
body: { ...input, workspaceId },
|
|
8974
9839
|
...transport()
|
|
8975
9840
|
})),
|
|
9841
|
+
connectApiKey: (input) => decode(AdApiKeyConnectResult, adsConnectApiKeyAccount({
|
|
9842
|
+
client,
|
|
9843
|
+
body: { ...input, workspaceId },
|
|
9844
|
+
...transport()
|
|
9845
|
+
})),
|
|
8976
9846
|
select: (accountId) => decode(AdAccountSelection, adsSelectAccount({
|
|
8977
9847
|
client,
|
|
8978
9848
|
path: { accountId },
|
|
@@ -8988,6 +9858,10 @@ function createPubNioClient({
|
|
|
8988
9858
|
campaigns: listAdCampaigns,
|
|
8989
9859
|
iterateCampaigns: (options, iteration) => iterateItems(listAdCampaigns, options ?? {}, iteration),
|
|
8990
9860
|
accountCampaigns: listAdAccountCampaigns,
|
|
9861
|
+
adGroups: listAdGroups,
|
|
9862
|
+
iterateAdGroups: (options, iteration) => iterateItems(listAdGroups, options ?? {}, iteration),
|
|
9863
|
+
ads: listAds,
|
|
9864
|
+
iterateAds: (options, iteration) => iterateItems(listAds, options ?? {}, iteration),
|
|
8991
9865
|
iterateAccountCampaigns: (accountId, options, iteration) => iterateItems((query) => listAdAccountCampaigns(accountId, query), options ?? {}, iteration),
|
|
8992
9866
|
tree: listAdTree,
|
|
8993
9867
|
iterateTree: (options, iteration) => iterateItems(listAdTree, options ?? {}, iteration),
|
|
@@ -8998,6 +9872,8 @@ function createPubNioClient({
|
|
|
8998
9872
|
...transport()
|
|
8999
9873
|
})),
|
|
9000
9874
|
creatives: listAdCreatives,
|
|
9875
|
+
creative: getAdCreative,
|
|
9876
|
+
createCreative: createAdCreative,
|
|
9001
9877
|
iterateCreatives: (options, iteration) => iterateItems(listAdCreatives, options ?? {}, iteration),
|
|
9002
9878
|
insights: listAdInsights,
|
|
9003
9879
|
iterateInsights: (options, iteration) => iterateItems(listAdInsights, options ?? {}, iteration),
|
|
@@ -9014,9 +9890,22 @@ function createPubNioClient({
|
|
|
9014
9890
|
setKillSwitch: setAdKillSwitch,
|
|
9015
9891
|
operation: readAdOperation,
|
|
9016
9892
|
validateBoost: validateAdBoost,
|
|
9893
|
+
validateCampaignPlan: validateAdCampaignPlan,
|
|
9894
|
+
createCampaignPlan: createAdCampaignPlan,
|
|
9895
|
+
campaignPlan: readAdCampaignPlan,
|
|
9896
|
+
campaignPlans: listAdCampaignPlans,
|
|
9897
|
+
iterateCampaignPlans: (options, iteration) => iterateItems(listAdCampaignPlans, options ?? {}, iteration),
|
|
9017
9898
|
createBoost: createAdBoost,
|
|
9018
9899
|
activateCampaign: activateAdCampaign,
|
|
9019
|
-
pauseCampaign: pauseAdCampaign
|
|
9900
|
+
pauseCampaign: pauseAdCampaign,
|
|
9901
|
+
archiveCampaign: archiveAdCampaign,
|
|
9902
|
+
duplicateCampaign: duplicateAdCampaign,
|
|
9903
|
+
setCampaignBudget,
|
|
9904
|
+
setAdGroupBudget,
|
|
9905
|
+
setAdGroupStatus,
|
|
9906
|
+
attachAd,
|
|
9907
|
+
createAdGroup,
|
|
9908
|
+
setAdStatus
|
|
9020
9909
|
},
|
|
9021
9910
|
analytics: {
|
|
9022
9911
|
post: (postId, options = {}) => decode(PostAnalytics, analyticsPostsGet({
|
|
@@ -10161,6 +11050,53 @@ function adsAccountsInfiniteOptions(workspace, { state, limit } = {}) {
|
|
|
10161
11050
|
getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
|
|
10162
11051
|
});
|
|
10163
11052
|
}
|
|
11053
|
+
function adsCampaignPlanOptions(workspace, planId) {
|
|
11054
|
+
return queryOptions({
|
|
11055
|
+
queryKey: [
|
|
11056
|
+
...adsKey(workspace.workspaceId),
|
|
11057
|
+
"plans",
|
|
11058
|
+
"detail",
|
|
11059
|
+
planId
|
|
11060
|
+
],
|
|
11061
|
+
queryFn: () => workspace.ads.campaignPlan(planId)
|
|
11062
|
+
});
|
|
11063
|
+
}
|
|
11064
|
+
function adsValidateCampaignPlanMutation(workspace) {
|
|
11065
|
+
return mutationOptions({
|
|
11066
|
+
mutationFn: (input) => workspace.ads.validateCampaignPlan(input)
|
|
11067
|
+
});
|
|
11068
|
+
}
|
|
11069
|
+
function adsCreateCampaignPlanMutation(workspace) {
|
|
11070
|
+
return mutationOptions({
|
|
11071
|
+
mutationFn: ({
|
|
11072
|
+
input,
|
|
11073
|
+
idempotencyKey
|
|
11074
|
+
}) => workspace.ads.createCampaignPlan(input, { idempotencyKey }),
|
|
11075
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11076
|
+
for (const domain of ["campaigns", "plans", "operations"])
|
|
11077
|
+
queryClient.invalidateQueries({
|
|
11078
|
+
queryKey: [...adsKey(workspace.workspaceId), domain]
|
|
11079
|
+
});
|
|
11080
|
+
}
|
|
11081
|
+
});
|
|
11082
|
+
}
|
|
11083
|
+
function adsCampaignPlansInfiniteOptions(workspace, { status, limit } = {}) {
|
|
11084
|
+
return infiniteQueryOptions({
|
|
11085
|
+
queryKey: [
|
|
11086
|
+
...adsKey(workspace.workspaceId),
|
|
11087
|
+
"plans",
|
|
11088
|
+
"infinite",
|
|
11089
|
+
{ status, limit }
|
|
11090
|
+
],
|
|
11091
|
+
initialPageParam: undefined,
|
|
11092
|
+
queryFn: ({ pageParam }) => workspace.ads.campaignPlans({
|
|
11093
|
+
status,
|
|
11094
|
+
cursor: pageParam,
|
|
11095
|
+
limit
|
|
11096
|
+
}),
|
|
11097
|
+
getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
|
|
11098
|
+
});
|
|
11099
|
+
}
|
|
10164
11100
|
function adsCampaignsInfiniteOptions(workspace, {
|
|
10165
11101
|
accountId,
|
|
10166
11102
|
provider,
|
|
@@ -10211,6 +11147,68 @@ function adsTreeInfiniteOptions(workspace, { accountId, campaignId, limit } = {}
|
|
|
10211
11147
|
getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
|
|
10212
11148
|
});
|
|
10213
11149
|
}
|
|
11150
|
+
function adsAdGroupsInfiniteOptions(workspace, {
|
|
11151
|
+
accountId,
|
|
11152
|
+
campaignId,
|
|
11153
|
+
provider,
|
|
11154
|
+
status,
|
|
11155
|
+
from,
|
|
11156
|
+
to,
|
|
11157
|
+
limit
|
|
11158
|
+
} = {}) {
|
|
11159
|
+
return infiniteQueryOptions({
|
|
11160
|
+
queryKey: [
|
|
11161
|
+
...adsKey(workspace.workspaceId),
|
|
11162
|
+
"ad-groups",
|
|
11163
|
+
"infinite",
|
|
11164
|
+
{ accountId, campaignId, provider, status, from, to, limit }
|
|
11165
|
+
],
|
|
11166
|
+
initialPageParam: undefined,
|
|
11167
|
+
queryFn: ({ pageParam }) => workspace.ads.adGroups({
|
|
11168
|
+
accountId,
|
|
11169
|
+
campaignId,
|
|
11170
|
+
provider,
|
|
11171
|
+
status,
|
|
11172
|
+
from,
|
|
11173
|
+
to,
|
|
11174
|
+
cursor: pageParam,
|
|
11175
|
+
limit
|
|
11176
|
+
}),
|
|
11177
|
+
getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
|
|
11178
|
+
});
|
|
11179
|
+
}
|
|
11180
|
+
function adsAdsInfiniteOptions(workspace, {
|
|
11181
|
+
accountId,
|
|
11182
|
+
campaignId,
|
|
11183
|
+
adGroupId,
|
|
11184
|
+
provider,
|
|
11185
|
+
status,
|
|
11186
|
+
from,
|
|
11187
|
+
to,
|
|
11188
|
+
limit
|
|
11189
|
+
} = {}) {
|
|
11190
|
+
return infiniteQueryOptions({
|
|
11191
|
+
queryKey: [
|
|
11192
|
+
...adsKey(workspace.workspaceId),
|
|
11193
|
+
"ads",
|
|
11194
|
+
"infinite",
|
|
11195
|
+
{ accountId, campaignId, adGroupId, provider, status, from, to, limit }
|
|
11196
|
+
],
|
|
11197
|
+
initialPageParam: undefined,
|
|
11198
|
+
queryFn: ({ pageParam }) => workspace.ads.ads({
|
|
11199
|
+
accountId,
|
|
11200
|
+
campaignId,
|
|
11201
|
+
adGroupId,
|
|
11202
|
+
provider,
|
|
11203
|
+
status,
|
|
11204
|
+
from,
|
|
11205
|
+
to,
|
|
11206
|
+
cursor: pageParam,
|
|
11207
|
+
limit
|
|
11208
|
+
}),
|
|
11209
|
+
getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
|
|
11210
|
+
});
|
|
11211
|
+
}
|
|
10214
11212
|
function adsCreativesInfiniteOptions(workspace, { accountId, adId, limit } = {}) {
|
|
10215
11213
|
return infiniteQueryOptions({
|
|
10216
11214
|
queryKey: [
|
|
@@ -10285,6 +11283,19 @@ function adsConnectMutation(workspace) {
|
|
|
10285
11283
|
}
|
|
10286
11284
|
});
|
|
10287
11285
|
}
|
|
11286
|
+
function adsConnectApiKeyMutation(workspace) {
|
|
11287
|
+
return mutationOptions({
|
|
11288
|
+
mutationFn: (input) => workspace.ads.connectApiKey(input),
|
|
11289
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11290
|
+
queryClient.invalidateQueries({
|
|
11291
|
+
queryKey: adsKey(workspace.workspaceId)
|
|
11292
|
+
});
|
|
11293
|
+
queryClient.invalidateQueries({
|
|
11294
|
+
queryKey: accountsKey(workspace.workspaceId)
|
|
11295
|
+
});
|
|
11296
|
+
}
|
|
11297
|
+
});
|
|
11298
|
+
}
|
|
10288
11299
|
function adsSelectMutation(workspace) {
|
|
10289
11300
|
return mutationOptions({
|
|
10290
11301
|
mutationFn: (accountId) => workspace.ads.select(accountId),
|
|
@@ -10408,6 +11419,8 @@ function invalidateCampaignWrite(queryClient, workspaceId) {
|
|
|
10408
11419
|
for (const domain of [
|
|
10409
11420
|
"accounts",
|
|
10410
11421
|
"campaigns",
|
|
11422
|
+
"ad-groups",
|
|
11423
|
+
"ads",
|
|
10411
11424
|
"tree",
|
|
10412
11425
|
"insights",
|
|
10413
11426
|
"operations"
|
|
@@ -10432,6 +11445,21 @@ function adsActivateCampaignMutation(workspace) {
|
|
|
10432
11445
|
}
|
|
10433
11446
|
});
|
|
10434
11447
|
}
|
|
11448
|
+
function adsArchiveCampaignMutation(workspace) {
|
|
11449
|
+
return mutationOptions({
|
|
11450
|
+
mutationFn: ({
|
|
11451
|
+
accountId,
|
|
11452
|
+
campaignId,
|
|
11453
|
+
input,
|
|
11454
|
+
idempotencyKey
|
|
11455
|
+
}) => workspace.ads.archiveCampaign(accountId, campaignId, input, {
|
|
11456
|
+
idempotencyKey
|
|
11457
|
+
}),
|
|
11458
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11459
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11460
|
+
}
|
|
11461
|
+
});
|
|
11462
|
+
}
|
|
10435
11463
|
function adsPauseCampaignMutation(workspace) {
|
|
10436
11464
|
return mutationOptions({
|
|
10437
11465
|
mutationFn: ({
|
|
@@ -10447,6 +11475,119 @@ function adsPauseCampaignMutation(workspace) {
|
|
|
10447
11475
|
}
|
|
10448
11476
|
});
|
|
10449
11477
|
}
|
|
11478
|
+
function adsCreateAdGroupMutation(workspace) {
|
|
11479
|
+
return mutationOptions({
|
|
11480
|
+
mutationFn: ({
|
|
11481
|
+
accountId,
|
|
11482
|
+
campaignId,
|
|
11483
|
+
input,
|
|
11484
|
+
idempotencyKey
|
|
11485
|
+
}) => workspace.ads.createAdGroup(accountId, campaignId, input, {
|
|
11486
|
+
idempotencyKey
|
|
11487
|
+
}),
|
|
11488
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11489
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11490
|
+
}
|
|
11491
|
+
});
|
|
11492
|
+
}
|
|
11493
|
+
function adsCreateCreativeMutation(workspace) {
|
|
11494
|
+
return mutationOptions({
|
|
11495
|
+
mutationFn: ({
|
|
11496
|
+
accountId,
|
|
11497
|
+
input,
|
|
11498
|
+
idempotencyKey
|
|
11499
|
+
}) => workspace.ads.createCreative(accountId, input, { idempotencyKey }),
|
|
11500
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11501
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11502
|
+
}
|
|
11503
|
+
});
|
|
11504
|
+
}
|
|
11505
|
+
function adsDuplicateCampaignMutation(workspace) {
|
|
11506
|
+
return mutationOptions({
|
|
11507
|
+
mutationFn: ({
|
|
11508
|
+
accountId,
|
|
11509
|
+
campaignId,
|
|
11510
|
+
input,
|
|
11511
|
+
idempotencyKey
|
|
11512
|
+
}) => workspace.ads.duplicateCampaign(accountId, campaignId, input, {
|
|
11513
|
+
idempotencyKey
|
|
11514
|
+
}),
|
|
11515
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11516
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11517
|
+
}
|
|
11518
|
+
});
|
|
11519
|
+
}
|
|
11520
|
+
function adsAttachAdMutation(workspace) {
|
|
11521
|
+
return mutationOptions({
|
|
11522
|
+
mutationFn: ({
|
|
11523
|
+
accountId,
|
|
11524
|
+
adGroupId,
|
|
11525
|
+
input,
|
|
11526
|
+
idempotencyKey
|
|
11527
|
+
}) => workspace.ads.attachAd(accountId, adGroupId, input, { idempotencyKey }),
|
|
11528
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11529
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11530
|
+
}
|
|
11531
|
+
});
|
|
11532
|
+
}
|
|
11533
|
+
function adsSetCampaignBudgetMutation(workspace) {
|
|
11534
|
+
return mutationOptions({
|
|
11535
|
+
mutationFn: ({
|
|
11536
|
+
accountId,
|
|
11537
|
+
campaignId,
|
|
11538
|
+
input,
|
|
11539
|
+
idempotencyKey
|
|
11540
|
+
}) => workspace.ads.setCampaignBudget(accountId, campaignId, input, {
|
|
11541
|
+
idempotencyKey
|
|
11542
|
+
}),
|
|
11543
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11544
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11545
|
+
}
|
|
11546
|
+
});
|
|
11547
|
+
}
|
|
11548
|
+
function adsSetAdGroupBudgetMutation(workspace) {
|
|
11549
|
+
return mutationOptions({
|
|
11550
|
+
mutationFn: ({
|
|
11551
|
+
accountId,
|
|
11552
|
+
adGroupId,
|
|
11553
|
+
input,
|
|
11554
|
+
idempotencyKey
|
|
11555
|
+
}) => workspace.ads.setAdGroupBudget(accountId, adGroupId, input, {
|
|
11556
|
+
idempotencyKey
|
|
11557
|
+
}),
|
|
11558
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11559
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11560
|
+
}
|
|
11561
|
+
});
|
|
11562
|
+
}
|
|
11563
|
+
function adsSetAdGroupStatusMutation(workspace) {
|
|
11564
|
+
return mutationOptions({
|
|
11565
|
+
mutationFn: ({
|
|
11566
|
+
accountId,
|
|
11567
|
+
adGroupId,
|
|
11568
|
+
input,
|
|
11569
|
+
idempotencyKey
|
|
11570
|
+
}) => workspace.ads.setAdGroupStatus(accountId, adGroupId, input, {
|
|
11571
|
+
idempotencyKey
|
|
11572
|
+
}),
|
|
11573
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11574
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11575
|
+
}
|
|
11576
|
+
});
|
|
11577
|
+
}
|
|
11578
|
+
function adsSetAdStatusMutation(workspace) {
|
|
11579
|
+
return mutationOptions({
|
|
11580
|
+
mutationFn: ({
|
|
11581
|
+
accountId,
|
|
11582
|
+
adId,
|
|
11583
|
+
input,
|
|
11584
|
+
idempotencyKey
|
|
11585
|
+
}) => workspace.ads.setAdStatus(accountId, adId, input, { idempotencyKey }),
|
|
11586
|
+
onSuccess: (_data, _input, _result, { client: queryClient }) => {
|
|
11587
|
+
invalidateCampaignWrite(queryClient, workspace.workspaceId);
|
|
11588
|
+
}
|
|
11589
|
+
});
|
|
11590
|
+
}
|
|
10450
11591
|
function queuesInfiniteOptions(workspace, { limit, accountId } = {}) {
|
|
10451
11592
|
return infiniteQueryOptions({
|
|
10452
11593
|
queryKey: [
|
|
@@ -10781,22 +11922,38 @@ export {
|
|
|
10781
11922
|
adOperationPollDelay,
|
|
10782
11923
|
adsAccountsInfiniteOptions,
|
|
10783
11924
|
adsActivateCampaignMutation,
|
|
11925
|
+
adsAdGroupsInfiniteOptions,
|
|
10784
11926
|
adsAdOptions,
|
|
11927
|
+
adsAdsInfiniteOptions,
|
|
11928
|
+
adsArchiveCampaignMutation,
|
|
11929
|
+
adsAttachAdMutation,
|
|
11930
|
+
adsCampaignPlanOptions,
|
|
11931
|
+
adsCampaignPlansInfiniteOptions,
|
|
10785
11932
|
adsCampaignsInfiniteOptions,
|
|
11933
|
+
adsConnectApiKeyMutation,
|
|
10786
11934
|
adsConnectMutation,
|
|
11935
|
+
adsCreateAdGroupMutation,
|
|
10787
11936
|
adsCreateBoostMutation,
|
|
11937
|
+
adsCreateCampaignPlanMutation,
|
|
11938
|
+
adsCreateCreativeMutation,
|
|
10788
11939
|
adsCreativesInfiniteOptions,
|
|
10789
11940
|
adsDisconnectMutation,
|
|
11941
|
+
adsDuplicateCampaignMutation,
|
|
10790
11942
|
adsInsightsInfiniteOptions,
|
|
10791
11943
|
adsOperationOptions,
|
|
10792
11944
|
adsPauseCampaignMutation,
|
|
10793
11945
|
adsRefreshMutation,
|
|
10794
11946
|
adsSelectMutation,
|
|
11947
|
+
adsSetAdGroupBudgetMutation,
|
|
11948
|
+
adsSetAdGroupStatusMutation,
|
|
11949
|
+
adsSetAdStatusMutation,
|
|
11950
|
+
adsSetCampaignBudgetMutation,
|
|
10795
11951
|
adsSetKillSwitchMutation,
|
|
10796
11952
|
adsSpendPolicyOptions,
|
|
10797
11953
|
adsTreeInfiniteOptions,
|
|
10798
11954
|
adsUpdateSpendPolicyMutation,
|
|
10799
11955
|
adsValidateBoostMutation,
|
|
11956
|
+
adsValidateCampaignPlanMutation,
|
|
10800
11957
|
apiKeysCreateMutation,
|
|
10801
11958
|
apiKeysGetOptions,
|
|
10802
11959
|
apiKeysInfiniteOptions,
|