@happyvertical/smrt-content 0.54.1 → 0.54.4

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 (92) hide show
  1. package/dist/chunks/{content-corrections-CKuY-MSv.js → content-corrections-DBYUJDaD.js} +9 -1
  2. package/dist/chunks/content-corrections-DBYUJDaD.js.map +1 -0
  3. package/dist/chunks/content-query-ChszuIuV.js +4196 -0
  4. package/dist/chunks/content-query-ChszuIuV.js.map +1 -0
  5. package/dist/chunks/{content-reviews-D6o0zK8s.js → content-reviews-B6h2aJ9m.js} +9 -1
  6. package/dist/chunks/content-reviews-B6h2aJ9m.js.map +1 -0
  7. package/dist/chunks/{content-versions-DieJcZ_H.js → content-versions-BrfgO59T.js} +10 -2
  8. package/dist/chunks/content-versions-BrfgO59T.js.map +1 -0
  9. package/dist/chunks/{contents-Bf4xFZMc.js → contents-CuWts3Lz.js} +3 -2
  10. package/dist/chunks/contents-CuWts3Lz.js.map +1 -0
  11. package/dist/content-assets.d.ts +1 -1
  12. package/dist/content-assets.d.ts.map +1 -1
  13. package/dist/content-contribution-attachment.d.ts +1 -1
  14. package/dist/content-contribution-attachment.d.ts.map +1 -1
  15. package/dist/content-contribution-attachments.d.ts +1 -1
  16. package/dist/content-contribution-attachments.d.ts.map +1 -1
  17. package/dist/content-contribution-revision.d.ts +1 -1
  18. package/dist/content-contribution-revision.d.ts.map +1 -1
  19. package/dist/content-contribution-revisions.d.ts +1 -1
  20. package/dist/content-contribution-revisions.d.ts.map +1 -1
  21. package/dist/content-contribution-type.d.ts +1 -1
  22. package/dist/content-contribution-type.d.ts.map +1 -1
  23. package/dist/content-contribution-types.d.ts +1 -1
  24. package/dist/content-contribution-types.d.ts.map +1 -1
  25. package/dist/content-contribution.d.ts +4 -4
  26. package/dist/content-contribution.d.ts.map +1 -1
  27. package/dist/content-contributions.d.ts +7 -7
  28. package/dist/content-contributions.d.ts.map +1 -1
  29. package/dist/content-contributor.d.ts +1 -1
  30. package/dist/content-contributor.d.ts.map +1 -1
  31. package/dist/content-contributors.d.ts +1 -1
  32. package/dist/content-contributors.d.ts.map +1 -1
  33. package/dist/content-correction.d.ts +1 -1
  34. package/dist/content-correction.d.ts.map +1 -1
  35. package/dist/content-corrections.d.ts +1 -1
  36. package/dist/content-corrections.d.ts.map +1 -1
  37. package/dist/content-feed-source.d.ts +1 -1
  38. package/dist/content-feed-source.d.ts.map +1 -1
  39. package/dist/content-feed-sources.d.ts +1 -1
  40. package/dist/content-feed-sources.d.ts.map +1 -1
  41. package/dist/content-feed-sync.d.ts +2 -2
  42. package/dist/content-feed-sync.d.ts.map +1 -1
  43. package/dist/content-governance-assignment.d.ts +1 -1
  44. package/dist/content-governance-assignment.d.ts.map +1 -1
  45. package/dist/content-governance-assignments.d.ts +1 -1
  46. package/dist/content-governance-assignments.d.ts.map +1 -1
  47. package/dist/content-governance-policies.d.ts +1 -1
  48. package/dist/content-governance-policies.d.ts.map +1 -1
  49. package/dist/content-governance-policy.d.ts +1 -1
  50. package/dist/content-governance-policy.d.ts.map +1 -1
  51. package/dist/content-governance-profile.d.ts +1 -1
  52. package/dist/content-governance-profile.d.ts.map +1 -1
  53. package/dist/content-governance-profiles.d.ts +1 -1
  54. package/dist/content-governance-profiles.d.ts.map +1 -1
  55. package/dist/content-governance.d.ts +1 -1
  56. package/dist/content-governance.d.ts.map +1 -1
  57. package/dist/content-references.d.ts +1 -1
  58. package/dist/content-references.d.ts.map +1 -1
  59. package/dist/content-review.d.ts +1 -1
  60. package/dist/content-review.d.ts.map +1 -1
  61. package/dist/content-reviews.d.ts +2 -2
  62. package/dist/content-reviews.d.ts.map +1 -1
  63. package/dist/content-types.d.ts +1 -1
  64. package/dist/content-types.d.ts.map +1 -1
  65. package/dist/content-version.d.ts +3 -3
  66. package/dist/content-version.d.ts.map +1 -1
  67. package/dist/content-versions.d.ts +3 -3
  68. package/dist/content-versions.d.ts.map +1 -1
  69. package/dist/content.d.ts +14 -14
  70. package/dist/content.d.ts.map +1 -1
  71. package/dist/contents.d.ts +9 -9
  72. package/dist/contents.d.ts.map +1 -1
  73. package/dist/index.d.ts +81 -81
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +92 -9
  76. package/dist/index.js.map +1 -1
  77. package/dist/manifest.json +15 -14
  78. package/dist/mock-smrt-client.d.ts +1 -1
  79. package/dist/mock-smrt-client.d.ts.map +1 -1
  80. package/dist/server.js +1 -1
  81. package/dist/smrt-knowledge.json +31 -31
  82. package/dist/thumbnail-generator.d.ts +1 -1
  83. package/dist/thumbnail-generator.d.ts.map +1 -1
  84. package/dist/utils.d.ts +1 -1
  85. package/dist/utils.d.ts.map +1 -1
  86. package/package.json +24 -24
  87. package/dist/chunks/content-corrections-CKuY-MSv.js.map +0 -1
  88. package/dist/chunks/content-query-CkXopqQ2.js +0 -4170
  89. package/dist/chunks/content-query-CkXopqQ2.js.map +0 -1
  90. package/dist/chunks/content-reviews-D6o0zK8s.js.map +0 -1
  91. package/dist/chunks/content-versions-DieJcZ_H.js.map +0 -1
  92. package/dist/chunks/contents-Bf4xFZMc.js.map +0 -1
@@ -4,12 +4,19 @@ import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
4
4
  //#region src/content-correction.ts
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true,
11
+ value
12
+ }) : obj[key] = value;
7
13
  var __decorateClass = (decorators, target, key, kind) => {
8
14
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
9
15
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10
16
  if (kind && result) __defProp(target, key, result);
11
17
  return result;
12
18
  };
19
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
20
  var ContentCorrection = class extends SmrtObject {
14
21
  contentId = "";
15
22
  contentVersionId = "";
@@ -52,6 +59,7 @@ var ContentCorrection = class extends SmrtObject {
52
59
  }
53
60
  }
54
61
  };
62
+ __publicField(ContentCorrection, "__smrtPackage__", "@happyvertical/smrt-content");
55
63
  __decorateClass([foreignKey("Content", {
56
64
  required: true,
57
65
  onDelete: "CASCADE"
@@ -107,4 +115,4 @@ var ContentCorrectionCollection = class extends SmrtCollection {
107
115
  //#endregion
108
116
  export { content_corrections_exports as n, ContentCorrection as r, ContentCorrectionCollection as t };
109
117
 
110
- //# sourceMappingURL=content-corrections-CKuY-MSv.js.map
118
+ //# sourceMappingURL=content-corrections-DBYUJDaD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-corrections-DBYUJDaD.js","names":[],"sources":["../../src/content-correction.ts","../../src/content-corrections.ts"],"sourcesContent":["import type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type {\n ContentCorrectionStatus,\n ContentCorrectionType,\n} from './content-governance';\n\nexport interface ContentCorrectionOptions extends SmrtObjectOptions {\n contentId?: string;\n contentVersionId?: string;\n factId?: string;\n replacementFactId?: string;\n correctionType?: ContentCorrectionType;\n status?: ContentCorrectionStatus;\n summary?: string;\n incorrectText?: string;\n correctedText?: string;\n publicNote?: string;\n metadata?: string | Record<string, unknown>;\n tenantId?: string | null;\n publishedAt?: Date | null;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'content_corrections',\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: { skipApiCheck: true },\n})\nexport class ContentCorrection extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-content\";\n @foreignKey('Content', { required: true, onDelete: 'CASCADE' })\n contentId = '';\n\n @foreignKey('ContentVersion', { onDelete: 'CASCADE' })\n contentVersionId = '';\n\n @crossPackageRef('@happyvertical/smrt-facts:Fact')\n factId = '';\n\n @crossPackageRef('@happyvertical/smrt-facts:Fact')\n replacementFactId = '';\n correctionType: ContentCorrectionType = 'fact';\n status: ContentCorrectionStatus = 'draft';\n summary = '';\n incorrectText = '';\n correctedText = '';\n publicNote = '';\n metadata = '';\n\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n publishedAt: Date | null = null;\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: ContentCorrectionOptions = {}) {\n super(options);\n if (options.contentId) this.contentId = options.contentId;\n if (options.contentVersionId !== undefined)\n this.contentVersionId = options.contentVersionId;\n if (options.factId !== undefined) this.factId = options.factId;\n if (options.replacementFactId !== undefined)\n this.replacementFactId = options.replacementFactId;\n if (options.correctionType !== undefined)\n this.correctionType = options.correctionType;\n if (options.status !== undefined) this.status = options.status;\n if (options.summary !== undefined) this.summary = options.summary;\n if (options.incorrectText !== undefined)\n this.incorrectText = options.incorrectText;\n if (options.correctedText !== undefined)\n this.correctedText = options.correctedText;\n if (options.publicNote !== undefined) this.publicNote = options.publicNote;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.publishedAt !== undefined)\n this.publishedAt = options.publishedAt;\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n\n if (options.metadata !== undefined) {\n this.metadata =\n typeof options.metadata === 'string'\n ? options.metadata\n : JSON.stringify(options.metadata);\n }\n }\n\n getMetadata(): Record<string, unknown> {\n try {\n return this.metadata ? JSON.parse(this.metadata) : {};\n } catch {\n return {};\n }\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { ContentCorrection } from './content-correction';\n\nexport class ContentCorrectionCollection extends SmrtCollection<ContentCorrection> {\n static readonly _itemClass = ContentCorrection;\n\n async listForContent(contentId: string): Promise<ContentCorrection[]> {\n return this.list({\n where: { contentId },\n orderBy: 'created_at DESC',\n });\n }\n\n async getPublishedForContent(\n contentId: string,\n ): Promise<ContentCorrection[]> {\n return this.list({\n where: { contentId, status: 'published' },\n orderBy: 'published_at DESC',\n });\n }\n\n async issue(\n options: ConstructorParameters<typeof ContentCorrection>[0],\n ): Promise<ContentCorrection> {\n if (!options) {\n return this.create({});\n }\n\n return this.create({\n ...options,\n metadata:\n typeof options.metadata === 'string'\n ? options.metadata\n : options.metadata\n ? JSON.stringify(options.metadata)\n : undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCO,IAAM,oBAAN,cAAgC,WAAW;CAEhD,YAAY;CAGZ,mBAAmB;CAGnB,SAAS;CAGT,oBAAoB;CACpB,iBAAwC;CACxC,SAAkC;CAClC,UAAU;CACV,gBAAgB;CAChB,gBAAgB;CAChB,aAAa;CACb,WAAW;CAGX,WAA0B;CAE1B,cAA2B;CAC3B,4BAAY,IAAI,KAAK;CACrB,4BAAY,IAAI,KAAK;CAErB,YAAY,UAAoC,CAAC,GAAG;EAClD,MAAM,OAAO;EACb,IAAI,QAAQ,WAAW,KAAK,YAAY,QAAQ;EAChD,IAAI,QAAQ,qBAAqB,KAAA,GAC/B,KAAK,mBAAmB,QAAQ;EAClC,IAAI,QAAQ,WAAW,KAAA,GAAW,KAAK,SAAS,QAAQ;EACxD,IAAI,QAAQ,sBAAsB,KAAA,GAChC,KAAK,oBAAoB,QAAQ;EACnC,IAAI,QAAQ,mBAAmB,KAAA,GAC7B,KAAK,iBAAiB,QAAQ;EAChC,IAAI,QAAQ,WAAW,KAAA,GAAW,KAAK,SAAS,QAAQ;EACxD,IAAI,QAAQ,YAAY,KAAA,GAAW,KAAK,UAAU,QAAQ;EAC1D,IAAI,QAAQ,kBAAkB,KAAA,GAC5B,KAAK,gBAAgB,QAAQ;EAC/B,IAAI,QAAQ,kBAAkB,KAAA,GAC5B,KAAK,gBAAgB,QAAQ;EAC/B,IAAI,QA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