@happyvertical/smrt-content 0.57.37 → 0.57.39
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/chunks/{content-query-DxZAmAPW.js → content-query-8pUNlvpL.js} +4 -4
- package/dist/chunks/{content-query-DxZAmAPW.js.map → content-query-8pUNlvpL.js.map} +1 -1
- package/dist/chunks/{content-versions-D0VjHrvd.js → content-versions-CjOoWZmn.js} +2 -2
- package/dist/chunks/{content-versions-D0VjHrvd.js.map → content-versions-CjOoWZmn.js.map} +1 -1
- package/dist/chunks/{contents-C9eZRig7.js → contents-ClzxE6GP.js} +2 -2
- package/dist/chunks/contents-ClzxE6GP.js.map +1 -0
- package/dist/content-contribution.d.ts.map +1 -1
- package/dist/content-query.d.ts +2 -2
- package/dist/content-query.d.ts.map +1 -1
- package/dist/content-types.d.ts +8 -0
- package/dist/content-types.d.ts.map +1 -1
- package/dist/contents.d.ts.map +1 -1
- package/dist/index.js +203 -198
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/server.js +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/svelte/content-list-controller.d.ts +7 -0
- package/dist/svelte/content-list-controller.d.ts.map +1 -1
- package/dist/svelte/content-list-controller.js +16 -0
- package/package.json +24 -24
- package/dist/chunks/contents-C9eZRig7.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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-8pUNlvpL.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 { 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-
|
|
6
|
+
import { i as fetchSafeRemoteUrlInternal, r as fetchSafeRemoteUrl, t as Contents } from "./chunks/contents-ClzxE6GP.js";
|
|
7
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-
|
|
8
|
+
import { r as ContentVersion, t as ContentVersionCollection } from "./chunks/content-versions-CjOoWZmn.js";
|
|
9
9
|
import { evaluateContentPublishReadiness } from "./publish-readiness.js";
|
|
10
10
|
import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
11
11
|
import { AssetCollection, AssetStatusCollection, AssetTypeCollection } from "@happyvertical/smrt-assets";
|
|
@@ -777,7 +777,7 @@ function evaluateContributionIntake(options) {
|
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
779
|
//#endregion
|
|
780
|
-
//#region src/content-
|
|
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-
|
|
988
|
+
const { Contents } = await import("./chunks/contents-ClzxE6GP.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,26 +1251,26 @@ var ContentContribution = class extends SmrtObject {
|
|
|
1160
1251
|
};
|
|
1161
1252
|
}
|
|
1162
1253
|
};
|
|
1163
|
-
__publicField$
|
|
1164
|
-
__decorateClass$
|
|
1165
|
-
__decorateClass$
|
|
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({
|
|
1166
1257
|
required: true,
|
|
1167
1258
|
description: "What kind of submission it is, such as an article or a letter."
|
|
1168
1259
|
})], ContentContribution.prototype, "contributionTypeKey", 2);
|
|
1169
|
-
__decorateClass$
|
|
1170
|
-
__decorateClass$
|
|
1171
|
-
__decorateClass$
|
|
1172
|
-
__decorateClass$
|
|
1173
|
-
__decorateClass$
|
|
1174
|
-
__decorateClass$
|
|
1175
|
-
__decorateClass$
|
|
1176
|
-
__decorateClass$
|
|
1177
|
-
__decorateClass$
|
|
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", {
|
|
1178
1269
|
nullable: true,
|
|
1179
1270
|
onDelete: "SET NULL"
|
|
1180
1271
|
})], ContentContribution.prototype, "promotedContentId", 2);
|
|
1181
|
-
__decorateClass$
|
|
1182
|
-
ContentContribution = __decorateClass$
|
|
1272
|
+
__decorateClass$11([tenantId({ nullable: true })], ContentContribution.prototype, "tenantId", 2);
|
|
1273
|
+
ContentContribution = __decorateClass$11([TenantScoped({ mode: "optional" }), smrt({
|
|
1183
1274
|
tableName: "content_contributions",
|
|
1184
1275
|
conflictColumns: ["id"],
|
|
1185
1276
|
api: {
|
|
@@ -1233,21 +1324,21 @@ ContentContribution = __decorateClass$12([TenantScoped({ mode: "optional" }), sm
|
|
|
1233
1324
|
})], ContentContribution);
|
|
1234
1325
|
//#endregion
|
|
1235
1326
|
//#region src/content-contribution-attachment.ts
|
|
1236
|
-
var __defProp$
|
|
1237
|
-
var __getOwnPropDesc$
|
|
1238
|
-
var __defNormalProp$
|
|
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, {
|
|
1239
1330
|
enumerable: true,
|
|
1240
1331
|
configurable: true,
|
|
1241
1332
|
writable: true,
|
|
1242
1333
|
value
|
|
1243
1334
|
}) : obj[key] = value;
|
|
1244
|
-
var __decorateClass$
|
|
1245
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1335
|
+
var __decorateClass$10 = (decorators, target, key, kind) => {
|
|
1336
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target;
|
|
1246
1337
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1247
|
-
if (kind && result) __defProp$
|
|
1338
|
+
if (kind && result) __defProp$10(target, key, result);
|
|
1248
1339
|
return result;
|
|
1249
1340
|
};
|
|
1250
|
-
var __publicField$
|
|
1341
|
+
var __publicField$10 = (obj, key, value) => __defNormalProp$10(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1251
1342
|
function parseMetadata$3(raw) {
|
|
1252
1343
|
if (!raw) return {};
|
|
1253
1344
|
if (typeof raw === "object") return { ...raw };
|
|
@@ -1303,12 +1394,12 @@ var ContentContributionAttachment = class extends SmrtObject {
|
|
|
1303
1394
|
};
|
|
1304
1395
|
}
|
|
1305
1396
|
};
|
|
1306
|
-
__publicField$
|
|
1307
|
-
__decorateClass$
|
|
1308
|
-
__decorateClass$
|
|
1309
|
-
__decorateClass$
|
|
1310
|
-
__decorateClass$
|
|
1311
|
-
ContentContributionAttachment = __decorateClass$
|
|
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({
|
|
1312
1403
|
tableName: "content_contribution_attachments",
|
|
1313
1404
|
conflictColumns: ["id"],
|
|
1314
1405
|
api: { include: [
|
|
@@ -1330,21 +1421,21 @@ ContentContributionAttachment = __decorateClass$11([TenantScoped({ mode: "option
|
|
|
1330
1421
|
//#endregion
|
|
1331
1422
|
//#region src/content-contribution-attachments.ts
|
|
1332
1423
|
var content_contribution_attachments_exports = /* @__PURE__ */ __exportAll({ ContentContributionAttachmentCollection: () => ContentContributionAttachmentCollection });
|
|
1333
|
-
var __defProp$
|
|
1334
|
-
var __getOwnPropDesc$
|
|
1335
|
-
var __defNormalProp$
|
|
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, {
|
|
1336
1427
|
enumerable: true,
|
|
1337
1428
|
configurable: true,
|
|
1338
1429
|
writable: true,
|
|
1339
1430
|
value
|
|
1340
1431
|
}) : obj[key] = value;
|
|
1341
|
-
var __decorateClass$
|
|
1342
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1432
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
1433
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
1343
1434
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1344
|
-
if (kind && result) __defProp$
|
|
1435
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
1345
1436
|
return result;
|
|
1346
1437
|
};
|
|
1347
|
-
var __publicField$
|
|
1438
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1348
1439
|
var ContentContributionAttachmentCollection = class extends SmrtCollection {
|
|
1349
1440
|
async listForContribution(contributionId) {
|
|
1350
1441
|
return this.list({
|
|
@@ -1359,9 +1450,9 @@ var ContentContributionAttachmentCollection = class extends SmrtCollection {
|
|
|
1359
1450
|
});
|
|
1360
1451
|
}
|
|
1361
1452
|
};
|
|
1362
|
-
__publicField$
|
|
1363
|
-
__publicField$
|
|
1364
|
-
ContentContributionAttachmentCollection = __decorateClass$
|
|
1453
|
+
__publicField$9(ContentContributionAttachmentCollection, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
1454
|
+
__publicField$9(ContentContributionAttachmentCollection, "_itemClass", ContentContributionAttachment);
|
|
1455
|
+
ContentContributionAttachmentCollection = __decorateClass$9([smrt({
|
|
1365
1456
|
tableName: "content_contribution_attachments",
|
|
1366
1457
|
conflictColumns: ["id"],
|
|
1367
1458
|
api: { include: [
|
|
@@ -1385,21 +1476,21 @@ ContentContributionAttachmentCollection = __decorateClass$10([smrt({
|
|
|
1385
1476
|
})], ContentContributionAttachmentCollection);
|
|
1386
1477
|
//#endregion
|
|
1387
1478
|
//#region src/content-contribution-revision.ts
|
|
1388
|
-
var __defProp$
|
|
1389
|
-
var __getOwnPropDesc$
|
|
1390
|
-
var __defNormalProp$
|
|
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, {
|
|
1391
1482
|
enumerable: true,
|
|
1392
1483
|
configurable: true,
|
|
1393
1484
|
writable: true,
|
|
1394
1485
|
value
|
|
1395
1486
|
}) : obj[key] = value;
|
|
1396
|
-
var __decorateClass$
|
|
1397
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1487
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
1488
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
1398
1489
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1399
|
-
if (kind && result) __defProp$
|
|
1490
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
1400
1491
|
return result;
|
|
1401
1492
|
};
|
|
1402
|
-
var __publicField$
|
|
1493
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1403
1494
|
function parseMetadata$2(raw) {
|
|
1404
1495
|
if (!raw) return {};
|
|
1405
1496
|
if (typeof raw === "object") return { ...raw };
|
|
@@ -1451,11 +1542,11 @@ var ContentContributionRevision = class extends SmrtObject {
|
|
|
1451
1542
|
};
|
|
1452
1543
|
}
|
|
1453
1544
|
};
|
|
1454
|
-
__publicField$
|
|
1455
|
-
__decorateClass$
|
|
1456
|
-
__decorateClass$
|
|
1457
|
-
__decorateClass$
|
|
1458
|
-
ContentContributionRevision = __decorateClass$
|
|
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({
|
|
1459
1550
|
tableName: "content_contribution_revisions",
|
|
1460
1551
|
conflictColumns: ["contribution_id", "revision_number"],
|
|
1461
1552
|
api: { include: [
|
|
@@ -1495,21 +1586,21 @@ var ContentContributionRevisionCollection = class extends SmrtCollection {
|
|
|
1495
1586
|
};
|
|
1496
1587
|
//#endregion
|
|
1497
1588
|
//#region src/content-contribution-type.ts
|
|
1498
|
-
var __defProp$
|
|
1499
|
-
var __getOwnPropDesc$
|
|
1500
|
-
var __defNormalProp$
|
|
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, {
|
|
1501
1592
|
enumerable: true,
|
|
1502
1593
|
configurable: true,
|
|
1503
1594
|
writable: true,
|
|
1504
1595
|
value
|
|
1505
1596
|
}) : obj[key] = value;
|
|
1506
|
-
var __decorateClass$
|
|
1507
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1597
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
1598
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
1508
1599
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1509
|
-
if (kind && result) __defProp$
|
|
1600
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
1510
1601
|
return result;
|
|
1511
1602
|
};
|
|
1512
|
-
var __publicField$
|
|
1603
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1513
1604
|
function parseJSON(raw, fallback) {
|
|
1514
1605
|
if (!raw) return fallback;
|
|
1515
1606
|
if (typeof raw === "object") return structuredClone(raw);
|
|
@@ -1615,10 +1706,10 @@ var ContentContributionType = class extends SmrtObject {
|
|
|
1615
1706
|
return super.delete();
|
|
1616
1707
|
}
|
|
1617
1708
|
};
|
|
1618
|
-
__publicField$
|
|
1619
|
-
__decorateClass$
|
|
1620
|
-
__decorateClass$
|
|
1621
|
-
ContentContributionType = __decorateClass$
|
|
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({
|
|
1622
1713
|
tableName: "content_contribution_types",
|
|
1623
1714
|
conflictColumns: ["tenant_id", "key"],
|
|
1624
1715
|
api: { include: [
|
|
@@ -1655,21 +1746,21 @@ var ContentContributionTypeCollection = class extends SmrtCollection {
|
|
|
1655
1746
|
};
|
|
1656
1747
|
//#endregion
|
|
1657
1748
|
//#region src/content-contributor.ts
|
|
1658
|
-
var __defProp$
|
|
1659
|
-
var __getOwnPropDesc$
|
|
1660
|
-
var __defNormalProp$
|
|
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, {
|
|
1661
1752
|
enumerable: true,
|
|
1662
1753
|
configurable: true,
|
|
1663
1754
|
writable: true,
|
|
1664
1755
|
value
|
|
1665
1756
|
}) : obj[key] = value;
|
|
1666
|
-
var __decorateClass$
|
|
1667
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1757
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
1758
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
1668
1759
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1669
|
-
if (kind && result) __defProp$
|
|
1760
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
1670
1761
|
return result;
|
|
1671
1762
|
};
|
|
1672
|
-
var __publicField$
|
|
1763
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1673
1764
|
function parseMetadata$1(raw) {
|
|
1674
1765
|
if (!raw) return {};
|
|
1675
1766
|
if (typeof raw === "object") return { ...raw };
|
|
@@ -1715,16 +1806,16 @@ var ContentContributor = class extends SmrtObject {
|
|
|
1715
1806
|
};
|
|
1716
1807
|
}
|
|
1717
1808
|
};
|
|
1718
|
-
__publicField$
|
|
1719
|
-
__decorateClass$
|
|
1720
|
-
__decorateClass$
|
|
1809
|
+
__publicField$6(ContentContributor, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
1810
|
+
__decorateClass$6([crossPackageRef("@happyvertical/smrt-profiles:Profile")], ContentContributor.prototype, "profileId", 2);
|
|
1811
|
+
__decorateClass$6([field({
|
|
1721
1812
|
required: true,
|
|
1722
1813
|
description: "The email address the contributor writes in from."
|
|
1723
1814
|
})], ContentContributor.prototype, "email", 2);
|
|
1724
|
-
__decorateClass$
|
|
1725
|
-
__decorateClass$
|
|
1726
|
-
__decorateClass$
|
|
1727
|
-
ContentContributor = __decorateClass$
|
|
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({
|
|
1728
1819
|
tableName: "content_contributors",
|
|
1729
1820
|
conflictColumns: ["email"],
|
|
1730
1821
|
api: { include: [
|
|
@@ -1746,21 +1837,21 @@ ContentContributor = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt
|
|
|
1746
1837
|
//#endregion
|
|
1747
1838
|
//#region src/content-contributors.ts
|
|
1748
1839
|
var content_contributors_exports = /* @__PURE__ */ __exportAll({ ContentContributorCollection: () => ContentContributorCollection });
|
|
1749
|
-
var __defProp$
|
|
1750
|
-
var __getOwnPropDesc$
|
|
1751
|
-
var __defNormalProp$
|
|
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, {
|
|
1752
1843
|
enumerable: true,
|
|
1753
1844
|
configurable: true,
|
|
1754
1845
|
writable: true,
|
|
1755
1846
|
value
|
|
1756
1847
|
}) : obj[key] = value;
|
|
1757
|
-
var __decorateClass$
|
|
1758
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1848
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
1849
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
1759
1850
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1760
|
-
if (kind && result) __defProp$
|
|
1851
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
1761
1852
|
return result;
|
|
1762
1853
|
};
|
|
1763
|
-
var __publicField$
|
|
1854
|
+
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1764
1855
|
var ContentContributorCollection = class extends SmrtCollection {
|
|
1765
1856
|
async getByEmail(email) {
|
|
1766
1857
|
return this.get({ email: email.toLowerCase().trim() });
|
|
@@ -1804,9 +1895,9 @@ var ContentContributorCollection = class extends SmrtCollection {
|
|
|
1804
1895
|
return contributor;
|
|
1805
1896
|
}
|
|
1806
1897
|
};
|
|
1807
|
-
__publicField$
|
|
1808
|
-
__publicField$
|
|
1809
|
-
ContentContributorCollection = __decorateClass$
|
|
1898
|
+
__publicField$5(ContentContributorCollection, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
1899
|
+
__publicField$5(ContentContributorCollection, "_itemClass", ContentContributor);
|
|
1900
|
+
ContentContributorCollection = __decorateClass$5([smrt({
|
|
1810
1901
|
tableName: "content_contributors",
|
|
1811
1902
|
conflictColumns: ["email"],
|
|
1812
1903
|
api: { include: [
|
|
@@ -1830,21 +1921,21 @@ ContentContributorCollection = __decorateClass$6([smrt({
|
|
|
1830
1921
|
})], ContentContributorCollection);
|
|
1831
1922
|
//#endregion
|
|
1832
1923
|
//#region src/content-contributions.ts
|
|
1833
|
-
var __defProp$
|
|
1834
|
-
var __getOwnPropDesc$
|
|
1835
|
-
var __defNormalProp$
|
|
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, {
|
|
1836
1927
|
enumerable: true,
|
|
1837
1928
|
configurable: true,
|
|
1838
1929
|
writable: true,
|
|
1839
1930
|
value
|
|
1840
1931
|
}) : obj[key] = value;
|
|
1841
|
-
var __decorateClass$
|
|
1842
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
1932
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
1933
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
1843
1934
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1844
|
-
if (kind && result) __defProp$
|
|
1935
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
1845
1936
|
return result;
|
|
1846
1937
|
};
|
|
1847
|
-
var __publicField$
|
|
1938
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1848
1939
|
function toContributionStatus(decision) {
|
|
1849
1940
|
if (decision === "quarantined") return "quarantined";
|
|
1850
1941
|
if (decision === "rejected") return "rejected";
|
|
@@ -2086,9 +2177,9 @@ var ContentContributions = class extends SmrtCollection {
|
|
|
2086
2177
|
};
|
|
2087
2178
|
}
|
|
2088
2179
|
};
|
|
2089
|
-
__publicField$
|
|
2090
|
-
__publicField$
|
|
2091
|
-
ContentContributions = __decorateClass$
|
|
2180
|
+
__publicField$4(ContentContributions, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
2181
|
+
__publicField$4(ContentContributions, "_itemClass", ContentContribution);
|
|
2182
|
+
ContentContributions = __decorateClass$4([smrt({
|
|
2092
2183
|
api: {
|
|
2093
2184
|
include: [
|
|
2094
2185
|
"submitWebContribution",
|
|
@@ -6219,21 +6310,21 @@ function parseContentFeed(xml, baseUrl) {
|
|
|
6219
6310
|
}
|
|
6220
6311
|
//#endregion
|
|
6221
6312
|
//#region src/content-feed-source.ts
|
|
6222
|
-
var __defProp$
|
|
6223
|
-
var __getOwnPropDesc$
|
|
6224
|
-
var __defNormalProp$
|
|
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, {
|
|
6225
6316
|
enumerable: true,
|
|
6226
6317
|
configurable: true,
|
|
6227
6318
|
writable: true,
|
|
6228
6319
|
value
|
|
6229
6320
|
}) : obj[key] = value;
|
|
6230
|
-
var __decorateClass$
|
|
6231
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6321
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
6322
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
6232
6323
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6233
|
-
if (kind && result) __defProp$
|
|
6324
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
6234
6325
|
return result;
|
|
6235
6326
|
};
|
|
6236
|
-
var __publicField$
|
|
6327
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6237
6328
|
var SOURCE_STATUSES = /* @__PURE__ */ new Set([
|
|
6238
6329
|
"active",
|
|
6239
6330
|
"paused",
|
|
@@ -6350,16 +6441,16 @@ var ContentFeedSource = class extends SmrtObject {
|
|
|
6350
6441
|
};
|
|
6351
6442
|
}
|
|
6352
6443
|
};
|
|
6353
|
-
__publicField$
|
|
6354
|
-
__decorateClass$
|
|
6355
|
-
__decorateClass$
|
|
6356
|
-
__decorateClass$
|
|
6357
|
-
__decorateClass$
|
|
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({
|
|
6358
6449
|
type: "text",
|
|
6359
6450
|
required: true,
|
|
6360
6451
|
default: "active"
|
|
6361
6452
|
})], ContentFeedSource.prototype, "status", 2);
|
|
6362
|
-
ContentFeedSource = __decorateClass$
|
|
6453
|
+
ContentFeedSource = __decorateClass$3([TenantScoped({ mode: "optional" }), smrt({
|
|
6363
6454
|
tableName: "content_feed_sources",
|
|
6364
6455
|
conflictColumns: ["tenant_id", "feed_url"],
|
|
6365
6456
|
api: { include: [
|
|
@@ -6408,92 +6499,6 @@ var ContentFeedSourceCollection = class extends SmrtCollection {
|
|
|
6408
6499
|
}
|
|
6409
6500
|
};
|
|
6410
6501
|
//#endregion
|
|
6411
|
-
//#region src/content-types.ts
|
|
6412
|
-
var __defProp$3 = Object.defineProperty;
|
|
6413
|
-
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
6414
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|
|
6415
|
-
enumerable: true,
|
|
6416
|
-
configurable: true,
|
|
6417
|
-
writable: true,
|
|
6418
|
-
value
|
|
6419
|
-
}) : obj[key] = value;
|
|
6420
|
-
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
6421
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
6422
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6423
|
-
if (kind && result) __defProp$3(target, key, result);
|
|
6424
|
-
return result;
|
|
6425
|
-
};
|
|
6426
|
-
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6427
|
-
var Article = class extends Content {
|
|
6428
|
-
constructor(options = {}) {
|
|
6429
|
-
super(options);
|
|
6430
|
-
}
|
|
6431
|
-
};
|
|
6432
|
-
__publicField$3(Article, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
6433
|
-
Article = __decorateClass$3([smrt({
|
|
6434
|
-
tableStrategy: "sti",
|
|
6435
|
-
api: false,
|
|
6436
|
-
mcp: false,
|
|
6437
|
-
cli: false
|
|
6438
|
-
})], Article);
|
|
6439
|
-
var ContentDocument = class extends Content {
|
|
6440
|
-
constructor(options = {}) {
|
|
6441
|
-
super(options);
|
|
6442
|
-
}
|
|
6443
|
-
};
|
|
6444
|
-
__publicField$3(ContentDocument, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
6445
|
-
ContentDocument = __decorateClass$3([smrt({
|
|
6446
|
-
tableStrategy: "sti",
|
|
6447
|
-
api: false,
|
|
6448
|
-
mcp: false,
|
|
6449
|
-
cli: false
|
|
6450
|
-
})], ContentDocument);
|
|
6451
|
-
function parseOptionalDate(value) {
|
|
6452
|
-
if (!value) return null;
|
|
6453
|
-
if (value instanceof Date) return value;
|
|
6454
|
-
const parsed = new Date(value);
|
|
6455
|
-
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
6456
|
-
}
|
|
6457
|
-
var Mirror = class extends Content {
|
|
6458
|
-
feedSourceId = null;
|
|
6459
|
-
sourceGuid = null;
|
|
6460
|
-
sourceName = null;
|
|
6461
|
-
sourceHomepageUrl = null;
|
|
6462
|
-
externalUrl = null;
|
|
6463
|
-
originalPublishedAt = null;
|
|
6464
|
-
dedupeKey = null;
|
|
6465
|
-
constructor(options = {}) {
|
|
6466
|
-
super(options);
|
|
6467
|
-
if (options.feedSourceId !== void 0) this.feedSourceId = options.feedSourceId;
|
|
6468
|
-
if (options.sourceGuid !== void 0) this.sourceGuid = options.sourceGuid;
|
|
6469
|
-
if (options.sourceName !== void 0) this.sourceName = options.sourceName;
|
|
6470
|
-
if (options.sourceHomepageUrl !== void 0) this.sourceHomepageUrl = options.sourceHomepageUrl;
|
|
6471
|
-
if (options.externalUrl !== void 0) this.externalUrl = options.externalUrl;
|
|
6472
|
-
if (options.originalPublishedAt !== void 0) this.originalPublishedAt = parseOptionalDate(options.originalPublishedAt);
|
|
6473
|
-
if (options.dedupeKey !== void 0) this.dedupeKey = options.dedupeKey;
|
|
6474
|
-
}
|
|
6475
|
-
transformJSON(json) {
|
|
6476
|
-
return {
|
|
6477
|
-
...json,
|
|
6478
|
-
feedSourceId: this.feedSourceId,
|
|
6479
|
-
sourceGuid: this.sourceGuid,
|
|
6480
|
-
sourceName: this.sourceName,
|
|
6481
|
-
sourceHomepageUrl: this.sourceHomepageUrl,
|
|
6482
|
-
externalUrl: this.externalUrl,
|
|
6483
|
-
originalPublishedAt: this.originalPublishedAt?.toISOString() ?? null,
|
|
6484
|
-
dedupeKey: this.dedupeKey
|
|
6485
|
-
};
|
|
6486
|
-
}
|
|
6487
|
-
};
|
|
6488
|
-
__publicField$3(Mirror, "__smrtPackage__", "@happyvertical/smrt-content");
|
|
6489
|
-
__decorateClass$3([foreignKey("ContentFeedSource")], Mirror.prototype, "feedSourceId", 2);
|
|
6490
|
-
Mirror = __decorateClass$3([smrt({
|
|
6491
|
-
tableStrategy: "sti",
|
|
6492
|
-
api: false,
|
|
6493
|
-
mcp: false,
|
|
6494
|
-
cli: false
|
|
6495
|
-
})], Mirror);
|
|
6496
|
-
//#endregion
|
|
6497
6502
|
//#region src/content-feed-sync.ts
|
|
6498
6503
|
var FALLBACK_MIRROR_META_TYPE = "@happyvertical/smrt-content:Mirror";
|
|
6499
6504
|
function getMirrorMetaType() {
|