@happyvertical/smrt-content 0.54.2 → 0.54.3

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-content",
5
- "packageVersion": "0.54.2",
5
+ "packageVersion": "0.54.3",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-content:ContentAsset": {
8
8
  "name": "contentasset",
@@ -205,12 +205,12 @@
205
205
  "packageName": "@happyvertical/smrt-content",
206
206
  "fields": {},
207
207
  "methods": {
208
- "byLeft": {
209
- "name": "byLeft",
208
+ "byRight": {
209
+ "name": "byRight",
210
210
  "async": true,
211
211
  "parameters": [
212
212
  {
213
- "name": "leftId",
213
+ "name": "rightId",
214
214
  "type": "string",
215
215
  "optional": false
216
216
  },
@@ -224,12 +224,12 @@
224
224
  "isStatic": false,
225
225
  "isPublic": true
226
226
  },
227
- "byRight": {
228
- "name": "byRight",
227
+ "byLeft": {
228
+ "name": "byLeft",
229
229
  "async": true,
230
230
  "parameters": [
231
231
  {
232
- "name": "rightId",
232
+ "name": "leftId",
233
233
  "type": "string",
234
234
  "optional": false
235
235
  },
@@ -5637,12 +5637,12 @@
5637
5637
  "packageName": "@happyvertical/smrt-content",
5638
5638
  "fields": {},
5639
5639
  "methods": {
5640
- "byLeft": {
5641
- "name": "byLeft",
5640
+ "byRight": {
5641
+ "name": "byRight",
5642
5642
  "async": true,
5643
5643
  "parameters": [
5644
5644
  {
5645
- "name": "leftId",
5645
+ "name": "rightId",
5646
5646
  "type": "string",
5647
5647
  "optional": false
5648
5648
  },
@@ -5656,12 +5656,12 @@
5656
5656
  "isStatic": false,
5657
5657
  "isPublic": true
5658
5658
  },
5659
- "byRight": {
5660
- "name": "byRight",
5659
+ "byLeft": {
5660
+ "name": "byLeft",
5661
5661
  "async": true,
5662
5662
  "parameters": [
5663
5663
  {
5664
- "name": "rightId",
5664
+ "name": "leftId",
5665
5665
  "type": "string",
5666
5666
  "optional": false
5667
5667
  },
@@ -12777,5 +12777,6 @@
12777
12777
  "@happyvertical/smrt-prompts",
12778
12778
  "@happyvertical/smrt-tenancy",
12779
12779
  "@happyvertical/smrt-users"
12780
- ]
12780
+ ],
12781
+ "stampsConstructors": true
12781
12782
  }
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as assertContentQuerySchema, t as CONTENT_QUERY_CLASS_NAME, v as buildContentQuerySchema, w as Content, x as executeContentQuery } from "./chunks/content-query-CySNL0lU.js";
1
+ import { _ as assertContentQuerySchema, t as CONTENT_QUERY_CLASS_NAME, v as buildContentQuerySchema, w as Content, x as executeContentQuery } from "./chunks/content-query-CbKxnce1.js";
2
2
  import { MAX_DATA_QUERY_PAGE_LIMIT, createDataQueryFingerprint, normalizeDataQueryRequest, startRestServer } from "@happyvertical/smrt-core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-content",
6
- "packageVersion": "0.54.2",
6
+ "packageVersion": "0.54.3",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "d31e44c1285b12168862c244f38f18971d66ba931ed16791c473f7d8051a10e0",
11
- "packageJson": "0f2cfe46382ed1cd0bef976009f07b0113fe411a243189f0a0ada06cab804f24",
10
+ "manifest": "0bd71432ad7f3d3005a58d25e14fec238c2b34be5f5a33c1025a3dab5cf64021",
11
+ "packageJson": "d836c79bc42fe71405f5b2f77fbb8e4ca11ba497b83788c9d8dbf1586a3c96c7",
12
12
  "agents": "dffe54f5b13fa274d24056c6dc48179bd3bb4ef93c4e47670651f27b67523826",
13
13
  "moduleDoc:agents/content-list.md": "e5e990d6688f2a89fe521741e9af6e202dad5fa827307c727cfb5db92a83145a"
14
14
  },
@@ -4439,18 +4439,18 @@
4439
4439
  "surfaces": [
4440
4440
  {
4441
4441
  "kind": "api",
4442
- "name": "contentreferences.byLeft",
4443
- "operation": "byLeft",
4442
+ "name": "contentreferences.byRight",
4443
+ "operation": "byRight",
4444
4444
  "objectName": "@happyvertical/smrt-content:ContentReferences",
4445
- "path": "/contentreferences/byLeft",
4445
+ "path": "/contentreferences/byRight",
4446
4446
  "method": "POST"
4447
4447
  },
4448
4448
  {
4449
4449
  "kind": "api",
4450
- "name": "contentreferences.byRight",
4451
- "operation": "byRight",
4450
+ "name": "contentreferences.byLeft",
4451
+ "operation": "byLeft",
4452
4452
  "objectName": "@happyvertical/smrt-content:ContentReferences",
4453
- "path": "/contentreferences/byRight",
4453
+ "path": "/contentreferences/byLeft",
4454
4454
  "method": "POST"
4455
4455
  },
4456
4456
  {
@@ -4503,14 +4503,14 @@
4503
4503
  },
4504
4504
  {
4505
4505
  "kind": "cli",
4506
- "name": "contentreferences_byLeft",
4507
- "operation": "byLeft",
4506
+ "name": "contentreferences_byRight",
4507
+ "operation": "byRight",
4508
4508
  "objectName": "@happyvertical/smrt-content:ContentReferences"
4509
4509
  },
4510
4510
  {
4511
4511
  "kind": "cli",
4512
- "name": "contentreferences_byRight",
4513
- "operation": "byRight",
4512
+ "name": "contentreferences_byLeft",
4513
+ "operation": "byLeft",
4514
4514
  "objectName": "@happyvertical/smrt-content:ContentReferences"
4515
4515
  },
4516
4516
  {
@@ -4551,14 +4551,14 @@
4551
4551
  },
4552
4552
  {
4553
4553
  "kind": "mcp",
4554
- "name": "contentreferences_byleft",
4555
- "operation": "byLeft",
4554
+ "name": "contentreferences_byright",
4555
+ "operation": "byRight",
4556
4556
  "objectName": "@happyvertical/smrt-content:ContentReferences"
4557
4557
  },
4558
4558
  {
4559
4559
  "kind": "mcp",
4560
- "name": "contentreferences_byright",
4561
- "operation": "byRight",
4560
+ "name": "contentreferences_byleft",
4561
+ "operation": "byLeft",
4562
4562
  "objectName": "@happyvertical/smrt-content:ContentReferences"
4563
4563
  },
4564
4564
  {
@@ -12931,18 +12931,18 @@
12931
12931
  },
12932
12932
  {
12933
12933
  "kind": "api",
12934
- "name": "contentreferences.byLeft",
12935
- "operation": "byLeft",
12934
+ "name": "contentreferences.byRight",
12935
+ "operation": "byRight",
12936
12936
  "objectName": "@happyvertical/smrt-content:ContentReferences",
12937
- "path": "/contentreferences/byLeft",
12937
+ "path": "/contentreferences/byRight",
12938
12938
  "method": "POST"
12939
12939
  },
12940
12940
  {
12941
12941
  "kind": "api",
12942
- "name": "contentreferences.byRight",
12943
- "operation": "byRight",
12942
+ "name": "contentreferences.byLeft",
12943
+ "operation": "byLeft",
12944
12944
  "objectName": "@happyvertical/smrt-content:ContentReferences",
12945
- "path": "/contentreferences/byRight",
12945
+ "path": "/contentreferences/byLeft",
12946
12946
  "method": "POST"
12947
12947
  },
12948
12948
  {
@@ -12995,14 +12995,14 @@
12995
12995
  },
12996
12996
  {
12997
12997
  "kind": "cli",
12998
- "name": "contentreferences_byLeft",
12999
- "operation": "byLeft",
12998
+ "name": "contentreferences_byRight",
12999
+ "operation": "byRight",
13000
13000
  "objectName": "@happyvertical/smrt-content:ContentReferences"
13001
13001
  },
13002
13002
  {
13003
13003
  "kind": "cli",
13004
- "name": "contentreferences_byRight",
13005
- "operation": "byRight",
13004
+ "name": "contentreferences_byLeft",
13005
+ "operation": "byLeft",
13006
13006
  "objectName": "@happyvertical/smrt-content:ContentReferences"
13007
13007
  },
13008
13008
  {
@@ -13043,14 +13043,14 @@
13043
13043
  },
13044
13044
  {
13045
13045
  "kind": "mcp",
13046
- "name": "contentreferences_byleft",
13047
- "operation": "byLeft",
13046
+ "name": "contentreferences_byright",
13047
+ "operation": "byRight",
13048
13048
  "objectName": "@happyvertical/smrt-content:ContentReferences"
13049
13049
  },
13050
13050
  {
13051
13051
  "kind": "mcp",
13052
- "name": "contentreferences_byright",
13053
- "operation": "byRight",
13052
+ "name": "contentreferences_byleft",
13053
+ "operation": "byLeft",
13054
13054
  "objectName": "@happyvertical/smrt-content:ContentReferences"
13055
13055
  },
13056
13056
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-content",
3
- "version": "0.54.2",
3
+ "version": "0.54.3",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "Content processing module for SMRT framework - handles documents, web content, and media",
6
6
  "type": "module",
@@ -47,29 +47,29 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@happyvertical/ai": "^0.100.3",
51
- "@happyvertical/documents": "^0.100.3",
52
- "@happyvertical/files": "^0.100.3",
53
- "@happyvertical/geo": "^0.100.3",
54
- "@happyvertical/images": "^0.100.3",
55
- "@happyvertical/logger": "^0.100.3",
50
+ "@happyvertical/ai": "^0.102.1",
51
+ "@happyvertical/documents": "^0.102.1",
52
+ "@happyvertical/files": "^0.102.1",
53
+ "@happyvertical/geo": "^0.102.1",
54
+ "@happyvertical/images": "^0.102.1",
55
+ "@happyvertical/logger": "^0.102.1",
56
56
  "@happyvertical/ocr": "^0.61.6",
57
57
  "@happyvertical/pdf": "^0.65.9",
58
- "@happyvertical/smrt-assets": "0.54.2",
59
- "@happyvertical/smrt-agents": "0.54.2",
60
- "@happyvertical/smrt-chat": "0.54.2",
61
- "@happyvertical/smrt-core": "0.54.2",
62
- "@happyvertical/smrt-facts": "0.54.2",
63
- "@happyvertical/smrt-images": "0.54.2",
64
- "@happyvertical/smrt-messages": "0.54.2",
65
- "@happyvertical/smrt-prompts": "0.54.2",
66
- "@happyvertical/smrt-profiles": "0.54.2",
67
- "@happyvertical/smrt-tenancy": "0.54.2",
68
- "@happyvertical/smrt-types": "0.54.2",
69
- "@happyvertical/smrt-ui": "0.54.2",
58
+ "@happyvertical/smrt-assets": "0.54.3",
59
+ "@happyvertical/smrt-agents": "0.54.3",
60
+ "@happyvertical/smrt-chat": "0.54.3",
61
+ "@happyvertical/smrt-core": "0.54.3",
62
+ "@happyvertical/smrt-facts": "0.54.3",
63
+ "@happyvertical/smrt-images": "0.54.3",
64
+ "@happyvertical/smrt-messages": "0.54.3",
65
+ "@happyvertical/smrt-prompts": "0.54.3",
66
+ "@happyvertical/smrt-profiles": "0.54.3",
67
+ "@happyvertical/smrt-tenancy": "0.54.3",
68
+ "@happyvertical/smrt-types": "0.54.3",
69
+ "@happyvertical/smrt-ui": "0.54.3",
70
70
  "@happyvertical/spider": "^1.1.13",
71
- "@happyvertical/sql": "^0.100.3",
72
- "@happyvertical/utils": "^0.100.3",
71
+ "@happyvertical/sql": "^0.102.1",
72
+ "@happyvertical/utils": "^0.102.1",
73
73
  "fast-xml-parser": "^5.11.1",
74
74
  "sanitize-html": "^2.17.7",
75
75
  "undici": "^7.29.1",
@@ -85,9 +85,9 @@
85
85
  },
86
86
  "devDependencies": {
87
87
  "@faker-js/faker": "^10.6.0",
88
- "@happyvertical/smrt-playground": "0.54.2",
89
- "@happyvertical/smrt-users": "0.54.2",
90
- "@happyvertical/smrt-vitest": "0.54.2",
88
+ "@happyvertical/smrt-playground": "0.54.3",
89
+ "@happyvertical/smrt-users": "0.54.3",
90
+ "@happyvertical/smrt-vitest": "0.54.3",
91
91
  "@sveltejs/kit": "2.69.1",
92
92
  "@sveltejs/package": "^2.5.8",
93
93
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-corrections-CKuY-MSv.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 {\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,KA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