@happyvertical/smrt-content 0.61.3 → 0.61.5

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 (33) hide show
  1. package/dist/chunks/{content-corrections-QyinPkfN.js → content-corrections-DgJ2duqR.js} +2 -1
  2. package/dist/chunks/content-corrections-DgJ2duqR.js.map +1 -0
  3. package/dist/chunks/content-query-Cvl7H0ui.js +4255 -0
  4. package/dist/chunks/content-query-Cvl7H0ui.js.map +1 -0
  5. package/dist/chunks/{content-reviews-H9ANWEi7.js → content-reviews-mzf5p6fz.js} +2 -1
  6. package/dist/chunks/content-reviews-mzf5p6fz.js.map +1 -0
  7. package/dist/chunks/{content-versions-Cw5nnYDl.js → content-versions-B5pIX39n.js} +3 -2
  8. package/dist/chunks/content-versions-B5pIX39n.js.map +1 -0
  9. package/dist/chunks/{contents-DjT0fTu8.js → contents-lNXJe6LN.js} +4 -4
  10. package/dist/chunks/contents-lNXJe6LN.js.map +1 -0
  11. package/dist/content-asset.d.ts.map +1 -1
  12. package/dist/content-contribution-attachment.d.ts.map +1 -1
  13. package/dist/content-contribution-revision.d.ts.map +1 -1
  14. package/dist/content-contribution.d.ts +1 -1
  15. package/dist/content-contribution.d.ts.map +1 -1
  16. package/dist/content-contributor.d.ts.map +1 -1
  17. package/dist/content-correction.d.ts.map +1 -1
  18. package/dist/content-review.d.ts.map +1 -1
  19. package/dist/content-version.d.ts.map +1 -1
  20. package/dist/content.d.ts.map +1 -1
  21. package/dist/contents.d.ts.map +1 -1
  22. package/dist/index.js +43 -17
  23. package/dist/index.js.map +1 -1
  24. package/dist/manifest.json +1520 -477
  25. package/dist/server.js +1 -1
  26. package/dist/smrt-knowledge.json +10 -10
  27. package/package.json +24 -24
  28. package/dist/chunks/content-corrections-QyinPkfN.js.map +0 -1
  29. package/dist/chunks/content-query-D4gwn8nD.js +0 -4246
  30. package/dist/chunks/content-query-D4gwn8nD.js.map +0 -1
  31. package/dist/chunks/content-reviews-H9ANWEi7.js.map +0 -1
  32. package/dist/chunks/content-versions-Cw5nnYDl.js.map +0 -1
  33. package/dist/chunks/contents-DjT0fTu8.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
2
- import { A as normalizeContentTransparency, B as findTenantReferencesToGlobalKey, C as resolveContentTenantReadScope, E as serializeContent, F as smrtContentReviewPrompt, G as getContentReviewPolicy, H as getContentGovernanceConfig, I as smrtContentThumbnailAIGeneratePrompt, J as getContentReviewRequirements, K as getContentReviewProfile, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, Q as hasStaticContentGovernanceProfile, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewKind, V as getAcceptedContentReviewStatuses, W as getContentReviewPolicies, X as getFallbackPolicyKind, Y as getEffectiveContentGovernanceConfig, Z as hasStaticContentGovernancePolicy, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as ContentAsset, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as parseContentReviewResponse, 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 ContentAssetCollection, 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 resolveConfiguredContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isAssetAssociable, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewProfileKeys, r as CONTENT_QUERY_DEFAULT_SORT, rt as resolveEffectiveContentGovernance, s as CONTENT_QUERY_MAX_RESULT_BYTES, st as isMetadataAccessor, t as CONTENT_QUERY_CLASS_NAME, tt as resetContentGovernanceConfig, 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-D4gwn8nD.js";
2
+ import { A as normalizeContentTransparency, B as findTenantReferencesToGlobalKey, C as resolveContentTenantReadScope, E as serializeContent, F as smrtContentReviewPrompt, G as getContentReviewPolicy, H as getContentGovernanceConfig, I as smrtContentThumbnailAIGeneratePrompt, J as getContentReviewRequirements, K as getContentReviewProfile, L as buildContentGovernanceAssignmentKey, M as ContentReference, N as promptMessageOptions, O as getQueryRows, P as smrtContentApplyCorrectionPrompt, Q as hasStaticContentGovernanceProfile, R as buildContentReviewPrompt, S as mergeContentQueryScope, T as ThumbnailGenerator, U as getContentReviewKind, V as getAcceptedContentReviewStatuses, W as getContentReviewPolicies, X as getFallbackPolicyKind, Y as getEffectiveContentGovernanceConfig, Z as hasStaticContentGovernancePolicy, _ as assertContentQuerySchema, a as CONTENT_QUERY_IDENTITY_FIELD, at as ContentAsset, b as clearContentQuerySchemaCache, c as CONTENT_QUERY_MIN_RESULT_BYTES, d as DATA_QUERY_MAX_JSON_DEPTH, et as parseContentReviewResponse, 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 ContentAssetCollection, 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 resolveConfiguredContentGovernance, o as CONTENT_QUERY_MAX_PAGE_LIMIT, ot as isAssetAssociable, p as DATA_QUERY_MAX_STRING_LENGTH, q as getContentReviewProfileKeys, r as CONTENT_QUERY_DEFAULT_SORT, rt as resolveEffectiveContentGovernance, s as CONTENT_QUERY_MAX_RESULT_BYTES, st as isMetadataAccessor, t as CONTENT_QUERY_CLASS_NAME, tt as resetContentGovernanceConfig, 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-Cvl7H0ui.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
4
  import { n as getByTenantKey, r as resolveLookupTenantId } from "./chunks/tenant-keyed-lookup-8z_TQG3s.js";
5
- import { r as ContentCorrection, t as ContentCorrectionCollection } from "./chunks/content-corrections-QyinPkfN.js";
5
+ import { r as ContentCorrection, t as ContentCorrectionCollection } from "./chunks/content-corrections-DgJ2duqR.js";
6
6
  import { contentEditorAssistantContextToChatProps, createContentEditorAssistantContext, sanitizeContentEditorAssistantFieldUpdates } from "./content-editor-assistant.js";
7
- import { i as fetchSafeRemoteUrlInternal, r as fetchSafeRemoteUrl, t as Contents } from "./chunks/contents-DjT0fTu8.js";
8
- import { r as ContentReview, t as ContentReviewCollection } from "./chunks/content-reviews-H9ANWEi7.js";
9
- import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-Cw5nnYDl.js";
7
+ import { i as fetchSafeRemoteUrlInternal, r as fetchSafeRemoteUrl, t as Contents } from "./chunks/contents-lNXJe6LN.js";
8
+ import { r as ContentReview, t as ContentReviewCollection } from "./chunks/content-reviews-mzf5p6fz.js";
9
+ import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-B5pIX39n.js";
10
10
  import { evaluateContentPublishReadiness } from "./publish-readiness.js";
11
11
  import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
12
12
  import { AssetCollection, AssetStatusCollection, AssetTypeCollection } from "@happyvertical/smrt-assets";
@@ -903,7 +903,7 @@ function inferAssetTypeSlug(mimeType) {
903
903
  return "document";
904
904
  }
905
905
  var ContentContribution = class extends SmrtObject {
906
- contributorId = "";
906
+ contributorId = null;
907
907
  contributionTypeKey = "";
908
908
  status = "submitted";
909
909
  intakeDecision = "accepted";
@@ -987,7 +987,7 @@ var ContentContribution = class extends SmrtObject {
987
987
  return ContentContributorCollection.create(this.options);
988
988
  }
989
989
  async getContentsCollection() {
990
- const { Contents } = await import("./chunks/contents-DjT0fTu8.js").then((n) => n.n);
990
+ const { Contents } = await import("./chunks/contents-lNXJe6LN.js").then((n) => n.n);
991
991
  return Contents.create({ db: this.db });
992
992
  }
993
993
  async getAssetCollection() {
@@ -1254,9 +1254,10 @@ var ContentContribution = class extends SmrtObject {
1254
1254
  }
1255
1255
  };
1256
1256
  __publicField$11(ContentContribution, "__smrtPackage__", "@happyvertical/smrt-content");
1257
- __decorateClass$11([foreignKey("ContentContributor", { required: true }), field({ description: "The person who sent this in." })], ContentContribution.prototype, "contributorId", 2);
1257
+ __decorateClass$11([foreignKey("ContentContributor", { nullable: true }), field({ description: "The person who sent this in." })], ContentContribution.prototype, "contributorId", 2);
1258
1258
  __decorateClass$11([field({
1259
1259
  required: true,
1260
+ requiredFor: "identity",
1260
1261
  description: "What kind of submission it is, such as an article or a letter."
1261
1262
  })], ContentContribution.prototype, "contributionTypeKey", 2);
1262
1263
  __decorateClass$11([field({ description: "Where the submission stands, from submitted to approved, rejected or published." })], ContentContribution.prototype, "status", 2);
@@ -1397,7 +1398,10 @@ var ContentContributionAttachment = class extends SmrtObject {
1397
1398
  }
1398
1399
  };
1399
1400
  __publicField$10(ContentContributionAttachment, "__smrtPackage__", "@happyvertical/smrt-content");
1400
- __decorateClass$10([foreignKey("ContentContribution", { required: true })], ContentContributionAttachment.prototype, "contributionId", 2);
1401
+ __decorateClass$10([foreignKey("ContentContribution", {
1402
+ required: true,
1403
+ requiredFor: "identity"
1404
+ })], ContentContributionAttachment.prototype, "contributionId", 2);
1401
1405
  __decorateClass$10([foreignKey("ContentContributionRevision")], ContentContributionAttachment.prototype, "revisionId", 2);
1402
1406
  __decorateClass$10([crossPackageRef("@happyvertical/smrt-assets:Asset")], ContentContributionAttachment.prototype, "promotedAssetId", 2);
1403
1407
  __decorateClass$10([tenantId({ nullable: true })], ContentContributionAttachment.prototype, "tenantId", 2);
@@ -1545,7 +1549,10 @@ var ContentContributionRevision = class extends SmrtObject {
1545
1549
  }
1546
1550
  };
1547
1551
  __publicField$8(ContentContributionRevision, "__smrtPackage__", "@happyvertical/smrt-content");
1548
- __decorateClass$8([foreignKey("ContentContribution", { required: true })], ContentContributionRevision.prototype, "contributionId", 2);
1552
+ __decorateClass$8([foreignKey("ContentContribution", {
1553
+ required: true,
1554
+ requiredFor: "identity"
1555
+ })], ContentContributionRevision.prototype, "contributionId", 2);
1549
1556
  __decorateClass$8([crossPackageRef("@happyvertical/smrt-messages:Message")], ContentContributionRevision.prototype, "sourceMessageId", 2);
1550
1557
  __decorateClass$8([tenantId({ nullable: true })], ContentContributionRevision.prototype, "tenantId", 2);
1551
1558
  ContentContributionRevision = __decorateClass$8([TenantScoped({ mode: "optional" }), smrt({
@@ -1709,7 +1716,10 @@ var ContentContributionType = class extends SmrtObject {
1709
1716
  }
1710
1717
  };
1711
1718
  __publicField$7(ContentContributionType, "__smrtPackage__", "@happyvertical/smrt-content");
1712
- __decorateClass$7([field({ required: true })], ContentContributionType.prototype, "key", 2);
1719
+ __decorateClass$7([field({
1720
+ required: true,
1721
+ requiredFor: "identity"
1722
+ })], ContentContributionType.prototype, "key", 2);
1713
1723
  __decorateClass$7([tenantId({ nullable: true })], ContentContributionType.prototype, "tenantId", 2);
1714
1724
  ContentContributionType = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt({
1715
1725
  tableName: "content_contribution_types",
@@ -1821,6 +1831,7 @@ __publicField$6(ContentContributor, "__smrtPackage__", "@happyvertical/smrt-cont
1821
1831
  __decorateClass$6([crossPackageRef("@happyvertical/smrt-profiles:Profile")], ContentContributor.prototype, "profileId", 2);
1822
1832
  __decorateClass$6([field({
1823
1833
  required: true,
1834
+ requiredFor: "identity",
1824
1835
  description: "The email address the contributor writes in from."
1825
1836
  })], ContentContributor.prototype, "email", 2);
1826
1837
  __decorateClass$6([field({ description: "The name the contributor goes by." })], ContentContributor.prototype, "name", 2);
@@ -6472,8 +6483,11 @@ var ContentFeedSource = class extends SmrtObject {
6472
6483
  };
6473
6484
  __publicField$3(ContentFeedSource, "__smrtPackage__", "@happyvertical/smrt-content");
6474
6485
  __decorateClass$3([tenantId({ nullable: true })], ContentFeedSource.prototype, "tenantId", 2);
6475
- __decorateClass$3([field({ required: true })], ContentFeedSource.prototype, "name", 2);
6476
- __decorateClass$3([field({ required: true })], ContentFeedSource.prototype, "feedUrl", 2);
6486
+ __decorateClass$3([field()], ContentFeedSource.prototype, "name", 2);
6487
+ __decorateClass$3([field({
6488
+ required: true,
6489
+ requiredFor: "identity"
6490
+ })], ContentFeedSource.prototype, "feedUrl", 2);
6477
6491
  __decorateClass$3([field({
6478
6492
  type: "text",
6479
6493
  required: true,
@@ -6837,8 +6851,14 @@ var ContentGovernanceAssignment = class extends SmrtObject {
6837
6851
  }
6838
6852
  };
6839
6853
  __publicField$2(ContentGovernanceAssignment, "__smrtPackage__", "@happyvertical/smrt-content");
6840
- __decorateClass$2([field({ required: true })], ContentGovernanceAssignment.prototype, "key", 2);
6841
- __decorateClass$2([field({ required: true })], ContentGovernanceAssignment.prototype, "contentType", 2);
6854
+ __decorateClass$2([field({
6855
+ required: true,
6856
+ requiredFor: "identity"
6857
+ })], ContentGovernanceAssignment.prototype, "key", 2);
6858
+ __decorateClass$2([field({
6859
+ required: true,
6860
+ requiredFor: "identity"
6861
+ })], ContentGovernanceAssignment.prototype, "contentType", 2);
6842
6862
  __decorateClass$2([tenantId({ nullable: true })], ContentGovernanceAssignment.prototype, "tenantId", 2);
6843
6863
  ContentGovernanceAssignment = __decorateClass$2([TenantScoped({ mode: "optional" }), smrt({
6844
6864
  tableName: "content_governance_assignments",
@@ -6957,7 +6977,10 @@ var ContentGovernancePolicy = class extends SmrtObject {
6957
6977
  }
6958
6978
  };
6959
6979
  __publicField$1(ContentGovernancePolicy, "__smrtPackage__", "@happyvertical/smrt-content");
6960
- __decorateClass$1([field({ required: true })], ContentGovernancePolicy.prototype, "key", 2);
6980
+ __decorateClass$1([field({
6981
+ required: true,
6982
+ requiredFor: "identity"
6983
+ })], ContentGovernancePolicy.prototype, "key", 2);
6961
6984
  __decorateClass$1([tenantId({ nullable: true })], ContentGovernancePolicy.prototype, "tenantId", 2);
6962
6985
  ContentGovernancePolicy = __decorateClass$1([TenantScoped({ mode: "optional" }), smrt({
6963
6986
  tableName: "content_governance_policies",
@@ -7088,7 +7111,10 @@ var ContentGovernanceProfile = class extends SmrtObject {
7088
7111
  }
7089
7112
  };
7090
7113
  __publicField(ContentGovernanceProfile, "__smrtPackage__", "@happyvertical/smrt-content");
7091
- __decorateClass([field({ required: true })], ContentGovernanceProfile.prototype, "key", 2);
7114
+ __decorateClass([field({
7115
+ required: true,
7116
+ requiredFor: "identity"
7117
+ })], ContentGovernanceProfile.prototype, "key", 2);
7092
7118
  __decorateClass([tenantId({ nullable: true })], ContentGovernanceProfile.prototype, "tenantId", 2);
7093
7119
  ContentGovernanceProfile = __decorateClass([TenantScoped({ mode: "optional" }), smrt({
7094
7120
  tableName: "content_governance_profiles",