@happyvertical/smrt-content 0.57.36 → 0.57.38

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.
Files changed (40) hide show
  1. package/AGENTS.md +1 -0
  2. package/dist/chunks/{content-corrections-BYT3Qdw5.js → content-corrections-QyinPkfN.js} +10 -3
  3. package/dist/chunks/content-corrections-QyinPkfN.js.map +1 -0
  4. package/dist/chunks/{content-query-Clu2wO7c.js → content-query-Ci31zT0E.js} +36 -37
  5. package/dist/chunks/content-query-Ci31zT0E.js.map +1 -0
  6. package/dist/chunks/{content-reviews-B6h2aJ9m.js → content-reviews-H9ANWEi7.js} +9 -3
  7. package/dist/chunks/content-reviews-H9ANWEi7.js.map +1 -0
  8. package/dist/chunks/{content-versions-CfzXQy_N.js → content-versions-lvpWUFzP.js} +10 -4
  9. package/dist/chunks/content-versions-lvpWUFzP.js.map +1 -0
  10. package/dist/chunks/{contents-D9USRXHr.js → contents-CAiRy-Ec.js} +2 -2
  11. package/dist/chunks/contents-CAiRy-Ec.js.map +1 -0
  12. package/dist/content-contribution.d.ts.map +1 -1
  13. package/dist/content-contributor.d.ts.map +1 -1
  14. package/dist/content-correction.d.ts.map +1 -1
  15. package/dist/content-query.d.ts +2 -2
  16. package/dist/content-query.d.ts.map +1 -1
  17. package/dist/content-review.d.ts.map +1 -1
  18. package/dist/content-types.d.ts +8 -0
  19. package/dist/content-types.d.ts.map +1 -1
  20. package/dist/content-version.d.ts.map +1 -1
  21. package/dist/content.d.ts.map +1 -1
  22. package/dist/contents.d.ts.map +1 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +502 -193
  26. package/dist/index.js.map +1 -1
  27. package/dist/manifest.json +795 -59
  28. package/dist/recipes.d.ts +423 -0
  29. package/dist/recipes.d.ts.map +1 -0
  30. package/dist/server.js +1 -1
  31. package/dist/smrt-knowledge.json +613 -79
  32. package/dist/svelte/content-list-controller.d.ts +7 -0
  33. package/dist/svelte/content-list-controller.d.ts.map +1 -1
  34. package/dist/svelte/content-list-controller.js +16 -0
  35. package/package.json +24 -24
  36. package/dist/chunks/content-corrections-BYT3Qdw5.js.map +0 -1
  37. package/dist/chunks/content-query-Clu2wO7c.js.map +0 -1
  38. package/dist/chunks/content-reviews-B6h2aJ9m.js.map +0 -1
  39. package/dist/chunks/content-versions-CfzXQy_N.js.map +0 -1
  40. package/dist/chunks/contents-D9USRXHr.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
2
- import { $ as parseContentReviewResponse, A as normalizeContentTransparency, B as getAcceptedContentReviewStatuses, C as resolveContentTenantReadScope, F as smrtContentReviewPrompt, G as getContentReviewProfile, H as getContentReviewKind, I as smrtContentThumbnailAIGeneratePrompt, J as getEffectiveContentGovernanceConfig, K as getContentReviewProfileKeys, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewPolicies, V as getContentGovernanceConfig, W as getContentReviewPolicy, X as hasStaticContentGovernancePolicy, Y as getFallbackPolicyKind, Z as hasStaticContentGovernanceProfile, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as isAssetAssociable, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as resetContentGovernanceConfig, f as DATA_QUERY_MAX_JSON_STRING_LENGTH, g as MAX_CONTENT_QUERY_OR_BRANCHES, h as DATA_QUERY_MAX_WARNING_LENGTH, i as CONTENT_QUERY_EXCLUDED_FIELD_IDS, it as ContentAsset, j as ContentReferences, k as isMissingTableError, l as DATA_QUERY_FORBIDDEN_JSON_KEYS, m as DATA_QUERY_MAX_WARNINGS, n as CONTENT_QUERY_DEFAULT_PAGE_LIMIT, nt as resolveEffectiveContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isMetadataAccessor, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewRequirements, r as CONTENT_QUERY_DEFAULT_SORT, rt as ContentAssetCollection, s as CONTENT_QUERY_MAX_RESULT_BYTES, t as CONTENT_QUERY_CLASS_NAME, tt as resolveConfiguredContentGovernance, u as DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, v as buildContentQuerySchema, w as Content, x as executeContentQuery, y as buildDataQuerySchemaForClass, z as configureContentGovernance } from "./chunks/content-query-Clu2wO7c.js";
2
+ import { $ as parseContentReviewResponse, A as normalizeContentTransparency, B as getAcceptedContentReviewStatuses, C as resolveContentTenantReadScope, F as smrtContentReviewPrompt, G as getContentReviewProfile, H as getContentReviewKind, I as smrtContentThumbnailAIGeneratePrompt, J as getEffectiveContentGovernanceConfig, K as getContentReviewProfileKeys, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewPolicies, V as getContentGovernanceConfig, W as getContentReviewPolicy, X as hasStaticContentGovernancePolicy, Y as getFallbackPolicyKind, Z as hasStaticContentGovernanceProfile, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as isAssetAssociable, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as resetContentGovernanceConfig, f as DATA_QUERY_MAX_JSON_STRING_LENGTH, g as MAX_CONTENT_QUERY_OR_BRANCHES, h as DATA_QUERY_MAX_WARNING_LENGTH, i as CONTENT_QUERY_EXCLUDED_FIELD_IDS, it as ContentAsset, j as ContentReferences, k as isMissingTableError, l as DATA_QUERY_FORBIDDEN_JSON_KEYS, m as DATA_QUERY_MAX_WARNINGS, n as CONTENT_QUERY_DEFAULT_PAGE_LIMIT, nt as resolveEffectiveContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isMetadataAccessor, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewRequirements, r as CONTENT_QUERY_DEFAULT_SORT, rt as ContentAssetCollection, s as CONTENT_QUERY_MAX_RESULT_BYTES, t as CONTENT_QUERY_CLASS_NAME, tt as resolveConfiguredContentGovernance, u as DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, v as buildContentQuerySchema, w as Content, x as executeContentQuery, y as buildDataQuerySchemaForClass, z as configureContentGovernance } from "./chunks/content-query-Ci31zT0E.js";
3
3
  import { BODY_MAIN_IMAGE_ATTRIBUTE, BODY_THUMBNAIL_ATTRIBUTE, DEFAULT_CONTENT_BODY_FORMAT, THUMBNAIL_WIDE_ASPECT_RATIO, bodyHasImage, bodyHasThumbnail, bodyToEditorHtml, editorHtmlToBody, extractBodyImages, htmlToMarkdown, placeThumbnailInBody, removeThumbnailFromBody, renderContentBodyHtml, renderMarkdownToHtml, resolveBodyFormat, resolveBodyMainPicture, sanitizeHtml, setBodyMainImage, stripHtml, thumbnailPlacementForSize } from "./body-format.js";
4
- import { r as ContentCorrection, t as ContentCorrectionCollection } from "./chunks/content-corrections-BYT3Qdw5.js";
4
+ import { r as ContentCorrection, t as ContentCorrectionCollection } from "./chunks/content-corrections-QyinPkfN.js";
5
5
  import { contentEditorAssistantContextToChatProps, createContentEditorAssistantContext, sanitizeContentEditorAssistantFieldUpdates } from "./content-editor-assistant.js";
6
- import { i as fetchSafeRemoteUrlInternal, r as fetchSafeRemoteUrl, t as Contents } from "./chunks/contents-D9USRXHr.js";
7
- import { r as ContentReview, t as ContentReviewCollection } from "./chunks/content-reviews-B6h2aJ9m.js";
8
- import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-CfzXQy_N.js";
6
+ import { i as fetchSafeRemoteUrlInternal, r as fetchSafeRemoteUrl, t as Contents } from "./chunks/contents-CAiRy-Ec.js";
7
+ import { r as ContentReview, t as ContentReviewCollection } from "./chunks/content-reviews-H9ANWEi7.js";
8
+ import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-lvpWUFzP.js";
9
9
  import { evaluateContentPublishReadiness } from "./publish-readiness.js";
10
- import { ObjectRegistry, SmrtCollection, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
10
+ import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
11
11
  import { AssetCollection, AssetStatusCollection, AssetTypeCollection } from "@happyvertical/smrt-assets";
12
12
  import { definePrompt, resolvePrompt } from "@happyvertical/smrt-prompts";
13
13
  import { TenantScoped, getCurrentTenant, isSuperAdminBypass, isSystemContext, isTenancyEnabled, tenantId } from "@happyvertical/smrt-tenancy";
@@ -777,7 +777,7 @@ function evaluateContributionIntake(options) {
777
777
  };
778
778
  }
779
779
  //#endregion
780
- //#region src/content-contribution.ts
780
+ //#region src/content-types.ts
781
781
  var __defProp$12 = Object.defineProperty;
782
782
  var __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor;
783
783
  var __defNormalProp$12 = (obj, key, value) => key in obj ? __defProp$12(obj, key, {
@@ -793,6 +793,96 @@ var __decorateClass$12 = (decorators, target, key, kind) => {
793
793
  return result;
794
794
  };
795
795
  var __publicField$12 = (obj, key, value) => __defNormalProp$12(obj, typeof key !== "symbol" ? key + "" : key, value);
796
+ var Article = class extends Content {
797
+ constructor(options = {}) {
798
+ super(options);
799
+ }
800
+ };
801
+ __publicField$12(Article, "__smrtPackage__", "@happyvertical/smrt-content");
802
+ Article = __decorateClass$12([smrt({
803
+ tableStrategy: "sti",
804
+ api: false,
805
+ mcp: false,
806
+ cli: false
807
+ })], Article);
808
+ var ContentDocument = class extends Content {
809
+ constructor(options = {}) {
810
+ super(options);
811
+ }
812
+ };
813
+ __publicField$12(ContentDocument, "__smrtPackage__", "@happyvertical/smrt-content");
814
+ ContentDocument = __decorateClass$12([smrt({
815
+ tableStrategy: "sti",
816
+ api: false,
817
+ mcp: false,
818
+ cli: false
819
+ })], ContentDocument);
820
+ function parseOptionalDate(value) {
821
+ if (!value) return null;
822
+ if (value instanceof Date) return value;
823
+ const parsed = new Date(value);
824
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
825
+ }
826
+ var Mirror = class extends Content {
827
+ feedSourceId = null;
828
+ sourceGuid = null;
829
+ sourceName = null;
830
+ sourceHomepageUrl = null;
831
+ externalUrl = null;
832
+ originalPublishedAt = null;
833
+ dedupeKey = null;
834
+ constructor(options = {}) {
835
+ super(options);
836
+ if (options.feedSourceId !== void 0) this.feedSourceId = options.feedSourceId;
837
+ if (options.sourceGuid !== void 0) this.sourceGuid = options.sourceGuid;
838
+ if (options.sourceName !== void 0) this.sourceName = options.sourceName;
839
+ if (options.sourceHomepageUrl !== void 0) this.sourceHomepageUrl = options.sourceHomepageUrl;
840
+ if (options.externalUrl !== void 0) this.externalUrl = options.externalUrl;
841
+ if (options.originalPublishedAt !== void 0) this.originalPublishedAt = parseOptionalDate(options.originalPublishedAt);
842
+ if (options.dedupeKey !== void 0) this.dedupeKey = options.dedupeKey;
843
+ }
844
+ transformJSON(json) {
845
+ return {
846
+ ...json,
847
+ feedSourceId: this.feedSourceId,
848
+ sourceGuid: this.sourceGuid,
849
+ sourceName: this.sourceName,
850
+ sourceHomepageUrl: this.sourceHomepageUrl,
851
+ externalUrl: this.externalUrl,
852
+ originalPublishedAt: this.originalPublishedAt?.toISOString() ?? null,
853
+ dedupeKey: this.dedupeKey
854
+ };
855
+ }
856
+ };
857
+ __publicField$12(Mirror, "__smrtPackage__", "@happyvertical/smrt-content");
858
+ __decorateClass$12([foreignKey("ContentFeedSource")], Mirror.prototype, "feedSourceId", 2);
859
+ Mirror = __decorateClass$12([smrt({
860
+ tableStrategy: "sti",
861
+ api: false,
862
+ mcp: false,
863
+ cli: false
864
+ })], Mirror);
865
+ function resolveContentMetaType(type) {
866
+ const subclass = type === "article" ? Article : type === "document" ? ContentDocument : type === "mirror" ? Mirror : Content;
867
+ return ObjectRegistry.getClassByConstructor(subclass)?.qualifiedName ?? `@happyvertical/smrt-content:${subclass.name}`;
868
+ }
869
+ //#endregion
870
+ //#region src/content-contribution.ts
871
+ var __defProp$11 = Object.defineProperty;
872
+ var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor;
873
+ var __defNormalProp$11 = (obj, key, value) => key in obj ? __defProp$11(obj, key, {
874
+ enumerable: true,
875
+ configurable: true,
876
+ writable: true,
877
+ value
878
+ }) : obj[key] = value;
879
+ var __decorateClass$11 = (decorators, target, key, kind) => {
880
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target;
881
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
882
+ if (kind && result) __defProp$11(target, key, result);
883
+ return result;
884
+ };
885
+ var __publicField$11 = (obj, key, value) => __defNormalProp$11(obj, typeof key !== "symbol" ? key + "" : key, value);
796
886
  function parseMetadata$4(raw) {
797
887
  if (!raw) return {};
798
888
  if (typeof raw === "object") return { ...raw };
@@ -895,7 +985,7 @@ var ContentContribution = class extends SmrtObject {
895
985
  return ContentContributorCollection.create(this.options);
896
986
  }
897
987
  async getContentsCollection() {
898
- const { Contents } = await import("./chunks/contents-D9USRXHr.js").then((n) => n.n);
988
+ const { Contents } = await import("./chunks/contents-CAiRy-Ec.js").then((n) => n.n);
899
989
  return Contents.create({ db: this.db });
900
990
  }
901
991
  async getAssetCollection() {
@@ -1089,6 +1179,7 @@ var ContentContribution = class extends SmrtObject {
1089
1179
  const content = await (await this.getContentsCollection()).create({
1090
1180
  tenantId: this.tenantId,
1091
1181
  type: promotion.targetContentType,
1182
+ _meta_type: resolveContentMetaType(promotion.targetContentType),
1092
1183
  variant: promotion.targetContentVariant || null,
1093
1184
  source: "contribution",
1094
1185
  status: options.targetStatus || promotion.targetContentStatus || "draft",
@@ -1160,16 +1251,26 @@ var ContentContribution = class extends SmrtObject {
1160
1251
  };
1161
1252
  }
1162
1253
  };
1163
- __publicField$12(ContentContribution, "__smrtPackage__", "@happyvertical/smrt-content");
1164
- __decorateClass$12([foreignKey("ContentContributor", { required: true })], ContentContribution.prototype, "contributorId", 2);
1165
- __decorateClass$12([field({ required: true })], ContentContribution.prototype, "contributionTypeKey", 2);
1166
- __decorateClass$12([crossPackageRef("@happyvertical/smrt-messages:Message")], ContentContribution.prototype, "sourceMessageId", 2);
1167
- __decorateClass$12([foreignKey("Content", {
1254
+ __publicField$11(ContentContribution, "__smrtPackage__", "@happyvertical/smrt-content");
1255
+ __decorateClass$11([foreignKey("ContentContributor", { required: true }), field({ description: "The person who sent this in." })], ContentContribution.prototype, "contributorId", 2);
1256
+ __decorateClass$11([field({
1257
+ required: true,
1258
+ description: "What kind of submission it is, such as an article or a letter."
1259
+ })], ContentContribution.prototype, "contributionTypeKey", 2);
1260
+ __decorateClass$11([field({ description: "Where the submission stands, from submitted to approved, rejected or published." })], ContentContribution.prototype, "status", 2);
1261
+ __decorateClass$11([field({ description: "How it arrived: through the website or by email." })], ContentContribution.prototype, "channel", 2);
1262
+ __decorateClass$11([field({ description: "The headline the contributor gave it." })], ContentContribution.prototype, "title", 2);
1263
+ __decorateClass$11([field({ description: "A short summary of the submission." })], ContentContribution.prototype, "description", 2);
1264
+ __decorateClass$11([field({ description: "The full text as it was sent in." })], ContentContribution.prototype, "body", 2);
1265
+ __decorateClass$11([field({ description: "The name the contributor gave." })], ContentContribution.prototype, "contributorName", 2);
1266
+ __decorateClass$11([crossPackageRef("@happyvertical/smrt-messages:Message")], ContentContribution.prototype, "sourceMessageId", 2);
1267
+ __decorateClass$11([field({ description: "Notes from your team about this submission." })], ContentContribution.prototype, "editorNotes", 2);
1268
+ __decorateClass$11([foreignKey("Content", {
1168
1269
  nullable: true,
1169
1270
  onDelete: "SET NULL"
1170
1271
  })], ContentContribution.prototype, "promotedContentId", 2);
1171
- __decorateClass$12([tenantId({ nullable: true })], ContentContribution.prototype, "tenantId", 2);
1172
- ContentContribution = __decorateClass$12([TenantScoped({ mode: "optional" }), smrt({
1272
+ __decorateClass$11([tenantId({ nullable: true })], ContentContribution.prototype, "tenantId", 2);
1273
+ ContentContribution = __decorateClass$11([TenantScoped({ mode: "optional" }), smrt({
1173
1274
  tableName: "content_contributions",
1174
1275
  conflictColumns: ["id"],
1175
1276
  api: {
@@ -1223,21 +1324,21 @@ ContentContribution = __decorateClass$12([TenantScoped({ mode: "optional" }), sm
1223
1324
  })], ContentContribution);
1224
1325
  //#endregion
1225
1326
  //#region src/content-contribution-attachment.ts
1226
- var __defProp$11 = Object.defineProperty;
1227
- var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor;
1228
- var __defNormalProp$11 = (obj, key, value) => key in obj ? __defProp$11(obj, key, {
1327
+ var __defProp$10 = Object.defineProperty;
1328
+ var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor;
1329
+ var __defNormalProp$10 = (obj, key, value) => key in obj ? __defProp$10(obj, key, {
1229
1330
  enumerable: true,
1230
1331
  configurable: true,
1231
1332
  writable: true,
1232
1333
  value
1233
1334
  }) : obj[key] = value;
1234
- var __decorateClass$11 = (decorators, target, key, kind) => {
1235
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target;
1335
+ var __decorateClass$10 = (decorators, target, key, kind) => {
1336
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target;
1236
1337
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1237
- if (kind && result) __defProp$11(target, key, result);
1338
+ if (kind && result) __defProp$10(target, key, result);
1238
1339
  return result;
1239
1340
  };
1240
- var __publicField$11 = (obj, key, value) => __defNormalProp$11(obj, typeof key !== "symbol" ? key + "" : key, value);
1341
+ var __publicField$10 = (obj, key, value) => __defNormalProp$10(obj, typeof key !== "symbol" ? key + "" : key, value);
1241
1342
  function parseMetadata$3(raw) {
1242
1343
  if (!raw) return {};
1243
1344
  if (typeof raw === "object") return { ...raw };
@@ -1293,12 +1394,12 @@ var ContentContributionAttachment = class extends SmrtObject {
1293
1394
  };
1294
1395
  }
1295
1396
  };
1296
- __publicField$11(ContentContributionAttachment, "__smrtPackage__", "@happyvertical/smrt-content");
1297
- __decorateClass$11([foreignKey("ContentContribution", { required: true })], ContentContributionAttachment.prototype, "contributionId", 2);
1298
- __decorateClass$11([foreignKey("ContentContributionRevision")], ContentContributionAttachment.prototype, "revisionId", 2);
1299
- __decorateClass$11([crossPackageRef("@happyvertical/smrt-assets:Asset")], ContentContributionAttachment.prototype, "promotedAssetId", 2);
1300
- __decorateClass$11([tenantId({ nullable: true })], ContentContributionAttachment.prototype, "tenantId", 2);
1301
- ContentContributionAttachment = __decorateClass$11([TenantScoped({ mode: "optional" }), smrt({
1397
+ __publicField$10(ContentContributionAttachment, "__smrtPackage__", "@happyvertical/smrt-content");
1398
+ __decorateClass$10([foreignKey("ContentContribution", { required: true })], ContentContributionAttachment.prototype, "contributionId", 2);
1399
+ __decorateClass$10([foreignKey("ContentContributionRevision")], ContentContributionAttachment.prototype, "revisionId", 2);
1400
+ __decorateClass$10([crossPackageRef("@happyvertical/smrt-assets:Asset")], ContentContributionAttachment.prototype, "promotedAssetId", 2);
1401
+ __decorateClass$10([tenantId({ nullable: true })], ContentContributionAttachment.prototype, "tenantId", 2);
1402
+ ContentContributionAttachment = __decorateClass$10([TenantScoped({ mode: "optional" }), smrt({
1302
1403
  tableName: "content_contribution_attachments",
1303
1404
  conflictColumns: ["id"],
1304
1405
  api: { include: [
@@ -1320,21 +1421,21 @@ ContentContributionAttachment = __decorateClass$11([TenantScoped({ mode: "option
1320
1421
  //#endregion
1321
1422
  //#region src/content-contribution-attachments.ts
1322
1423
  var content_contribution_attachments_exports = /* @__PURE__ */ __exportAll({ ContentContributionAttachmentCollection: () => ContentContributionAttachmentCollection });
1323
- var __defProp$10 = Object.defineProperty;
1324
- var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor;
1325
- var __defNormalProp$10 = (obj, key, value) => key in obj ? __defProp$10(obj, key, {
1424
+ var __defProp$9 = Object.defineProperty;
1425
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1426
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, {
1326
1427
  enumerable: true,
1327
1428
  configurable: true,
1328
1429
  writable: true,
1329
1430
  value
1330
1431
  }) : obj[key] = value;
1331
- var __decorateClass$10 = (decorators, target, key, kind) => {
1332
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target;
1432
+ var __decorateClass$9 = (decorators, target, key, kind) => {
1433
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1333
1434
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1334
- if (kind && result) __defProp$10(target, key, result);
1435
+ if (kind && result) __defProp$9(target, key, result);
1335
1436
  return result;
1336
1437
  };
1337
- var __publicField$10 = (obj, key, value) => __defNormalProp$10(obj, typeof key !== "symbol" ? key + "" : key, value);
1438
+ var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
1338
1439
  var ContentContributionAttachmentCollection = class extends SmrtCollection {
1339
1440
  async listForContribution(contributionId) {
1340
1441
  return this.list({
@@ -1349,9 +1450,9 @@ var ContentContributionAttachmentCollection = class extends SmrtCollection {
1349
1450
  });
1350
1451
  }
1351
1452
  };
1352
- __publicField$10(ContentContributionAttachmentCollection, "__smrtPackage__", "@happyvertical/smrt-content");
1353
- __publicField$10(ContentContributionAttachmentCollection, "_itemClass", ContentContributionAttachment);
1354
- ContentContributionAttachmentCollection = __decorateClass$10([smrt({
1453
+ __publicField$9(ContentContributionAttachmentCollection, "__smrtPackage__", "@happyvertical/smrt-content");
1454
+ __publicField$9(ContentContributionAttachmentCollection, "_itemClass", ContentContributionAttachment);
1455
+ ContentContributionAttachmentCollection = __decorateClass$9([smrt({
1355
1456
  tableName: "content_contribution_attachments",
1356
1457
  conflictColumns: ["id"],
1357
1458
  api: { include: [
@@ -1375,21 +1476,21 @@ ContentContributionAttachmentCollection = __decorateClass$10([smrt({
1375
1476
  })], ContentContributionAttachmentCollection);
1376
1477
  //#endregion
1377
1478
  //#region src/content-contribution-revision.ts
1378
- var __defProp$9 = Object.defineProperty;
1379
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1380
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, {
1479
+ var __defProp$8 = Object.defineProperty;
1480
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
1481
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, {
1381
1482
  enumerable: true,
1382
1483
  configurable: true,
1383
1484
  writable: true,
1384
1485
  value
1385
1486
  }) : obj[key] = value;
1386
- var __decorateClass$9 = (decorators, target, key, kind) => {
1387
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1487
+ var __decorateClass$8 = (decorators, target, key, kind) => {
1488
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
1388
1489
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1389
- if (kind && result) __defProp$9(target, key, result);
1490
+ if (kind && result) __defProp$8(target, key, result);
1390
1491
  return result;
1391
1492
  };
1392
- var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
1493
+ var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
1393
1494
  function parseMetadata$2(raw) {
1394
1495
  if (!raw) return {};
1395
1496
  if (typeof raw === "object") return { ...raw };
@@ -1441,11 +1542,11 @@ var ContentContributionRevision = class extends SmrtObject {
1441
1542
  };
1442
1543
  }
1443
1544
  };
1444
- __publicField$9(ContentContributionRevision, "__smrtPackage__", "@happyvertical/smrt-content");
1445
- __decorateClass$9([foreignKey("ContentContribution", { required: true })], ContentContributionRevision.prototype, "contributionId", 2);
1446
- __decorateClass$9([crossPackageRef("@happyvertical/smrt-messages:Message")], ContentContributionRevision.prototype, "sourceMessageId", 2);
1447
- __decorateClass$9([tenantId({ nullable: true })], ContentContributionRevision.prototype, "tenantId", 2);
1448
- ContentContributionRevision = __decorateClass$9([TenantScoped({ mode: "optional" }), smrt({
1545
+ __publicField$8(ContentContributionRevision, "__smrtPackage__", "@happyvertical/smrt-content");
1546
+ __decorateClass$8([foreignKey("ContentContribution", { required: true })], ContentContributionRevision.prototype, "contributionId", 2);
1547
+ __decorateClass$8([crossPackageRef("@happyvertical/smrt-messages:Message")], ContentContributionRevision.prototype, "sourceMessageId", 2);
1548
+ __decorateClass$8([tenantId({ nullable: true })], ContentContributionRevision.prototype, "tenantId", 2);
1549
+ ContentContributionRevision = __decorateClass$8([TenantScoped({ mode: "optional" }), smrt({
1449
1550
  tableName: "content_contribution_revisions",
1450
1551
  conflictColumns: ["contribution_id", "revision_number"],
1451
1552
  api: { include: [
@@ -1485,21 +1586,21 @@ var ContentContributionRevisionCollection = class extends SmrtCollection {
1485
1586
  };
1486
1587
  //#endregion
1487
1588
  //#region src/content-contribution-type.ts
1488
- var __defProp$8 = Object.defineProperty;
1489
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
1490
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, {
1589
+ var __defProp$7 = Object.defineProperty;
1590
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
1591
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
1491
1592
  enumerable: true,
1492
1593
  configurable: true,
1493
1594
  writable: true,
1494
1595
  value
1495
1596
  }) : obj[key] = value;
1496
- var __decorateClass$8 = (decorators, target, key, kind) => {
1497
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
1597
+ var __decorateClass$7 = (decorators, target, key, kind) => {
1598
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
1498
1599
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1499
- if (kind && result) __defProp$8(target, key, result);
1600
+ if (kind && result) __defProp$7(target, key, result);
1500
1601
  return result;
1501
1602
  };
1502
- var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
1603
+ var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
1503
1604
  function parseJSON(raw, fallback) {
1504
1605
  if (!raw) return fallback;
1505
1606
  if (typeof raw === "object") return structuredClone(raw);
@@ -1605,10 +1706,10 @@ var ContentContributionType = class extends SmrtObject {
1605
1706
  return super.delete();
1606
1707
  }
1607
1708
  };
1608
- __publicField$8(ContentContributionType, "__smrtPackage__", "@happyvertical/smrt-content");
1609
- __decorateClass$8([field({ required: true })], ContentContributionType.prototype, "key", 2);
1610
- __decorateClass$8([tenantId({ nullable: true })], ContentContributionType.prototype, "tenantId", 2);
1611
- ContentContributionType = __decorateClass$8([TenantScoped({ mode: "optional" }), smrt({
1709
+ __publicField$7(ContentContributionType, "__smrtPackage__", "@happyvertical/smrt-content");
1710
+ __decorateClass$7([field({ required: true })], ContentContributionType.prototype, "key", 2);
1711
+ __decorateClass$7([tenantId({ nullable: true })], ContentContributionType.prototype, "tenantId", 2);
1712
+ ContentContributionType = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt({
1612
1713
  tableName: "content_contribution_types",
1613
1714
  conflictColumns: ["tenant_id", "key"],
1614
1715
  api: { include: [
@@ -1645,21 +1746,21 @@ var ContentContributionTypeCollection = class extends SmrtCollection {
1645
1746
  };
1646
1747
  //#endregion
1647
1748
  //#region src/content-contributor.ts
1648
- var __defProp$7 = Object.defineProperty;
1649
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
1650
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
1749
+ var __defProp$6 = Object.defineProperty;
1750
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
1751
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
1651
1752
  enumerable: true,
1652
1753
  configurable: true,
1653
1754
  writable: true,
1654
1755
  value
1655
1756
  }) : obj[key] = value;
1656
- var __decorateClass$7 = (decorators, target, key, kind) => {
1657
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
1757
+ var __decorateClass$6 = (decorators, target, key, kind) => {
1758
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
1658
1759
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1659
- if (kind && result) __defProp$7(target, key, result);
1760
+ if (kind && result) __defProp$6(target, key, result);
1660
1761
  return result;
1661
1762
  };
1662
- var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
1763
+ var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
1663
1764
  function parseMetadata$1(raw) {
1664
1765
  if (!raw) return {};
1665
1766
  if (typeof raw === "object") return { ...raw };
@@ -1705,11 +1806,16 @@ var ContentContributor = class extends SmrtObject {
1705
1806
  };
1706
1807
  }
1707
1808
  };
1708
- __publicField$7(ContentContributor, "__smrtPackage__", "@happyvertical/smrt-content");
1709
- __decorateClass$7([crossPackageRef("@happyvertical/smrt-profiles:Profile")], ContentContributor.prototype, "profileId", 2);
1710
- __decorateClass$7([field({ required: true })], ContentContributor.prototype, "email", 2);
1711
- __decorateClass$7([tenantId({ nullable: true })], ContentContributor.prototype, "tenantId", 2);
1712
- ContentContributor = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt({
1809
+ __publicField$6(ContentContributor, "__smrtPackage__", "@happyvertical/smrt-content");
1810
+ __decorateClass$6([crossPackageRef("@happyvertical/smrt-profiles:Profile")], ContentContributor.prototype, "profileId", 2);
1811
+ __decorateClass$6([field({
1812
+ required: true,
1813
+ description: "The email address the contributor writes in from."
1814
+ })], ContentContributor.prototype, "email", 2);
1815
+ __decorateClass$6([field({ description: "The name the contributor goes by." })], ContentContributor.prototype, "name", 2);
1816
+ __decorateClass$6([field({ description: "How far you trust what they send in: standard, trusted or blocked." })], ContentContributor.prototype, "trustLevel", 2);
1817
+ __decorateClass$6([tenantId({ nullable: true })], ContentContributor.prototype, "tenantId", 2);
1818
+ ContentContributor = __decorateClass$6([TenantScoped({ mode: "optional" }), smrt({
1713
1819
  tableName: "content_contributors",
1714
1820
  conflictColumns: ["email"],
1715
1821
  api: { include: [
@@ -1731,21 +1837,21 @@ ContentContributor = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt
1731
1837
  //#endregion
1732
1838
  //#region src/content-contributors.ts
1733
1839
  var content_contributors_exports = /* @__PURE__ */ __exportAll({ ContentContributorCollection: () => ContentContributorCollection });
1734
- var __defProp$6 = Object.defineProperty;
1735
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
1736
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
1840
+ var __defProp$5 = Object.defineProperty;
1841
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
1842
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
1737
1843
  enumerable: true,
1738
1844
  configurable: true,
1739
1845
  writable: true,
1740
1846
  value
1741
1847
  }) : obj[key] = value;
1742
- var __decorateClass$6 = (decorators, target, key, kind) => {
1743
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
1848
+ var __decorateClass$5 = (decorators, target, key, kind) => {
1849
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
1744
1850
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1745
- if (kind && result) __defProp$6(target, key, result);
1851
+ if (kind && result) __defProp$5(target, key, result);
1746
1852
  return result;
1747
1853
  };
1748
- var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
1854
+ var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
1749
1855
  var ContentContributorCollection = class extends SmrtCollection {
1750
1856
  async getByEmail(email) {
1751
1857
  return this.get({ email: email.toLowerCase().trim() });
@@ -1789,9 +1895,9 @@ var ContentContributorCollection = class extends SmrtCollection {
1789
1895
  return contributor;
1790
1896
  }
1791
1897
  };
1792
- __publicField$6(ContentContributorCollection, "__smrtPackage__", "@happyvertical/smrt-content");
1793
- __publicField$6(ContentContributorCollection, "_itemClass", ContentContributor);
1794
- ContentContributorCollection = __decorateClass$6([smrt({
1898
+ __publicField$5(ContentContributorCollection, "__smrtPackage__", "@happyvertical/smrt-content");
1899
+ __publicField$5(ContentContributorCollection, "_itemClass", ContentContributor);
1900
+ ContentContributorCollection = __decorateClass$5([smrt({
1795
1901
  tableName: "content_contributors",
1796
1902
  conflictColumns: ["email"],
1797
1903
  api: { include: [
@@ -1815,21 +1921,21 @@ ContentContributorCollection = __decorateClass$6([smrt({
1815
1921
  })], ContentContributorCollection);
1816
1922
  //#endregion
1817
1923
  //#region src/content-contributions.ts
1818
- var __defProp$5 = Object.defineProperty;
1819
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
1820
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
1924
+ var __defProp$4 = Object.defineProperty;
1925
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
1926
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
1821
1927
  enumerable: true,
1822
1928
  configurable: true,
1823
1929
  writable: true,
1824
1930
  value
1825
1931
  }) : obj[key] = value;
1826
- var __decorateClass$5 = (decorators, target, key, kind) => {
1827
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
1932
+ var __decorateClass$4 = (decorators, target, key, kind) => {
1933
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
1828
1934
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1829
- if (kind && result) __defProp$5(target, key, result);
1935
+ if (kind && result) __defProp$4(target, key, result);
1830
1936
  return result;
1831
1937
  };
1832
- var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
1938
+ var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
1833
1939
  function toContributionStatus(decision) {
1834
1940
  if (decision === "quarantined") return "quarantined";
1835
1941
  if (decision === "rejected") return "rejected";
@@ -2071,9 +2177,9 @@ var ContentContributions = class extends SmrtCollection {
2071
2177
  };
2072
2178
  }
2073
2179
  };
2074
- __publicField$5(ContentContributions, "__smrtPackage__", "@happyvertical/smrt-content");
2075
- __publicField$5(ContentContributions, "_itemClass", ContentContribution);
2076
- ContentContributions = __decorateClass$5([smrt({
2180
+ __publicField$4(ContentContributions, "__smrtPackage__", "@happyvertical/smrt-content");
2181
+ __publicField$4(ContentContributions, "_itemClass", ContentContribution);
2182
+ ContentContributions = __decorateClass$4([smrt({
2077
2183
  api: {
2078
2184
  include: [
2079
2185
  "submitWebContribution",
@@ -6204,21 +6310,21 @@ function parseContentFeed(xml, baseUrl) {
6204
6310
  }
6205
6311
  //#endregion
6206
6312
  //#region src/content-feed-source.ts
6207
- var __defProp$4 = Object.defineProperty;
6208
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
6209
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
6313
+ var __defProp$3 = Object.defineProperty;
6314
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
6315
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
6210
6316
  enumerable: true,
6211
6317
  configurable: true,
6212
6318
  writable: true,
6213
6319
  value
6214
6320
  }) : obj[key] = value;
6215
- var __decorateClass$4 = (decorators, target, key, kind) => {
6216
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
6321
+ var __decorateClass$3 = (decorators, target, key, kind) => {
6322
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
6217
6323
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6218
- if (kind && result) __defProp$4(target, key, result);
6324
+ if (kind && result) __defProp$3(target, key, result);
6219
6325
  return result;
6220
6326
  };
6221
- var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
6327
+ var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
6222
6328
  var SOURCE_STATUSES = /* @__PURE__ */ new Set([
6223
6329
  "active",
6224
6330
  "paused",
@@ -6335,16 +6441,16 @@ var ContentFeedSource = class extends SmrtObject {
6335
6441
  };
6336
6442
  }
6337
6443
  };
6338
- __publicField$4(ContentFeedSource, "__smrtPackage__", "@happyvertical/smrt-content");
6339
- __decorateClass$4([tenantId({ nullable: true })], ContentFeedSource.prototype, "tenantId", 2);
6340
- __decorateClass$4([field({ required: true })], ContentFeedSource.prototype, "name", 2);
6341
- __decorateClass$4([field({ required: true })], ContentFeedSource.prototype, "feedUrl", 2);
6342
- __decorateClass$4([field({
6444
+ __publicField$3(ContentFeedSource, "__smrtPackage__", "@happyvertical/smrt-content");
6445
+ __decorateClass$3([tenantId({ nullable: true })], ContentFeedSource.prototype, "tenantId", 2);
6446
+ __decorateClass$3([field({ required: true })], ContentFeedSource.prototype, "name", 2);
6447
+ __decorateClass$3([field({ required: true })], ContentFeedSource.prototype, "feedUrl", 2);
6448
+ __decorateClass$3([field({
6343
6449
  type: "text",
6344
6450
  required: true,
6345
6451
  default: "active"
6346
6452
  })], ContentFeedSource.prototype, "status", 2);
6347
- ContentFeedSource = __decorateClass$4([TenantScoped({ mode: "optional" }), smrt({
6453
+ ContentFeedSource = __decorateClass$3([TenantScoped({ mode: "optional" }), smrt({
6348
6454
  tableName: "content_feed_sources",
6349
6455
  conflictColumns: ["tenant_id", "feed_url"],
6350
6456
  api: { include: [
@@ -6393,92 +6499,6 @@ var ContentFeedSourceCollection = class extends SmrtCollection {
6393
6499
  }
6394
6500
  };
6395
6501
  //#endregion
6396
- //#region src/content-types.ts
6397
- var __defProp$3 = Object.defineProperty;
6398
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
6399
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
6400
- enumerable: true,
6401
- configurable: true,
6402
- writable: true,
6403
- value
6404
- }) : obj[key] = value;
6405
- var __decorateClass$3 = (decorators, target, key, kind) => {
6406
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
6407
- for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6408
- if (kind && result) __defProp$3(target, key, result);
6409
- return result;
6410
- };
6411
- var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
6412
- var Article = class extends Content {
6413
- constructor(options = {}) {
6414
- super(options);
6415
- }
6416
- };
6417
- __publicField$3(Article, "__smrtPackage__", "@happyvertical/smrt-content");
6418
- Article = __decorateClass$3([smrt({
6419
- tableStrategy: "sti",
6420
- api: false,
6421
- mcp: false,
6422
- cli: false
6423
- })], Article);
6424
- var ContentDocument = class extends Content {
6425
- constructor(options = {}) {
6426
- super(options);
6427
- }
6428
- };
6429
- __publicField$3(ContentDocument, "__smrtPackage__", "@happyvertical/smrt-content");
6430
- ContentDocument = __decorateClass$3([smrt({
6431
- tableStrategy: "sti",
6432
- api: false,
6433
- mcp: false,
6434
- cli: false
6435
- })], ContentDocument);
6436
- function parseOptionalDate(value) {
6437
- if (!value) return null;
6438
- if (value instanceof Date) return value;
6439
- const parsed = new Date(value);
6440
- return Number.isNaN(parsed.getTime()) ? null : parsed;
6441
- }
6442
- var Mirror = class extends Content {
6443
- feedSourceId = null;
6444
- sourceGuid = null;
6445
- sourceName = null;
6446
- sourceHomepageUrl = null;
6447
- externalUrl = null;
6448
- originalPublishedAt = null;
6449
- dedupeKey = null;
6450
- constructor(options = {}) {
6451
- super(options);
6452
- if (options.feedSourceId !== void 0) this.feedSourceId = options.feedSourceId;
6453
- if (options.sourceGuid !== void 0) this.sourceGuid = options.sourceGuid;
6454
- if (options.sourceName !== void 0) this.sourceName = options.sourceName;
6455
- if (options.sourceHomepageUrl !== void 0) this.sourceHomepageUrl = options.sourceHomepageUrl;
6456
- if (options.externalUrl !== void 0) this.externalUrl = options.externalUrl;
6457
- if (options.originalPublishedAt !== void 0) this.originalPublishedAt = parseOptionalDate(options.originalPublishedAt);
6458
- if (options.dedupeKey !== void 0) this.dedupeKey = options.dedupeKey;
6459
- }
6460
- transformJSON(json) {
6461
- return {
6462
- ...json,
6463
- feedSourceId: this.feedSourceId,
6464
- sourceGuid: this.sourceGuid,
6465
- sourceName: this.sourceName,
6466
- sourceHomepageUrl: this.sourceHomepageUrl,
6467
- externalUrl: this.externalUrl,
6468
- originalPublishedAt: this.originalPublishedAt?.toISOString() ?? null,
6469
- dedupeKey: this.dedupeKey
6470
- };
6471
- }
6472
- };
6473
- __publicField$3(Mirror, "__smrtPackage__", "@happyvertical/smrt-content");
6474
- __decorateClass$3([foreignKey("ContentFeedSource")], Mirror.prototype, "feedSourceId", 2);
6475
- Mirror = __decorateClass$3([smrt({
6476
- tableStrategy: "sti",
6477
- api: false,
6478
- mcp: false,
6479
- cli: false
6480
- })], Mirror);
6481
- //#endregion
6482
6502
  //#region src/content-feed-sync.ts
6483
6503
  var FALLBACK_MIRROR_META_TYPE = "@happyvertical/smrt-content:Mirror";
6484
6504
  function getMirrorMetaType() {
@@ -7026,6 +7046,295 @@ var ContentGovernanceProfileCollection = class extends SmrtCollection {
7026
7046
  }
7027
7047
  };
7028
7048
  //#endregion
7049
+ //#region src/recipes.ts
7050
+ var ArticlesRecipe = class extends SmrtRecipe {
7051
+ static id = "content.articles";
7052
+ static help = "./articles.recipe.md";
7053
+ static label = "Articles";
7054
+ static summary = "Write articles, publish them, and keep a record of every change, review and correction.";
7055
+ static synonyms = [
7056
+ "articles",
7057
+ "posts",
7058
+ "blog",
7059
+ "news",
7060
+ "stories",
7061
+ "drafts",
7062
+ "publishing"
7063
+ ];
7064
+ static section = {
7065
+ id: "publish",
7066
+ label: "Publish",
7067
+ icon: "fileText",
7068
+ description: "What you write, record and put out."
7069
+ };
7070
+ static models = [
7071
+ Content,
7072
+ ContentVersion,
7073
+ ContentCorrection,
7074
+ ContentReview,
7075
+ ContentContribution,
7076
+ ContentContributor
7077
+ ];
7078
+ static nav = [
7079
+ {
7080
+ label: "Articles",
7081
+ model: Content,
7082
+ key: "articles",
7083
+ icon: "fileText",
7084
+ description: "Every article, from first draft to published.",
7085
+ noun: "article",
7086
+ filter: {
7087
+ field: "type",
7088
+ value: "article"
7089
+ }
7090
+ },
7091
+ {
7092
+ label: "Versions",
7093
+ model: ContentVersion,
7094
+ icon: "layers",
7095
+ description: "Each saved state of an article, so nothing is lost.",
7096
+ noun: "version"
7097
+ },
7098
+ {
7099
+ label: "Corrections",
7100
+ model: ContentCorrection,
7101
+ icon: "wrench",
7102
+ description: "Fixes made to an article after it went out.",
7103
+ noun: "correction"
7104
+ },
7105
+ {
7106
+ label: "Reviews",
7107
+ model: ContentReview,
7108
+ icon: "book",
7109
+ description: "What the checks found before an article went out.",
7110
+ noun: "review"
7111
+ },
7112
+ {
7113
+ label: "Contributions",
7114
+ model: ContentContribution,
7115
+ icon: "users",
7116
+ description: "Pieces sent in by readers and outside writers.",
7117
+ noun: "contribution"
7118
+ }
7119
+ ];
7120
+ static options = {
7121
+ Content: { fields: {
7122
+ title: { order: 1 },
7123
+ name: {
7124
+ label: "Short name",
7125
+ order: 2
7126
+ },
7127
+ type: {
7128
+ label: "Kind",
7129
+ order: 3,
7130
+ default: "article"
7131
+ },
7132
+ status: { order: 4 },
7133
+ description: {
7134
+ label: "Summary",
7135
+ order: 5
7136
+ },
7137
+ body: { order: 6 },
7138
+ author: { order: 7 },
7139
+ publish_date: {
7140
+ label: "Published on",
7141
+ order: 8
7142
+ },
7143
+ category: {
7144
+ label: "Section",
7145
+ order: 9
7146
+ },
7147
+ tags: { order: 10 },
7148
+ language: { visibility: "advanced" },
7149
+ state: { visibility: "advanced" },
7150
+ url: {
7151
+ label: "Web address",
7152
+ visibility: "advanced"
7153
+ },
7154
+ source: { visibility: "advanced" },
7155
+ original_url: {
7156
+ label: "Original web address",
7157
+ visibility: "advanced"
7158
+ },
7159
+ thumbnailAssetId: {
7160
+ label: "Picture",
7161
+ visibility: "advanced"
7162
+ },
7163
+ tenantId: { visibility: "hidden" },
7164
+ variant: { visibility: "hidden" },
7165
+ fileKey: { visibility: "hidden" },
7166
+ bodyFormat: { visibility: "hidden" },
7167
+ metadata: { visibility: "hidden" }
7168
+ } },
7169
+ ContentVersion: { fields: {
7170
+ contentId: {
7171
+ label: "Article",
7172
+ order: 1
7173
+ },
7174
+ version: {
7175
+ label: "Version number",
7176
+ order: 2
7177
+ },
7178
+ kind: { order: 3 },
7179
+ summary: { order: 4 },
7180
+ title: { order: 5 },
7181
+ status: { order: 6 },
7182
+ createdAt: {
7183
+ label: "Saved on",
7184
+ order: 7
7185
+ },
7186
+ description: {
7187
+ label: "Summary at the time",
7188
+ visibility: "advanced"
7189
+ },
7190
+ body: {
7191
+ label: "Text at the time",
7192
+ visibility: "advanced"
7193
+ },
7194
+ tenantId: { visibility: "hidden" },
7195
+ snapshot: { visibility: "hidden" },
7196
+ metadata: { visibility: "hidden" },
7197
+ updatedAt: { visibility: "hidden" }
7198
+ } },
7199
+ ContentCorrection: { fields: {
7200
+ contentId: {
7201
+ label: "Article",
7202
+ order: 1
7203
+ },
7204
+ correctionType: {
7205
+ label: "Kind",
7206
+ order: 2
7207
+ },
7208
+ status: { order: 3 },
7209
+ summary: { order: 4 },
7210
+ incorrectText: {
7211
+ label: "What was wrong",
7212
+ order: 5
7213
+ },
7214
+ correctedText: {
7215
+ label: "What it should say",
7216
+ order: 6
7217
+ },
7218
+ publicNote: {
7219
+ label: "Note to readers",
7220
+ order: 7
7221
+ },
7222
+ publishedAt: {
7223
+ label: "Published on",
7224
+ order: 8
7225
+ },
7226
+ contentVersionId: {
7227
+ label: "Version",
7228
+ visibility: "advanced"
7229
+ },
7230
+ factId: { visibility: "hidden" },
7231
+ replacementFactId: { visibility: "hidden" },
7232
+ tenantId: { visibility: "hidden" },
7233
+ metadata: { visibility: "hidden" },
7234
+ createdAt: { visibility: "hidden" },
7235
+ updatedAt: { visibility: "hidden" }
7236
+ } },
7237
+ ContentReview: { fields: {
7238
+ contentId: {
7239
+ label: "Article",
7240
+ order: 1
7241
+ },
7242
+ kind: { order: 2 },
7243
+ policyKey: {
7244
+ label: "Policy",
7245
+ order: 3
7246
+ },
7247
+ status: {
7248
+ label: "Outcome",
7249
+ order: 4
7250
+ },
7251
+ summary: { order: 5 },
7252
+ reviewer: { order: 6 },
7253
+ createdAt: {
7254
+ label: "Reviewed on",
7255
+ order: 7
7256
+ },
7257
+ contentVersionId: {
7258
+ label: "Version",
7259
+ visibility: "advanced"
7260
+ },
7261
+ findings: { visibility: "hidden" },
7262
+ tenantId: { visibility: "hidden" },
7263
+ metadata: { visibility: "hidden" },
7264
+ updatedAt: { visibility: "hidden" }
7265
+ } },
7266
+ ContentContribution: { fields: {
7267
+ title: { order: 1 },
7268
+ contributorName: {
7269
+ label: "From",
7270
+ order: 2
7271
+ },
7272
+ contributionTypeKey: {
7273
+ label: "Kind",
7274
+ order: 3
7275
+ },
7276
+ status: { order: 4 },
7277
+ channel: {
7278
+ label: "Arrived by",
7279
+ order: 5
7280
+ },
7281
+ description: {
7282
+ label: "Summary",
7283
+ order: 6
7284
+ },
7285
+ body: { order: 7 },
7286
+ editorNotes: {
7287
+ label: "Your notes",
7288
+ order: 8
7289
+ },
7290
+ contributorId: {
7291
+ label: "Contributor",
7292
+ order: 9
7293
+ },
7294
+ contributorEmail: {
7295
+ label: "Email",
7296
+ visibility: "advanced"
7297
+ },
7298
+ promotedContentId: {
7299
+ label: "Published as",
7300
+ visibility: "advanced"
7301
+ },
7302
+ intakeDecision: { visibility: "advanced" },
7303
+ revisionCount: {
7304
+ label: "Times revised",
7305
+ visibility: "advanced"
7306
+ },
7307
+ threadKey: { visibility: "hidden" },
7308
+ sourceMessageId: { visibility: "hidden" },
7309
+ approvedAt: { visibility: "hidden" },
7310
+ promotedAt: { visibility: "hidden" },
7311
+ rejectedAt: { visibility: "hidden" },
7312
+ withdrawnAt: { visibility: "hidden" },
7313
+ requestedChangesAt: { visibility: "hidden" },
7314
+ tenantId: { visibility: "hidden" },
7315
+ metadata: { visibility: "hidden" },
7316
+ createdAt: { visibility: "hidden" },
7317
+ updatedAt: { visibility: "hidden" }
7318
+ } },
7319
+ ContentContributor: { fields: {
7320
+ name: { order: 1 },
7321
+ email: { order: 2 },
7322
+ trustLevel: {
7323
+ label: "Trust",
7324
+ order: 3
7325
+ },
7326
+ profileId: {
7327
+ label: "Person",
7328
+ visibility: "advanced"
7329
+ },
7330
+ tenantId: { visibility: "hidden" },
7331
+ metadata: { visibility: "hidden" },
7332
+ createdAt: { visibility: "hidden" },
7333
+ updatedAt: { visibility: "hidden" }
7334
+ } }
7335
+ };
7336
+ };
7337
+ //#endregion
7029
7338
  //#region src/utils.ts
7030
7339
  function contentToString(content) {
7031
7340
  const { body, ...frontmatter } = content;
@@ -7058,6 +7367,6 @@ function stringToContent(data) {
7058
7367
  };
7059
7368
  }
7060
7369
  //#endregion
7061
- export { Article, BODY_MAIN_IMAGE_ATTRIBUTE, BODY_THUMBNAIL_ATTRIBUTE, CONTENT_QUERY_CLASS_NAME, CONTENT_QUERY_DEFAULT_PAGE_LIMIT, CONTENT_QUERY_DEFAULT_SORT, CONTENT_QUERY_EXCLUDED_FIELD_IDS, CONTENT_QUERY_IDENTITY_FIELD, CONTENT_QUERY_MAX_PAGE_LIMIT, CONTENT_QUERY_MAX_RESULT_BYTES, CONTENT_QUERY_MIN_RESULT_BYTES, Content, ContentAsset, ContentAssetCollection, ContentContribution, ContentContributionAttachment, ContentContributionAttachmentCollection, ContentContributionRevision, ContentContributionRevisionCollection, ContentContributionType, ContentContributionTypeCollection, ContentContributions, ContentContributor, ContentContributorCollection, ContentCorrection, ContentCorrectionCollection, ContentDocument, ContentFeedSource, ContentFeedSourceCollection, ContentGovernanceAssignment, ContentGovernanceAssignmentCollection, ContentGovernancePolicy, ContentGovernancePolicyCollection, ContentGovernanceProfile, ContentGovernanceProfileCollection, ContentReference, ContentReferences, ContentReview, ContentReviewCollection, ContentVersion, ContentVersionCollection, Contents, DATA_QUERY_FORBIDDEN_JSON_KEYS, DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, DATA_QUERY_MAX_JSON_DEPTH, DATA_QUERY_MAX_JSON_STRING_LENGTH, DATA_QUERY_MAX_STRING_LENGTH, DATA_QUERY_MAX_WARNINGS, DATA_QUERY_MAX_WARNING_LENGTH, DEFAULT_CONTENT_BODY_FORMAT, MAX_CONTENT_QUERY_OR_BRANCHES, Mirror, THUMBNAIL_WIDE_ASPECT_RATIO, ThumbnailGenerator, assertContentQuerySchema, bodyHasImage, bodyHasThumbnail, bodyToEditorHtml, buildContentChatModelUpdates, buildContentEditorInteractionVariables, buildContentEditorSessionContext, buildContentGovernanceAssignmentKey, buildContentQuerySchema, buildContentReviewPrompt, buildDataQuerySchemaForClass, clearContentQuerySchemaCache, configureContentContributions, configureContentGovernance, contentChatMessageToJSON, contentChatSessionIsAuthorized, contentChatSessionKey, contentChatSessionMatchesContent, contentEditorAssistantContextToChatProps, contentEditorInteractionPrompt, contentEditorSessionPrompt, contentToString, createContentEditorAssistantContext, createContentEditorChatThread, editorHtmlToBody, evaluateContentPublishReadiness, evaluateContributionIntake, executeContentQuery, extractBodyImages, fetchSafeRemoteUrl, getAcceptedContentReviewStatuses, getContentChatAISelection, getContentContributionConfig, getContentContributionTypeConfigState, getContentGovernanceConfig, getContentReviewKind, getContentReviewPolicies, getContentReviewPolicy, getContentReviewProfile, getContentReviewProfileKeys, getContentReviewRequirements, getEffectiveContentContributionConfig, getEffectiveContentGovernanceConfig, getOrCreateContentEditorChatSession, hasStaticContentContributionType, hasStaticContentGovernancePolicy, hasStaticContentGovernanceProfile, htmlToMarkdown, inferProviderFromModel, isAssetAssociable, isMetadataAccessor, listContentEditorChatThreadMessages, loadPersistedContentContributionTypes, mergeContentQueryScope, normalizeContentTransparency, parseContentFeed, parseContentReviewResponse, placeThumbnailInBody, promptMessageOptions, removeThumbnailFromBody, renderContentBodyHtml, renderMarkdownToHtml, resetContentContributionConfig, resetContentGovernanceConfig, resolveBodyFormat, resolveBodyMainPicture, resolveConfiguredContentGovernance, resolveContentChatModelSelection, resolveContentTenantReadScope, resolveDefaultContentChatAI, resolveEffectiveContentContributionType, resolveEffectiveContentGovernance, sanitizeContentEditorAssistantFieldUpdates, sanitizeHtml, sendContentEditorChatThreadMessage, serializeContentChatMessageForUI, setBodyMainImage, smrtContentApplyCorrectionPrompt, smrtContentReviewPrompt, smrtContentThumbnailAIGeneratePrompt, stringToContent, stripHtml, syncContentFeedSource, thumbnailPlacementForSize };
7370
+ export { Article, ArticlesRecipe, BODY_MAIN_IMAGE_ATTRIBUTE, BODY_THUMBNAIL_ATTRIBUTE, CONTENT_QUERY_CLASS_NAME, CONTENT_QUERY_DEFAULT_PAGE_LIMIT, CONTENT_QUERY_DEFAULT_SORT, CONTENT_QUERY_EXCLUDED_FIELD_IDS, CONTENT_QUERY_IDENTITY_FIELD, CONTENT_QUERY_MAX_PAGE_LIMIT, CONTENT_QUERY_MAX_RESULT_BYTES, CONTENT_QUERY_MIN_RESULT_BYTES, Content, ContentAsset, ContentAssetCollection, ContentContribution, ContentContributionAttachment, ContentContributionAttachmentCollection, ContentContributionRevision, ContentContributionRevisionCollection, ContentContributionType, ContentContributionTypeCollection, ContentContributions, ContentContributor, ContentContributorCollection, ContentCorrection, ContentCorrectionCollection, ContentDocument, ContentFeedSource, ContentFeedSourceCollection, ContentGovernanceAssignment, ContentGovernanceAssignmentCollection, ContentGovernancePolicy, ContentGovernancePolicyCollection, ContentGovernanceProfile, ContentGovernanceProfileCollection, ContentReference, ContentReferences, ContentReview, ContentReviewCollection, ContentVersion, ContentVersionCollection, Contents, DATA_QUERY_FORBIDDEN_JSON_KEYS, DATA_QUERY_MAX_JSON_CONTAINER_ITEMS, DATA_QUERY_MAX_JSON_DEPTH, DATA_QUERY_MAX_JSON_STRING_LENGTH, DATA_QUERY_MAX_STRING_LENGTH, DATA_QUERY_MAX_WARNINGS, DATA_QUERY_MAX_WARNING_LENGTH, DEFAULT_CONTENT_BODY_FORMAT, MAX_CONTENT_QUERY_OR_BRANCHES, Mirror, THUMBNAIL_WIDE_ASPECT_RATIO, ThumbnailGenerator, assertContentQuerySchema, bodyHasImage, bodyHasThumbnail, bodyToEditorHtml, buildContentChatModelUpdates, buildContentEditorInteractionVariables, buildContentEditorSessionContext, buildContentGovernanceAssignmentKey, buildContentQuerySchema, buildContentReviewPrompt, buildDataQuerySchemaForClass, clearContentQuerySchemaCache, configureContentContributions, configureContentGovernance, contentChatMessageToJSON, contentChatSessionIsAuthorized, contentChatSessionKey, contentChatSessionMatchesContent, contentEditorAssistantContextToChatProps, contentEditorInteractionPrompt, contentEditorSessionPrompt, contentToString, createContentEditorAssistantContext, createContentEditorChatThread, editorHtmlToBody, evaluateContentPublishReadiness, evaluateContributionIntake, executeContentQuery, extractBodyImages, fetchSafeRemoteUrl, getAcceptedContentReviewStatuses, getContentChatAISelection, getContentContributionConfig, getContentContributionTypeConfigState, getContentGovernanceConfig, getContentReviewKind, getContentReviewPolicies, getContentReviewPolicy, getContentReviewProfile, getContentReviewProfileKeys, getContentReviewRequirements, getEffectiveContentContributionConfig, getEffectiveContentGovernanceConfig, getOrCreateContentEditorChatSession, hasStaticContentContributionType, hasStaticContentGovernancePolicy, hasStaticContentGovernanceProfile, htmlToMarkdown, inferProviderFromModel, isAssetAssociable, isMetadataAccessor, listContentEditorChatThreadMessages, loadPersistedContentContributionTypes, mergeContentQueryScope, normalizeContentTransparency, parseContentFeed, parseContentReviewResponse, placeThumbnailInBody, promptMessageOptions, removeThumbnailFromBody, renderContentBodyHtml, renderMarkdownToHtml, resetContentContributionConfig, resetContentGovernanceConfig, resolveBodyFormat, resolveBodyMainPicture, resolveConfiguredContentGovernance, resolveContentChatModelSelection, resolveContentTenantReadScope, resolveDefaultContentChatAI, resolveEffectiveContentContributionType, resolveEffectiveContentGovernance, sanitizeContentEditorAssistantFieldUpdates, sanitizeHtml, sendContentEditorChatThreadMessage, serializeContentChatMessageForUI, setBodyMainImage, smrtContentApplyCorrectionPrompt, smrtContentReviewPrompt, smrtContentThumbnailAIGeneratePrompt, stringToContent, stripHtml, syncContentFeedSource, thumbnailPlacementForSize };
7062
7371
 
7063
7372
  //# sourceMappingURL=index.js.map