@redaksjon/context 0.0.6-dev.20260201002029.b3e330c → 0.0.6
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/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +28 -0
- package/dist/index10.cjs.map +1 -0
- package/dist/index10.js +24 -0
- package/dist/index10.js.map +1 -0
- package/dist/index2.cjs +18 -5
- package/dist/index2.cjs.map +1 -1
- package/dist/index2.js +7 -5
- package/dist/index2.js.map +1 -1
- package/dist/index4.cjs +7 -1
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +7 -1
- package/dist/index4.js.map +1 -1
- package/dist/index5.cjs +104 -8
- package/dist/index5.cjs.map +1 -1
- package/dist/index5.js +98 -8
- package/dist/index5.js.map +1 -1
- package/dist/index6.cjs +48 -15
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +44 -15
- package/dist/index6.js.map +1 -1
- package/dist/index7.cjs +6 -32
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +6 -29
- package/dist/index7.js.map +1 -1
- package/dist/index8.cjs +18 -11
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +18 -11
- package/dist/index8.js.map +1 -1
- package/dist/index9.cjs +41 -0
- package/dist/index9.cjs.map +1 -0
- package/dist/index9.js +35 -0
- package/dist/index9.js.map +1 -0
- package/dist/schemas/company.d.ts +16 -0
- package/dist/schemas/company.d.ts.map +1 -1
- package/dist/schemas/content.d.ts +59 -0
- package/dist/schemas/content.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +66 -7
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/person.d.ts +16 -0
- package/dist/schemas/person.d.ts.map +1 -1
- package/dist/schemas/project.d.ts +16 -17
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/relationships.d.ts +46 -0
- package/dist/schemas/relationships.d.ts.map +1 -0
- package/dist/schemas/term.d.ts +16 -0
- package/dist/schemas/term.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const index = require('./index2.cjs');
|
|
6
6
|
const types = require('./index3.cjs');
|
|
7
7
|
const company = require('./index4.cjs');
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
const content = require('./index5.cjs');
|
|
9
|
+
const relationships = require('./index6.cjs');
|
|
10
|
+
const ignored = require('./index7.cjs');
|
|
11
|
+
const person = require('./index8.cjs');
|
|
12
|
+
const project = require('./index9.cjs');
|
|
13
|
+
const term = require('./index10.cjs');
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
@@ -17,10 +19,21 @@ exports.redaksjonSchemas = index.redaksjonSchemas;
|
|
|
17
19
|
exports.DIRECTORY_TO_TYPE = types.DIRECTORY_TO_TYPE;
|
|
18
20
|
exports.TYPE_TO_DIRECTORY = types.TYPE_TO_DIRECTORY;
|
|
19
21
|
exports.CompanySchema = company.CompanySchema;
|
|
22
|
+
exports.EntityContentItemSchema = content.EntityContentItemSchema;
|
|
23
|
+
exports.EntityContentSchema = content.EntityContentSchema;
|
|
24
|
+
exports.createCodeContent = content.createCodeContent;
|
|
25
|
+
exports.createDocumentContent = content.createDocumentContent;
|
|
26
|
+
exports.createMarkdownContent = content.createMarkdownContent;
|
|
27
|
+
exports.createTextContent = content.createTextContent;
|
|
28
|
+
exports.createUrlContent = content.createUrlContent;
|
|
29
|
+
exports.EntityRelationshipSchema = relationships.EntityRelationshipSchema;
|
|
30
|
+
exports.RelationshipsSchema = relationships.RelationshipsSchema;
|
|
31
|
+
exports.createEntityUri = relationships.createEntityUri;
|
|
32
|
+
exports.createRelationship = relationships.createRelationship;
|
|
33
|
+
exports.parseEntityUri = relationships.parseEntityUri;
|
|
20
34
|
exports.IgnoredTermSchema = ignored.IgnoredTermSchema;
|
|
21
35
|
exports.PersonSchema = person.PersonSchema;
|
|
22
36
|
exports.ProjectClassificationSchema = project.ProjectClassificationSchema;
|
|
23
|
-
exports.ProjectRelationshipsSchema = project.ProjectRelationshipsSchema;
|
|
24
37
|
exports.ProjectRoutingSchema = project.ProjectRoutingSchema;
|
|
25
38
|
exports.ProjectSchema = project.ProjectSchema;
|
|
26
39
|
exports.TermSchema = term.TermSchema;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { redaksjonPluralNames, redaksjonSchemas } from './index2.js';
|
|
2
2
|
export { DIRECTORY_TO_TYPE, TYPE_TO_DIRECTORY } from './index3.js';
|
|
3
3
|
export { CompanySchema } from './index4.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
4
|
+
export { EntityContentItemSchema, EntityContentSchema, createCodeContent, createDocumentContent, createMarkdownContent, createTextContent, createUrlContent } from './index5.js';
|
|
5
|
+
export { EntityRelationshipSchema, RelationshipsSchema, createEntityUri, createRelationship, parseEntityUri } from './index6.js';
|
|
6
|
+
export { IgnoredTermSchema } from './index7.js';
|
|
7
|
+
export { PersonSchema } from './index8.js';
|
|
8
|
+
export { ProjectClassificationSchema, ProjectRoutingSchema, ProjectSchema } from './index9.js';
|
|
9
|
+
export { TermSchema } from './index10.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/index10.cjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zod = require('zod');
|
|
6
|
+
const overcontext = require('@utilarium/overcontext');
|
|
7
|
+
const relationships = require('./index6.cjs');
|
|
8
|
+
const content = require('./index5.cjs');
|
|
9
|
+
|
|
10
|
+
const TermSchema = overcontext.BaseEntitySchema.merge(zod.z.object({
|
|
11
|
+
type: zod.z.literal("term"),
|
|
12
|
+
expansion: zod.z.string().optional(),
|
|
13
|
+
// Full form if acronym
|
|
14
|
+
domain: zod.z.string().optional(),
|
|
15
|
+
// E.g., "engineering", "finance"
|
|
16
|
+
sounds_like: zod.z.array(zod.z.string()).optional(),
|
|
17
|
+
projects: zod.z.array(zod.z.string()).optional(),
|
|
18
|
+
// DEPRECATED: Use relationships instead
|
|
19
|
+
description: zod.z.string().optional(),
|
|
20
|
+
topics: zod.z.array(zod.z.string()).optional(),
|
|
21
|
+
relationships: relationships.RelationshipsSchema,
|
|
22
|
+
// Relationships to other entities
|
|
23
|
+
content: content.EntityContentSchema
|
|
24
|
+
// Attached content (URLs, text, documents)
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
exports.TermSchema = TermSchema;
|
|
28
|
+
//# sourceMappingURL=index10.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index10.cjs","sources":["../src/schemas/term.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Term entity - domain-specific terminology and acronyms.\n */\nexport const TermSchema = BaseEntitySchema.merge(z.object({\n type: z.literal('term'),\n \n expansion: z.string().optional(), // Full form if acronym\n domain: z.string().optional(), // E.g., \"engineering\", \"finance\"\n sounds_like: z.array(z.string()).optional(),\n projects: z.array(z.string()).optional(), // DEPRECATED: Use relationships instead\n description: z.string().optional(),\n topics: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":["BaseEntitySchema","z","RelationshipsSchema","EntityContentSchema"],"mappings":";;;;;;;;;AAQO,MAAM,UAAA,GAAaA,4BAAA,CAAiB,KAAA,CAAMC,KAAA,CAAE,MAAA,CAAO;AAAA,EACtD,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,MAAM,CAAA;AAAA,EAEtB,SAAA,EAAWA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAC/B,MAAA,EAAQA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAC5B,aAAaA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,UAAUA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA;AAAA,EACvC,WAAA,EAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACjC,QAAQA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EACrC,aAAA,EAAeC,iCAAA;AAAA;AAAA,EACf,OAAA,EAASC;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index10.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseEntitySchema } from '@utilarium/overcontext';
|
|
3
|
+
import { RelationshipsSchema } from './index6.js';
|
|
4
|
+
import { EntityContentSchema } from './index5.js';
|
|
5
|
+
|
|
6
|
+
const TermSchema = BaseEntitySchema.merge(z.object({
|
|
7
|
+
type: z.literal("term"),
|
|
8
|
+
expansion: z.string().optional(),
|
|
9
|
+
// Full form if acronym
|
|
10
|
+
domain: z.string().optional(),
|
|
11
|
+
// E.g., "engineering", "finance"
|
|
12
|
+
sounds_like: z.array(z.string()).optional(),
|
|
13
|
+
projects: z.array(z.string()).optional(),
|
|
14
|
+
// DEPRECATED: Use relationships instead
|
|
15
|
+
description: z.string().optional(),
|
|
16
|
+
topics: z.array(z.string()).optional(),
|
|
17
|
+
relationships: RelationshipsSchema,
|
|
18
|
+
// Relationships to other entities
|
|
19
|
+
content: EntityContentSchema
|
|
20
|
+
// Attached content (URLs, text, documents)
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
export { TermSchema };
|
|
24
|
+
//# sourceMappingURL=index10.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/schemas/term.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Term entity - domain-specific terminology and acronyms.\n */\nexport const TermSchema = BaseEntitySchema.merge(z.object({\n type: z.literal('term'),\n \n expansion: z.string().optional(), // Full form if acronym\n domain: z.string().optional(), // E.g., \"engineering\", \"finance\"\n sounds_like: z.array(z.string()).optional(),\n projects: z.array(z.string()).optional(), // DEPRECATED: Use relationships instead\n description: z.string().optional(),\n topics: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":[],"mappings":";;;;;AAQO,MAAM,UAAA,GAAa,gBAAA,CAAiB,KAAA,CAAM,CAAA,CAAE,MAAA,CAAO;AAAA,EACtD,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,MAAM,CAAA;AAAA,EAEtB,SAAA,EAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAC/B,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAC5B,aAAa,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,UAAU,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA;AAAA,EACvC,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACjC,QAAQ,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EACrC,aAAA,EAAe,mBAAA;AAAA;AAAA,EACf,OAAA,EAAS;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index2.cjs
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const person = require('./
|
|
6
|
-
const project = require('./
|
|
5
|
+
const person = require('./index8.cjs');
|
|
6
|
+
const project = require('./index9.cjs');
|
|
7
7
|
const company = require('./index4.cjs');
|
|
8
|
-
const term = require('./
|
|
9
|
-
const ignored = require('./
|
|
8
|
+
const term = require('./index10.cjs');
|
|
9
|
+
const ignored = require('./index7.cjs');
|
|
10
|
+
const relationships = require('./index6.cjs');
|
|
11
|
+
const content = require('./index5.cjs');
|
|
10
12
|
|
|
11
13
|
const redaksjonSchemas = {
|
|
12
14
|
person: person.PersonSchema,
|
|
@@ -25,12 +27,23 @@ const redaksjonPluralNames = {
|
|
|
25
27
|
|
|
26
28
|
exports.PersonSchema = person.PersonSchema;
|
|
27
29
|
exports.ProjectClassificationSchema = project.ProjectClassificationSchema;
|
|
28
|
-
exports.ProjectRelationshipsSchema = project.ProjectRelationshipsSchema;
|
|
29
30
|
exports.ProjectRoutingSchema = project.ProjectRoutingSchema;
|
|
30
31
|
exports.ProjectSchema = project.ProjectSchema;
|
|
31
32
|
exports.CompanySchema = company.CompanySchema;
|
|
32
33
|
exports.TermSchema = term.TermSchema;
|
|
33
34
|
exports.IgnoredTermSchema = ignored.IgnoredTermSchema;
|
|
35
|
+
exports.EntityRelationshipSchema = relationships.EntityRelationshipSchema;
|
|
36
|
+
exports.RelationshipsSchema = relationships.RelationshipsSchema;
|
|
37
|
+
exports.createEntityUri = relationships.createEntityUri;
|
|
38
|
+
exports.createRelationship = relationships.createRelationship;
|
|
39
|
+
exports.parseEntityUri = relationships.parseEntityUri;
|
|
40
|
+
exports.EntityContentItemSchema = content.EntityContentItemSchema;
|
|
41
|
+
exports.EntityContentSchema = content.EntityContentSchema;
|
|
42
|
+
exports.createCodeContent = content.createCodeContent;
|
|
43
|
+
exports.createDocumentContent = content.createDocumentContent;
|
|
44
|
+
exports.createMarkdownContent = content.createMarkdownContent;
|
|
45
|
+
exports.createTextContent = content.createTextContent;
|
|
46
|
+
exports.createUrlContent = content.createUrlContent;
|
|
34
47
|
exports.redaksjonPluralNames = redaksjonPluralNames;
|
|
35
48
|
exports.redaksjonSchemas = redaksjonSchemas;
|
|
36
49
|
//# sourceMappingURL=index2.cjs.map
|
package/dist/index2.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.cjs","sources":["../src/schemas/index.ts"],"sourcesContent":["export * from './person';\nexport * from './project';\nexport * from './company';\nexport * from './term';\nexport * from './ignored';\n\nimport { PersonSchema } from './person';\nimport { ProjectSchema } from './project';\nimport { CompanySchema } from './company';\nimport { TermSchema } from './term';\nimport { IgnoredTermSchema } from './ignored';\n\n/**\n * All redaksjon schemas for use with overcontext.\n * \n * Usage:\n * ```typescript\n * import { redaksjonSchemas } from '@redaksjon/context';\n * import { discoverOvercontext } from '@utilarium/overcontext';\n * \n * const ctx = await discoverOvercontext({\n * schemas: redaksjonSchemas,\n * pluralNames: redaksjonPluralNames,\n * });\n * ```\n */\nexport const redaksjonSchemas = {\n person: PersonSchema,\n project: ProjectSchema,\n company: CompanySchema,\n term: TermSchema,\n ignored: IgnoredTermSchema,\n};\n\n/**\n * Plural names for directory mapping.\n */\nexport const redaksjonPluralNames = {\n person: 'people',\n company: 'companies',\n term: 'terms',\n ignored: 'ignored',\n project: 'projects',\n};\n"],"names":["PersonSchema","ProjectSchema","CompanySchema","TermSchema","IgnoredTermSchema"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index2.cjs","sources":["../src/schemas/index.ts"],"sourcesContent":["export * from './person';\nexport * from './project';\nexport * from './company';\nexport * from './term';\nexport * from './ignored';\nexport * from './relationships';\nexport * from './content';\n\nimport { PersonSchema } from './person';\nimport { ProjectSchema } from './project';\nimport { CompanySchema } from './company';\nimport { TermSchema } from './term';\nimport { IgnoredTermSchema } from './ignored';\n\n/**\n * All redaksjon schemas for use with overcontext.\n * \n * Usage:\n * ```typescript\n * import { redaksjonSchemas } from '@redaksjon/context';\n * import { discoverOvercontext } from '@utilarium/overcontext';\n * \n * const ctx = await discoverOvercontext({\n * schemas: redaksjonSchemas,\n * pluralNames: redaksjonPluralNames,\n * });\n * ```\n */\nexport const redaksjonSchemas = {\n person: PersonSchema,\n project: ProjectSchema,\n company: CompanySchema,\n term: TermSchema,\n ignored: IgnoredTermSchema,\n};\n\n/**\n * Plural names for directory mapping.\n */\nexport const redaksjonPluralNames = {\n person: 'people',\n company: 'companies',\n term: 'terms',\n ignored: 'ignored',\n project: 'projects',\n};\n"],"names":["PersonSchema","ProjectSchema","CompanySchema","TermSchema","IgnoredTermSchema"],"mappings":";;;;;;;;;;;;AA4BO,MAAM,gBAAA,GAAmB;AAAA,EAC5B,MAAA,EAAQA,mBAAA;AAAA,EACR,OAAA,EAASC,qBAAA;AAAA,EACT,OAAA,EAASC,qBAAA;AAAA,EACT,IAAA,EAAMC,eAAA;AAAA,EACN,OAAA,EAASC;AACb;AAKO,MAAM,oBAAA,GAAuB;AAAA,EAChC,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,WAAA;AAAA,EACT,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS;AACb;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index2.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { PersonSchema } from './
|
|
2
|
-
import { ProjectSchema } from './
|
|
3
|
-
export { ProjectClassificationSchema,
|
|
1
|
+
import { PersonSchema } from './index8.js';
|
|
2
|
+
import { ProjectSchema } from './index9.js';
|
|
3
|
+
export { ProjectClassificationSchema, ProjectRoutingSchema } from './index9.js';
|
|
4
4
|
import { CompanySchema } from './index4.js';
|
|
5
|
-
import { TermSchema } from './
|
|
6
|
-
import { IgnoredTermSchema } from './
|
|
5
|
+
import { TermSchema } from './index10.js';
|
|
6
|
+
import { IgnoredTermSchema } from './index7.js';
|
|
7
|
+
export { EntityRelationshipSchema, RelationshipsSchema, createEntityUri, createRelationship, parseEntityUri } from './index6.js';
|
|
8
|
+
export { EntityContentItemSchema, EntityContentSchema, createCodeContent, createDocumentContent, createMarkdownContent, createTextContent, createUrlContent } from './index5.js';
|
|
7
9
|
|
|
8
10
|
const redaksjonSchemas = {
|
|
9
11
|
person: PersonSchema,
|
package/dist/index2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":["../src/schemas/index.ts"],"sourcesContent":["export * from './person';\nexport * from './project';\nexport * from './company';\nexport * from './term';\nexport * from './ignored';\n\nimport { PersonSchema } from './person';\nimport { ProjectSchema } from './project';\nimport { CompanySchema } from './company';\nimport { TermSchema } from './term';\nimport { IgnoredTermSchema } from './ignored';\n\n/**\n * All redaksjon schemas for use with overcontext.\n * \n * Usage:\n * ```typescript\n * import { redaksjonSchemas } from '@redaksjon/context';\n * import { discoverOvercontext } from '@utilarium/overcontext';\n * \n * const ctx = await discoverOvercontext({\n * schemas: redaksjonSchemas,\n * pluralNames: redaksjonPluralNames,\n * });\n * ```\n */\nexport const redaksjonSchemas = {\n person: PersonSchema,\n project: ProjectSchema,\n company: CompanySchema,\n term: TermSchema,\n ignored: IgnoredTermSchema,\n};\n\n/**\n * Plural names for directory mapping.\n */\nexport const redaksjonPluralNames = {\n person: 'people',\n company: 'companies',\n term: 'terms',\n ignored: 'ignored',\n project: 'projects',\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index2.js","sources":["../src/schemas/index.ts"],"sourcesContent":["export * from './person';\nexport * from './project';\nexport * from './company';\nexport * from './term';\nexport * from './ignored';\nexport * from './relationships';\nexport * from './content';\n\nimport { PersonSchema } from './person';\nimport { ProjectSchema } from './project';\nimport { CompanySchema } from './company';\nimport { TermSchema } from './term';\nimport { IgnoredTermSchema } from './ignored';\n\n/**\n * All redaksjon schemas for use with overcontext.\n * \n * Usage:\n * ```typescript\n * import { redaksjonSchemas } from '@redaksjon/context';\n * import { discoverOvercontext } from '@utilarium/overcontext';\n * \n * const ctx = await discoverOvercontext({\n * schemas: redaksjonSchemas,\n * pluralNames: redaksjonPluralNames,\n * });\n * ```\n */\nexport const redaksjonSchemas = {\n person: PersonSchema,\n project: ProjectSchema,\n company: CompanySchema,\n term: TermSchema,\n ignored: IgnoredTermSchema,\n};\n\n/**\n * Plural names for directory mapping.\n */\nexport const redaksjonPluralNames = {\n person: 'people',\n company: 'companies',\n term: 'terms',\n ignored: 'ignored',\n project: 'projects',\n};\n"],"names":[],"mappings":";;;;;;;;;AA4BO,MAAM,gBAAA,GAAmB;AAAA,EAC5B,MAAA,EAAQ,YAAA;AAAA,EACR,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS;AACb;AAKO,MAAM,oBAAA,GAAuB;AAAA,EAChC,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,WAAA;AAAA,EACT,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS;AACb;;;;"}
|
package/dist/index4.cjs
CHANGED
|
@@ -4,12 +4,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const zod = require('zod');
|
|
6
6
|
const overcontext = require('@utilarium/overcontext');
|
|
7
|
+
const relationships = require('./index6.cjs');
|
|
8
|
+
const content = require('./index5.cjs');
|
|
7
9
|
|
|
8
10
|
const CompanySchema = overcontext.BaseEntitySchema.merge(zod.z.object({
|
|
9
11
|
type: zod.z.literal("company"),
|
|
10
12
|
fullName: zod.z.string().optional(),
|
|
11
13
|
industry: zod.z.string().optional(),
|
|
12
|
-
sounds_like: zod.z.array(zod.z.string()).optional()
|
|
14
|
+
sounds_like: zod.z.array(zod.z.string()).optional(),
|
|
15
|
+
relationships: relationships.RelationshipsSchema,
|
|
16
|
+
// Relationships to other entities
|
|
17
|
+
content: content.EntityContentSchema
|
|
18
|
+
// Attached content (URLs, text, documents)
|
|
13
19
|
}));
|
|
14
20
|
|
|
15
21
|
exports.CompanySchema = CompanySchema;
|
package/dist/index4.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.cjs","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n}));\n"],"names":["BaseEntitySchema","z"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index4.cjs","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":["BaseEntitySchema","z","RelationshipsSchema","EntityContentSchema"],"mappings":";;;;;;;;;AAQO,MAAM,aAAA,GAAgBA,4BAAA,CAAiB,KAAA,CAAMC,KAAA,CAAE,MAAA,CAAO;AAAA,EACzD,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,SAAS,CAAA;AAAA,EAEzB,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,aAAaA,KAAA,CAAE,KAAA,CAAMA,MAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,aAAA,EAAeC,iCAAA;AAAA;AAAA,EACf,OAAA,EAASC;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index4.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseEntitySchema } from '@utilarium/overcontext';
|
|
3
|
+
import { RelationshipsSchema } from './index6.js';
|
|
4
|
+
import { EntityContentSchema } from './index5.js';
|
|
3
5
|
|
|
4
6
|
const CompanySchema = BaseEntitySchema.merge(z.object({
|
|
5
7
|
type: z.literal("company"),
|
|
6
8
|
fullName: z.string().optional(),
|
|
7
9
|
industry: z.string().optional(),
|
|
8
|
-
sounds_like: z.array(z.string()).optional()
|
|
10
|
+
sounds_like: z.array(z.string()).optional(),
|
|
11
|
+
relationships: RelationshipsSchema,
|
|
12
|
+
// Relationships to other entities
|
|
13
|
+
content: EntityContentSchema
|
|
14
|
+
// Attached content (URLs, text, documents)
|
|
9
15
|
}));
|
|
10
16
|
|
|
11
17
|
export { CompanySchema };
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n}));\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../src/schemas/company.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseEntitySchema } from '@utilarium/overcontext';\nimport { RelationshipsSchema } from './relationships';\nimport { EntityContentSchema } from './content';\n\n/**\n * Company entity - organizations referenced in notes.\n */\nexport const CompanySchema = BaseEntitySchema.merge(z.object({\n type: z.literal('company'),\n \n fullName: z.string().optional(),\n industry: z.string().optional(),\n sounds_like: z.array(z.string()).optional(),\n relationships: RelationshipsSchema, // Relationships to other entities\n content: EntityContentSchema, // Attached content (URLs, text, documents)\n}));\n"],"names":[],"mappings":";;;;;AAQO,MAAM,aAAA,GAAgB,gBAAA,CAAiB,KAAA,CAAM,CAAA,CAAE,MAAA,CAAO;AAAA,EACzD,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,SAAS,CAAA;AAAA,EAEzB,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,aAAa,CAAA,CAAE,KAAA,CAAM,EAAE,MAAA,EAAQ,EAAE,QAAA,EAAS;AAAA,EAC1C,aAAA,EAAe,mBAAA;AAAA;AAAA,EACf,OAAA,EAAS;AAAA;AACb,CAAC,CAAC;;;;"}
|
package/dist/index5.cjs
CHANGED
|
@@ -3,14 +3,110 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const zod = require('zod');
|
|
6
|
-
const overcontext = require('@utilarium/overcontext');
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const EntityContentItemSchema = zod.z.object({
|
|
8
|
+
/**
|
|
9
|
+
* Type of content
|
|
10
|
+
* Common types: url, text, markdown, html, document, image, video, code
|
|
11
|
+
*/
|
|
12
|
+
type: zod.z.string(),
|
|
13
|
+
/**
|
|
14
|
+
* Title or label for this content
|
|
15
|
+
*/
|
|
16
|
+
title: zod.z.string().optional(),
|
|
17
|
+
/**
|
|
18
|
+
* The actual content
|
|
19
|
+
* - For URLs: the URL string
|
|
20
|
+
* - For text: the text content
|
|
21
|
+
* - For documents: could be markdown, HTML, or plain text
|
|
22
|
+
* - For references: could be a file path or external reference
|
|
23
|
+
*/
|
|
24
|
+
content: zod.z.string(),
|
|
25
|
+
/**
|
|
26
|
+
* MIME type (optional)
|
|
27
|
+
* Examples: text/plain, text/markdown, text/html, application/pdf
|
|
28
|
+
*/
|
|
29
|
+
mimeType: zod.z.string().optional(),
|
|
30
|
+
/**
|
|
31
|
+
* Source or origin of this content
|
|
32
|
+
* Examples: "Company website", "LinkedIn profile", "Manual entry"
|
|
33
|
+
*/
|
|
34
|
+
source: zod.z.string().optional(),
|
|
35
|
+
/**
|
|
36
|
+
* When this content was added or last updated
|
|
37
|
+
*/
|
|
38
|
+
timestamp: zod.z.string().datetime().optional(),
|
|
39
|
+
/**
|
|
40
|
+
* Optional notes about this content
|
|
41
|
+
*/
|
|
42
|
+
notes: zod.z.string().optional(),
|
|
43
|
+
/**
|
|
44
|
+
* Optional metadata
|
|
45
|
+
*/
|
|
46
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
47
|
+
});
|
|
48
|
+
const EntityContentSchema = zod.z.array(EntityContentItemSchema).optional();
|
|
49
|
+
function createUrlContent(url, title, source, notes) {
|
|
50
|
+
return {
|
|
51
|
+
type: "url",
|
|
52
|
+
title: title || "Website",
|
|
53
|
+
content: url,
|
|
54
|
+
mimeType: "text/uri-list",
|
|
55
|
+
source,
|
|
56
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
57
|
+
notes
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function createTextContent(text, title, source, notes) {
|
|
61
|
+
return {
|
|
62
|
+
type: "text",
|
|
63
|
+
title: title || "Description",
|
|
64
|
+
content: text,
|
|
65
|
+
mimeType: "text/plain",
|
|
66
|
+
source,
|
|
67
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
68
|
+
notes
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function createMarkdownContent(markdown, title, source, notes) {
|
|
72
|
+
return {
|
|
73
|
+
type: "markdown",
|
|
74
|
+
title: title || "Document",
|
|
75
|
+
content: markdown,
|
|
76
|
+
mimeType: "text/markdown",
|
|
77
|
+
source,
|
|
78
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
79
|
+
notes
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function createCodeContent(code, language, title, source, notes) {
|
|
83
|
+
return {
|
|
84
|
+
type: "code",
|
|
85
|
+
title: title || `${language} code`,
|
|
86
|
+
content: code,
|
|
87
|
+
mimeType: `text/x-${language}`,
|
|
88
|
+
source,
|
|
89
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
90
|
+
notes,
|
|
91
|
+
metadata: { language }
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function createDocumentContent(path, title, mimeType, notes) {
|
|
95
|
+
return {
|
|
96
|
+
type: "document",
|
|
97
|
+
title: title || "Document",
|
|
98
|
+
content: path,
|
|
99
|
+
mimeType: mimeType || "application/octet-stream",
|
|
100
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
101
|
+
notes
|
|
102
|
+
};
|
|
103
|
+
}
|
|
14
104
|
|
|
15
|
-
exports.
|
|
105
|
+
exports.EntityContentItemSchema = EntityContentItemSchema;
|
|
106
|
+
exports.EntityContentSchema = EntityContentSchema;
|
|
107
|
+
exports.createCodeContent = createCodeContent;
|
|
108
|
+
exports.createDocumentContent = createDocumentContent;
|
|
109
|
+
exports.createMarkdownContent = createMarkdownContent;
|
|
110
|
+
exports.createTextContent = createTextContent;
|
|
111
|
+
exports.createUrlContent = createUrlContent;
|
|
16
112
|
//# sourceMappingURL=index5.cjs.map
|
package/dist/index5.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index5.cjs","sources":["../src/schemas/
|
|
1
|
+
{"version":3,"file":"index5.cjs","sources":["../src/schemas/content.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Entity Content Item\n * \n * Represents structured content attached to an entity.\n * Can be URLs, text snippets, documents, or any other information.\n * \n * Examples:\n * - Company website URL\n * - Project description document\n * - Person's bio\n * - Term definition from external source\n */\nexport const EntityContentItemSchema = z.object({\n /**\n * Type of content\n * Common types: url, text, markdown, html, document, image, video, code\n */\n type: z.string(),\n \n /**\n * Title or label for this content\n */\n title: z.string().optional(),\n \n /**\n * The actual content\n * - For URLs: the URL string\n * - For text: the text content\n * - For documents: could be markdown, HTML, or plain text\n * - For references: could be a file path or external reference\n */\n content: z.string(),\n \n /**\n * MIME type (optional)\n * Examples: text/plain, text/markdown, text/html, application/pdf\n */\n mimeType: z.string().optional(),\n \n /**\n * Source or origin of this content\n * Examples: \"Company website\", \"LinkedIn profile\", \"Manual entry\"\n */\n source: z.string().optional(),\n \n /**\n * When this content was added or last updated\n */\n timestamp: z.string().datetime().optional(),\n \n /**\n * Optional notes about this content\n */\n notes: z.string().optional(),\n \n /**\n * Optional metadata\n */\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type EntityContentItem = z.infer<typeof EntityContentItemSchema>;\n\n/**\n * Content array for entities\n * Array of content items attached to an entity\n */\nexport const EntityContentSchema = z.array(EntityContentItemSchema).optional();\n\n/**\n * Helper function to create a URL content item\n */\nexport function createUrlContent(\n url: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'url',\n title: title || 'Website',\n content: url,\n mimeType: 'text/uri-list',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a text content item\n */\nexport function createTextContent(\n text: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'text',\n title: title || 'Description',\n content: text,\n mimeType: 'text/plain',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a markdown content item\n */\nexport function createMarkdownContent(\n markdown: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'markdown',\n title: title || 'Document',\n content: markdown,\n mimeType: 'text/markdown',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a code snippet content item\n */\nexport function createCodeContent(\n code: string,\n language: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'code',\n title: title || `${language} code`,\n content: code,\n mimeType: `text/x-${language}`,\n source,\n timestamp: new Date().toISOString(),\n notes,\n metadata: { language },\n };\n}\n\n/**\n * Helper function to create a document reference content item\n */\nexport function createDocumentContent(\n path: string,\n title?: string,\n mimeType?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'document',\n title: title || 'Document',\n content: path,\n mimeType: mimeType || 'application/octet-stream',\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n"],"names":["z"],"mappings":";;;;;;AAcO,MAAM,uBAAA,GAA0BA,MAAE,MAAA,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA,EAKf,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3B,OAAA,EAASA,MAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,QAAA,EAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,MAAA,EAAQA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK5B,WAAWA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK1C,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK3B,QAAA,EAAUA,KAAA,CAAE,MAAA,CAAOA,KAAA,CAAE,MAAA,IAAUA,KAAA,CAAE,OAAA,EAAS,CAAA,CAAE,QAAA;AAChD,CAAC;AAQM,MAAM,mBAAA,GAAsBA,KAAA,CAAE,KAAA,CAAM,uBAAuB,EAAE,QAAA;AAK7D,SAAS,gBAAA,CACZ,GAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,KAAA;AAAA,IACN,OAAO,KAAA,IAAS,SAAA;AAAA,IAChB,OAAA,EAAS,GAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,OAAO,KAAA,IAAS,aAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,YAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,qBAAA,CACZ,QAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,QAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,QAAA,EACA,KAAA,EACA,QACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAAO,KAAA,IAAS,CAAA,EAAG,QAAQ,CAAA,KAAA,CAAA;AAAA,IAC3B,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,UAAU,QAAQ,CAAA,CAAA;AAAA,IAC5B,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC,KAAA;AAAA,IACA,QAAA,EAAU,EAAE,QAAA;AAAS,GACzB;AACJ;AAKO,SAAS,qBAAA,CACZ,IAAA,EACA,KAAA,EACA,QAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,UAAU,QAAA,IAAY,0BAAA;AAAA,IACtB,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;;;;;;;;;;"}
|
package/dist/index5.js
CHANGED
|
@@ -1,12 +1,102 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { BaseEntitySchema } from '@utilarium/overcontext';
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const EntityContentItemSchema = z.object({
|
|
4
|
+
/**
|
|
5
|
+
* Type of content
|
|
6
|
+
* Common types: url, text, markdown, html, document, image, video, code
|
|
7
|
+
*/
|
|
8
|
+
type: z.string(),
|
|
9
|
+
/**
|
|
10
|
+
* Title or label for this content
|
|
11
|
+
*/
|
|
12
|
+
title: z.string().optional(),
|
|
13
|
+
/**
|
|
14
|
+
* The actual content
|
|
15
|
+
* - For URLs: the URL string
|
|
16
|
+
* - For text: the text content
|
|
17
|
+
* - For documents: could be markdown, HTML, or plain text
|
|
18
|
+
* - For references: could be a file path or external reference
|
|
19
|
+
*/
|
|
20
|
+
content: z.string(),
|
|
21
|
+
/**
|
|
22
|
+
* MIME type (optional)
|
|
23
|
+
* Examples: text/plain, text/markdown, text/html, application/pdf
|
|
24
|
+
*/
|
|
25
|
+
mimeType: z.string().optional(),
|
|
26
|
+
/**
|
|
27
|
+
* Source or origin of this content
|
|
28
|
+
* Examples: "Company website", "LinkedIn profile", "Manual entry"
|
|
29
|
+
*/
|
|
30
|
+
source: z.string().optional(),
|
|
31
|
+
/**
|
|
32
|
+
* When this content was added or last updated
|
|
33
|
+
*/
|
|
34
|
+
timestamp: z.string().datetime().optional(),
|
|
35
|
+
/**
|
|
36
|
+
* Optional notes about this content
|
|
37
|
+
*/
|
|
38
|
+
notes: z.string().optional(),
|
|
39
|
+
/**
|
|
40
|
+
* Optional metadata
|
|
41
|
+
*/
|
|
42
|
+
metadata: z.record(z.string(), z.unknown()).optional()
|
|
43
|
+
});
|
|
44
|
+
const EntityContentSchema = z.array(EntityContentItemSchema).optional();
|
|
45
|
+
function createUrlContent(url, title, source, notes) {
|
|
46
|
+
return {
|
|
47
|
+
type: "url",
|
|
48
|
+
title: title || "Website",
|
|
49
|
+
content: url,
|
|
50
|
+
mimeType: "text/uri-list",
|
|
51
|
+
source,
|
|
52
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
53
|
+
notes
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function createTextContent(text, title, source, notes) {
|
|
57
|
+
return {
|
|
58
|
+
type: "text",
|
|
59
|
+
title: title || "Description",
|
|
60
|
+
content: text,
|
|
61
|
+
mimeType: "text/plain",
|
|
62
|
+
source,
|
|
63
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
64
|
+
notes
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function createMarkdownContent(markdown, title, source, notes) {
|
|
68
|
+
return {
|
|
69
|
+
type: "markdown",
|
|
70
|
+
title: title || "Document",
|
|
71
|
+
content: markdown,
|
|
72
|
+
mimeType: "text/markdown",
|
|
73
|
+
source,
|
|
74
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
75
|
+
notes
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function createCodeContent(code, language, title, source, notes) {
|
|
79
|
+
return {
|
|
80
|
+
type: "code",
|
|
81
|
+
title: title || `${language} code`,
|
|
82
|
+
content: code,
|
|
83
|
+
mimeType: `text/x-${language}`,
|
|
84
|
+
source,
|
|
85
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
86
|
+
notes,
|
|
87
|
+
metadata: { language }
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function createDocumentContent(path, title, mimeType, notes) {
|
|
91
|
+
return {
|
|
92
|
+
type: "document",
|
|
93
|
+
title: title || "Document",
|
|
94
|
+
content: path,
|
|
95
|
+
mimeType: mimeType || "application/octet-stream",
|
|
96
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
97
|
+
notes
|
|
98
|
+
};
|
|
99
|
+
}
|
|
10
100
|
|
|
11
|
-
export {
|
|
101
|
+
export { EntityContentItemSchema, EntityContentSchema, createCodeContent, createDocumentContent, createMarkdownContent, createTextContent, createUrlContent };
|
|
12
102
|
//# sourceMappingURL=index5.js.map
|
package/dist/index5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index5.js","sources":["../src/schemas/
|
|
1
|
+
{"version":3,"file":"index5.js","sources":["../src/schemas/content.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Entity Content Item\n * \n * Represents structured content attached to an entity.\n * Can be URLs, text snippets, documents, or any other information.\n * \n * Examples:\n * - Company website URL\n * - Project description document\n * - Person's bio\n * - Term definition from external source\n */\nexport const EntityContentItemSchema = z.object({\n /**\n * Type of content\n * Common types: url, text, markdown, html, document, image, video, code\n */\n type: z.string(),\n \n /**\n * Title or label for this content\n */\n title: z.string().optional(),\n \n /**\n * The actual content\n * - For URLs: the URL string\n * - For text: the text content\n * - For documents: could be markdown, HTML, or plain text\n * - For references: could be a file path or external reference\n */\n content: z.string(),\n \n /**\n * MIME type (optional)\n * Examples: text/plain, text/markdown, text/html, application/pdf\n */\n mimeType: z.string().optional(),\n \n /**\n * Source or origin of this content\n * Examples: \"Company website\", \"LinkedIn profile\", \"Manual entry\"\n */\n source: z.string().optional(),\n \n /**\n * When this content was added or last updated\n */\n timestamp: z.string().datetime().optional(),\n \n /**\n * Optional notes about this content\n */\n notes: z.string().optional(),\n \n /**\n * Optional metadata\n */\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type EntityContentItem = z.infer<typeof EntityContentItemSchema>;\n\n/**\n * Content array for entities\n * Array of content items attached to an entity\n */\nexport const EntityContentSchema = z.array(EntityContentItemSchema).optional();\n\n/**\n * Helper function to create a URL content item\n */\nexport function createUrlContent(\n url: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'url',\n title: title || 'Website',\n content: url,\n mimeType: 'text/uri-list',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a text content item\n */\nexport function createTextContent(\n text: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'text',\n title: title || 'Description',\n content: text,\n mimeType: 'text/plain',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a markdown content item\n */\nexport function createMarkdownContent(\n markdown: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'markdown',\n title: title || 'Document',\n content: markdown,\n mimeType: 'text/markdown',\n source,\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n\n/**\n * Helper function to create a code snippet content item\n */\nexport function createCodeContent(\n code: string,\n language: string,\n title?: string,\n source?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'code',\n title: title || `${language} code`,\n content: code,\n mimeType: `text/x-${language}`,\n source,\n timestamp: new Date().toISOString(),\n notes,\n metadata: { language },\n };\n}\n\n/**\n * Helper function to create a document reference content item\n */\nexport function createDocumentContent(\n path: string,\n title?: string,\n mimeType?: string,\n notes?: string\n): EntityContentItem {\n return {\n type: 'document',\n title: title || 'Document',\n content: path,\n mimeType: mimeType || 'application/octet-stream',\n timestamp: new Date().toISOString(),\n notes,\n };\n}\n"],"names":[],"mappings":";;AAcO,MAAM,uBAAA,GAA0B,EAAE,MAAA,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA,EAKf,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3B,OAAA,EAAS,EAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK5B,WAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK1C,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA;AAAA;AAAA,EAK3B,QAAA,EAAU,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,OAAA,EAAS,CAAA,CAAE,QAAA;AAChD,CAAC;AAQM,MAAM,mBAAA,GAAsB,CAAA,CAAE,KAAA,CAAM,uBAAuB,EAAE,QAAA;AAK7D,SAAS,gBAAA,CACZ,GAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,KAAA;AAAA,IACN,OAAO,KAAA,IAAS,SAAA;AAAA,IAChB,OAAA,EAAS,GAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,OAAO,KAAA,IAAS,aAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,YAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,qBAAA,CACZ,QAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,QAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;AAKO,SAAS,iBAAA,CACZ,IAAA,EACA,QAAA,EACA,KAAA,EACA,QACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAAO,KAAA,IAAS,CAAA,EAAG,QAAQ,CAAA,KAAA,CAAA;AAAA,IAC3B,OAAA,EAAS,IAAA;AAAA,IACT,QAAA,EAAU,UAAU,QAAQ,CAAA,CAAA;AAAA,IAC5B,MAAA;AAAA,IACA,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC,KAAA;AAAA,IACA,QAAA,EAAU,EAAE,QAAA;AAAS,GACzB;AACJ;AAKO,SAAS,qBAAA,CACZ,IAAA,EACA,KAAA,EACA,QAAA,EACA,KAAA,EACiB;AACjB,EAAA,OAAO;AAAA,IACH,IAAA,EAAM,UAAA;AAAA,IACN,OAAO,KAAA,IAAS,UAAA;AAAA,IAChB,OAAA,EAAS,IAAA;AAAA,IACT,UAAU,QAAA,IAAY,0BAAA;AAAA,IACtB,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,IAClC;AAAA,GACJ;AACJ;;;;"}
|
package/dist/index6.cjs
CHANGED
|
@@ -3,21 +3,54 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const zod = require('zod');
|
|
6
|
-
const overcontext = require('@utilarium/overcontext');
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const EntityRelationshipSchema = zod.z.object({
|
|
8
|
+
/**
|
|
9
|
+
* The URI of the related entity
|
|
10
|
+
* Format: redaksjon://{type}/{id}
|
|
11
|
+
*/
|
|
12
|
+
uri: zod.z.string().regex(
|
|
13
|
+
/^redaksjon:\/\/[a-z]+\/[a-zA-Z0-9._-]+$/,
|
|
14
|
+
{ message: "URI must be in format: redaksjon://{type}/{id}" }
|
|
15
|
+
),
|
|
16
|
+
/**
|
|
17
|
+
* The type of relationship (freeform)
|
|
18
|
+
* Examples: "works_at", "manages", "related_to", "depends_on", "part_of"
|
|
19
|
+
*/
|
|
20
|
+
relationship: zod.z.string(),
|
|
21
|
+
/**
|
|
22
|
+
* Optional notes about this relationship
|
|
23
|
+
*/
|
|
24
|
+
notes: zod.z.string().optional(),
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata
|
|
27
|
+
*/
|
|
28
|
+
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
29
|
+
});
|
|
30
|
+
const RelationshipsSchema = zod.z.array(EntityRelationshipSchema).optional();
|
|
31
|
+
function createEntityUri(type, id) {
|
|
32
|
+
return `redaksjon://${type}/${id}`;
|
|
33
|
+
}
|
|
34
|
+
function parseEntityUri(uri) {
|
|
35
|
+
const match = uri.match(/^redaksjon:\/\/([a-z]+)\/([a-zA-Z0-9._-]+)$/);
|
|
36
|
+
if (!match) return null;
|
|
37
|
+
return {
|
|
38
|
+
type: match[1],
|
|
39
|
+
id: match[2]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function createRelationship(targetType, targetId, relationship, notes, metadata) {
|
|
43
|
+
return {
|
|
44
|
+
uri: createEntityUri(targetType, targetId),
|
|
45
|
+
relationship,
|
|
46
|
+
notes,
|
|
47
|
+
metadata
|
|
48
|
+
};
|
|
49
|
+
}
|
|
21
50
|
|
|
22
|
-
exports.
|
|
51
|
+
exports.EntityRelationshipSchema = EntityRelationshipSchema;
|
|
52
|
+
exports.RelationshipsSchema = RelationshipsSchema;
|
|
53
|
+
exports.createEntityUri = createEntityUri;
|
|
54
|
+
exports.createRelationship = createRelationship;
|
|
55
|
+
exports.parseEntityUri = parseEntityUri;
|
|
23
56
|
//# sourceMappingURL=index6.cjs.map
|