@adport/provider-reddit 0.9.0 → 0.11.0

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
@@ -1330,6 +1330,7 @@ import { z as z10 } from "zod";
1330
1330
 
1331
1331
  // src/catalog-feed-schemas.ts
1332
1332
  import { z as z9 } from "zod";
1333
+ import { hostedFeedUrl } from "@adport/core";
1333
1334
 
1334
1335
  // src/catalog-feed-timezones.ts
1335
1336
  var REDDIT_CATALOG_TIMEZONES = /* @__PURE__ */ new Set([
@@ -1970,7 +1971,7 @@ var feedCreate = catalogInput.omit({ account_id: true }).extend({
1970
1971
  acknowledge_shared_effects: z9.literal(true),
1971
1972
  acknowledge_automatic_processing: z9.literal(true)
1972
1973
  }).strict();
1973
- var feedUpdate = selected.extend({
1974
+ var feedUpdateFields = selected.extend({
1974
1975
  name: name2.optional(),
1975
1976
  url: sourceUrl.optional(),
1976
1977
  mode: feedMode.optional(),
@@ -1979,7 +1980,10 @@ var feedUpdate = selected.extend({
1979
1980
  expected_configuration_hash: hash,
1980
1981
  acknowledge_shared_effects: z9.literal(true),
1981
1982
  acknowledge_automatic_processing: z9.literal(true).optional()
1982
- }).strict().refine((input) => ["name", "url", "mode", "schedule", "username", "password"].some((key) => Object.hasOwn(input, key)), "Provide a feed field").refine((input) => !["url", "mode", "schedule", "username", "password"].some((key) => Object.hasOwn(input, key)) || input.acknowledge_automatic_processing === true, "Source/mode/schedule/authentication changes require automatic-processing acknowledgement");
1983
+ }).strict();
1984
+ var feedUpdate = feedUpdateFields.refine((input) => ["name", "url", "mode", "schedule", "username", "password"].some((key) => Object.hasOwn(input, key)), "Provide a feed field").refine((input) => !["url", "mode", "schedule", "username", "password"].some((key) => Object.hasOwn(input, key)) || input.acknowledge_automatic_processing === true, "Source/mode/schedule/authentication changes require automatic-processing acknowledgement");
1985
+ var hostedFeedCreate = feedCreate.omit({ username: true, password: true }).extend({ url: hostedFeedUrl });
1986
+ var hostedFeedUpdate = feedUpdateFields.omit({ username: true, password: true }).extend({ url: hostedFeedUrl.optional() });
1983
1987
  var feedStatus = selected.extend({ is_paused: z9.boolean(), expected_configuration_hash: hash, acknowledge_shared_effects: z9.literal(true), acknowledge_automatic_processing: z9.literal(true) }).strict();
1984
1988
  var feedDelete = selected.extend({ expected_configuration_hash: hash, acknowledge_shared_effects: z9.literal(true), acknowledge_delete_feed: z9.literal(true) }).strict();
1985
1989
 
@@ -3039,8 +3043,8 @@ function redditCatalogFeedTools(provider) {
3039
3043
  return [
3040
3044
  defineTool5({ ...read, name: "reddit_catalog_feeds", description: "Browse feeds in one explicitly granted Business catalog. Native lists are unpaged; Adport bounds to5,000 and snapshot-pages locally. Source paths, query values and authentication stay private.", input: feedList, pagination: { cursorInput: "cursor" }, handler: (input) => provider.catalogFeeds.list(input) }),
3041
3045
  defineTool5({ ...read, name: "reddit_get_catalog_feed", description: "Read one exact catalog/feed with safe source origin/fingerprint, reported schedule and configuration_hash. Missing schedule fields remain unavailable; authentication values are never returned.", input: feedInput, handler: (input) => provider.catalogFeeds.get(input) }),
3042
- guardedWriteTool5({ name: "reddit_create_catalog_feed", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "create", destructive: true, description: "Create a native catalog feed with explicit REPLACE/UPDATE and schedule/null, fresh catalog hash and shared/automatic-processing acknowledgements. Can start ingestion and affect existing ads. Private source/name arguments stay out of widget approvals; apply through the agent. Readback is not ingestion/authentication proof.", payload: feedCreate, sensitiveInputs: ["url", "username", "password", "name"] }),
3043
- guardedWriteTool5({ name: "reddit_update_catalog_feed", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "update", destructive: true, description: "Change selected native feed fields using current configuration_hash. Omitted source/authentication fields are not sent; supplied schedule replaces timing. Source/mode/auth/schedule changes need automatic-processing acknowledgement. Private source/name arguments stay out of widget approvals; no automatic replay.", payload: feedUpdate, sensitiveInputs: ["url", "username", "password", "name"] }),
3046
+ guardedWriteTool5({ name: "reddit_create_catalog_feed", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "create", destructive: true, description: "Create a native catalog feed with explicit REPLACE/UPDATE and schedule/null, fresh catalog hash and shared/automatic-processing acknowledgements. Can start ingestion and affect existing ads. Private source/name arguments stay out of widget approvals; apply through the agent. Readback is not ingestion/authentication proof.", payload: feedCreate, hosted: { payload: hostedFeedCreate, description: "Create a feed from a public HTTPS URL in the selected Reddit catalog. Choose REPLACE or UPDATE and confirm processing and effects on existing products and ads." }, sensitiveInputs: ["url", "username", "password", "name"] }),
3047
+ guardedWriteTool5({ name: "reddit_update_catalog_feed", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "update", destructive: true, description: "Change selected native feed fields using current configuration_hash. Omitted source/authentication fields are not sent; supplied schedule replaces timing. Source/mode/auth/schedule changes need automatic-processing acknowledgement. Private source/name arguments stay out of widget approvals; no automatic replay.", payload: feedUpdate, hosted: { payload: hostedFeedUpdate, description: "Update selected Reddit feed settings using its current configuration hash. A replacement source must be a public HTTPS URL. Source, mode and schedule changes require acknowledging processing and can affect existing products and ads." }, sensitiveInputs: ["url", "username", "password", "name"] }),
3044
3048
  guardedWriteTool5({ name: "reddit_set_catalog_feed_schedule_status", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "update", destructive: true, description: "Pause or resume one verified feed schedule with a current hash and shared/automatic-processing acknowledgements. Uses the opposite known pause state and preserves reported timing/source/mode. Does not cancel or undo an existing import.", payload: feedStatus }),
3045
3049
  guardedWriteTool5({ name: "reddit_delete_catalog_feed", namespace: "reddit", provider: "reddit", catalog: { category: "creatives", exposure: "specialist" }, kind: "remove", destructive: true, description: "Permanently delete an exact writable catalog/feed using its current configuration_hash and shared/deletion acknowledgements. Checks native204 acknowledgement and exactGET404. Other errors remain errors; imported products/ads are not frozen or automatically removed.", payload: feedDelete })
3046
3050
  ];
@@ -3053,7 +3057,7 @@ function redditCatalogProductTools(provider) {
3053
3057
  const catalog = { category: "creatives", exposure: "specialist" }, write2 = { namespace: "reddit", provider: "reddit", catalog };
3054
3058
  return [
3055
3059
  defineTool6({ name: "reddit_catalog_product_context", namespace: "reddit", catalog, annotations: { readOnly: true }, presentation: "records", description: "Read up to 100 exact external SKUs in one granted Business catalog, exhausting scoped native pagination. Returns a selection_hash and present/absent state for manual product changes; not a global inventory.", input: productContext, output: z18.looseObject({ records: z18.array(z18.record(z18.string(), z18.unknown())) }), handler: (input) => provider.catalogProducts.context(input) }),
3056
- guardedWriteTool6({ ...write2, name: "reddit_create_catalog_products", kind: "create", destructive: false, description: "Create up to 100 absent SKUs through native batch upsert with fresh selection_hash and complete product copy/price/URLs. Rechecks absence, uses normal approval and independent readback. Native concurrent upsert races and feed overwrites remain possible.", payload: productsCreate }),
3060
+ guardedWriteTool6({ ...write2, name: "reddit_create_catalog_products", kind: "create", destructive: true, description: "Create up to 100 absent SKUs through native batch upsert with fresh selection_hash and complete product copy/price/URLs. Rechecks absence, uses normal approval and independent readback. Native concurrent upsert races and feed overwrites remain possible.", payload: productsCreate }),
3057
3061
  guardedWriteTool6({ ...write2, name: "reddit_update_catalog_products", kind: "update", destructive: true, description: "Update selected fields on up to 100 existing external SKUs with current selection_hash. Merges all known writable fields, refuses unknown configuration, verifies complete readback and reports uncertain/partial outcomes without replay.", payload: productsUpdate }),
3058
3062
  guardedWriteTool6({ ...write2, name: "reddit_delete_catalog_products", kind: "remove", destructive: true, description: "Permanently delete up to 100 exact present external SKUs with selection_hash and explicit acknowledgement. Verifies per-SKU native receipts and exhausted absence readback. Feeds can recreate products; internal Reddit IDs are not SKUs.", payload: productsDelete })
3059
3063
  ];