@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.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
  // ../protocol/src/accounts.ts
2
190
  import { Schema as Schema2 } from "effect";
3
191
 
@@ -182,6 +370,7 @@ var PROVIDERS = [
182
370
  "linkedin",
183
371
  "pinterest",
184
372
  "reddit",
373
+ "snapchat",
185
374
  "tiktok",
186
375
  "threads",
187
376
  "x",
@@ -198,7 +387,8 @@ var ACCOUNT_PROVIDERS = [
198
387
  "tiktok_ads",
199
388
  "linkedin_ads",
200
389
  "snapchat_ads",
201
- "amazon_ads"
390
+ "amazon_ads",
391
+ "openai_ads"
202
392
  ];
203
393
  var AccountProvider = Schema7.Literals(ACCOUNT_PROVIDERS);
204
394
  var AmazonAdsRegion = Schema7.Literals(["na", "eu", "fe"]);
@@ -1298,7 +1488,7 @@ var providerCatalog = {
1298
1488
  availability: "beta",
1299
1489
  authFamily: "bluesky",
1300
1490
  accountKinds: ["social_account"],
1301
- capabilities: { social_account: socialCapabilities },
1491
+ capabilities: { social_account: messagingCapabilities },
1302
1492
  approvalRequired: {},
1303
1493
  limited: {}
1304
1494
  },
@@ -1346,9 +1536,16 @@ var providerCatalog = {
1346
1536
  availability: "upcoming",
1347
1537
  authFamily: "reddit",
1348
1538
  accountKinds: ["social_account"],
1349
- capabilities: {
1350
- social_account: ["publish", "read_insights", "manage_comments"]
1351
- },
1539
+ capabilities: { social_account: messagingCapabilities },
1540
+ approvalRequired: {},
1541
+ limited: {}
1542
+ },
1543
+ snapchat: {
1544
+ label: "Snapchat",
1545
+ availability: "beta",
1546
+ authFamily: "snapchat",
1547
+ accountKinds: ["social_page"],
1548
+ capabilities: { social_page: ["publish"] },
1352
1549
  approvalRequired: {},
1353
1550
  limited: {}
1354
1551
  },
@@ -1420,6 +1617,7 @@ var accountProviderCatalog = {
1420
1617
  linkedin: { ...providerCatalog.linkedin, publishCapable: true },
1421
1618
  pinterest: { ...providerCatalog.pinterest, publishCapable: true },
1422
1619
  reddit: { ...providerCatalog.reddit, publishCapable: true },
1620
+ snapchat: { ...providerCatalog.snapchat, publishCapable: true },
1423
1621
  tiktok: { ...providerCatalog.tiktok, publishCapable: true },
1424
1622
  threads: { ...providerCatalog.threads, publishCapable: true },
1425
1623
  x: { ...providerCatalog.x, publishCapable: true },
@@ -1436,7 +1634,8 @@ var accountProviderCatalog = {
1436
1634
  capabilities: { ad_account: ["ads_read"] },
1437
1635
  approvalRequired: {},
1438
1636
  limited: {},
1439
- publishCapable: false
1637
+ publishCapable: false,
1638
+ integrationState: "connectable"
1440
1639
  },
1441
1640
  google_ads: {
1442
1641
  label: "Google Ads",
@@ -1446,7 +1645,8 @@ var accountProviderCatalog = {
1446
1645
  capabilities: { ad_account: ["ads_read"] },
1447
1646
  approvalRequired: {},
1448
1647
  limited: {},
1449
- publishCapable: false
1648
+ publishCapable: false,
1649
+ integrationState: "connectable"
1450
1650
  },
1451
1651
  reddit_ads: {
1452
1652
  label: "Reddit Ads",
@@ -1456,7 +1656,8 @@ var accountProviderCatalog = {
1456
1656
  capabilities: { ad_account: ["ads_read"] },
1457
1657
  approvalRequired: {},
1458
1658
  limited: {},
1459
- publishCapable: false
1659
+ publishCapable: false,
1660
+ integrationState: "connectable"
1460
1661
  },
1461
1662
  pinterest_ads: {
1462
1663
  label: "Pinterest Ads",
@@ -1466,7 +1667,8 @@ var accountProviderCatalog = {
1466
1667
  capabilities: { ad_account: ["ads_read"] },
1467
1668
  approvalRequired: {},
1468
1669
  limited: {},
1469
- publishCapable: false
1670
+ publishCapable: false,
1671
+ integrationState: "connectable"
1470
1672
  },
1471
1673
  tiktok_ads: {
1472
1674
  label: "TikTok Ads",
@@ -1476,7 +1678,8 @@ var accountProviderCatalog = {
1476
1678
  capabilities: { ad_account: ["ads_read"] },
1477
1679
  approvalRequired: {},
1478
1680
  limited: {},
1479
- publishCapable: false
1681
+ publishCapable: false,
1682
+ integrationState: "connectable"
1480
1683
  },
1481
1684
  linkedin_ads: {
1482
1685
  label: "LinkedIn Ads",
@@ -1486,7 +1689,8 @@ var accountProviderCatalog = {
1486
1689
  capabilities: { ad_account: ["ads_read"] },
1487
1690
  approvalRequired: {},
1488
1691
  limited: {},
1489
- publishCapable: false
1692
+ publishCapable: false,
1693
+ integrationState: "connectable"
1490
1694
  },
1491
1695
  snapchat_ads: {
1492
1696
  label: "Snapchat Ads",
@@ -1496,7 +1700,8 @@ var accountProviderCatalog = {
1496
1700
  capabilities: { ad_account: ["ads_read"] },
1497
1701
  approvalRequired: {},
1498
1702
  limited: {},
1499
- publishCapable: false
1703
+ publishCapable: false,
1704
+ integrationState: "connectable"
1500
1705
  },
1501
1706
  amazon_ads: {
1502
1707
  label: "Amazon Ads",
@@ -1506,7 +1711,19 @@ var accountProviderCatalog = {
1506
1711
  capabilities: { ad_account: ["ads_read"] },
1507
1712
  approvalRequired: {},
1508
1713
  limited: {},
1509
- publishCapable: false
1714
+ publishCapable: false,
1715
+ integrationState: "connectable"
1716
+ },
1717
+ openai_ads: {
1718
+ label: "OpenAI Ads",
1719
+ availability: "beta",
1720
+ authFamily: "openai_ads",
1721
+ accountKinds: ["ad_account"],
1722
+ capabilities: { ad_account: ["ads_read"] },
1723
+ approvalRequired: {},
1724
+ limited: {},
1725
+ publishCapable: false,
1726
+ integrationState: "connectable"
1510
1727
  }
1511
1728
  };
1512
1729
  var capabilityCatalog = PROVIDERS.flatMap((provider) => {
@@ -1733,6 +1950,13 @@ var AccountDetails = Schema16.Union([
1733
1950
  kind: Schema16.Literal("account"),
1734
1951
  username: Schema16.String
1735
1952
  }),
1953
+ Schema16.Struct({
1954
+ provider: Schema16.Literal("snapchat"),
1955
+ kind: Schema16.Literal("public_profile"),
1956
+ profileId: Schema16.String,
1957
+ organizationId: Schema16.optionalKey(Schema16.String),
1958
+ username: Schema16.optionalKey(Schema16.String)
1959
+ }),
1736
1960
  Schema16.Struct({
1737
1961
  provider: Schema16.Literal("tiktok"),
1738
1962
  kind: Schema16.Literal("account"),
@@ -1881,6 +2105,20 @@ var AccountDetails = Schema16.Union([
1881
2105
  region: AmazonAdsRegion,
1882
2106
  businessId: Schema16.optionalKey(Schema16.String),
1883
2107
  managerId: Schema16.optionalKey(Schema16.String)
2108
+ }),
2109
+ Schema16.Struct({
2110
+ provider: Schema16.Literal("openai_ads"),
2111
+ kind: Schema16.Literal("ad_account"),
2112
+ externalId: Schema16.String,
2113
+ currency: Schema16.String.check(Schema16.isPattern(/^[A-Z]{3}$/)),
2114
+ timezone: Schema16.String,
2115
+ status: Schema16.Literals([
2116
+ "active",
2117
+ "disabled",
2118
+ "pending",
2119
+ "closed",
2120
+ "unknown"
2121
+ ])
1884
2122
  })
1885
2123
  ]);
1886
2124
  var ProviderAccount = Schema16.Struct({
@@ -1912,7 +2150,8 @@ var AccountRef = Schema17.Struct({ accountId: AccountId });
1912
2150
  var ConnectionRef = Schema17.Struct({ connectionId: uuid3 });
1913
2151
  var ConnectionLaunch = Schema17.Struct({
1914
2152
  attemptId: uuid3,
1915
- url: Schema17.String
2153
+ url: Schema17.String,
2154
+ expiresAt: Schema17.optionalKey(Schema17.String)
1916
2155
  });
1917
2156
  var OAuthFailureReason = Schema17.Literals([
1918
2157
  "provider_error",
@@ -2125,6 +2364,13 @@ var RedditFeedSettings = Schema18.Struct({
2125
2364
  thumbnailMediaId: Schema18.optionalKey(MediaId),
2126
2365
  firstComment: Schema18.optionalKey(text)
2127
2366
  }).annotate({ identifier: "RedditFeedSettings" });
2367
+ var SnapchatStorySettings = Schema18.Struct({
2368
+ contentType: Schema18.optionalKey(Schema18.Literals(["story", "saved_story", "spotlight"])),
2369
+ title: Schema18.optionalKey(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(45))),
2370
+ description: Schema18.optionalKey(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(160))),
2371
+ link: Schema18.optionalKey(MediaUrl),
2372
+ locale: Schema18.optionalKey(Schema18.String.check(Schema18.isPattern(/^[a-z]{2}_[A-Z]{2}$/)))
2373
+ }).annotate({ identifier: "SnapchatStorySettings" });
2128
2374
  var YouTubeVideoSettings = Schema18.Struct({
2129
2375
  title: Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(100)),
2130
2376
  description: Schema18.optionalKey(Schema18.String.check(Schema18.isMaxLength(5000))),
@@ -2283,6 +2529,13 @@ var PublishTarget = Schema18.Union([
2283
2529
  ...overrides,
2284
2530
  settings: RedditFeedSettings
2285
2531
  }),
2532
+ Schema18.Struct({
2533
+ accountId: AccountId,
2534
+ provider: Schema18.Literal("snapchat"),
2535
+ placement: Schema18.Literal("story"),
2536
+ ...overrides,
2537
+ settings: Schema18.optionalKey(SnapchatStorySettings)
2538
+ }),
2286
2539
  Schema18.Struct({
2287
2540
  accountId: AccountId,
2288
2541
  provider: Schema18.Literal("tiktok"),
@@ -2314,6 +2567,7 @@ var providerSettings = Schema18.Union([
2314
2567
  InstagramStorySettings,
2315
2568
  LinkedInFeedSettings,
2316
2569
  RedditFeedSettings,
2570
+ SnapchatStorySettings,
2317
2571
  ThreadsFeedSettings,
2318
2572
  XFeedSettings,
2319
2573
  YouTubeVideoSettings,
@@ -2992,6 +3246,7 @@ var InboxReview = Schema21.Struct({
2992
3246
  providerUpdatedAt: Schema21.NullOr(Schema21.String),
2993
3247
  repliedAt: Schema21.NullOr(Schema21.String),
2994
3248
  replyText: Schema21.NullOr(Schema21.String),
3249
+ canReply: Schema21.Boolean,
2995
3250
  deletedAt: Schema21.NullOr(Schema21.String),
2996
3251
  createdAt: Schema21.String
2997
3252
  }).annotate({ identifier: "InboxReview" });
@@ -3129,6 +3384,9 @@ var SendInboxMessage = Schema21.Struct({
3129
3384
  var ReplyInboxComment = Schema21.Struct({
3130
3385
  text: replyText
3131
3386
  }).annotate({ identifier: "ReplyInboxComment" });
3387
+ var ReplyInboxReview = Schema21.Struct({
3388
+ text: replyText
3389
+ }).annotate({ identifier: "ReplyInboxReview" });
3132
3390
  var UpdateInboxComment = Schema21.Struct({
3133
3391
  hidden: Schema21.optionalKey(Schema21.Boolean),
3134
3392
  liked: Schema21.optionalKey(Schema21.Boolean)
@@ -3206,7 +3464,8 @@ var AD_PROVIDERS = [
3206
3464
  "tiktok_ads",
3207
3465
  "linkedin_ads",
3208
3466
  "snapchat_ads",
3209
- "amazon_ads"
3467
+ "amazon_ads",
3468
+ "openai_ads"
3210
3469
  ];
3211
3470
  var AdProvider = Schema23.Literals(AD_PROVIDERS);
3212
3471
  var AdAccountState = Schema23.Literals(["available", "selected"]);
@@ -3301,8 +3560,17 @@ var AdKillSwitchResult = Schema23.Struct({
3301
3560
  }).annotate({ identifier: "AdKillSwitchResult" });
3302
3561
  var AdOperationKind = Schema23.Literals([
3303
3562
  "boost.create",
3563
+ "campaign.create",
3304
3564
  "campaign.activate",
3305
- "campaign.pause"
3565
+ "campaign.pause",
3566
+ "campaign.archive",
3567
+ "ad_group.status",
3568
+ "ad_group.create",
3569
+ "ad.status",
3570
+ "ad.attach",
3571
+ "creative.create",
3572
+ "campaign.duplicate",
3573
+ "budget.update"
3306
3574
  ]);
3307
3575
  var AdOperationStatus = Schema23.Literals([
3308
3576
  "queued",
@@ -3379,6 +3647,48 @@ var AdCampaignActivationInput = Schema23.Struct({
3379
3647
  var AdCampaignPauseInput = Schema23.Struct({
3380
3648
  expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
3381
3649
  }).annotate({ identifier: "AdCampaignPauseInput" });
3650
+ var AdCampaignArchiveInput = Schema23.Struct({
3651
+ expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
3652
+ }).annotate({ identifier: "AdCampaignArchiveInput" });
3653
+ var AdEntityStatusUpdate = Schema23.Struct({
3654
+ status: Schema23.Literals(["active", "paused", "archived"]),
3655
+ expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
3656
+ }).annotate({ identifier: "AdEntityStatusUpdate" });
3657
+ var AdBudgetUpdateInput = Schema23.Struct({
3658
+ budget: AdBudget,
3659
+ expectedRevision: Schema23.Int.check(Schema23.isGreaterThan(0))
3660
+ }).annotate({ identifier: "AdBudgetUpdateInput" });
3661
+ var AdAttachAdCreative = Schema23.Struct({
3662
+ headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
3663
+ body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
3664
+ callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
3665
+ destinationUrl: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2048))),
3666
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3667
+ }).annotate({ identifier: "AdAttachAdCreative" });
3668
+ var AdAdGroupCreateInput = Schema23.Struct({
3669
+ name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
3670
+ budget: Schema23.optionalKey(AdBudget),
3671
+ targeting: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
3672
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3673
+ }).annotate({ identifier: "AdAdGroupCreateInput" });
3674
+ var AdCreativeCreateInput = Schema23.Struct({
3675
+ actorAccountId: AccountId,
3676
+ mediaId: Schema23.String.check(Schema23.isUUID()),
3677
+ headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
3678
+ body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
3679
+ callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
3680
+ destinationUrl: Schema23.String.check(Schema23.isMaxLength(2048)),
3681
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3682
+ }).annotate({ identifier: "AdCreativeCreateInput" });
3683
+ var AdCampaignDuplicateInput = Schema23.Struct({
3684
+ name: Schema23.optionalKey(Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)))
3685
+ }).annotate({ identifier: "AdCampaignDuplicateInput" });
3686
+ var AdAttachAdInput = Schema23.Struct({
3687
+ name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
3688
+ creativeId: Schema23.optionalKey(AdCreativeId),
3689
+ creative: Schema23.optionalKey(AdAttachAdCreative),
3690
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3691
+ }).annotate({ identifier: "AdAttachAdInput" });
3382
3692
  var AdWriteHeaders = Schema23.Struct({
3383
3693
  "idempotency-key": IdempotencyKey
3384
3694
  });
@@ -3417,6 +3727,18 @@ var AdConnectLaunch = Schema23.Struct({
3417
3727
  url: Schema23.String,
3418
3728
  status: Schema23.Literal("pending")
3419
3729
  }).annotate({ identifier: "AdConnectLaunch" });
3730
+ var AdApiKeyConnectInput = Schema23.Struct({
3731
+ workspaceId: WorkspaceId,
3732
+ provider: Schema23.Literal("openai_ads"),
3733
+ apiKey: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(2048)),
3734
+ accountId: Schema23.optionalKey(AccountId),
3735
+ profileId: Schema23.optionalKey(ProfileId)
3736
+ }).annotate({ identifier: "AdApiKeyConnectInput" });
3737
+ var AdApiKeyConnectResult = Schema23.Struct({
3738
+ provider: Schema23.Literal("openai_ads"),
3739
+ accountId: AccountId,
3740
+ status: Schema23.Literal("connected")
3741
+ }).annotate({ identifier: "AdApiKeyConnectResult" });
3420
3742
  var AdAccountRef = Schema23.Struct({
3421
3743
  workspaceId: WorkspaceId,
3422
3744
  accountId: AccountId
@@ -3477,6 +3799,128 @@ var AdBoostInput = Schema23.Struct({
3477
3799
  accountId: AccountId,
3478
3800
  ...AdBoostDraft.fields
3479
3801
  }).annotate({ identifier: "AdBoostInput" });
3802
+ var AdCampaignPlanCapability = Schema23.Literals([
3803
+ "campaign.create",
3804
+ "ad_group.create",
3805
+ "creative.create",
3806
+ "ad.create",
3807
+ "campaign.activate",
3808
+ "campaign.pause",
3809
+ "campaign.archive",
3810
+ "ad_group.activate",
3811
+ "ad_group.pause",
3812
+ "ad_group.archive",
3813
+ "ad.activate",
3814
+ "ad.pause",
3815
+ "ad.archive",
3816
+ "budget.update",
3817
+ "boost.create"
3818
+ ]);
3819
+ var AdCampaignPlanProfile = Schema23.Struct({
3820
+ budgetOwner: Schema23.Literals(["campaign", "ad_group", "shared"]),
3821
+ maxAdGroups: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(1))),
3822
+ budgetUnit: Schema23.Literals(["minor", "micros"]),
3823
+ hierarchy: Schema23.Array(Schema23.Literals(["campaign", "ad_group", "creative", "ad"])),
3824
+ actor: Schema23.Literals(["required", "none"]),
3825
+ creative: Schema23.Literals(["separate", "embedded"]),
3826
+ review: Schema23.Literals(["sync", "pending", "async"]),
3827
+ activation: Schema23.Literals(["campaign", "ad_group"])
3828
+ }).annotate({ identifier: "AdCampaignPlanProfile" });
3829
+ var AdCampaignPlanTarget = Schema23.Struct({
3830
+ accountId: AccountId,
3831
+ actorAccountId: Schema23.optionalKey(AccountId),
3832
+ budget: Schema23.optionalKey(AdBudget),
3833
+ schedule: Schema23.optionalKey(AdSchedule),
3834
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3835
+ }).annotate({ identifier: "AdCampaignPlanTarget" });
3836
+ var AdCampaignPlanCreative = Schema23.Struct({
3837
+ headline: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(255))),
3838
+ body: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2000))),
3839
+ callToAction: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(64))),
3840
+ destinationUrl: Schema23.optionalKey(Schema23.String.check(Schema23.isMaxLength(2048))),
3841
+ media: Schema23.optionalKey(MediaInputs),
3842
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3843
+ }).annotate({ identifier: "AdCampaignPlanCreative" });
3844
+ var AdCampaignPlanAd = Schema23.Struct({
3845
+ name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
3846
+ creative: AdCampaignPlanCreative,
3847
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3848
+ }).annotate({ identifier: "AdCampaignPlanAd" });
3849
+ var AdCampaignPlanAdGroup = Schema23.Struct({
3850
+ name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
3851
+ budget: Schema23.optionalKey(AdBudget),
3852
+ targeting: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
3853
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown)),
3854
+ ads: Schema23.Array(AdCampaignPlanAd).check(Schema23.isMinLength(1), Schema23.isMaxLength(50))
3855
+ }).annotate({ identifier: "AdCampaignPlanAdGroup" });
3856
+ var AdCampaignPlan = Schema23.Struct({
3857
+ name: Schema23.String.check(Schema23.isMinLength(1), Schema23.isMaxLength(255)),
3858
+ objective: AdObjective,
3859
+ budget: Schema23.optionalKey(AdBudget),
3860
+ schedule: Schema23.optionalKey(AdSchedule),
3861
+ targets: Schema23.Array(AdCampaignPlanTarget).check(Schema23.isMinLength(1), Schema23.isMaxLength(50)),
3862
+ adGroups: Schema23.Array(AdCampaignPlanAdGroup).check(Schema23.isMinLength(1), Schema23.isMaxLength(50)),
3863
+ providerSettings: Schema23.optionalKey(Schema23.Record(Schema23.String, Schema23.Unknown))
3864
+ }).annotate({ identifier: "AdCampaignPlan" });
3865
+ var AdCampaignPlanTargetValidation = Schema23.Struct({
3866
+ accountId: AccountId,
3867
+ provider: Schema23.optionalKey(AdProvider),
3868
+ name: Schema23.optionalKey(Schema23.String),
3869
+ currency: Schema23.optionalKey(CurrencyCode),
3870
+ budget: Schema23.optionalKey(Schema23.NullOr(AdBudget)),
3871
+ profile: Schema23.optionalKey(AdCampaignPlanProfile),
3872
+ capabilities: Schema23.optionalKey(Schema23.Array(AdCampaignPlanCapability)),
3873
+ issues: Schema23.Array(AdIssue)
3874
+ }).annotate({ identifier: "AdCampaignPlanTargetValidation" });
3875
+ var AdCampaignPlanValidation = Schema23.Struct({
3876
+ valid: Schema23.Boolean,
3877
+ issues: Schema23.Array(AdIssue),
3878
+ targets: Schema23.Array(AdCampaignPlanTargetValidation)
3879
+ }).annotate({ identifier: "AdCampaignPlanValidation" });
3880
+ var AdCampaignPlanStatus = Schema23.Literals([
3881
+ "queued",
3882
+ "creating",
3883
+ "partial",
3884
+ "succeeded",
3885
+ "failed",
3886
+ "unresolved"
3887
+ ]);
3888
+ var AdCampaignPlanTargetAccepted = Schema23.Struct({
3889
+ accountId: AccountId,
3890
+ provider: AdProvider,
3891
+ operationId: AdOperationId,
3892
+ status: AdOperationStatus
3893
+ }).annotate({ identifier: "AdCampaignPlanTargetAccepted" });
3894
+ var AdCampaignPlanAccepted = Schema23.Struct({
3895
+ planId: Schema23.String.check(Schema23.isUUID()),
3896
+ status: AdCampaignPlanStatus,
3897
+ targets: Schema23.Array(AdCampaignPlanTargetAccepted)
3898
+ }).annotate({ identifier: "AdCampaignPlanAccepted" });
3899
+ var AdCampaignPlanListRow = Schema23.Struct({
3900
+ planId: Schema23.String.check(Schema23.isUUID()),
3901
+ status: AdCampaignPlanStatus,
3902
+ createdAt: Schema23.String,
3903
+ targets: Schema23.Array(AdCampaignPlanTargetAccepted)
3904
+ }).annotate({ identifier: "AdCampaignPlanListRow" });
3905
+ var AdCampaignPlanList = Schema23.Struct({
3906
+ data: Schema23.Array(AdCampaignPlanListRow),
3907
+ ...pageFields
3908
+ }).annotate({ identifier: "AdCampaignPlanList" });
3909
+ var AdCampaignPlanTargetDetail = Schema23.Struct({
3910
+ accountId: AccountId,
3911
+ provider: AdProvider,
3912
+ operationId: AdOperationId,
3913
+ campaignId: Schema23.NullOr(AdCampaignId),
3914
+ status: AdOperationStatus,
3915
+ issues: Schema23.Array(AdIssue)
3916
+ }).annotate({ identifier: "AdCampaignPlanTargetDetail" });
3917
+ var AdCampaignPlanDetail = Schema23.Struct({
3918
+ planId: Schema23.String.check(Schema23.isUUID()),
3919
+ status: AdCampaignPlanStatus,
3920
+ createdAt: Schema23.String,
3921
+ targets: Schema23.Array(AdCampaignPlanTargetDetail),
3922
+ issues: Schema23.Array(AdIssue)
3923
+ }).annotate({ identifier: "AdCampaignPlanDetail" });
3480
3924
  var AdCampaign = Schema23.Struct({
3481
3925
  id: AdCampaignId,
3482
3926
  accountId: AccountId,
@@ -3611,6 +4055,20 @@ var AdCampaignList = Schema23.Struct({
3611
4055
  ...pageFields,
3612
4056
  freshness: AdFreshness
3613
4057
  }).annotate({ identifier: "AdCampaignList" });
4058
+ var AdGroupListRow = Schema23.Struct({
4059
+ ...AdGroup.fields,
4060
+ insights: Schema23.optionalKey(Schema23.NullOr(AdInsightSummary))
4061
+ }).annotate({ identifier: "AdGroupListRow" });
4062
+ var AdGroupList = Schema23.Struct({
4063
+ data: Schema23.Array(AdGroupListRow),
4064
+ ...pageFields,
4065
+ freshness: AdFreshness
4066
+ }).annotate({ identifier: "AdGroupList" });
4067
+ var AdList = Schema23.Struct({
4068
+ data: Schema23.Array(Ad),
4069
+ ...pageFields,
4070
+ freshness: AdFreshness
4071
+ }).annotate({ identifier: "AdList" });
3614
4072
  var AdCreativeList = Schema23.Struct({
3615
4073
  data: Schema23.Array(AdCreative),
3616
4074
  ...pageFields,
@@ -3721,6 +4179,7 @@ var WorkspaceEventType = Schema26.Literals([
3721
4179
  "inbox.review.updated",
3722
4180
  "inbox.review.deleted",
3723
4181
  "inbox.review.restored",
4182
+ "inbox.review.replied",
3724
4183
  "inbox.mention.received",
3725
4184
  "inbox.message.sent",
3726
4185
  "inbox.message.delivered",
@@ -3740,12 +4199,14 @@ var WorkspaceEventType = Schema26.Literals([
3740
4199
  "ads.kill_switch.activated",
3741
4200
  "ads.lead.received",
3742
4201
  "ads.campaign.status_changed",
4202
+ "ads.ad_group.status_changed",
3743
4203
  "ads.ad.status_changed",
3744
4204
  "ads.ad_account.status_changed",
3745
4205
  "ads.ad.review.approved",
3746
4206
  "ads.ad.review.rejected",
3747
4207
  "ads.sync.failed",
3748
4208
  "ads.sync.recovered",
4209
+ "ads.initial_sync.completed",
3749
4210
  "schedule.assignment.changed",
3750
4211
  "account.connected",
3751
4212
  "account.disconnected",
@@ -3977,6 +4438,11 @@ var WebhookEvent = Schema27.Union([
3977
4438
  type: Schema27.Literal("inbox.review.restored"),
3978
4439
  data: Schema27.Struct(inboxReviewData)
3979
4440
  }),
4441
+ Schema27.Struct({
4442
+ ...envelope,
4443
+ type: Schema27.Literal("inbox.review.replied"),
4444
+ data: Schema27.Struct(inboxReviewData)
4445
+ }),
3980
4446
  Schema27.Struct({
3981
4447
  ...envelope,
3982
4448
  type: Schema27.Literal("inbox.mention.received"),
@@ -4134,6 +4600,16 @@ var WebhookEvent = Schema27.Union([
4134
4600
  status: AdEntityStatus
4135
4601
  })
4136
4602
  }),
4603
+ Schema27.Struct({
4604
+ ...envelope,
4605
+ type: Schema27.Literal("ads.ad_group.status_changed"),
4606
+ data: Schema27.Struct({
4607
+ accountId: AccountId,
4608
+ adGroupId: AdGroupId,
4609
+ provider: AdProvider,
4610
+ status: AdEntityStatus
4611
+ })
4612
+ }),
4137
4613
  Schema27.Struct({
4138
4614
  ...envelope,
4139
4615
  type: Schema27.Literal("ads.ad.status_changed"),
@@ -4187,6 +4663,14 @@ var WebhookEvent = Schema27.Union([
4187
4663
  provider: AdProvider
4188
4664
  })
4189
4665
  }),
4666
+ Schema27.Struct({
4667
+ ...envelope,
4668
+ type: Schema27.Literal("ads.initial_sync.completed"),
4669
+ data: Schema27.Struct({
4670
+ accountId: AccountId,
4671
+ provider: AdProvider
4672
+ })
4673
+ }),
4190
4674
  Schema27.Struct({
4191
4675
  ...envelope,
4192
4676
  type: Schema27.Literal("account.connected"),
@@ -4979,7 +5463,13 @@ class AdRevisionConflict extends HttpApiError.Problem()("AdRevisionConflict", {
4979
5463
  status: 409,
4980
5464
  title: "Ad resource revision conflict"
4981
5465
  }, {
4982
- resource: Schema28.Literals(["spend_policy", "campaign", "boost"]),
5466
+ resource: Schema28.Literals([
5467
+ "spend_policy",
5468
+ "campaign",
5469
+ "ad_group",
5470
+ "ad",
5471
+ "boost"
5472
+ ]),
4983
5473
  expectedRevision: Schema28.Int.check(Schema28.isGreaterThanOrEqualTo(0)),
4984
5474
  actualRevision: Schema28.Int.check(Schema28.isGreaterThanOrEqualTo(0)),
4985
5475
  nextAction: Schema28.String
@@ -5594,12 +6084,13 @@ import { ProblemDetails } from "effect/http";
5594
6084
  // package.json
5595
6085
  var package_default = {
5596
6086
  name: "@pubnio/sdk",
5597
- version: "0.1.2",
6087
+ version: "0.2.1",
5598
6088
  description: "JavaScript and TypeScript client for the PubNio API",
5599
6089
  type: "module",
5600
6090
  exports: {
5601
6091
  ".": "./src/index.ts",
5602
6092
  "./solid": "./src/solid.ts",
6093
+ "./internal": "./src/internal.ts",
5603
6094
  "./package.json": "./package.json"
5604
6095
  },
5605
6096
  dependencies: {
@@ -6756,6 +7247,11 @@ var webhooksReplayDelivery = (options) => (options.client ?? client).post({
6756
7247
  url: "/api/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/replay",
6757
7248
  ...options
6758
7249
  });
7250
+ var webhooksEventTypes = (options) => (options?.client ?? client).get({
7251
+ security: [{ scheme: "bearer", type: "http" }],
7252
+ url: "/api/v1/webhooks/event-types",
7253
+ ...options
7254
+ });
6759
7255
  var integrationsList = (options) => (options.client ?? client).get({
6760
7256
  security: [{ scheme: "bearer", type: "http" }],
6761
7257
  url: "/api/v1/integrations",
@@ -6784,6 +7280,15 @@ var integrationsPrepareConnection = (options) => (options.client ?? client).post
6784
7280
  url: "/api/v1/integrations/{provider}/connect",
6785
7281
  ...options
6786
7282
  });
7283
+ var integrationsBlueskySession = (options) => (options.client ?? client).post({
7284
+ security: [{ scheme: "bearer", type: "http" }],
7285
+ url: "/api/v1/integrations/bluesky/session",
7286
+ ...options,
7287
+ headers: {
7288
+ "Content-Type": "application/json",
7289
+ ...options.headers
7290
+ }
7291
+ });
6787
7292
  var integrationsConnectionStatus = (options) => (options.client ?? client).get({
6788
7293
  security: [{ scheme: "bearer", type: "http" }],
6789
7294
  url: "/api/v1/integrations/attempts/{attemptId}",
@@ -6897,6 +7402,15 @@ var mediaGet = (options) => (options.client ?? client).get({
6897
7402
  url: "/api/v1/media/{mediaId}",
6898
7403
  ...options
6899
7404
  });
7405
+ var mediaUploadInline = (options) => (options.client ?? client).post({
7406
+ security: [{ scheme: "bearer", type: "http" }],
7407
+ url: "/api/v1/media/inline",
7408
+ ...options,
7409
+ headers: {
7410
+ "Content-Type": "application/json",
7411
+ ...options.headers
7412
+ }
7413
+ });
6900
7414
  var mediaImport = (options) => (options.client ?? client).post({
6901
7415
  security: [{ scheme: "bearer", type: "http" }],
6902
7416
  url: "/api/v1/media/import",
@@ -7173,6 +7687,15 @@ var inboxReviewsGet = (options) => (options.client ?? client).get({
7173
7687
  url: "/api/v1/inbox/reviews/{reviewId}",
7174
7688
  ...options
7175
7689
  });
7690
+ var inboxReviewsReply = (options) => (options.client ?? client).post({
7691
+ security: [{ scheme: "bearer", type: "http" }],
7692
+ url: "/api/v1/inbox/reviews/{reviewId}/replies",
7693
+ ...options,
7694
+ headers: {
7695
+ "Content-Type": "application/json",
7696
+ ...options.headers
7697
+ }
7698
+ });
7176
7699
  var inboxUnreadCount = (options) => (options.client ?? client).get({
7177
7700
  security: [{ scheme: "bearer", type: "http" }],
7178
7701
  url: "/api/v1/inbox/unread-count",
@@ -7202,6 +7725,15 @@ var inboxAttachmentsGet = (options) => (options.client ?? client).get({
7202
7725
  url: "/api/v1/inbox/attachments/{attachmentId}",
7203
7726
  ...options
7204
7727
  });
7728
+ var commentsCreate = (options) => (options.client ?? client).post({
7729
+ security: [{ scheme: "bearer", type: "http" }],
7730
+ url: "/api/v1/comments",
7731
+ ...options,
7732
+ headers: {
7733
+ "Content-Type": "application/json",
7734
+ ...options.headers
7735
+ }
7736
+ });
7205
7737
  var postsList = (options) => (options.client ?? client).get({
7206
7738
  security: [{ scheme: "bearer", type: "http" }],
7207
7739
  url: "/api/v1/posts",
@@ -7286,6 +7818,48 @@ var adsConnectAccount = (options) => (options.client ?? client).post({
7286
7818
  ...options.headers
7287
7819
  }
7288
7820
  });
7821
+ var adsConnectApiKeyAccount = (options) => (options.client ?? client).post({
7822
+ security: [{ scheme: "bearer", type: "http" }],
7823
+ url: "/api/v1/ads/accounts/connect/api-key",
7824
+ ...options,
7825
+ headers: {
7826
+ "Content-Type": "application/json",
7827
+ ...options.headers
7828
+ }
7829
+ });
7830
+ var adsValidateCampaignPlan = (options) => (options.client ?? client).post({
7831
+ security: [{ scheme: "bearer", type: "http" }],
7832
+ url: "/api/v1/ads/campaigns/validate",
7833
+ ...options,
7834
+ headers: {
7835
+ "Content-Type": "application/json",
7836
+ ...options.headers
7837
+ }
7838
+ });
7839
+ var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
7840
+ security: [{ scheme: "bearer", type: "http" }],
7841
+ url: "/api/v1/ads/campaigns",
7842
+ ...options
7843
+ });
7844
+ var adsCreateCampaignPlan = (options) => (options.client ?? client).post({
7845
+ security: [{ scheme: "bearer", type: "http" }],
7846
+ url: "/api/v1/ads/campaigns",
7847
+ ...options,
7848
+ headers: {
7849
+ "Content-Type": "application/json",
7850
+ ...options.headers
7851
+ }
7852
+ });
7853
+ var adsListCampaignPlans = (options) => (options.client ?? client).get({
7854
+ security: [{ scheme: "bearer", type: "http" }],
7855
+ url: "/api/v1/ads/plans",
7856
+ ...options
7857
+ });
7858
+ var adsGetCampaignPlan = (options) => (options.client ?? client).get({
7859
+ security: [{ scheme: "bearer", type: "http" }],
7860
+ url: "/api/v1/ads/plans/{planId}",
7861
+ ...options
7862
+ });
7289
7863
  var adsSelectAccount = (options) => (options.client ?? client).post({
7290
7864
  security: [{ scheme: "bearer", type: "http" }],
7291
7865
  url: "/api/v1/ads/accounts/{accountId}/select",
@@ -7296,11 +7870,6 @@ var adsDisconnectAccount = (options) => (options.client ?? client).post({
7296
7870
  url: "/api/v1/ads/accounts/{accountId}/disconnect",
7297
7871
  ...options
7298
7872
  });
7299
- var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
7300
- security: [{ scheme: "bearer", type: "http" }],
7301
- url: "/api/v1/ads/campaigns",
7302
- ...options
7303
- });
7304
7873
  var adsListCampaigns = (options) => (options.client ?? client).get({
7305
7874
  security: [{ scheme: "bearer", type: "http" }],
7306
7875
  url: "/api/v1/ads/accounts/{accountId}/campaigns",
@@ -7311,6 +7880,16 @@ var adsGetTree = (options) => (options.client ?? client).get({
7311
7880
  url: "/api/v1/ads/tree",
7312
7881
  ...options
7313
7882
  });
7883
+ var adsListAds = (options) => (options.client ?? client).get({
7884
+ security: [{ scheme: "bearer", type: "http" }],
7885
+ url: "/api/v1/ads/ads",
7886
+ ...options
7887
+ });
7888
+ var adsListAdGroups = (options) => (options.client ?? client).get({
7889
+ security: [{ scheme: "bearer", type: "http" }],
7890
+ url: "/api/v1/ads/ad-groups",
7891
+ ...options
7892
+ });
7314
7893
  var adsGetAd = (options) => (options.client ?? client).get({
7315
7894
  security: [{ scheme: "bearer", type: "http" }],
7316
7895
  url: "/api/v1/ads/ads/{adId}",
@@ -7321,6 +7900,20 @@ var adsListCreatives = (options) => (options.client ?? client).get({
7321
7900
  url: "/api/v1/ads/creatives",
7322
7901
  ...options
7323
7902
  });
7903
+ var adsCreateCreative = (options) => (options.client ?? client).post({
7904
+ security: [{ scheme: "bearer", type: "http" }],
7905
+ url: "/api/v1/ads/accounts/{accountId}/creatives",
7906
+ ...options,
7907
+ headers: {
7908
+ "Content-Type": "application/json",
7909
+ ...options.headers
7910
+ }
7911
+ });
7912
+ var adsGetCreative = (options) => (options.client ?? client).get({
7913
+ security: [{ scheme: "bearer", type: "http" }],
7914
+ url: "/api/v1/ads/creatives/{creativeId}",
7915
+ ...options
7916
+ });
7324
7917
  var adsListWorkspaceInsights = (options) => (options.client ?? client).get({
7325
7918
  security: [{ scheme: "bearer", type: "http" }],
7326
7919
  url: "/api/v1/ads/insights",
@@ -7400,6 +7993,78 @@ var adsPauseCampaign = (options) => (options.client ?? client).post({
7400
7993
  ...options.headers
7401
7994
  }
7402
7995
  });
7996
+ var adsArchiveCampaign = (options) => (options.client ?? client).post({
7997
+ security: [{ scheme: "bearer", type: "http" }],
7998
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/archive",
7999
+ ...options,
8000
+ headers: {
8001
+ "Content-Type": "application/json",
8002
+ ...options.headers
8003
+ }
8004
+ });
8005
+ var adsDuplicateCampaign = (options) => (options.client ?? client).post({
8006
+ security: [{ scheme: "bearer", type: "http" }],
8007
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/duplicate",
8008
+ ...options,
8009
+ headers: {
8010
+ "Content-Type": "application/json",
8011
+ ...options.headers
8012
+ }
8013
+ });
8014
+ var adsSetCampaignBudget = (options) => (options.client ?? client).post({
8015
+ security: [{ scheme: "bearer", type: "http" }],
8016
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/budget",
8017
+ ...options,
8018
+ headers: {
8019
+ "Content-Type": "application/json",
8020
+ ...options.headers
8021
+ }
8022
+ });
8023
+ var adsSetAdGroupBudget = (options) => (options.client ?? client).post({
8024
+ security: [{ scheme: "bearer", type: "http" }],
8025
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/budget",
8026
+ ...options,
8027
+ headers: {
8028
+ "Content-Type": "application/json",
8029
+ ...options.headers
8030
+ }
8031
+ });
8032
+ var adsSetAdGroupStatus = (options) => (options.client ?? client).post({
8033
+ security: [{ scheme: "bearer", type: "http" }],
8034
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/status",
8035
+ ...options,
8036
+ headers: {
8037
+ "Content-Type": "application/json",
8038
+ ...options.headers
8039
+ }
8040
+ });
8041
+ var adsCreateAdGroup = (options) => (options.client ?? client).post({
8042
+ security: [{ scheme: "bearer", type: "http" }],
8043
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/ad-groups",
8044
+ ...options,
8045
+ headers: {
8046
+ "Content-Type": "application/json",
8047
+ ...options.headers
8048
+ }
8049
+ });
8050
+ var adsAttachAd = (options) => (options.client ?? client).post({
8051
+ security: [{ scheme: "bearer", type: "http" }],
8052
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/ads",
8053
+ ...options,
8054
+ headers: {
8055
+ "Content-Type": "application/json",
8056
+ ...options.headers
8057
+ }
8058
+ });
8059
+ var adsSetAdStatus = (options) => (options.client ?? client).post({
8060
+ security: [{ scheme: "bearer", type: "http" }],
8061
+ url: "/api/v1/ads/accounts/{accountId}/ads/{adId}/status",
8062
+ ...options,
8063
+ headers: {
8064
+ "Content-Type": "application/json",
8065
+ ...options.headers
8066
+ }
8067
+ });
7403
8068
  var auditList = (options) => (options.client ?? client).get({
7404
8069
  security: [{ scheme: "bearer", type: "http" }],
7405
8070
  url: "/api/v1/workspaces/{workspaceId}/audit-logs",
@@ -7751,7 +8416,8 @@ function createPubNioClient({
7751
8416
  signal: clientSignal,
7752
8417
  retries: requestedRetries = defaultRetries,
7753
8418
  clientName = "sdk",
7754
- clientVersion = package_default.version
8419
+ clientVersion = package_default.version,
8420
+ onRuntime
7755
8421
  }) {
7756
8422
  const timeoutMs = checkedTimeout(requestedTimeoutMs, "timeoutMs");
7757
8423
  const retries = checkedRetries(requestedRetries);
@@ -7806,6 +8472,7 @@ function createPubNioClient({
7806
8472
  throw invalidResponse();
7807
8473
  });
7808
8474
  }
8475
+ onRuntime?.({ client, transport, decode });
7809
8476
  async function poll(read, done, { timeoutMs: waitTimeoutMs = 60000, signal } = {}) {
7810
8477
  const timeoutMs = checkedTimeout(waitTimeoutMs, "timeoutMs");
7811
8478
  const deadline = performance.now() + timeoutMs;
@@ -8278,6 +8945,37 @@ function createPubNioClient({
8278
8945
  },
8279
8946
  ...transport()
8280
8947
  }));
8948
+ const listAdGroups = (options = {}) => decode(AdGroupList, adsListAdGroups({
8949
+ client,
8950
+ query: {
8951
+ workspaceId,
8952
+ accountId: options.accountId,
8953
+ campaignId: options.campaignId,
8954
+ provider: options.provider,
8955
+ status: options.status,
8956
+ from: options.from,
8957
+ to: options.to,
8958
+ cursor: options.cursor,
8959
+ limit: options.limit === undefined ? undefined : String(options.limit)
8960
+ },
8961
+ ...transport()
8962
+ }));
8963
+ const listAds = (options = {}) => decode(AdList, adsListAds({
8964
+ client,
8965
+ query: {
8966
+ workspaceId,
8967
+ accountId: options.accountId,
8968
+ campaignId: options.campaignId,
8969
+ adGroupId: options.adGroupId,
8970
+ provider: options.provider,
8971
+ status: options.status,
8972
+ from: options.from,
8973
+ to: options.to,
8974
+ cursor: options.cursor,
8975
+ limit: options.limit === undefined ? undefined : String(options.limit)
8976
+ },
8977
+ ...transport()
8978
+ }));
8281
8979
  const listAdTree = (options = {}) => decode(AdTree, adsGetTree({
8282
8980
  client,
8283
8981
  query: {
@@ -8300,6 +8998,23 @@ function createPubNioClient({
8300
8998
  },
8301
8999
  ...transport()
8302
9000
  }));
9001
+ const createAdCreative = (accountId, input, options = {}) => {
9002
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9003
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateCreative({
9004
+ client,
9005
+ path: { accountId },
9006
+ query: { workspaceId },
9007
+ headers: { "idempotency-key": idempotencyKey },
9008
+ body: input,
9009
+ ...transport()
9010
+ })));
9011
+ };
9012
+ const getAdCreative = (creativeId) => decode(AdCreative, adsGetCreative({
9013
+ client,
9014
+ path: { creativeId },
9015
+ query: { workspaceId },
9016
+ ...transport()
9017
+ }));
8303
9018
  const listAdInsights = (options = {}) => decode(AdInsightList, adsListWorkspaceInsights({
8304
9019
  client,
8305
9020
  query: {
@@ -8367,6 +9082,68 @@ function createPubNioClient({
8367
9082
  body: input,
8368
9083
  ...transport()
8369
9084
  }));
9085
+ const mutableCampaignPlan = (plan) => ({
9086
+ ...plan,
9087
+ ...plan.budget ? { budget: { ...plan.budget } } : {},
9088
+ ...plan.schedule ? { schedule: { ...plan.schedule } } : {},
9089
+ ...plan.providerSettings ? { providerSettings: { ...plan.providerSettings } } : {},
9090
+ targets: plan.targets.map((target) => ({
9091
+ ...target,
9092
+ ...target.budget ? { budget: { ...target.budget } } : {},
9093
+ ...target.schedule ? { schedule: { ...target.schedule } } : {},
9094
+ ...target.providerSettings ? { providerSettings: { ...target.providerSettings } } : {}
9095
+ })),
9096
+ adGroups: plan.adGroups.map((group) => ({
9097
+ ...group,
9098
+ ...group.budget ? { budget: { ...group.budget } } : {},
9099
+ ...group.targeting ? { targeting: { ...group.targeting } } : {},
9100
+ ...group.providerSettings ? { providerSettings: { ...group.providerSettings } } : {},
9101
+ ads: group.ads.map((ad) => ({
9102
+ ...ad,
9103
+ ...ad.providerSettings ? { providerSettings: { ...ad.providerSettings } } : {},
9104
+ creative: {
9105
+ ...ad.creative.headline !== undefined ? { headline: ad.creative.headline } : {},
9106
+ ...ad.creative.body !== undefined ? { body: ad.creative.body } : {},
9107
+ ...ad.creative.callToAction !== undefined ? { callToAction: ad.creative.callToAction } : {},
9108
+ ...ad.creative.destinationUrl !== undefined ? { destinationUrl: ad.creative.destinationUrl } : {},
9109
+ ...ad.creative.media ? { media: ad.creative.media.map((item) => ({ ...item })) } : {},
9110
+ ...ad.creative.providerSettings ? { providerSettings: { ...ad.creative.providerSettings } } : {}
9111
+ }
9112
+ }))
9113
+ }))
9114
+ });
9115
+ const validateAdCampaignPlan = (input) => decode(AdCampaignPlanValidation, adsValidateCampaignPlan({
9116
+ client,
9117
+ query: { workspaceId },
9118
+ body: mutableCampaignPlan(input),
9119
+ ...transport()
9120
+ }));
9121
+ const createAdCampaignPlan = (input, options = {}) => {
9122
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9123
+ return withIdempotencyKey(idempotencyKey, () => decode(AdCampaignPlanAccepted, adsCreateCampaignPlan({
9124
+ client,
9125
+ query: { workspaceId },
9126
+ headers: { "idempotency-key": idempotencyKey },
9127
+ body: mutableCampaignPlan(input),
9128
+ ...transport()
9129
+ })));
9130
+ };
9131
+ const listAdCampaignPlans = (options = {}) => decode(AdCampaignPlanList, adsListCampaignPlans({
9132
+ client,
9133
+ query: {
9134
+ workspaceId,
9135
+ status: options.status,
9136
+ cursor: options.cursor,
9137
+ limit: options.limit === undefined ? undefined : String(options.limit)
9138
+ },
9139
+ ...transport()
9140
+ }));
9141
+ const readAdCampaignPlan = (planId) => decode(AdCampaignPlanDetail, adsGetCampaignPlan({
9142
+ client,
9143
+ path: { planId },
9144
+ query: { workspaceId },
9145
+ ...transport()
9146
+ }));
8370
9147
  const createAdBoost = (accountId, input, options = {}) => {
8371
9148
  const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
8372
9149
  return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateBoost({
@@ -8400,6 +9177,94 @@ function createPubNioClient({
8400
9177
  ...transport()
8401
9178
  })));
8402
9179
  };
9180
+ const duplicateAdCampaign = (accountId, campaignId, input, options = {}) => {
9181
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9182
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsDuplicateCampaign({
9183
+ client,
9184
+ path: { accountId, campaignId },
9185
+ query: { workspaceId },
9186
+ headers: { "idempotency-key": idempotencyKey },
9187
+ body: input,
9188
+ ...transport()
9189
+ })));
9190
+ };
9191
+ const archiveAdCampaign = (accountId, campaignId, input, options = {}) => {
9192
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9193
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsArchiveCampaign({
9194
+ client,
9195
+ path: { accountId, campaignId },
9196
+ query: { workspaceId },
9197
+ headers: { "idempotency-key": idempotencyKey },
9198
+ body: input,
9199
+ ...transport()
9200
+ })));
9201
+ };
9202
+ const setCampaignBudget = (accountId, campaignId, input, options = {}) => {
9203
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9204
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetCampaignBudget({
9205
+ client,
9206
+ path: { accountId, campaignId },
9207
+ query: { workspaceId },
9208
+ headers: { "idempotency-key": idempotencyKey },
9209
+ body: input,
9210
+ ...transport()
9211
+ })));
9212
+ };
9213
+ const createAdGroup = (accountId, campaignId, input, options = {}) => {
9214
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9215
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateAdGroup({
9216
+ client,
9217
+ path: { accountId, campaignId },
9218
+ query: { workspaceId },
9219
+ headers: { "idempotency-key": idempotencyKey },
9220
+ body: input,
9221
+ ...transport()
9222
+ })));
9223
+ };
9224
+ const attachAd = (accountId, adGroupId, input, options = {}) => {
9225
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9226
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsAttachAd({
9227
+ client,
9228
+ path: { accountId, adGroupId },
9229
+ query: { workspaceId },
9230
+ headers: { "idempotency-key": idempotencyKey },
9231
+ body: input,
9232
+ ...transport()
9233
+ })));
9234
+ };
9235
+ const setAdGroupBudget = (accountId, adGroupId, input, options = {}) => {
9236
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9237
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupBudget({
9238
+ client,
9239
+ path: { accountId, adGroupId },
9240
+ query: { workspaceId },
9241
+ headers: { "idempotency-key": idempotencyKey },
9242
+ body: input,
9243
+ ...transport()
9244
+ })));
9245
+ };
9246
+ const setAdGroupStatus = (accountId, adGroupId, input, options = {}) => {
9247
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9248
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupStatus({
9249
+ client,
9250
+ path: { accountId, adGroupId },
9251
+ query: { workspaceId },
9252
+ headers: { "idempotency-key": idempotencyKey },
9253
+ body: input,
9254
+ ...transport()
9255
+ })));
9256
+ };
9257
+ const setAdStatus = (accountId, adId, input, options = {}) => {
9258
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9259
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdStatus({
9260
+ client,
9261
+ path: { accountId, adId },
9262
+ query: { workspaceId },
9263
+ headers: { "idempotency-key": idempotencyKey },
9264
+ body: input,
9265
+ ...transport()
9266
+ })));
9267
+ };
8403
9268
  return {
8404
9269
  workspaceId,
8405
9270
  posts: {
@@ -8966,6 +9831,11 @@ function createPubNioClient({
8966
9831
  body: { ...input, workspaceId },
8967
9832
  ...transport()
8968
9833
  })),
9834
+ connectApiKey: (input) => decode(AdApiKeyConnectResult, adsConnectApiKeyAccount({
9835
+ client,
9836
+ body: { ...input, workspaceId },
9837
+ ...transport()
9838
+ })),
8969
9839
  select: (accountId) => decode(AdAccountSelection, adsSelectAccount({
8970
9840
  client,
8971
9841
  path: { accountId },
@@ -8981,6 +9851,10 @@ function createPubNioClient({
8981
9851
  campaigns: listAdCampaigns,
8982
9852
  iterateCampaigns: (options, iteration) => iterateItems(listAdCampaigns, options ?? {}, iteration),
8983
9853
  accountCampaigns: listAdAccountCampaigns,
9854
+ adGroups: listAdGroups,
9855
+ iterateAdGroups: (options, iteration) => iterateItems(listAdGroups, options ?? {}, iteration),
9856
+ ads: listAds,
9857
+ iterateAds: (options, iteration) => iterateItems(listAds, options ?? {}, iteration),
8984
9858
  iterateAccountCampaigns: (accountId, options, iteration) => iterateItems((query) => listAdAccountCampaigns(accountId, query), options ?? {}, iteration),
8985
9859
  tree: listAdTree,
8986
9860
  iterateTree: (options, iteration) => iterateItems(listAdTree, options ?? {}, iteration),
@@ -8991,6 +9865,8 @@ function createPubNioClient({
8991
9865
  ...transport()
8992
9866
  })),
8993
9867
  creatives: listAdCreatives,
9868
+ creative: getAdCreative,
9869
+ createCreative: createAdCreative,
8994
9870
  iterateCreatives: (options, iteration) => iterateItems(listAdCreatives, options ?? {}, iteration),
8995
9871
  insights: listAdInsights,
8996
9872
  iterateInsights: (options, iteration) => iterateItems(listAdInsights, options ?? {}, iteration),
@@ -9007,9 +9883,22 @@ function createPubNioClient({
9007
9883
  setKillSwitch: setAdKillSwitch,
9008
9884
  operation: readAdOperation,
9009
9885
  validateBoost: validateAdBoost,
9886
+ validateCampaignPlan: validateAdCampaignPlan,
9887
+ createCampaignPlan: createAdCampaignPlan,
9888
+ campaignPlan: readAdCampaignPlan,
9889
+ campaignPlans: listAdCampaignPlans,
9890
+ iterateCampaignPlans: (options, iteration) => iterateItems(listAdCampaignPlans, options ?? {}, iteration),
9010
9891
  createBoost: createAdBoost,
9011
9892
  activateCampaign: activateAdCampaign,
9012
- pauseCampaign: pauseAdCampaign
9893
+ pauseCampaign: pauseAdCampaign,
9894
+ archiveCampaign: archiveAdCampaign,
9895
+ duplicateCampaign: duplicateAdCampaign,
9896
+ setCampaignBudget,
9897
+ setAdGroupBudget,
9898
+ setAdGroupStatus,
9899
+ attachAd,
9900
+ createAdGroup,
9901
+ setAdStatus
9013
9902
  },
9014
9903
  analytics: {
9015
9904
  post: (postId, options = {}) => decode(PostAnalytics, analyticsPostsGet({