@wictorwilen/cocogen 1.0.0
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/LICENSE +21 -0
- package/README.md +149 -0
- package/RELEASING.md +36 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +288 -0
- package/dist/cli.js.map +1 -0
- package/dist/emit/emit.d.ts +3 -0
- package/dist/emit/emit.d.ts.map +1 -0
- package/dist/emit/emit.js +13 -0
- package/dist/emit/emit.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/init/init.d.ts +34 -0
- package/dist/init/init.d.ts.map +1 -0
- package/dist/init/init.js +886 -0
- package/dist/init/init.js.map +1 -0
- package/dist/init/template.d.ts +2 -0
- package/dist/init/template.d.ts.map +1 -0
- package/dist/init/template.js +19 -0
- package/dist/init/template.js.map +1 -0
- package/dist/init/templates/dotnet/.env.example.ejs +12 -0
- package/dist/init/templates/dotnet/.gitignore.ejs +6 -0
- package/dist/init/templates/dotnet/Datasource/CsvItemSource.cs.ejs +42 -0
- package/dist/init/templates/dotnet/Datasource/IItemSource.cs.ejs +12 -0
- package/dist/init/templates/dotnet/Generated/Constants.cs.ejs +17 -0
- package/dist/init/templates/dotnet/Generated/CsvParser.cs.ejs +119 -0
- package/dist/init/templates/dotnet/Generated/FromCsvRow.cs.ejs +14 -0
- package/dist/init/templates/dotnet/Generated/ItemPayload.cs.ejs +41 -0
- package/dist/init/templates/dotnet/Generated/Model.cs.ejs +28 -0
- package/dist/init/templates/dotnet/Generated/PersonEntityDefaults.cs.ejs +48 -0
- package/dist/init/templates/dotnet/Generated/PropertyTransforms.cs.ejs +22 -0
- package/dist/init/templates/dotnet/Generated/SchemaPayload.cs.ejs +18 -0
- package/dist/init/templates/dotnet/PersonEntityOverrides.cs.ejs +49 -0
- package/dist/init/templates/dotnet/Program.commandline.cs.ejs +426 -0
- package/dist/init/templates/dotnet/Program.cs.ejs +487 -0
- package/dist/init/templates/dotnet/README.md.ejs +56 -0
- package/dist/init/templates/dotnet/appsettings.json.ejs +21 -0
- package/dist/init/templates/dotnet/package.json.ejs +7 -0
- package/dist/init/templates/dotnet/project.csproj.ejs +29 -0
- package/dist/init/templates/dotnet/tspconfig.yaml.ejs +2 -0
- package/dist/init/templates/ts/.env.example.ejs +20 -0
- package/dist/init/templates/ts/README.md.ejs +54 -0
- package/dist/init/templates/ts/package.json.ejs +25 -0
- package/dist/init/templates/ts/src/cli.ts.ejs +299 -0
- package/dist/init/templates/ts/src/datasource/csvItemSource.ts.ejs +25 -0
- package/dist/init/templates/ts/src/datasource/itemSource.ts.ejs +8 -0
- package/dist/init/templates/ts/src/generated/constants.ts.ejs +10 -0
- package/dist/init/templates/ts/src/generated/csv.ts.ejs +44 -0
- package/dist/init/templates/ts/src/generated/fromCsvRow.ts.ejs +43 -0
- package/dist/init/templates/ts/src/generated/index.ts.ejs +5 -0
- package/dist/init/templates/ts/src/generated/itemPayload.ts.ejs +21 -0
- package/dist/init/templates/ts/src/generated/model.ts.ejs +16 -0
- package/dist/init/templates/ts/src/generated/personEntityDefaults.ts.ejs +33 -0
- package/dist/init/templates/ts/src/generated/propertyTransforms.ts.ejs +23 -0
- package/dist/init/templates/ts/src/generated/schemaPayload.ts.ejs +1 -0
- package/dist/init/templates/ts/src/index.ts.ejs +1 -0
- package/dist/init/templates/ts/src/personEntityOverrides.ts.ejs +36 -0
- package/dist/init/templates/ts/tsconfig.json.ejs +13 -0
- package/dist/init/templates/ts/tspconfig.yaml.ejs +2 -0
- package/dist/ir.d.ts +49 -0
- package/dist/ir.d.ts.map +1 -0
- package/dist/ir.js +2 -0
- package/dist/ir.js.map +1 -0
- package/dist/tsp/init-tsp.d.ts +14 -0
- package/dist/tsp/init-tsp.d.ts.map +1 -0
- package/dist/tsp/init-tsp.js +126 -0
- package/dist/tsp/init-tsp.js.map +1 -0
- package/dist/tsp/loader.d.ts +8 -0
- package/dist/tsp/loader.d.ts.map +1 -0
- package/dist/tsp/loader.js +264 -0
- package/dist/tsp/loader.js.map +1 -0
- package/dist/typespec/decorators.d.ts +14 -0
- package/dist/typespec/decorators.d.ts.map +1 -0
- package/dist/typespec/decorators.js +139 -0
- package/dist/typespec/decorators.js.map +1 -0
- package/dist/typespec/state.d.ts +37 -0
- package/dist/typespec/state.d.ts.map +1 -0
- package/dist/typespec/state.js +13 -0
- package/dist/typespec/state.js.map +1 -0
- package/dist/validate/validator.d.ts +9 -0
- package/dist/validate/validator.d.ts.map +1 -0
- package/dist/validate/validator.js +204 -0
- package/dist/validate/validator.js.map +1 -0
- package/package.json +66 -0
- package/typespec/main.tsp +117 -0
- package/typespec/tsp-index.js +6 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const COCOGEN_STATE_ITEM_MODELS: unique symbol;
|
|
2
|
+
export declare const COCOGEN_STATE_ID_PROPERTIES: unique symbol;
|
|
3
|
+
export declare const COCOGEN_STATE_CONTENT_PROPERTIES: unique symbol;
|
|
4
|
+
export declare const COCOGEN_STATE_CONNECTION_SETTINGS: unique symbol;
|
|
5
|
+
export declare const COCOGEN_STATE_PROFILE_SOURCE_SETTINGS: unique symbol;
|
|
6
|
+
export declare const COCOGEN_STATE_PROPERTY_LABELS: unique symbol;
|
|
7
|
+
export declare const COCOGEN_STATE_PROPERTY_ALIASES: unique symbol;
|
|
8
|
+
export declare const COCOGEN_STATE_PROPERTY_NAME_OVERRIDES: unique symbol;
|
|
9
|
+
export declare const COCOGEN_STATE_PROPERTY_DESCRIPTIONS: unique symbol;
|
|
10
|
+
export declare const COCOGEN_STATE_PROPERTY_SEARCH: unique symbol;
|
|
11
|
+
export declare const COCOGEN_STATE_PROPERTY_SOURCE: unique symbol;
|
|
12
|
+
export declare const COCOGEN_STATE_PROPERTY_PERSON_FIELDS: unique symbol;
|
|
13
|
+
export type CocogenConnectionSettings = {
|
|
14
|
+
contentCategory?: "uncategorized" | "knowledgeBase" | "wikis" | "fileRepository" | "qna" | "crm" | "dashboard" | "people" | "media" | "email" | "messaging" | "meetingTranscripts" | "taskManagement" | "learningManagement";
|
|
15
|
+
connectionId?: string;
|
|
16
|
+
connectionDescription?: string;
|
|
17
|
+
};
|
|
18
|
+
export type CocogenProfileSourceSettings = {
|
|
19
|
+
webUrl: string;
|
|
20
|
+
displayName?: string;
|
|
21
|
+
priority?: "first" | "last";
|
|
22
|
+
};
|
|
23
|
+
export type CocogenSearchFlags = {
|
|
24
|
+
searchable?: boolean;
|
|
25
|
+
queryable?: boolean;
|
|
26
|
+
retrievable?: boolean;
|
|
27
|
+
refinable?: boolean;
|
|
28
|
+
exactMatchRequired?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type CocogenSourceSettings = {
|
|
31
|
+
csv?: string;
|
|
32
|
+
};
|
|
33
|
+
export type CocogenPersonEntityField = {
|
|
34
|
+
path: string;
|
|
35
|
+
source: CocogenSourceSettings | string;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/typespec/state.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,eAAgD,CAAC;AACvF,eAAO,MAAM,2BAA2B,eAAkD,CAAC;AAC3F,eAAO,MAAM,gCAAgC,eAAuD,CAAC;AACrG,eAAO,MAAM,iCAAiC,eAAwD,CAAC;AACvG,eAAO,MAAM,qCAAqC,eAA2D,CAAC;AAC9G,eAAO,MAAM,6BAA6B,eAAoD,CAAC;AAC/F,eAAO,MAAM,8BAA8B,eAAqD,CAAC;AACjG,eAAO,MAAM,qCAAqC,eAA2D,CAAC;AAC9G,eAAO,MAAM,mCAAmC,eAA0D,CAAC;AAC3G,eAAO,MAAM,6BAA6B,eAAoD,CAAC;AAC/F,eAAO,MAAM,6BAA6B,eAAoD,CAAC;AAC/F,eAAO,MAAM,oCAAoC,eAA0D,CAAC;AAE5G,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,CAAC,EACZ,eAAe,GACf,eAAe,GACf,OAAO,GACP,gBAAgB,GAChB,KAAK,GACL,KAAK,GACL,WAAW,GACX,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,oBAAoB,GACpB,gBAAgB,GAChB,oBAAoB,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAAC;CACxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const COCOGEN_STATE_ITEM_MODELS = Symbol.for("@wictorwilen/cocogen/itemModels");
|
|
2
|
+
export const COCOGEN_STATE_ID_PROPERTIES = Symbol.for("@wictorwilen/cocogen/idProperties");
|
|
3
|
+
export const COCOGEN_STATE_CONTENT_PROPERTIES = Symbol.for("@wictorwilen/cocogen/contentProperties");
|
|
4
|
+
export const COCOGEN_STATE_CONNECTION_SETTINGS = Symbol.for("@wictorwilen/cocogen/connectionSettings");
|
|
5
|
+
export const COCOGEN_STATE_PROFILE_SOURCE_SETTINGS = Symbol.for("@wictorwilen/cocogen/profileSourceSettings");
|
|
6
|
+
export const COCOGEN_STATE_PROPERTY_LABELS = Symbol.for("@wictorwilen/cocogen/propertyLabels");
|
|
7
|
+
export const COCOGEN_STATE_PROPERTY_ALIASES = Symbol.for("@wictorwilen/cocogen/propertyAliases");
|
|
8
|
+
export const COCOGEN_STATE_PROPERTY_NAME_OVERRIDES = Symbol.for("@wictorwilen/cocogen/propertyNameOverrides");
|
|
9
|
+
export const COCOGEN_STATE_PROPERTY_DESCRIPTIONS = Symbol.for("@wictorwilen/cocogen/propertyDescriptions");
|
|
10
|
+
export const COCOGEN_STATE_PROPERTY_SEARCH = Symbol.for("@wictorwilen/cocogen/propertySearch");
|
|
11
|
+
export const COCOGEN_STATE_PROPERTY_SOURCE = Symbol.for("@wictorwilen/cocogen/propertySource");
|
|
12
|
+
export const COCOGEN_STATE_PROPERTY_PERSON_FIELDS = Symbol.for("@wictorwilen/cocogen/propertyPersonFields");
|
|
13
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/typespec/state.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AACvF,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AACrG,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACvG,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;AAC3G,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectorIr } from "../ir.js";
|
|
2
|
+
export type ValidationSeverity = "error" | "warning";
|
|
3
|
+
export type ValidationIssue = {
|
|
4
|
+
severity: ValidationSeverity;
|
|
5
|
+
message: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function validateIr(ir: ConnectorIr): ValidationIssue[];
|
|
9
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/validate/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,GAAG,eAAe,EAAE,CA6K7D"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
function isSearchableType(type) {
|
|
2
|
+
return type === "string" || type === "stringCollection";
|
|
3
|
+
}
|
|
4
|
+
function isPeopleLabeled(labels) {
|
|
5
|
+
return labels.some((l) => l.startsWith("person"));
|
|
6
|
+
}
|
|
7
|
+
function hasSearchFlags(flags) {
|
|
8
|
+
return Object.values(flags).some((value) => Boolean(value));
|
|
9
|
+
}
|
|
10
|
+
const PEOPLE_LABELS = new Set([
|
|
11
|
+
"personAccount",
|
|
12
|
+
"personName",
|
|
13
|
+
"personCurrentPosition",
|
|
14
|
+
"personAddresses",
|
|
15
|
+
"personEmails",
|
|
16
|
+
"personPhones",
|
|
17
|
+
"personAwards",
|
|
18
|
+
"personCertifications",
|
|
19
|
+
"personProjects",
|
|
20
|
+
"personSkills",
|
|
21
|
+
"personWebAccounts",
|
|
22
|
+
"personWebSite",
|
|
23
|
+
"personAnniversaries",
|
|
24
|
+
"personNote",
|
|
25
|
+
]);
|
|
26
|
+
const PEOPLE_ENTITY_BY_LABEL = new Map([
|
|
27
|
+
["personAccount", "userAccountInformation"],
|
|
28
|
+
["personName", "personName"],
|
|
29
|
+
["personCurrentPosition", "workPosition"],
|
|
30
|
+
["personAddresses", "itemAddress"],
|
|
31
|
+
["personEmails", "itemEmail"],
|
|
32
|
+
["personPhones", "itemPhone"],
|
|
33
|
+
["personAwards", "personAward"],
|
|
34
|
+
["personCertifications", "personCertification"],
|
|
35
|
+
["personProjects", "projectParticipation"],
|
|
36
|
+
["personSkills", "skillProficiency"],
|
|
37
|
+
["personWebAccounts", "webAccount"],
|
|
38
|
+
["personWebSite", "personWebsite"],
|
|
39
|
+
["personAnniversaries", "personAnniversary"],
|
|
40
|
+
["personNote", "personAnnotation"],
|
|
41
|
+
]);
|
|
42
|
+
export function validateIr(ir) {
|
|
43
|
+
const issues = [];
|
|
44
|
+
// Graph constraints
|
|
45
|
+
if (ir.properties.length > 128) {
|
|
46
|
+
issues.push({
|
|
47
|
+
severity: "error",
|
|
48
|
+
message: `Too many schema properties (${ir.properties.length}). Microsoft Graph external connections allow max 128.`,
|
|
49
|
+
hint: "Remove or consolidate properties in the item model.",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const seenNames = new Set();
|
|
53
|
+
for (const prop of ir.properties) {
|
|
54
|
+
if (seenNames.has(prop.name)) {
|
|
55
|
+
issues.push({
|
|
56
|
+
severity: "error",
|
|
57
|
+
message: `Duplicate property name '${prop.name}' after applying @coco.name overrides.`,
|
|
58
|
+
hint: "Use @coco.name(\"...\") to provide a shorter name.",
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
seenNames.add(prop.name);
|
|
62
|
+
if (prop.name.length > 32) {
|
|
63
|
+
issues.push({
|
|
64
|
+
severity: "error",
|
|
65
|
+
message: `Property '${prop.name}' is too long (${prop.name.length}). Graph schema names must be <= 32 characters.`,
|
|
66
|
+
hint: "Use @coco.name(\"...\") to provide a shorter name.",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (!/^[A-Za-z0-9]+$/.test(prop.name)) {
|
|
70
|
+
issues.push({
|
|
71
|
+
severity: "error",
|
|
72
|
+
message: `Property '${prop.name}' contains invalid characters. Graph schema names must be alphanumeric only.`,
|
|
73
|
+
hint: "Use @coco.name(\"...\") to provide an alphanumeric name.",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (prop.search.searchable) {
|
|
77
|
+
if (!isSearchableType(prop.type)) {
|
|
78
|
+
issues.push({
|
|
79
|
+
severity: "error",
|
|
80
|
+
message: `Property '${prop.name}' is marked searchable but has type '${prop.type}'. Only string/stringCollection can be searchable.`,
|
|
81
|
+
hint: "Remove searchable=true or change the property to string/stringCollection.",
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (prop.search.refinable) {
|
|
85
|
+
issues.push({
|
|
86
|
+
severity: "error",
|
|
87
|
+
message: `Property '${prop.name}' is both searchable and refinable. This combination is not supported.`,
|
|
88
|
+
hint: "Remove refinable=true or searchable=true.",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (prop.type === "principal" && prop.search.searchable) {
|
|
93
|
+
issues.push({
|
|
94
|
+
severity: "error",
|
|
95
|
+
message: `Property '${prop.name}' has type 'principal' and cannot be marked searchable.`,
|
|
96
|
+
hint: "Remove searchable=true for this property.",
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const idProp = ir.properties.find((p) => p.name === ir.item.idPropertyName);
|
|
101
|
+
if (!idProp) {
|
|
102
|
+
issues.push({
|
|
103
|
+
severity: "error",
|
|
104
|
+
message: `Internal mismatch: id property '${ir.item.idPropertyName}' is not present in properties list.`,
|
|
105
|
+
hint: "This is a cocogen bug. Please file an issue with your schema.",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
else if (idProp.type !== "string") {
|
|
109
|
+
issues.push({
|
|
110
|
+
severity: "error",
|
|
111
|
+
message: `@coco.id property '${idProp.name}' must be a string (external item ids are strings). Found '${idProp.type}'.`,
|
|
112
|
+
hint: "Change the TypeSpec property type to 'string'.",
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (ir.item.contentPropertyName) {
|
|
116
|
+
const contentProp = ir.properties.find((p) => p.name === ir.item.contentPropertyName);
|
|
117
|
+
if (!contentProp) {
|
|
118
|
+
issues.push({
|
|
119
|
+
severity: "error",
|
|
120
|
+
message: `Internal mismatch: content property '${ir.item.contentPropertyName}' is not present in properties list.`,
|
|
121
|
+
hint: "This is a cocogen bug. Please file an issue with your schema.",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else if (contentProp.type !== "string") {
|
|
125
|
+
issues.push({
|
|
126
|
+
severity: "error",
|
|
127
|
+
message: `@coco.content property '${contentProp.name}' must be a string (full-text content value). Found '${contentProp.type}'.`,
|
|
128
|
+
hint: "Change the TypeSpec property type to 'string'.",
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// People connectors rules (preview)
|
|
133
|
+
if (ir.connection.contentCategory === "people") {
|
|
134
|
+
if (ir.connection.profileSource && ir.connection.profileSource.webUrl.trim().length === 0) {
|
|
135
|
+
issues.push({
|
|
136
|
+
severity: "error",
|
|
137
|
+
message: "@coco.profileSource requires a non-empty webUrl.",
|
|
138
|
+
hint: "Set webUrl to an HTTPS link to the source system or info page.",
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (ir.item.contentPropertyName) {
|
|
142
|
+
issues.push({
|
|
143
|
+
severity: "error",
|
|
144
|
+
message: `People connectors do not support externalItem.content. Remove @coco.content from '${ir.item.contentPropertyName}'.`,
|
|
145
|
+
hint: "For people connectors, represent all searchable/retrievable data as schema properties instead of externalItem.content.",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const personAccountProps = ir.properties.filter((p) => p.labels.includes("personAccount"));
|
|
149
|
+
if (personAccountProps.length !== 1) {
|
|
150
|
+
issues.push({
|
|
151
|
+
severity: "error",
|
|
152
|
+
message: personAccountProps.length === 0
|
|
153
|
+
? "People connectors require exactly one property labeled 'personAccount', but none was found."
|
|
154
|
+
: `People connectors require exactly one property labeled 'personAccount', but found ${personAccountProps.length} (${personAccountProps
|
|
155
|
+
.map((p) => p.name)
|
|
156
|
+
.join(", ")}).`,
|
|
157
|
+
hint: "Add @coco.label(\"personAccount\") to the property that identifies the person account.",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
for (const prop of ir.properties) {
|
|
161
|
+
if (hasSearchFlags(prop.search)) {
|
|
162
|
+
issues.push({
|
|
163
|
+
severity: "warning",
|
|
164
|
+
message: `People connectors ignore @coco.search flags (property '${prop.name}').`,
|
|
165
|
+
hint: "Remove @coco.search from people connector schemas to avoid confusion.",
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (!isPeopleLabeled(prop.labels))
|
|
169
|
+
continue;
|
|
170
|
+
for (const label of prop.labels) {
|
|
171
|
+
if (label.startsWith("person") && !PEOPLE_LABELS.has(label)) {
|
|
172
|
+
issues.push({
|
|
173
|
+
severity: "error",
|
|
174
|
+
message: `People connector label '${label}' is not supported.`,
|
|
175
|
+
hint: "Use a supported people label like personCurrentPosition or personEmails.",
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (prop.type !== "string" && prop.type !== "stringCollection") {
|
|
180
|
+
issues.push({
|
|
181
|
+
severity: "error",
|
|
182
|
+
message: `People-labeled property '${prop.name}' must be string or stringCollection. Found '${prop.type}'.`,
|
|
183
|
+
hint: "For People connectors, people-domain labeled properties must contain JSON-serialized profile entity objects in strings.",
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (!prop.personEntity) {
|
|
187
|
+
issues.push({
|
|
188
|
+
severity: "error",
|
|
189
|
+
message: `People-labeled property '${prop.name}' must define @coco.source(..., to) mappings.`,
|
|
190
|
+
hint: "Add one or more @coco.source(" + "\"column\", \"entity.path\"" + ") decorators to build the required JSON entity payload.",
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (ir.connection.profileSource && ir.connection.contentCategory !== "people") {
|
|
196
|
+
issues.push({
|
|
197
|
+
severity: "error",
|
|
198
|
+
message: "@coco.profileSource can only be used with people connectors.",
|
|
199
|
+
hint: "Set @coco.connection({ contentCategory: \"people\" }) or remove @coco.profileSource.",
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
return issues;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/validate/validator.ts"],"names":[],"mappings":"AAUA,SAAS,gBAAgB,CAAC,IAAkB;IAC1C,OAAO,IAAI,KAAK,Q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"1.0.0",
|
|
4
|
+
"description": "TypeSpec-driven Microsoft Copilot connector generator",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Wictor Wilén <wictor@wictorwilen.se>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/wictorwilen/cocogen.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/wictorwilen/cocogen/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/wictorwilen/cocogen#readme",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"tspMain": "./typespec/main.tsp",
|
|
17
|
+
"bin": {
|
|
18
|
+
"cocogen": "dist/cli.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"typespec",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"THIRD_PARTY_NOTICES.md",
|
|
26
|
+
"RELEASING.md"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=22"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.build.json && node ./scripts/copy-init-templates.mjs",
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"pretest": "npm run typecheck && npm run build",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"test:coverage": "vitest run tests/unit --coverage",
|
|
43
|
+
"test:watch": "vitest",
|
|
44
|
+
"test:unit": "vitest run tests/unit",
|
|
45
|
+
"pretest:e2e": "npm run build",
|
|
46
|
+
"test:e2e": "vitest run tests/e2e"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@typespec/compiler": "^1.8.0",
|
|
53
|
+
"@inquirer/prompts": "^7.2.1",
|
|
54
|
+
"commander": "^14.0.2",
|
|
55
|
+
"ejs": "^4.0.1",
|
|
56
|
+
"ora": "^9.0.0",
|
|
57
|
+
"picocolors": "^1.1.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/node": "^25.0.9",
|
|
61
|
+
"@types/ejs": "^3.1.5",
|
|
62
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vitest": "^4.0.17"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// TypeSpec library entrypoint for @wictorwilen/cocogen
|
|
2
|
+
//
|
|
3
|
+
// This file defines the decorators consumed by cocogen.
|
|
4
|
+
// The implementations live in the JS module for this package.
|
|
5
|
+
|
|
6
|
+
import "./tsp-index.js";
|
|
7
|
+
|
|
8
|
+
using TypeSpec.Reflection;
|
|
9
|
+
|
|
10
|
+
namespace coco {
|
|
11
|
+
model ConnectionSettings {
|
|
12
|
+
contentCategory?: ContentCategory;
|
|
13
|
+
connectionId?: string;
|
|
14
|
+
connectionDescription?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
model ProfileSourceSettings {
|
|
18
|
+
webUrl: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
priority?: "first" | "last";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
model SearchFlags {
|
|
24
|
+
searchable?: boolean;
|
|
25
|
+
queryable?: boolean;
|
|
26
|
+
retrievable?: boolean;
|
|
27
|
+
refinable?: boolean;
|
|
28
|
+
exactMatchRequired?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
model ContentSettings {
|
|
32
|
+
type?: "text";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
model SourceSettings {
|
|
36
|
+
csv?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
alias ContentCategory =
|
|
41
|
+
| "uncategorized"
|
|
42
|
+
| "knowledgeBase"
|
|
43
|
+
| "wikis"
|
|
44
|
+
| "fileRepository"
|
|
45
|
+
| "qna"
|
|
46
|
+
| "crm"
|
|
47
|
+
| "dashboard"
|
|
48
|
+
| "people"
|
|
49
|
+
| "media"
|
|
50
|
+
| "email"
|
|
51
|
+
| "messaging"
|
|
52
|
+
| "meetingTranscripts"
|
|
53
|
+
| "taskManagement"
|
|
54
|
+
| "learningManagement";
|
|
55
|
+
|
|
56
|
+
alias Label =
|
|
57
|
+
| "title"
|
|
58
|
+
| "url"
|
|
59
|
+
| "createdDateTime"
|
|
60
|
+
| "lastModifiedDateTime"
|
|
61
|
+
| "fileExtension"
|
|
62
|
+
| "iconUrl"
|
|
63
|
+
| "containerName"
|
|
64
|
+
| "containerUrl"
|
|
65
|
+
| "createdBy"
|
|
66
|
+
| "lastModifiedBy"
|
|
67
|
+
| "personAccount"
|
|
68
|
+
| "personName"
|
|
69
|
+
| "personCurrentPosition"
|
|
70
|
+
| "personAddresses"
|
|
71
|
+
| "personEmails"
|
|
72
|
+
| "personPhones"
|
|
73
|
+
| "personAwards"
|
|
74
|
+
| "personCertifications"
|
|
75
|
+
| "personProjects"
|
|
76
|
+
| "personSkills"
|
|
77
|
+
| "personWebAccounts"
|
|
78
|
+
| "personWebSite"
|
|
79
|
+
| "personAnniversaries"
|
|
80
|
+
| "personNote";
|
|
81
|
+
|
|
82
|
+
// Marks the external item model.
|
|
83
|
+
extern dec item(target: Model);
|
|
84
|
+
|
|
85
|
+
// Marks the item ID field.
|
|
86
|
+
extern dec id(target: ModelProperty);
|
|
87
|
+
|
|
88
|
+
// Schema labels (Graph externalConnectors.label values).
|
|
89
|
+
extern dec label(target: ModelProperty, value: Label);
|
|
90
|
+
|
|
91
|
+
// Aliases for schema fields.
|
|
92
|
+
extern dec aliases(target: ModelProperty, value: string);
|
|
93
|
+
|
|
94
|
+
// Schema property description (emitted to Microsoft Graph schema property.description).
|
|
95
|
+
extern dec description(target: ModelProperty, value: string);
|
|
96
|
+
|
|
97
|
+
// Field rename for Graph schema constraints.
|
|
98
|
+
extern dec name(target: ModelProperty, value: string);
|
|
99
|
+
|
|
100
|
+
// Connection-level settings.
|
|
101
|
+
extern dec connection(target: Model, settings: ConnectionSettings);
|
|
102
|
+
|
|
103
|
+
// People connector profile source settings.
|
|
104
|
+
extern dec profileSource(target: Model, settings: ProfileSourceSettings);
|
|
105
|
+
|
|
106
|
+
// Search flags.
|
|
107
|
+
extern dec search(target: ModelProperty, flags: SearchFlags);
|
|
108
|
+
|
|
109
|
+
// Marks an item content field for externalItem.content.value.
|
|
110
|
+
extern dec content(target: ModelProperty, settings?: ContentSettings);
|
|
111
|
+
|
|
112
|
+
// Maps a source field (CSV header) to a property or entity path.
|
|
113
|
+
extern dec source(target: ModelProperty, from: SourceSettings | string, to?: string);
|
|
114
|
+
|
|
115
|
+
// A custom scalar we map to Graph schema propertyType = principal.
|
|
116
|
+
scalar Principal;
|
|
117
|
+
}
|