@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/solid.cjs CHANGED
@@ -49,22 +49,38 @@ __export(exports_solid, {
49
49
  adOperationPollDelay: () => adOperationPollDelay,
50
50
  adsAccountsInfiniteOptions: () => adsAccountsInfiniteOptions,
51
51
  adsActivateCampaignMutation: () => adsActivateCampaignMutation,
52
+ adsAdGroupsInfiniteOptions: () => adsAdGroupsInfiniteOptions,
52
53
  adsAdOptions: () => adsAdOptions,
54
+ adsAdsInfiniteOptions: () => adsAdsInfiniteOptions,
55
+ adsArchiveCampaignMutation: () => adsArchiveCampaignMutation,
56
+ adsAttachAdMutation: () => adsAttachAdMutation,
57
+ adsCampaignPlanOptions: () => adsCampaignPlanOptions,
58
+ adsCampaignPlansInfiniteOptions: () => adsCampaignPlansInfiniteOptions,
53
59
  adsCampaignsInfiniteOptions: () => adsCampaignsInfiniteOptions,
60
+ adsConnectApiKeyMutation: () => adsConnectApiKeyMutation,
54
61
  adsConnectMutation: () => adsConnectMutation,
62
+ adsCreateAdGroupMutation: () => adsCreateAdGroupMutation,
55
63
  adsCreateBoostMutation: () => adsCreateBoostMutation,
64
+ adsCreateCampaignPlanMutation: () => adsCreateCampaignPlanMutation,
65
+ adsCreateCreativeMutation: () => adsCreateCreativeMutation,
56
66
  adsCreativesInfiniteOptions: () => adsCreativesInfiniteOptions,
57
67
  adsDisconnectMutation: () => adsDisconnectMutation,
68
+ adsDuplicateCampaignMutation: () => adsDuplicateCampaignMutation,
58
69
  adsInsightsInfiniteOptions: () => adsInsightsInfiniteOptions,
59
70
  adsOperationOptions: () => adsOperationOptions,
60
71
  adsPauseCampaignMutation: () => adsPauseCampaignMutation,
61
72
  adsRefreshMutation: () => adsRefreshMutation,
62
73
  adsSelectMutation: () => adsSelectMutation,
74
+ adsSetAdGroupBudgetMutation: () => adsSetAdGroupBudgetMutation,
75
+ adsSetAdGroupStatusMutation: () => adsSetAdGroupStatusMutation,
76
+ adsSetAdStatusMutation: () => adsSetAdStatusMutation,
77
+ adsSetCampaignBudgetMutation: () => adsSetCampaignBudgetMutation,
63
78
  adsSetKillSwitchMutation: () => adsSetKillSwitchMutation,
64
79
  adsSpendPolicyOptions: () => adsSpendPolicyOptions,
65
80
  adsTreeInfiniteOptions: () => adsTreeInfiniteOptions,
66
81
  adsUpdateSpendPolicyMutation: () => adsUpdateSpendPolicyMutation,
67
82
  adsValidateBoostMutation: () => adsValidateBoostMutation,
83
+ adsValidateCampaignPlanMutation: () => adsValidateCampaignPlanMutation,
68
84
  apiKeysCreateMutation: () => apiKeysCreateMutation,
69
85
  apiKeysGetOptions: () => apiKeysGetOptions,
70
86
  apiKeysInfiniteOptions: () => apiKeysInfiniteOptions,
@@ -191,6 +207,179 @@ __export(exports_src, {
191
207
  verifyWebhookSignature: () => verifyWebhookSignature
192
208
  });
193
209
 
210
+ // src/generated/sdk.gen.ts
211
+ var exports_sdk_gen = {};
212
+ __export(exports_sdk_gen, {
213
+ adsActivateCampaign: () => adsActivateCampaign,
214
+ adsArchiveCampaign: () => adsArchiveCampaign,
215
+ adsAttachAd: () => adsAttachAd,
216
+ adsConnectAccount: () => adsConnectAccount,
217
+ adsConnectApiKeyAccount: () => adsConnectApiKeyAccount,
218
+ adsCreateAdGroup: () => adsCreateAdGroup,
219
+ adsCreateBoost: () => adsCreateBoost,
220
+ adsCreateCampaignPlan: () => adsCreateCampaignPlan,
221
+ adsCreateCreative: () => adsCreateCreative,
222
+ adsDisconnectAccount: () => adsDisconnectAccount,
223
+ adsDuplicateCampaign: () => adsDuplicateCampaign,
224
+ adsGetAd: () => adsGetAd,
225
+ adsGetCampaignPlan: () => adsGetCampaignPlan,
226
+ adsGetCreative: () => adsGetCreative,
227
+ adsGetOperation: () => adsGetOperation,
228
+ adsGetSpendPolicy: () => adsGetSpendPolicy,
229
+ adsGetTree: () => adsGetTree,
230
+ adsListAccounts: () => adsListAccounts,
231
+ adsListAdGroups: () => adsListAdGroups,
232
+ adsListAds: () => adsListAds,
233
+ adsListCampaignPlans: () => adsListCampaignPlans,
234
+ adsListCampaigns: () => adsListCampaigns,
235
+ adsListCreatives: () => adsListCreatives,
236
+ adsListInsights: () => adsListInsights,
237
+ adsListWorkspaceCampaigns: () => adsListWorkspaceCampaigns,
238
+ adsListWorkspaceInsights: () => adsListWorkspaceInsights,
239
+ adsPauseCampaign: () => adsPauseCampaign,
240
+ adsRefreshInsights: () => adsRefreshInsights,
241
+ adsSelectAccount: () => adsSelectAccount,
242
+ adsSetAdGroupBudget: () => adsSetAdGroupBudget,
243
+ adsSetAdGroupStatus: () => adsSetAdGroupStatus,
244
+ adsSetAdStatus: () => adsSetAdStatus,
245
+ adsSetCampaignBudget: () => adsSetCampaignBudget,
246
+ adsSetKillSwitch: () => adsSetKillSwitch,
247
+ adsUpdateSpendPolicy: () => adsUpdateSpendPolicy,
248
+ adsValidateBoost: () => adsValidateBoost,
249
+ adsValidateCampaignPlan: () => adsValidateCampaignPlan,
250
+ analyticsAccountsGet: () => analyticsAccountsGet,
251
+ analyticsAccountsList: () => analyticsAccountsList,
252
+ analyticsCapabilitiesGet: () => analyticsCapabilitiesGet,
253
+ analyticsPostsGet: () => analyticsPostsGet,
254
+ analyticsPostsSeries: () => analyticsPostsSeries,
255
+ analyticsRefreshesCreate: () => analyticsRefreshesCreate,
256
+ analyticsRefreshesGet: () => analyticsRefreshesGet,
257
+ apiKeysCreate: () => apiKeysCreate,
258
+ apiKeysGet: () => apiKeysGet,
259
+ apiKeysList: () => apiKeysList,
260
+ apiKeysRevoke: () => apiKeysRevoke,
261
+ apiKeysUpdate: () => apiKeysUpdate,
262
+ auditActionsList: () => auditActionsList,
263
+ auditGet: () => auditGet,
264
+ auditList: () => auditList,
265
+ billingCheckoutCreate: () => billingCheckoutCreate,
266
+ billingGet: () => billingGet,
267
+ billingLedgerList: () => billingLedgerList,
268
+ billingPlansList: () => billingPlansList,
269
+ billingPortalCreate: () => billingPortalCreate,
270
+ billingSpendControlsUpdate: () => billingSpendControlsUpdate,
271
+ billingUsageGet: () => billingUsageGet,
272
+ capabilitiesCatalog: () => capabilitiesCatalog,
273
+ capabilitiesGet: () => capabilitiesGet,
274
+ capabilitiesList: () => capabilitiesList,
275
+ commentsCreate: () => commentsCreate,
276
+ inboxAttachmentsGet: () => inboxAttachmentsGet,
277
+ inboxCapabilitiesGet: () => inboxCapabilitiesGet,
278
+ inboxCommentsDelete: () => inboxCommentsDelete,
279
+ inboxCommentsGet: () => inboxCommentsGet,
280
+ inboxCommentsList: () => inboxCommentsList,
281
+ inboxCommentsModerate: () => inboxCommentsModerate,
282
+ inboxCommentsReply: () => inboxCommentsReply,
283
+ inboxConversationsGet: () => inboxConversationsGet,
284
+ inboxConversationsList: () => inboxConversationsList,
285
+ inboxConversationsUpdate: () => inboxConversationsUpdate,
286
+ inboxMentionsList: () => inboxMentionsList,
287
+ inboxMentionsReply: () => inboxMentionsReply,
288
+ inboxMessagesList: () => inboxMessagesList,
289
+ inboxMessagesSend: () => inboxMessagesSend,
290
+ inboxReviewsGet: () => inboxReviewsGet,
291
+ inboxReviewsList: () => inboxReviewsList,
292
+ inboxReviewsReply: () => inboxReviewsReply,
293
+ inboxSyncGet: () => inboxSyncGet,
294
+ inboxSyncStart: () => inboxSyncStart,
295
+ inboxUnreadCount: () => inboxUnreadCount,
296
+ integrationsBlueskySession: () => integrationsBlueskySession,
297
+ integrationsConnectionStatus: () => integrationsConnectionStatus,
298
+ integrationsDisconnect: () => integrationsDisconnect,
299
+ integrationsGetAccount: () => integrationsGetAccount,
300
+ integrationsGetInstagramAudio: () => integrationsGetInstagramAudio,
301
+ integrationsInstagramPublishingLimit: () => integrationsInstagramPublishingLimit,
302
+ integrationsList: () => integrationsList,
303
+ integrationsMoveAccount: () => integrationsMoveAccount,
304
+ integrationsPrepareConnection: () => integrationsPrepareConnection,
305
+ integrationsReconnect: () => integrationsReconnect,
306
+ integrationsSearchInstagramAudio: () => integrationsSearchInstagramAudio,
307
+ integrationsSetEnabled: () => integrationsSetEnabled,
308
+ limitsGet: () => limitsGet,
309
+ meInvitesAccept: () => meInvitesAccept,
310
+ meInvitesDecline: () => meInvitesDecline,
311
+ meInvitesList: () => meInvitesList,
312
+ mediaCompleteUpload: () => mediaCompleteUpload,
313
+ mediaDelete: () => mediaDelete,
314
+ mediaDownload: () => mediaDownload,
315
+ mediaGet: () => mediaGet,
316
+ mediaImport: () => mediaImport,
317
+ mediaList: () => mediaList,
318
+ mediaStartUpload: () => mediaStartUpload,
319
+ mediaStatus: () => mediaStatus,
320
+ mediaUpload: () => mediaUpload,
321
+ mediaUploadInline: () => mediaUploadInline,
322
+ mediaUploadPart: () => mediaUploadPart,
323
+ notificationsPreferencesGet: () => notificationsPreferencesGet,
324
+ notificationsPreferencesUpdate: () => notificationsPreferencesUpdate,
325
+ postsAttempts: () => postsAttempts,
326
+ postsCreate: () => postsCreate,
327
+ postsDelete: () => postsDelete,
328
+ postsGet: () => postsGet,
329
+ postsList: () => postsList,
330
+ postsPublish: () => postsPublish,
331
+ postsReconcile: () => postsReconcile,
332
+ postsRetry: () => postsRetry,
333
+ postsUpdate: () => postsUpdate,
334
+ postsValidate: () => postsValidate,
335
+ profileDeactivate: () => profileDeactivate,
336
+ profileGet: () => profileGet,
337
+ profileUpdate: () => profileUpdate,
338
+ profilesArchive: () => profilesArchive,
339
+ profilesCreate: () => profilesCreate,
340
+ profilesGet: () => profilesGet,
341
+ profilesList: () => profilesList,
342
+ profilesUpdate: () => profilesUpdate,
343
+ queuesArchive: () => queuesArchive,
344
+ queuesBlackoutsCreate: () => queuesBlackoutsCreate,
345
+ queuesBlackoutsDelete: () => queuesBlackoutsDelete,
346
+ queuesBlackoutsList: () => queuesBlackoutsList,
347
+ queuesCreate: () => queuesCreate,
348
+ queuesGet: () => queuesGet,
349
+ queuesList: () => queuesList,
350
+ queuesSkipsCreate: () => queuesSkipsCreate,
351
+ queuesSkipsDelete: () => queuesSkipsDelete,
352
+ queuesSkipsList: () => queuesSkipsList,
353
+ queuesSlotsNext: () => queuesSlotsNext,
354
+ queuesSlotsPreview: () => queuesSlotsPreview,
355
+ queuesSlotsReplace: () => queuesSlotsReplace,
356
+ queuesUpdate: () => queuesUpdate,
357
+ scheduleChange: () => scheduleChange,
358
+ scheduleList: () => scheduleList,
359
+ webhooksCreate: () => webhooksCreate,
360
+ webhooksDelete: () => webhooksDelete,
361
+ webhooksEventTypes: () => webhooksEventTypes,
362
+ webhooksGet: () => webhooksGet,
363
+ webhooksGetDelivery: () => webhooksGetDelivery,
364
+ webhooksList: () => webhooksList,
365
+ webhooksListDeliveries: () => webhooksListDeliveries,
366
+ webhooksReplayDelivery: () => webhooksReplayDelivery,
367
+ webhooksTest: () => webhooksTest,
368
+ webhooksUpdate: () => webhooksUpdate,
369
+ workspacesArchive: () => workspacesArchive,
370
+ workspacesCreate: () => workspacesCreate,
371
+ workspacesGet: () => workspacesGet,
372
+ workspacesInvitesCreate: () => workspacesInvitesCreate,
373
+ workspacesInvitesList: () => workspacesInvitesList,
374
+ workspacesInvitesResend: () => workspacesInvitesResend,
375
+ workspacesInvitesRevoke: () => workspacesInvitesRevoke,
376
+ workspacesList: () => workspacesList,
377
+ workspacesMembersList: () => workspacesMembersList,
378
+ workspacesMembersRemove: () => workspacesMembersRemove,
379
+ workspacesMembersUpdateRole: () => workspacesMembersUpdateRole,
380
+ workspacesUpdate: () => workspacesUpdate
381
+ });
382
+
194
383
  // src/solid.ts
195
384
  var import_solid_query = require("@tanstack/solid-query");
196
385
 
@@ -378,6 +567,7 @@ var PROVIDERS = [
378
567
  "linkedin",
379
568
  "pinterest",
380
569
  "reddit",
570
+ "snapchat",
381
571
  "tiktok",
382
572
  "threads",
383
573
  "x",
@@ -394,7 +584,8 @@ var ACCOUNT_PROVIDERS = [
394
584
  "tiktok_ads",
395
585
  "linkedin_ads",
396
586
  "snapchat_ads",
397
- "amazon_ads"
587
+ "amazon_ads",
588
+ "openai_ads"
398
589
  ];
399
590
  var AccountProvider = import_effect7.Schema.Literals(ACCOUNT_PROVIDERS);
400
591
  var AmazonAdsRegion = import_effect7.Schema.Literals(["na", "eu", "fe"]);
@@ -1494,7 +1685,7 @@ var providerCatalog = {
1494
1685
  availability: "beta",
1495
1686
  authFamily: "bluesky",
1496
1687
  accountKinds: ["social_account"],
1497
- capabilities: { social_account: socialCapabilities },
1688
+ capabilities: { social_account: messagingCapabilities },
1498
1689
  approvalRequired: {},
1499
1690
  limited: {}
1500
1691
  },
@@ -1542,9 +1733,16 @@ var providerCatalog = {
1542
1733
  availability: "upcoming",
1543
1734
  authFamily: "reddit",
1544
1735
  accountKinds: ["social_account"],
1545
- capabilities: {
1546
- social_account: ["publish", "read_insights", "manage_comments"]
1547
- },
1736
+ capabilities: { social_account: messagingCapabilities },
1737
+ approvalRequired: {},
1738
+ limited: {}
1739
+ },
1740
+ snapchat: {
1741
+ label: "Snapchat",
1742
+ availability: "beta",
1743
+ authFamily: "snapchat",
1744
+ accountKinds: ["social_page"],
1745
+ capabilities: { social_page: ["publish"] },
1548
1746
  approvalRequired: {},
1549
1747
  limited: {}
1550
1748
  },
@@ -1616,6 +1814,7 @@ var accountProviderCatalog = {
1616
1814
  linkedin: { ...providerCatalog.linkedin, publishCapable: true },
1617
1815
  pinterest: { ...providerCatalog.pinterest, publishCapable: true },
1618
1816
  reddit: { ...providerCatalog.reddit, publishCapable: true },
1817
+ snapchat: { ...providerCatalog.snapchat, publishCapable: true },
1619
1818
  tiktok: { ...providerCatalog.tiktok, publishCapable: true },
1620
1819
  threads: { ...providerCatalog.threads, publishCapable: true },
1621
1820
  x: { ...providerCatalog.x, publishCapable: true },
@@ -1632,7 +1831,8 @@ var accountProviderCatalog = {
1632
1831
  capabilities: { ad_account: ["ads_read"] },
1633
1832
  approvalRequired: {},
1634
1833
  limited: {},
1635
- publishCapable: false
1834
+ publishCapable: false,
1835
+ integrationState: "connectable"
1636
1836
  },
1637
1837
  google_ads: {
1638
1838
  label: "Google Ads",
@@ -1642,7 +1842,8 @@ var accountProviderCatalog = {
1642
1842
  capabilities: { ad_account: ["ads_read"] },
1643
1843
  approvalRequired: {},
1644
1844
  limited: {},
1645
- publishCapable: false
1845
+ publishCapable: false,
1846
+ integrationState: "connectable"
1646
1847
  },
1647
1848
  reddit_ads: {
1648
1849
  label: "Reddit Ads",
@@ -1652,7 +1853,8 @@ var accountProviderCatalog = {
1652
1853
  capabilities: { ad_account: ["ads_read"] },
1653
1854
  approvalRequired: {},
1654
1855
  limited: {},
1655
- publishCapable: false
1856
+ publishCapable: false,
1857
+ integrationState: "connectable"
1656
1858
  },
1657
1859
  pinterest_ads: {
1658
1860
  label: "Pinterest Ads",
@@ -1662,7 +1864,8 @@ var accountProviderCatalog = {
1662
1864
  capabilities: { ad_account: ["ads_read"] },
1663
1865
  approvalRequired: {},
1664
1866
  limited: {},
1665
- publishCapable: false
1867
+ publishCapable: false,
1868
+ integrationState: "connectable"
1666
1869
  },
1667
1870
  tiktok_ads: {
1668
1871
  label: "TikTok Ads",
@@ -1672,7 +1875,8 @@ var accountProviderCatalog = {
1672
1875
  capabilities: { ad_account: ["ads_read"] },
1673
1876
  approvalRequired: {},
1674
1877
  limited: {},
1675
- publishCapable: false
1878
+ publishCapable: false,
1879
+ integrationState: "connectable"
1676
1880
  },
1677
1881
  linkedin_ads: {
1678
1882
  label: "LinkedIn Ads",
@@ -1682,7 +1886,8 @@ var accountProviderCatalog = {
1682
1886
  capabilities: { ad_account: ["ads_read"] },
1683
1887
  approvalRequired: {},
1684
1888
  limited: {},
1685
- publishCapable: false
1889
+ publishCapable: false,
1890
+ integrationState: "connectable"
1686
1891
  },
1687
1892
  snapchat_ads: {
1688
1893
  label: "Snapchat Ads",
@@ -1692,7 +1897,8 @@ var accountProviderCatalog = {
1692
1897
  capabilities: { ad_account: ["ads_read"] },
1693
1898
  approvalRequired: {},
1694
1899
  limited: {},
1695
- publishCapable: false
1900
+ publishCapable: false,
1901
+ integrationState: "connectable"
1696
1902
  },
1697
1903
  amazon_ads: {
1698
1904
  label: "Amazon Ads",
@@ -1702,7 +1908,19 @@ var accountProviderCatalog = {
1702
1908
  capabilities: { ad_account: ["ads_read"] },
1703
1909
  approvalRequired: {},
1704
1910
  limited: {},
1705
- publishCapable: false
1911
+ publishCapable: false,
1912
+ integrationState: "connectable"
1913
+ },
1914
+ openai_ads: {
1915
+ label: "OpenAI Ads",
1916
+ availability: "beta",
1917
+ authFamily: "openai_ads",
1918
+ accountKinds: ["ad_account"],
1919
+ capabilities: { ad_account: ["ads_read"] },
1920
+ approvalRequired: {},
1921
+ limited: {},
1922
+ publishCapable: false,
1923
+ integrationState: "connectable"
1706
1924
  }
1707
1925
  };
1708
1926
  var capabilityCatalog = PROVIDERS.flatMap((provider) => {
@@ -1929,6 +2147,13 @@ var AccountDetails = import_effect16.Schema.Union([
1929
2147
  kind: import_effect16.Schema.Literal("account"),
1930
2148
  username: import_effect16.Schema.String
1931
2149
  }),
2150
+ import_effect16.Schema.Struct({
2151
+ provider: import_effect16.Schema.Literal("snapchat"),
2152
+ kind: import_effect16.Schema.Literal("public_profile"),
2153
+ profileId: import_effect16.Schema.String,
2154
+ organizationId: import_effect16.Schema.optionalKey(import_effect16.Schema.String),
2155
+ username: import_effect16.Schema.optionalKey(import_effect16.Schema.String)
2156
+ }),
1932
2157
  import_effect16.Schema.Struct({
1933
2158
  provider: import_effect16.Schema.Literal("tiktok"),
1934
2159
  kind: import_effect16.Schema.Literal("account"),
@@ -2077,6 +2302,20 @@ var AccountDetails = import_effect16.Schema.Union([
2077
2302
  region: AmazonAdsRegion,
2078
2303
  businessId: import_effect16.Schema.optionalKey(import_effect16.Schema.String),
2079
2304
  managerId: import_effect16.Schema.optionalKey(import_effect16.Schema.String)
2305
+ }),
2306
+ import_effect16.Schema.Struct({
2307
+ provider: import_effect16.Schema.Literal("openai_ads"),
2308
+ kind: import_effect16.Schema.Literal("ad_account"),
2309
+ externalId: import_effect16.Schema.String,
2310
+ currency: import_effect16.Schema.String.check(import_effect16.Schema.isPattern(/^[A-Z]{3}$/)),
2311
+ timezone: import_effect16.Schema.String,
2312
+ status: import_effect16.Schema.Literals([
2313
+ "active",
2314
+ "disabled",
2315
+ "pending",
2316
+ "closed",
2317
+ "unknown"
2318
+ ])
2080
2319
  })
2081
2320
  ]);
2082
2321
  var ProviderAccount = import_effect16.Schema.Struct({
@@ -2108,7 +2347,8 @@ var AccountRef = import_effect17.Schema.Struct({ accountId: AccountId });
2108
2347
  var ConnectionRef = import_effect17.Schema.Struct({ connectionId: uuid3 });
2109
2348
  var ConnectionLaunch = import_effect17.Schema.Struct({
2110
2349
  attemptId: uuid3,
2111
- url: import_effect17.Schema.String
2350
+ url: import_effect17.Schema.String,
2351
+ expiresAt: import_effect17.Schema.optionalKey(import_effect17.Schema.String)
2112
2352
  });
2113
2353
  var OAuthFailureReason = import_effect17.Schema.Literals([
2114
2354
  "provider_error",
@@ -2321,6 +2561,13 @@ var RedditFeedSettings = import_effect18.Schema.Struct({
2321
2561
  thumbnailMediaId: import_effect18.Schema.optionalKey(MediaId),
2322
2562
  firstComment: import_effect18.Schema.optionalKey(text)
2323
2563
  }).annotate({ identifier: "RedditFeedSettings" });
2564
+ var SnapchatStorySettings = import_effect18.Schema.Struct({
2565
+ contentType: import_effect18.Schema.optionalKey(import_effect18.Schema.Literals(["story", "saved_story", "spotlight"])),
2566
+ title: import_effect18.Schema.optionalKey(import_effect18.Schema.String.check(import_effect18.Schema.isMinLength(1), import_effect18.Schema.isMaxLength(45))),
2567
+ description: import_effect18.Schema.optionalKey(import_effect18.Schema.String.check(import_effect18.Schema.isMinLength(1), import_effect18.Schema.isMaxLength(160))),
2568
+ link: import_effect18.Schema.optionalKey(MediaUrl),
2569
+ locale: import_effect18.Schema.optionalKey(import_effect18.Schema.String.check(import_effect18.Schema.isPattern(/^[a-z]{2}_[A-Z]{2}$/)))
2570
+ }).annotate({ identifier: "SnapchatStorySettings" });
2324
2571
  var YouTubeVideoSettings = import_effect18.Schema.Struct({
2325
2572
  title: import_effect18.Schema.String.check(import_effect18.Schema.isMinLength(1), import_effect18.Schema.isMaxLength(100)),
2326
2573
  description: import_effect18.Schema.optionalKey(import_effect18.Schema.String.check(import_effect18.Schema.isMaxLength(5000))),
@@ -2479,6 +2726,13 @@ var PublishTarget = import_effect18.Schema.Union([
2479
2726
  ...overrides,
2480
2727
  settings: RedditFeedSettings
2481
2728
  }),
2729
+ import_effect18.Schema.Struct({
2730
+ accountId: AccountId,
2731
+ provider: import_effect18.Schema.Literal("snapchat"),
2732
+ placement: import_effect18.Schema.Literal("story"),
2733
+ ...overrides,
2734
+ settings: import_effect18.Schema.optionalKey(SnapchatStorySettings)
2735
+ }),
2482
2736
  import_effect18.Schema.Struct({
2483
2737
  accountId: AccountId,
2484
2738
  provider: import_effect18.Schema.Literal("tiktok"),
@@ -2510,6 +2764,7 @@ var providerSettings = import_effect18.Schema.Union([
2510
2764
  InstagramStorySettings,
2511
2765
  LinkedInFeedSettings,
2512
2766
  RedditFeedSettings,
2767
+ SnapchatStorySettings,
2513
2768
  ThreadsFeedSettings,
2514
2769
  XFeedSettings,
2515
2770
  YouTubeVideoSettings,
@@ -3188,6 +3443,7 @@ var InboxReview = import_effect21.Schema.Struct({
3188
3443
  providerUpdatedAt: import_effect21.Schema.NullOr(import_effect21.Schema.String),
3189
3444
  repliedAt: import_effect21.Schema.NullOr(import_effect21.Schema.String),
3190
3445
  replyText: import_effect21.Schema.NullOr(import_effect21.Schema.String),
3446
+ canReply: import_effect21.Schema.Boolean,
3191
3447
  deletedAt: import_effect21.Schema.NullOr(import_effect21.Schema.String),
3192
3448
  createdAt: import_effect21.Schema.String
3193
3449
  }).annotate({ identifier: "InboxReview" });
@@ -3325,6 +3581,9 @@ var SendInboxMessage = import_effect21.Schema.Struct({
3325
3581
  var ReplyInboxComment = import_effect21.Schema.Struct({
3326
3582
  text: replyText
3327
3583
  }).annotate({ identifier: "ReplyInboxComment" });
3584
+ var ReplyInboxReview = import_effect21.Schema.Struct({
3585
+ text: replyText
3586
+ }).annotate({ identifier: "ReplyInboxReview" });
3328
3587
  var UpdateInboxComment = import_effect21.Schema.Struct({
3329
3588
  hidden: import_effect21.Schema.optionalKey(import_effect21.Schema.Boolean),
3330
3589
  liked: import_effect21.Schema.optionalKey(import_effect21.Schema.Boolean)
@@ -3402,7 +3661,8 @@ var AD_PROVIDERS = [
3402
3661
  "tiktok_ads",
3403
3662
  "linkedin_ads",
3404
3663
  "snapchat_ads",
3405
- "amazon_ads"
3664
+ "amazon_ads",
3665
+ "openai_ads"
3406
3666
  ];
3407
3667
  var AdProvider = import_effect23.Schema.Literals(AD_PROVIDERS);
3408
3668
  var AdAccountState = import_effect23.Schema.Literals(["available", "selected"]);
@@ -3497,8 +3757,17 @@ var AdKillSwitchResult = import_effect23.Schema.Struct({
3497
3757
  }).annotate({ identifier: "AdKillSwitchResult" });
3498
3758
  var AdOperationKind = import_effect23.Schema.Literals([
3499
3759
  "boost.create",
3760
+ "campaign.create",
3500
3761
  "campaign.activate",
3501
- "campaign.pause"
3762
+ "campaign.pause",
3763
+ "campaign.archive",
3764
+ "ad_group.status",
3765
+ "ad_group.create",
3766
+ "ad.status",
3767
+ "ad.attach",
3768
+ "creative.create",
3769
+ "campaign.duplicate",
3770
+ "budget.update"
3502
3771
  ]);
3503
3772
  var AdOperationStatus = import_effect23.Schema.Literals([
3504
3773
  "queued",
@@ -3575,6 +3844,48 @@ var AdCampaignActivationInput = import_effect23.Schema.Struct({
3575
3844
  var AdCampaignPauseInput = import_effect23.Schema.Struct({
3576
3845
  expectedRevision: import_effect23.Schema.Int.check(import_effect23.Schema.isGreaterThan(0))
3577
3846
  }).annotate({ identifier: "AdCampaignPauseInput" });
3847
+ var AdCampaignArchiveInput = import_effect23.Schema.Struct({
3848
+ expectedRevision: import_effect23.Schema.Int.check(import_effect23.Schema.isGreaterThan(0))
3849
+ }).annotate({ identifier: "AdCampaignArchiveInput" });
3850
+ var AdEntityStatusUpdate = import_effect23.Schema.Struct({
3851
+ status: import_effect23.Schema.Literals(["active", "paused", "archived"]),
3852
+ expectedRevision: import_effect23.Schema.Int.check(import_effect23.Schema.isGreaterThan(0))
3853
+ }).annotate({ identifier: "AdEntityStatusUpdate" });
3854
+ var AdBudgetUpdateInput = import_effect23.Schema.Struct({
3855
+ budget: AdBudget,
3856
+ expectedRevision: import_effect23.Schema.Int.check(import_effect23.Schema.isGreaterThan(0))
3857
+ }).annotate({ identifier: "AdBudgetUpdateInput" });
3858
+ var AdAttachAdCreative = import_effect23.Schema.Struct({
3859
+ headline: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(255))),
3860
+ body: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2000))),
3861
+ callToAction: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(64))),
3862
+ destinationUrl: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2048))),
3863
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
3864
+ }).annotate({ identifier: "AdAttachAdCreative" });
3865
+ var AdAdGroupCreateInput = import_effect23.Schema.Struct({
3866
+ name: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)),
3867
+ budget: import_effect23.Schema.optionalKey(AdBudget),
3868
+ targeting: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown)),
3869
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
3870
+ }).annotate({ identifier: "AdAdGroupCreateInput" });
3871
+ var AdCreativeCreateInput = import_effect23.Schema.Struct({
3872
+ actorAccountId: AccountId,
3873
+ mediaId: import_effect23.Schema.String.check(import_effect23.Schema.isUUID()),
3874
+ headline: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(255))),
3875
+ body: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2000))),
3876
+ callToAction: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(64))),
3877
+ destinationUrl: import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2048)),
3878
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
3879
+ }).annotate({ identifier: "AdCreativeCreateInput" });
3880
+ var AdCampaignDuplicateInput = import_effect23.Schema.Struct({
3881
+ name: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)))
3882
+ }).annotate({ identifier: "AdCampaignDuplicateInput" });
3883
+ var AdAttachAdInput = import_effect23.Schema.Struct({
3884
+ name: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)),
3885
+ creativeId: import_effect23.Schema.optionalKey(AdCreativeId),
3886
+ creative: import_effect23.Schema.optionalKey(AdAttachAdCreative),
3887
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
3888
+ }).annotate({ identifier: "AdAttachAdInput" });
3578
3889
  var AdWriteHeaders = import_effect23.Schema.Struct({
3579
3890
  "idempotency-key": IdempotencyKey
3580
3891
  });
@@ -3613,6 +3924,18 @@ var AdConnectLaunch = import_effect23.Schema.Struct({
3613
3924
  url: import_effect23.Schema.String,
3614
3925
  status: import_effect23.Schema.Literal("pending")
3615
3926
  }).annotate({ identifier: "AdConnectLaunch" });
3927
+ var AdApiKeyConnectInput = import_effect23.Schema.Struct({
3928
+ workspaceId: WorkspaceId,
3929
+ provider: import_effect23.Schema.Literal("openai_ads"),
3930
+ apiKey: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(2048)),
3931
+ accountId: import_effect23.Schema.optionalKey(AccountId),
3932
+ profileId: import_effect23.Schema.optionalKey(ProfileId)
3933
+ }).annotate({ identifier: "AdApiKeyConnectInput" });
3934
+ var AdApiKeyConnectResult = import_effect23.Schema.Struct({
3935
+ provider: import_effect23.Schema.Literal("openai_ads"),
3936
+ accountId: AccountId,
3937
+ status: import_effect23.Schema.Literal("connected")
3938
+ }).annotate({ identifier: "AdApiKeyConnectResult" });
3616
3939
  var AdAccountRef = import_effect23.Schema.Struct({
3617
3940
  workspaceId: WorkspaceId,
3618
3941
  accountId: AccountId
@@ -3673,6 +3996,128 @@ var AdBoostInput = import_effect23.Schema.Struct({
3673
3996
  accountId: AccountId,
3674
3997
  ...AdBoostDraft.fields
3675
3998
  }).annotate({ identifier: "AdBoostInput" });
3999
+ var AdCampaignPlanCapability = import_effect23.Schema.Literals([
4000
+ "campaign.create",
4001
+ "ad_group.create",
4002
+ "creative.create",
4003
+ "ad.create",
4004
+ "campaign.activate",
4005
+ "campaign.pause",
4006
+ "campaign.archive",
4007
+ "ad_group.activate",
4008
+ "ad_group.pause",
4009
+ "ad_group.archive",
4010
+ "ad.activate",
4011
+ "ad.pause",
4012
+ "ad.archive",
4013
+ "budget.update",
4014
+ "boost.create"
4015
+ ]);
4016
+ var AdCampaignPlanProfile = import_effect23.Schema.Struct({
4017
+ budgetOwner: import_effect23.Schema.Literals(["campaign", "ad_group", "shared"]),
4018
+ maxAdGroups: import_effect23.Schema.optionalKey(import_effect23.Schema.Int.check(import_effect23.Schema.isGreaterThanOrEqualTo(1))),
4019
+ budgetUnit: import_effect23.Schema.Literals(["minor", "micros"]),
4020
+ hierarchy: import_effect23.Schema.Array(import_effect23.Schema.Literals(["campaign", "ad_group", "creative", "ad"])),
4021
+ actor: import_effect23.Schema.Literals(["required", "none"]),
4022
+ creative: import_effect23.Schema.Literals(["separate", "embedded"]),
4023
+ review: import_effect23.Schema.Literals(["sync", "pending", "async"]),
4024
+ activation: import_effect23.Schema.Literals(["campaign", "ad_group"])
4025
+ }).annotate({ identifier: "AdCampaignPlanProfile" });
4026
+ var AdCampaignPlanTarget = import_effect23.Schema.Struct({
4027
+ accountId: AccountId,
4028
+ actorAccountId: import_effect23.Schema.optionalKey(AccountId),
4029
+ budget: import_effect23.Schema.optionalKey(AdBudget),
4030
+ schedule: import_effect23.Schema.optionalKey(AdSchedule),
4031
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
4032
+ }).annotate({ identifier: "AdCampaignPlanTarget" });
4033
+ var AdCampaignPlanCreative = import_effect23.Schema.Struct({
4034
+ headline: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(255))),
4035
+ body: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2000))),
4036
+ callToAction: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(64))),
4037
+ destinationUrl: import_effect23.Schema.optionalKey(import_effect23.Schema.String.check(import_effect23.Schema.isMaxLength(2048))),
4038
+ media: import_effect23.Schema.optionalKey(MediaInputs),
4039
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
4040
+ }).annotate({ identifier: "AdCampaignPlanCreative" });
4041
+ var AdCampaignPlanAd = import_effect23.Schema.Struct({
4042
+ name: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)),
4043
+ creative: AdCampaignPlanCreative,
4044
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
4045
+ }).annotate({ identifier: "AdCampaignPlanAd" });
4046
+ var AdCampaignPlanAdGroup = import_effect23.Schema.Struct({
4047
+ name: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)),
4048
+ budget: import_effect23.Schema.optionalKey(AdBudget),
4049
+ targeting: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown)),
4050
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown)),
4051
+ ads: import_effect23.Schema.Array(AdCampaignPlanAd).check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(50))
4052
+ }).annotate({ identifier: "AdCampaignPlanAdGroup" });
4053
+ var AdCampaignPlan = import_effect23.Schema.Struct({
4054
+ name: import_effect23.Schema.String.check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(255)),
4055
+ objective: AdObjective,
4056
+ budget: import_effect23.Schema.optionalKey(AdBudget),
4057
+ schedule: import_effect23.Schema.optionalKey(AdSchedule),
4058
+ targets: import_effect23.Schema.Array(AdCampaignPlanTarget).check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(50)),
4059
+ adGroups: import_effect23.Schema.Array(AdCampaignPlanAdGroup).check(import_effect23.Schema.isMinLength(1), import_effect23.Schema.isMaxLength(50)),
4060
+ providerSettings: import_effect23.Schema.optionalKey(import_effect23.Schema.Record(import_effect23.Schema.String, import_effect23.Schema.Unknown))
4061
+ }).annotate({ identifier: "AdCampaignPlan" });
4062
+ var AdCampaignPlanTargetValidation = import_effect23.Schema.Struct({
4063
+ accountId: AccountId,
4064
+ provider: import_effect23.Schema.optionalKey(AdProvider),
4065
+ name: import_effect23.Schema.optionalKey(import_effect23.Schema.String),
4066
+ currency: import_effect23.Schema.optionalKey(CurrencyCode),
4067
+ budget: import_effect23.Schema.optionalKey(import_effect23.Schema.NullOr(AdBudget)),
4068
+ profile: import_effect23.Schema.optionalKey(AdCampaignPlanProfile),
4069
+ capabilities: import_effect23.Schema.optionalKey(import_effect23.Schema.Array(AdCampaignPlanCapability)),
4070
+ issues: import_effect23.Schema.Array(AdIssue)
4071
+ }).annotate({ identifier: "AdCampaignPlanTargetValidation" });
4072
+ var AdCampaignPlanValidation = import_effect23.Schema.Struct({
4073
+ valid: import_effect23.Schema.Boolean,
4074
+ issues: import_effect23.Schema.Array(AdIssue),
4075
+ targets: import_effect23.Schema.Array(AdCampaignPlanTargetValidation)
4076
+ }).annotate({ identifier: "AdCampaignPlanValidation" });
4077
+ var AdCampaignPlanStatus = import_effect23.Schema.Literals([
4078
+ "queued",
4079
+ "creating",
4080
+ "partial",
4081
+ "succeeded",
4082
+ "failed",
4083
+ "unresolved"
4084
+ ]);
4085
+ var AdCampaignPlanTargetAccepted = import_effect23.Schema.Struct({
4086
+ accountId: AccountId,
4087
+ provider: AdProvider,
4088
+ operationId: AdOperationId,
4089
+ status: AdOperationStatus
4090
+ }).annotate({ identifier: "AdCampaignPlanTargetAccepted" });
4091
+ var AdCampaignPlanAccepted = import_effect23.Schema.Struct({
4092
+ planId: import_effect23.Schema.String.check(import_effect23.Schema.isUUID()),
4093
+ status: AdCampaignPlanStatus,
4094
+ targets: import_effect23.Schema.Array(AdCampaignPlanTargetAccepted)
4095
+ }).annotate({ identifier: "AdCampaignPlanAccepted" });
4096
+ var AdCampaignPlanListRow = import_effect23.Schema.Struct({
4097
+ planId: import_effect23.Schema.String.check(import_effect23.Schema.isUUID()),
4098
+ status: AdCampaignPlanStatus,
4099
+ createdAt: import_effect23.Schema.String,
4100
+ targets: import_effect23.Schema.Array(AdCampaignPlanTargetAccepted)
4101
+ }).annotate({ identifier: "AdCampaignPlanListRow" });
4102
+ var AdCampaignPlanList = import_effect23.Schema.Struct({
4103
+ data: import_effect23.Schema.Array(AdCampaignPlanListRow),
4104
+ ...pageFields
4105
+ }).annotate({ identifier: "AdCampaignPlanList" });
4106
+ var AdCampaignPlanTargetDetail = import_effect23.Schema.Struct({
4107
+ accountId: AccountId,
4108
+ provider: AdProvider,
4109
+ operationId: AdOperationId,
4110
+ campaignId: import_effect23.Schema.NullOr(AdCampaignId),
4111
+ status: AdOperationStatus,
4112
+ issues: import_effect23.Schema.Array(AdIssue)
4113
+ }).annotate({ identifier: "AdCampaignPlanTargetDetail" });
4114
+ var AdCampaignPlanDetail = import_effect23.Schema.Struct({
4115
+ planId: import_effect23.Schema.String.check(import_effect23.Schema.isUUID()),
4116
+ status: AdCampaignPlanStatus,
4117
+ createdAt: import_effect23.Schema.String,
4118
+ targets: import_effect23.Schema.Array(AdCampaignPlanTargetDetail),
4119
+ issues: import_effect23.Schema.Array(AdIssue)
4120
+ }).annotate({ identifier: "AdCampaignPlanDetail" });
3676
4121
  var AdCampaign = import_effect23.Schema.Struct({
3677
4122
  id: AdCampaignId,
3678
4123
  accountId: AccountId,
@@ -3807,6 +4252,20 @@ var AdCampaignList = import_effect23.Schema.Struct({
3807
4252
  ...pageFields,
3808
4253
  freshness: AdFreshness
3809
4254
  }).annotate({ identifier: "AdCampaignList" });
4255
+ var AdGroupListRow = import_effect23.Schema.Struct({
4256
+ ...AdGroup.fields,
4257
+ insights: import_effect23.Schema.optionalKey(import_effect23.Schema.NullOr(AdInsightSummary))
4258
+ }).annotate({ identifier: "AdGroupListRow" });
4259
+ var AdGroupList = import_effect23.Schema.Struct({
4260
+ data: import_effect23.Schema.Array(AdGroupListRow),
4261
+ ...pageFields,
4262
+ freshness: AdFreshness
4263
+ }).annotate({ identifier: "AdGroupList" });
4264
+ var AdList = import_effect23.Schema.Struct({
4265
+ data: import_effect23.Schema.Array(Ad),
4266
+ ...pageFields,
4267
+ freshness: AdFreshness
4268
+ }).annotate({ identifier: "AdList" });
3810
4269
  var AdCreativeList = import_effect23.Schema.Struct({
3811
4270
  data: import_effect23.Schema.Array(AdCreative),
3812
4271
  ...pageFields,
@@ -3917,6 +4376,7 @@ var WorkspaceEventType = import_effect26.Schema.Literals([
3917
4376
  "inbox.review.updated",
3918
4377
  "inbox.review.deleted",
3919
4378
  "inbox.review.restored",
4379
+ "inbox.review.replied",
3920
4380
  "inbox.mention.received",
3921
4381
  "inbox.message.sent",
3922
4382
  "inbox.message.delivered",
@@ -3936,12 +4396,14 @@ var WorkspaceEventType = import_effect26.Schema.Literals([
3936
4396
  "ads.kill_switch.activated",
3937
4397
  "ads.lead.received",
3938
4398
  "ads.campaign.status_changed",
4399
+ "ads.ad_group.status_changed",
3939
4400
  "ads.ad.status_changed",
3940
4401
  "ads.ad_account.status_changed",
3941
4402
  "ads.ad.review.approved",
3942
4403
  "ads.ad.review.rejected",
3943
4404
  "ads.sync.failed",
3944
4405
  "ads.sync.recovered",
4406
+ "ads.initial_sync.completed",
3945
4407
  "schedule.assignment.changed",
3946
4408
  "account.connected",
3947
4409
  "account.disconnected",
@@ -4173,6 +4635,11 @@ var WebhookEvent = import_effect27.Schema.Union([
4173
4635
  type: import_effect27.Schema.Literal("inbox.review.restored"),
4174
4636
  data: import_effect27.Schema.Struct(inboxReviewData)
4175
4637
  }),
4638
+ import_effect27.Schema.Struct({
4639
+ ...envelope,
4640
+ type: import_effect27.Schema.Literal("inbox.review.replied"),
4641
+ data: import_effect27.Schema.Struct(inboxReviewData)
4642
+ }),
4176
4643
  import_effect27.Schema.Struct({
4177
4644
  ...envelope,
4178
4645
  type: import_effect27.Schema.Literal("inbox.mention.received"),
@@ -4330,6 +4797,16 @@ var WebhookEvent = import_effect27.Schema.Union([
4330
4797
  status: AdEntityStatus
4331
4798
  })
4332
4799
  }),
4800
+ import_effect27.Schema.Struct({
4801
+ ...envelope,
4802
+ type: import_effect27.Schema.Literal("ads.ad_group.status_changed"),
4803
+ data: import_effect27.Schema.Struct({
4804
+ accountId: AccountId,
4805
+ adGroupId: AdGroupId,
4806
+ provider: AdProvider,
4807
+ status: AdEntityStatus
4808
+ })
4809
+ }),
4333
4810
  import_effect27.Schema.Struct({
4334
4811
  ...envelope,
4335
4812
  type: import_effect27.Schema.Literal("ads.ad.status_changed"),
@@ -4383,6 +4860,14 @@ var WebhookEvent = import_effect27.Schema.Union([
4383
4860
  provider: AdProvider
4384
4861
  })
4385
4862
  }),
4863
+ import_effect27.Schema.Struct({
4864
+ ...envelope,
4865
+ type: import_effect27.Schema.Literal("ads.initial_sync.completed"),
4866
+ data: import_effect27.Schema.Struct({
4867
+ accountId: AccountId,
4868
+ provider: AdProvider
4869
+ })
4870
+ }),
4386
4871
  import_effect27.Schema.Struct({
4387
4872
  ...envelope,
4388
4873
  type: import_effect27.Schema.Literal("account.connected"),
@@ -5175,7 +5660,13 @@ class AdRevisionConflict extends import_http_api.HttpApiError.Problem()("AdRevis
5175
5660
  status: 409,
5176
5661
  title: "Ad resource revision conflict"
5177
5662
  }, {
5178
- resource: import_effect28.Schema.Literals(["spend_policy", "campaign", "boost"]),
5663
+ resource: import_effect28.Schema.Literals([
5664
+ "spend_policy",
5665
+ "campaign",
5666
+ "ad_group",
5667
+ "ad",
5668
+ "boost"
5669
+ ]),
5179
5670
  expectedRevision: import_effect28.Schema.Int.check(import_effect28.Schema.isGreaterThanOrEqualTo(0)),
5180
5671
  actualRevision: import_effect28.Schema.Int.check(import_effect28.Schema.isGreaterThanOrEqualTo(0)),
5181
5672
  nextAction: import_effect28.Schema.String
@@ -5790,12 +6281,13 @@ var import_http = require("effect/http");
5790
6281
  // package.json
5791
6282
  var package_default = {
5792
6283
  name: "@pubnio/sdk",
5793
- version: "0.1.2",
6284
+ version: "0.2.1",
5794
6285
  description: "JavaScript and TypeScript client for the PubNio API",
5795
6286
  type: "module",
5796
6287
  exports: {
5797
6288
  ".": "./src/index.ts",
5798
6289
  "./solid": "./src/solid.ts",
6290
+ "./internal": "./src/internal.ts",
5799
6291
  "./package.json": "./package.json"
5800
6292
  },
5801
6293
  dependencies: {
@@ -6952,6 +7444,11 @@ var webhooksReplayDelivery = (options) => (options.client ?? client).post({
6952
7444
  url: "/api/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/replay",
6953
7445
  ...options
6954
7446
  });
7447
+ var webhooksEventTypes = (options) => (options?.client ?? client).get({
7448
+ security: [{ scheme: "bearer", type: "http" }],
7449
+ url: "/api/v1/webhooks/event-types",
7450
+ ...options
7451
+ });
6955
7452
  var integrationsList = (options) => (options.client ?? client).get({
6956
7453
  security: [{ scheme: "bearer", type: "http" }],
6957
7454
  url: "/api/v1/integrations",
@@ -6980,6 +7477,15 @@ var integrationsPrepareConnection = (options) => (options.client ?? client).post
6980
7477
  url: "/api/v1/integrations/{provider}/connect",
6981
7478
  ...options
6982
7479
  });
7480
+ var integrationsBlueskySession = (options) => (options.client ?? client).post({
7481
+ security: [{ scheme: "bearer", type: "http" }],
7482
+ url: "/api/v1/integrations/bluesky/session",
7483
+ ...options,
7484
+ headers: {
7485
+ "Content-Type": "application/json",
7486
+ ...options.headers
7487
+ }
7488
+ });
6983
7489
  var integrationsConnectionStatus = (options) => (options.client ?? client).get({
6984
7490
  security: [{ scheme: "bearer", type: "http" }],
6985
7491
  url: "/api/v1/integrations/attempts/{attemptId}",
@@ -7093,6 +7599,15 @@ var mediaGet = (options) => (options.client ?? client).get({
7093
7599
  url: "/api/v1/media/{mediaId}",
7094
7600
  ...options
7095
7601
  });
7602
+ var mediaUploadInline = (options) => (options.client ?? client).post({
7603
+ security: [{ scheme: "bearer", type: "http" }],
7604
+ url: "/api/v1/media/inline",
7605
+ ...options,
7606
+ headers: {
7607
+ "Content-Type": "application/json",
7608
+ ...options.headers
7609
+ }
7610
+ });
7096
7611
  var mediaImport = (options) => (options.client ?? client).post({
7097
7612
  security: [{ scheme: "bearer", type: "http" }],
7098
7613
  url: "/api/v1/media/import",
@@ -7369,6 +7884,15 @@ var inboxReviewsGet = (options) => (options.client ?? client).get({
7369
7884
  url: "/api/v1/inbox/reviews/{reviewId}",
7370
7885
  ...options
7371
7886
  });
7887
+ var inboxReviewsReply = (options) => (options.client ?? client).post({
7888
+ security: [{ scheme: "bearer", type: "http" }],
7889
+ url: "/api/v1/inbox/reviews/{reviewId}/replies",
7890
+ ...options,
7891
+ headers: {
7892
+ "Content-Type": "application/json",
7893
+ ...options.headers
7894
+ }
7895
+ });
7372
7896
  var inboxUnreadCount = (options) => (options.client ?? client).get({
7373
7897
  security: [{ scheme: "bearer", type: "http" }],
7374
7898
  url: "/api/v1/inbox/unread-count",
@@ -7398,6 +7922,15 @@ var inboxAttachmentsGet = (options) => (options.client ?? client).get({
7398
7922
  url: "/api/v1/inbox/attachments/{attachmentId}",
7399
7923
  ...options
7400
7924
  });
7925
+ var commentsCreate = (options) => (options.client ?? client).post({
7926
+ security: [{ scheme: "bearer", type: "http" }],
7927
+ url: "/api/v1/comments",
7928
+ ...options,
7929
+ headers: {
7930
+ "Content-Type": "application/json",
7931
+ ...options.headers
7932
+ }
7933
+ });
7401
7934
  var postsList = (options) => (options.client ?? client).get({
7402
7935
  security: [{ scheme: "bearer", type: "http" }],
7403
7936
  url: "/api/v1/posts",
@@ -7482,6 +8015,48 @@ var adsConnectAccount = (options) => (options.client ?? client).post({
7482
8015
  ...options.headers
7483
8016
  }
7484
8017
  });
8018
+ var adsConnectApiKeyAccount = (options) => (options.client ?? client).post({
8019
+ security: [{ scheme: "bearer", type: "http" }],
8020
+ url: "/api/v1/ads/accounts/connect/api-key",
8021
+ ...options,
8022
+ headers: {
8023
+ "Content-Type": "application/json",
8024
+ ...options.headers
8025
+ }
8026
+ });
8027
+ var adsValidateCampaignPlan = (options) => (options.client ?? client).post({
8028
+ security: [{ scheme: "bearer", type: "http" }],
8029
+ url: "/api/v1/ads/campaigns/validate",
8030
+ ...options,
8031
+ headers: {
8032
+ "Content-Type": "application/json",
8033
+ ...options.headers
8034
+ }
8035
+ });
8036
+ var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
8037
+ security: [{ scheme: "bearer", type: "http" }],
8038
+ url: "/api/v1/ads/campaigns",
8039
+ ...options
8040
+ });
8041
+ var adsCreateCampaignPlan = (options) => (options.client ?? client).post({
8042
+ security: [{ scheme: "bearer", type: "http" }],
8043
+ url: "/api/v1/ads/campaigns",
8044
+ ...options,
8045
+ headers: {
8046
+ "Content-Type": "application/json",
8047
+ ...options.headers
8048
+ }
8049
+ });
8050
+ var adsListCampaignPlans = (options) => (options.client ?? client).get({
8051
+ security: [{ scheme: "bearer", type: "http" }],
8052
+ url: "/api/v1/ads/plans",
8053
+ ...options
8054
+ });
8055
+ var adsGetCampaignPlan = (options) => (options.client ?? client).get({
8056
+ security: [{ scheme: "bearer", type: "http" }],
8057
+ url: "/api/v1/ads/plans/{planId}",
8058
+ ...options
8059
+ });
7485
8060
  var adsSelectAccount = (options) => (options.client ?? client).post({
7486
8061
  security: [{ scheme: "bearer", type: "http" }],
7487
8062
  url: "/api/v1/ads/accounts/{accountId}/select",
@@ -7492,11 +8067,6 @@ var adsDisconnectAccount = (options) => (options.client ?? client).post({
7492
8067
  url: "/api/v1/ads/accounts/{accountId}/disconnect",
7493
8068
  ...options
7494
8069
  });
7495
- var adsListWorkspaceCampaigns = (options) => (options.client ?? client).get({
7496
- security: [{ scheme: "bearer", type: "http" }],
7497
- url: "/api/v1/ads/campaigns",
7498
- ...options
7499
- });
7500
8070
  var adsListCampaigns = (options) => (options.client ?? client).get({
7501
8071
  security: [{ scheme: "bearer", type: "http" }],
7502
8072
  url: "/api/v1/ads/accounts/{accountId}/campaigns",
@@ -7507,6 +8077,16 @@ var adsGetTree = (options) => (options.client ?? client).get({
7507
8077
  url: "/api/v1/ads/tree",
7508
8078
  ...options
7509
8079
  });
8080
+ var adsListAds = (options) => (options.client ?? client).get({
8081
+ security: [{ scheme: "bearer", type: "http" }],
8082
+ url: "/api/v1/ads/ads",
8083
+ ...options
8084
+ });
8085
+ var adsListAdGroups = (options) => (options.client ?? client).get({
8086
+ security: [{ scheme: "bearer", type: "http" }],
8087
+ url: "/api/v1/ads/ad-groups",
8088
+ ...options
8089
+ });
7510
8090
  var adsGetAd = (options) => (options.client ?? client).get({
7511
8091
  security: [{ scheme: "bearer", type: "http" }],
7512
8092
  url: "/api/v1/ads/ads/{adId}",
@@ -7517,6 +8097,20 @@ var adsListCreatives = (options) => (options.client ?? client).get({
7517
8097
  url: "/api/v1/ads/creatives",
7518
8098
  ...options
7519
8099
  });
8100
+ var adsCreateCreative = (options) => (options.client ?? client).post({
8101
+ security: [{ scheme: "bearer", type: "http" }],
8102
+ url: "/api/v1/ads/accounts/{accountId}/creatives",
8103
+ ...options,
8104
+ headers: {
8105
+ "Content-Type": "application/json",
8106
+ ...options.headers
8107
+ }
8108
+ });
8109
+ var adsGetCreative = (options) => (options.client ?? client).get({
8110
+ security: [{ scheme: "bearer", type: "http" }],
8111
+ url: "/api/v1/ads/creatives/{creativeId}",
8112
+ ...options
8113
+ });
7520
8114
  var adsListWorkspaceInsights = (options) => (options.client ?? client).get({
7521
8115
  security: [{ scheme: "bearer", type: "http" }],
7522
8116
  url: "/api/v1/ads/insights",
@@ -7596,6 +8190,78 @@ var adsPauseCampaign = (options) => (options.client ?? client).post({
7596
8190
  ...options.headers
7597
8191
  }
7598
8192
  });
8193
+ var adsArchiveCampaign = (options) => (options.client ?? client).post({
8194
+ security: [{ scheme: "bearer", type: "http" }],
8195
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/archive",
8196
+ ...options,
8197
+ headers: {
8198
+ "Content-Type": "application/json",
8199
+ ...options.headers
8200
+ }
8201
+ });
8202
+ var adsDuplicateCampaign = (options) => (options.client ?? client).post({
8203
+ security: [{ scheme: "bearer", type: "http" }],
8204
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/duplicate",
8205
+ ...options,
8206
+ headers: {
8207
+ "Content-Type": "application/json",
8208
+ ...options.headers
8209
+ }
8210
+ });
8211
+ var adsSetCampaignBudget = (options) => (options.client ?? client).post({
8212
+ security: [{ scheme: "bearer", type: "http" }],
8213
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/budget",
8214
+ ...options,
8215
+ headers: {
8216
+ "Content-Type": "application/json",
8217
+ ...options.headers
8218
+ }
8219
+ });
8220
+ var adsSetAdGroupBudget = (options) => (options.client ?? client).post({
8221
+ security: [{ scheme: "bearer", type: "http" }],
8222
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/budget",
8223
+ ...options,
8224
+ headers: {
8225
+ "Content-Type": "application/json",
8226
+ ...options.headers
8227
+ }
8228
+ });
8229
+ var adsSetAdGroupStatus = (options) => (options.client ?? client).post({
8230
+ security: [{ scheme: "bearer", type: "http" }],
8231
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/status",
8232
+ ...options,
8233
+ headers: {
8234
+ "Content-Type": "application/json",
8235
+ ...options.headers
8236
+ }
8237
+ });
8238
+ var adsCreateAdGroup = (options) => (options.client ?? client).post({
8239
+ security: [{ scheme: "bearer", type: "http" }],
8240
+ url: "/api/v1/ads/accounts/{accountId}/campaigns/{campaignId}/ad-groups",
8241
+ ...options,
8242
+ headers: {
8243
+ "Content-Type": "application/json",
8244
+ ...options.headers
8245
+ }
8246
+ });
8247
+ var adsAttachAd = (options) => (options.client ?? client).post({
8248
+ security: [{ scheme: "bearer", type: "http" }],
8249
+ url: "/api/v1/ads/accounts/{accountId}/ad-groups/{adGroupId}/ads",
8250
+ ...options,
8251
+ headers: {
8252
+ "Content-Type": "application/json",
8253
+ ...options.headers
8254
+ }
8255
+ });
8256
+ var adsSetAdStatus = (options) => (options.client ?? client).post({
8257
+ security: [{ scheme: "bearer", type: "http" }],
8258
+ url: "/api/v1/ads/accounts/{accountId}/ads/{adId}/status",
8259
+ ...options,
8260
+ headers: {
8261
+ "Content-Type": "application/json",
8262
+ ...options.headers
8263
+ }
8264
+ });
7599
8265
  var auditList = (options) => (options.client ?? client).get({
7600
8266
  security: [{ scheme: "bearer", type: "http" }],
7601
8267
  url: "/api/v1/workspaces/{workspaceId}/audit-logs",
@@ -7947,7 +8613,8 @@ function createPubNioClient({
7947
8613
  signal: clientSignal,
7948
8614
  retries: requestedRetries = defaultRetries,
7949
8615
  clientName = "sdk",
7950
- clientVersion = package_default.version
8616
+ clientVersion = package_default.version,
8617
+ onRuntime
7951
8618
  }) {
7952
8619
  const timeoutMs = checkedTimeout(requestedTimeoutMs, "timeoutMs");
7953
8620
  const retries = checkedRetries(requestedRetries);
@@ -8002,6 +8669,7 @@ function createPubNioClient({
8002
8669
  throw invalidResponse();
8003
8670
  });
8004
8671
  }
8672
+ onRuntime?.({ client, transport, decode });
8005
8673
  async function poll(read, done, { timeoutMs: waitTimeoutMs = 60000, signal } = {}) {
8006
8674
  const timeoutMs = checkedTimeout(waitTimeoutMs, "timeoutMs");
8007
8675
  const deadline = performance.now() + timeoutMs;
@@ -8474,29 +9142,77 @@ function createPubNioClient({
8474
9142
  },
8475
9143
  ...transport()
8476
9144
  }));
8477
- const listAdTree = (options = {}) => decode(AdTree, adsGetTree({
9145
+ const listAdGroups = (options = {}) => decode(AdGroupList, adsListAdGroups({
8478
9146
  client,
8479
9147
  query: {
8480
9148
  workspaceId,
8481
9149
  accountId: options.accountId,
8482
9150
  campaignId: options.campaignId,
9151
+ provider: options.provider,
9152
+ status: options.status,
9153
+ from: options.from,
9154
+ to: options.to,
8483
9155
  cursor: options.cursor,
8484
9156
  limit: options.limit === undefined ? undefined : String(options.limit)
8485
9157
  },
8486
9158
  ...transport()
8487
9159
  }));
8488
- const listAdCreatives = (options = {}) => decode(AdCreativeList, adsListCreatives({
9160
+ const listAds = (options = {}) => decode(AdList, adsListAds({
8489
9161
  client,
8490
9162
  query: {
8491
9163
  workspaceId,
8492
9164
  accountId: options.accountId,
8493
- adId: options.adId,
9165
+ campaignId: options.campaignId,
9166
+ adGroupId: options.adGroupId,
9167
+ provider: options.provider,
9168
+ status: options.status,
9169
+ from: options.from,
9170
+ to: options.to,
8494
9171
  cursor: options.cursor,
8495
9172
  limit: options.limit === undefined ? undefined : String(options.limit)
8496
9173
  },
8497
9174
  ...transport()
8498
9175
  }));
8499
- const listAdInsights = (options = {}) => decode(AdInsightList, adsListWorkspaceInsights({
9176
+ const listAdTree = (options = {}) => decode(AdTree, adsGetTree({
9177
+ client,
9178
+ query: {
9179
+ workspaceId,
9180
+ accountId: options.accountId,
9181
+ campaignId: options.campaignId,
9182
+ cursor: options.cursor,
9183
+ limit: options.limit === undefined ? undefined : String(options.limit)
9184
+ },
9185
+ ...transport()
9186
+ }));
9187
+ const listAdCreatives = (options = {}) => decode(AdCreativeList, adsListCreatives({
9188
+ client,
9189
+ query: {
9190
+ workspaceId,
9191
+ accountId: options.accountId,
9192
+ adId: options.adId,
9193
+ cursor: options.cursor,
9194
+ limit: options.limit === undefined ? undefined : String(options.limit)
9195
+ },
9196
+ ...transport()
9197
+ }));
9198
+ const createAdCreative = (accountId, input, options = {}) => {
9199
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9200
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateCreative({
9201
+ client,
9202
+ path: { accountId },
9203
+ query: { workspaceId },
9204
+ headers: { "idempotency-key": idempotencyKey },
9205
+ body: input,
9206
+ ...transport()
9207
+ })));
9208
+ };
9209
+ const getAdCreative = (creativeId) => decode(AdCreative, adsGetCreative({
9210
+ client,
9211
+ path: { creativeId },
9212
+ query: { workspaceId },
9213
+ ...transport()
9214
+ }));
9215
+ const listAdInsights = (options = {}) => decode(AdInsightList, adsListWorkspaceInsights({
8500
9216
  client,
8501
9217
  query: {
8502
9218
  workspaceId,
@@ -8563,6 +9279,68 @@ function createPubNioClient({
8563
9279
  body: input,
8564
9280
  ...transport()
8565
9281
  }));
9282
+ const mutableCampaignPlan = (plan) => ({
9283
+ ...plan,
9284
+ ...plan.budget ? { budget: { ...plan.budget } } : {},
9285
+ ...plan.schedule ? { schedule: { ...plan.schedule } } : {},
9286
+ ...plan.providerSettings ? { providerSettings: { ...plan.providerSettings } } : {},
9287
+ targets: plan.targets.map((target) => ({
9288
+ ...target,
9289
+ ...target.budget ? { budget: { ...target.budget } } : {},
9290
+ ...target.schedule ? { schedule: { ...target.schedule } } : {},
9291
+ ...target.providerSettings ? { providerSettings: { ...target.providerSettings } } : {}
9292
+ })),
9293
+ adGroups: plan.adGroups.map((group) => ({
9294
+ ...group,
9295
+ ...group.budget ? { budget: { ...group.budget } } : {},
9296
+ ...group.targeting ? { targeting: { ...group.targeting } } : {},
9297
+ ...group.providerSettings ? { providerSettings: { ...group.providerSettings } } : {},
9298
+ ads: group.ads.map((ad) => ({
9299
+ ...ad,
9300
+ ...ad.providerSettings ? { providerSettings: { ...ad.providerSettings } } : {},
9301
+ creative: {
9302
+ ...ad.creative.headline !== undefined ? { headline: ad.creative.headline } : {},
9303
+ ...ad.creative.body !== undefined ? { body: ad.creative.body } : {},
9304
+ ...ad.creative.callToAction !== undefined ? { callToAction: ad.creative.callToAction } : {},
9305
+ ...ad.creative.destinationUrl !== undefined ? { destinationUrl: ad.creative.destinationUrl } : {},
9306
+ ...ad.creative.media ? { media: ad.creative.media.map((item) => ({ ...item })) } : {},
9307
+ ...ad.creative.providerSettings ? { providerSettings: { ...ad.creative.providerSettings } } : {}
9308
+ }
9309
+ }))
9310
+ }))
9311
+ });
9312
+ const validateAdCampaignPlan = (input) => decode(AdCampaignPlanValidation, adsValidateCampaignPlan({
9313
+ client,
9314
+ query: { workspaceId },
9315
+ body: mutableCampaignPlan(input),
9316
+ ...transport()
9317
+ }));
9318
+ const createAdCampaignPlan = (input, options = {}) => {
9319
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9320
+ return withIdempotencyKey(idempotencyKey, () => decode(AdCampaignPlanAccepted, adsCreateCampaignPlan({
9321
+ client,
9322
+ query: { workspaceId },
9323
+ headers: { "idempotency-key": idempotencyKey },
9324
+ body: mutableCampaignPlan(input),
9325
+ ...transport()
9326
+ })));
9327
+ };
9328
+ const listAdCampaignPlans = (options = {}) => decode(AdCampaignPlanList, adsListCampaignPlans({
9329
+ client,
9330
+ query: {
9331
+ workspaceId,
9332
+ status: options.status,
9333
+ cursor: options.cursor,
9334
+ limit: options.limit === undefined ? undefined : String(options.limit)
9335
+ },
9336
+ ...transport()
9337
+ }));
9338
+ const readAdCampaignPlan = (planId) => decode(AdCampaignPlanDetail, adsGetCampaignPlan({
9339
+ client,
9340
+ path: { planId },
9341
+ query: { workspaceId },
9342
+ ...transport()
9343
+ }));
8566
9344
  const createAdBoost = (accountId, input, options = {}) => {
8567
9345
  const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
8568
9346
  return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateBoost({
@@ -8596,6 +9374,94 @@ function createPubNioClient({
8596
9374
  ...transport()
8597
9375
  })));
8598
9376
  };
9377
+ const duplicateAdCampaign = (accountId, campaignId, input, options = {}) => {
9378
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9379
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsDuplicateCampaign({
9380
+ client,
9381
+ path: { accountId, campaignId },
9382
+ query: { workspaceId },
9383
+ headers: { "idempotency-key": idempotencyKey },
9384
+ body: input,
9385
+ ...transport()
9386
+ })));
9387
+ };
9388
+ const archiveAdCampaign = (accountId, campaignId, input, options = {}) => {
9389
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9390
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsArchiveCampaign({
9391
+ client,
9392
+ path: { accountId, campaignId },
9393
+ query: { workspaceId },
9394
+ headers: { "idempotency-key": idempotencyKey },
9395
+ body: input,
9396
+ ...transport()
9397
+ })));
9398
+ };
9399
+ const setCampaignBudget = (accountId, campaignId, input, options = {}) => {
9400
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9401
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetCampaignBudget({
9402
+ client,
9403
+ path: { accountId, campaignId },
9404
+ query: { workspaceId },
9405
+ headers: { "idempotency-key": idempotencyKey },
9406
+ body: input,
9407
+ ...transport()
9408
+ })));
9409
+ };
9410
+ const createAdGroup = (accountId, campaignId, input, options = {}) => {
9411
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9412
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsCreateAdGroup({
9413
+ client,
9414
+ path: { accountId, campaignId },
9415
+ query: { workspaceId },
9416
+ headers: { "idempotency-key": idempotencyKey },
9417
+ body: input,
9418
+ ...transport()
9419
+ })));
9420
+ };
9421
+ const attachAd = (accountId, adGroupId, input, options = {}) => {
9422
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9423
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsAttachAd({
9424
+ client,
9425
+ path: { accountId, adGroupId },
9426
+ query: { workspaceId },
9427
+ headers: { "idempotency-key": idempotencyKey },
9428
+ body: input,
9429
+ ...transport()
9430
+ })));
9431
+ };
9432
+ const setAdGroupBudget = (accountId, adGroupId, input, options = {}) => {
9433
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9434
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupBudget({
9435
+ client,
9436
+ path: { accountId, adGroupId },
9437
+ query: { workspaceId },
9438
+ headers: { "idempotency-key": idempotencyKey },
9439
+ body: input,
9440
+ ...transport()
9441
+ })));
9442
+ };
9443
+ const setAdGroupStatus = (accountId, adGroupId, input, options = {}) => {
9444
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9445
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdGroupStatus({
9446
+ client,
9447
+ path: { accountId, adGroupId },
9448
+ query: { workspaceId },
9449
+ headers: { "idempotency-key": idempotencyKey },
9450
+ body: input,
9451
+ ...transport()
9452
+ })));
9453
+ };
9454
+ const setAdStatus = (accountId, adId, input, options = {}) => {
9455
+ const idempotencyKey = options.idempotencyKey ?? crypto.randomUUID();
9456
+ return withIdempotencyKey(idempotencyKey, () => decode(AdOperation, adsSetAdStatus({
9457
+ client,
9458
+ path: { accountId, adId },
9459
+ query: { workspaceId },
9460
+ headers: { "idempotency-key": idempotencyKey },
9461
+ body: input,
9462
+ ...transport()
9463
+ })));
9464
+ };
8599
9465
  return {
8600
9466
  workspaceId,
8601
9467
  posts: {
@@ -9162,6 +10028,11 @@ function createPubNioClient({
9162
10028
  body: { ...input, workspaceId },
9163
10029
  ...transport()
9164
10030
  })),
10031
+ connectApiKey: (input) => decode(AdApiKeyConnectResult, adsConnectApiKeyAccount({
10032
+ client,
10033
+ body: { ...input, workspaceId },
10034
+ ...transport()
10035
+ })),
9165
10036
  select: (accountId) => decode(AdAccountSelection, adsSelectAccount({
9166
10037
  client,
9167
10038
  path: { accountId },
@@ -9177,6 +10048,10 @@ function createPubNioClient({
9177
10048
  campaigns: listAdCampaigns,
9178
10049
  iterateCampaigns: (options, iteration) => iterateItems(listAdCampaigns, options ?? {}, iteration),
9179
10050
  accountCampaigns: listAdAccountCampaigns,
10051
+ adGroups: listAdGroups,
10052
+ iterateAdGroups: (options, iteration) => iterateItems(listAdGroups, options ?? {}, iteration),
10053
+ ads: listAds,
10054
+ iterateAds: (options, iteration) => iterateItems(listAds, options ?? {}, iteration),
9180
10055
  iterateAccountCampaigns: (accountId, options, iteration) => iterateItems((query) => listAdAccountCampaigns(accountId, query), options ?? {}, iteration),
9181
10056
  tree: listAdTree,
9182
10057
  iterateTree: (options, iteration) => iterateItems(listAdTree, options ?? {}, iteration),
@@ -9187,6 +10062,8 @@ function createPubNioClient({
9187
10062
  ...transport()
9188
10063
  })),
9189
10064
  creatives: listAdCreatives,
10065
+ creative: getAdCreative,
10066
+ createCreative: createAdCreative,
9190
10067
  iterateCreatives: (options, iteration) => iterateItems(listAdCreatives, options ?? {}, iteration),
9191
10068
  insights: listAdInsights,
9192
10069
  iterateInsights: (options, iteration) => iterateItems(listAdInsights, options ?? {}, iteration),
@@ -9203,9 +10080,22 @@ function createPubNioClient({
9203
10080
  setKillSwitch: setAdKillSwitch,
9204
10081
  operation: readAdOperation,
9205
10082
  validateBoost: validateAdBoost,
10083
+ validateCampaignPlan: validateAdCampaignPlan,
10084
+ createCampaignPlan: createAdCampaignPlan,
10085
+ campaignPlan: readAdCampaignPlan,
10086
+ campaignPlans: listAdCampaignPlans,
10087
+ iterateCampaignPlans: (options, iteration) => iterateItems(listAdCampaignPlans, options ?? {}, iteration),
9206
10088
  createBoost: createAdBoost,
9207
10089
  activateCampaign: activateAdCampaign,
9208
- pauseCampaign: pauseAdCampaign
10090
+ pauseCampaign: pauseAdCampaign,
10091
+ archiveCampaign: archiveAdCampaign,
10092
+ duplicateCampaign: duplicateAdCampaign,
10093
+ setCampaignBudget,
10094
+ setAdGroupBudget,
10095
+ setAdGroupStatus,
10096
+ attachAd,
10097
+ createAdGroup,
10098
+ setAdStatus
9209
10099
  },
9210
10100
  analytics: {
9211
10101
  post: (postId, options = {}) => decode(PostAnalytics, analyticsPostsGet({
@@ -10350,6 +11240,53 @@ function adsAccountsInfiniteOptions(workspace, { state, limit } = {}) {
10350
11240
  getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
10351
11241
  });
10352
11242
  }
11243
+ function adsCampaignPlanOptions(workspace, planId) {
11244
+ return import_solid_query.queryOptions({
11245
+ queryKey: [
11246
+ ...adsKey(workspace.workspaceId),
11247
+ "plans",
11248
+ "detail",
11249
+ planId
11250
+ ],
11251
+ queryFn: () => workspace.ads.campaignPlan(planId)
11252
+ });
11253
+ }
11254
+ function adsValidateCampaignPlanMutation(workspace) {
11255
+ return import_solid_query.mutationOptions({
11256
+ mutationFn: (input) => workspace.ads.validateCampaignPlan(input)
11257
+ });
11258
+ }
11259
+ function adsCreateCampaignPlanMutation(workspace) {
11260
+ return import_solid_query.mutationOptions({
11261
+ mutationFn: ({
11262
+ input,
11263
+ idempotencyKey
11264
+ }) => workspace.ads.createCampaignPlan(input, { idempotencyKey }),
11265
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11266
+ for (const domain of ["campaigns", "plans", "operations"])
11267
+ queryClient.invalidateQueries({
11268
+ queryKey: [...adsKey(workspace.workspaceId), domain]
11269
+ });
11270
+ }
11271
+ });
11272
+ }
11273
+ function adsCampaignPlansInfiniteOptions(workspace, { status, limit } = {}) {
11274
+ return import_solid_query.infiniteQueryOptions({
11275
+ queryKey: [
11276
+ ...adsKey(workspace.workspaceId),
11277
+ "plans",
11278
+ "infinite",
11279
+ { status, limit }
11280
+ ],
11281
+ initialPageParam: undefined,
11282
+ queryFn: ({ pageParam }) => workspace.ads.campaignPlans({
11283
+ status,
11284
+ cursor: pageParam,
11285
+ limit
11286
+ }),
11287
+ getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
11288
+ });
11289
+ }
10353
11290
  function adsCampaignsInfiniteOptions(workspace, {
10354
11291
  accountId,
10355
11292
  provider,
@@ -10400,6 +11337,68 @@ function adsTreeInfiniteOptions(workspace, { accountId, campaignId, limit } = {}
10400
11337
  getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
10401
11338
  });
10402
11339
  }
11340
+ function adsAdGroupsInfiniteOptions(workspace, {
11341
+ accountId,
11342
+ campaignId,
11343
+ provider,
11344
+ status,
11345
+ from,
11346
+ to,
11347
+ limit
11348
+ } = {}) {
11349
+ return import_solid_query.infiniteQueryOptions({
11350
+ queryKey: [
11351
+ ...adsKey(workspace.workspaceId),
11352
+ "ad-groups",
11353
+ "infinite",
11354
+ { accountId, campaignId, provider, status, from, to, limit }
11355
+ ],
11356
+ initialPageParam: undefined,
11357
+ queryFn: ({ pageParam }) => workspace.ads.adGroups({
11358
+ accountId,
11359
+ campaignId,
11360
+ provider,
11361
+ status,
11362
+ from,
11363
+ to,
11364
+ cursor: pageParam,
11365
+ limit
11366
+ }),
11367
+ getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
11368
+ });
11369
+ }
11370
+ function adsAdsInfiniteOptions(workspace, {
11371
+ accountId,
11372
+ campaignId,
11373
+ adGroupId,
11374
+ provider,
11375
+ status,
11376
+ from,
11377
+ to,
11378
+ limit
11379
+ } = {}) {
11380
+ return import_solid_query.infiniteQueryOptions({
11381
+ queryKey: [
11382
+ ...adsKey(workspace.workspaceId),
11383
+ "ads",
11384
+ "infinite",
11385
+ { accountId, campaignId, adGroupId, provider, status, from, to, limit }
11386
+ ],
11387
+ initialPageParam: undefined,
11388
+ queryFn: ({ pageParam }) => workspace.ads.ads({
11389
+ accountId,
11390
+ campaignId,
11391
+ adGroupId,
11392
+ provider,
11393
+ status,
11394
+ from,
11395
+ to,
11396
+ cursor: pageParam,
11397
+ limit
11398
+ }),
11399
+ getNextPageParam: (lastPage) => lastPage.hasMore ? lastPage.nextCursor : undefined
11400
+ });
11401
+ }
10403
11402
  function adsCreativesInfiniteOptions(workspace, { accountId, adId, limit } = {}) {
10404
11403
  return import_solid_query.infiniteQueryOptions({
10405
11404
  queryKey: [
@@ -10474,6 +11473,19 @@ function adsConnectMutation(workspace) {
10474
11473
  }
10475
11474
  });
10476
11475
  }
11476
+ function adsConnectApiKeyMutation(workspace) {
11477
+ return import_solid_query.mutationOptions({
11478
+ mutationFn: (input) => workspace.ads.connectApiKey(input),
11479
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11480
+ queryClient.invalidateQueries({
11481
+ queryKey: adsKey(workspace.workspaceId)
11482
+ });
11483
+ queryClient.invalidateQueries({
11484
+ queryKey: accountsKey(workspace.workspaceId)
11485
+ });
11486
+ }
11487
+ });
11488
+ }
10477
11489
  function adsSelectMutation(workspace) {
10478
11490
  return import_solid_query.mutationOptions({
10479
11491
  mutationFn: (accountId) => workspace.ads.select(accountId),
@@ -10597,6 +11609,8 @@ function invalidateCampaignWrite(queryClient, workspaceId) {
10597
11609
  for (const domain of [
10598
11610
  "accounts",
10599
11611
  "campaigns",
11612
+ "ad-groups",
11613
+ "ads",
10600
11614
  "tree",
10601
11615
  "insights",
10602
11616
  "operations"
@@ -10621,6 +11635,21 @@ function adsActivateCampaignMutation(workspace) {
10621
11635
  }
10622
11636
  });
10623
11637
  }
11638
+ function adsArchiveCampaignMutation(workspace) {
11639
+ return import_solid_query.mutationOptions({
11640
+ mutationFn: ({
11641
+ accountId,
11642
+ campaignId,
11643
+ input,
11644
+ idempotencyKey
11645
+ }) => workspace.ads.archiveCampaign(accountId, campaignId, input, {
11646
+ idempotencyKey
11647
+ }),
11648
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11649
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11650
+ }
11651
+ });
11652
+ }
10624
11653
  function adsPauseCampaignMutation(workspace) {
10625
11654
  return import_solid_query.mutationOptions({
10626
11655
  mutationFn: ({
@@ -10636,6 +11665,119 @@ function adsPauseCampaignMutation(workspace) {
10636
11665
  }
10637
11666
  });
10638
11667
  }
11668
+ function adsCreateAdGroupMutation(workspace) {
11669
+ return import_solid_query.mutationOptions({
11670
+ mutationFn: ({
11671
+ accountId,
11672
+ campaignId,
11673
+ input,
11674
+ idempotencyKey
11675
+ }) => workspace.ads.createAdGroup(accountId, campaignId, input, {
11676
+ idempotencyKey
11677
+ }),
11678
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11679
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11680
+ }
11681
+ });
11682
+ }
11683
+ function adsCreateCreativeMutation(workspace) {
11684
+ return import_solid_query.mutationOptions({
11685
+ mutationFn: ({
11686
+ accountId,
11687
+ input,
11688
+ idempotencyKey
11689
+ }) => workspace.ads.createCreative(accountId, input, { idempotencyKey }),
11690
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11691
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11692
+ }
11693
+ });
11694
+ }
11695
+ function adsDuplicateCampaignMutation(workspace) {
11696
+ return import_solid_query.mutationOptions({
11697
+ mutationFn: ({
11698
+ accountId,
11699
+ campaignId,
11700
+ input,
11701
+ idempotencyKey
11702
+ }) => workspace.ads.duplicateCampaign(accountId, campaignId, input, {
11703
+ idempotencyKey
11704
+ }),
11705
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11706
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11707
+ }
11708
+ });
11709
+ }
11710
+ function adsAttachAdMutation(workspace) {
11711
+ return import_solid_query.mutationOptions({
11712
+ mutationFn: ({
11713
+ accountId,
11714
+ adGroupId,
11715
+ input,
11716
+ idempotencyKey
11717
+ }) => workspace.ads.attachAd(accountId, adGroupId, input, { idempotencyKey }),
11718
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11719
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11720
+ }
11721
+ });
11722
+ }
11723
+ function adsSetCampaignBudgetMutation(workspace) {
11724
+ return import_solid_query.mutationOptions({
11725
+ mutationFn: ({
11726
+ accountId,
11727
+ campaignId,
11728
+ input,
11729
+ idempotencyKey
11730
+ }) => workspace.ads.setCampaignBudget(accountId, campaignId, input, {
11731
+ idempotencyKey
11732
+ }),
11733
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11734
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11735
+ }
11736
+ });
11737
+ }
11738
+ function adsSetAdGroupBudgetMutation(workspace) {
11739
+ return import_solid_query.mutationOptions({
11740
+ mutationFn: ({
11741
+ accountId,
11742
+ adGroupId,
11743
+ input,
11744
+ idempotencyKey
11745
+ }) => workspace.ads.setAdGroupBudget(accountId, adGroupId, input, {
11746
+ idempotencyKey
11747
+ }),
11748
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11749
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11750
+ }
11751
+ });
11752
+ }
11753
+ function adsSetAdGroupStatusMutation(workspace) {
11754
+ return import_solid_query.mutationOptions({
11755
+ mutationFn: ({
11756
+ accountId,
11757
+ adGroupId,
11758
+ input,
11759
+ idempotencyKey
11760
+ }) => workspace.ads.setAdGroupStatus(accountId, adGroupId, input, {
11761
+ idempotencyKey
11762
+ }),
11763
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11764
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11765
+ }
11766
+ });
11767
+ }
11768
+ function adsSetAdStatusMutation(workspace) {
11769
+ return import_solid_query.mutationOptions({
11770
+ mutationFn: ({
11771
+ accountId,
11772
+ adId,
11773
+ input,
11774
+ idempotencyKey
11775
+ }) => workspace.ads.setAdStatus(accountId, adId, input, { idempotencyKey }),
11776
+ onSuccess: (_data, _input, _result, { client: queryClient }) => {
11777
+ invalidateCampaignWrite(queryClient, workspace.workspaceId);
11778
+ }
11779
+ });
11780
+ }
10639
11781
  function queuesInfiniteOptions(workspace, { limit, accountId } = {}) {
10640
11782
  return import_solid_query.infiniteQueryOptions({
10641
11783
  queryKey: [