@wictorwilen/cocogen 1.1.0-preview.1 → 1.1.0-preview.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +6 -3
  3. package/data/graph-capabilities.json +574 -73
  4. package/data/graph-external-connectors-principal.json +1 -1
  5. package/data/graph-profile-schema.json +322 -1
  6. package/dist/init/dotnet/generator.d.ts +2 -0
  7. package/dist/init/dotnet/generator.d.ts.map +1 -1
  8. package/dist/init/dotnet/generator.js +22 -31
  9. package/dist/init/dotnet/generator.js.map +1 -1
  10. package/dist/init/dotnet/people-entity.d.ts.map +1 -1
  11. package/dist/init/dotnet/people-entity.js +5 -4
  12. package/dist/init/dotnet/people-entity.js.map +1 -1
  13. package/dist/init/helpers/schema.js +5 -5
  14. package/dist/init/helpers/schema.js.map +1 -1
  15. package/dist/init/init.d.ts.map +1 -1
  16. package/dist/init/init.js +1 -0
  17. package/dist/init/init.js.map +1 -1
  18. package/dist/init/templates/dotnet/Core/ConnectorCore.cs.ejs +84 -8
  19. package/dist/init/templates/dotnet/Core/PeoplePayload.cs.ejs +145 -61
  20. package/dist/init/templates/dotnet/Generated/PropertyTransformBase.cs.ejs +7 -2
  21. package/dist/init/templates/dotnet/Program.commandline.cs.ejs +1 -5
  22. package/dist/init/templates/dotnet/PropertyTransform.cs.ejs +42 -1
  23. package/dist/init/templates/dotnet/README.md.ejs +2 -2
  24. package/dist/init/templates/dotnet/project.csproj.ejs +3 -0
  25. package/dist/init/templates/starter/AGENTS.md.ejs +5 -5
  26. package/dist/init/templates/ts/README.md.ejs +2 -2
  27. package/dist/init/templates/ts/src/cli.ts.ejs +1 -5
  28. package/dist/init/templates/ts/src/core/people.ts.ejs +23 -2
  29. package/dist/ir.d.ts +1 -1
  30. package/dist/ir.d.ts.map +1 -1
  31. package/dist/people/label-registry.d.ts.map +1 -1
  32. package/dist/people/label-registry.js +5 -0
  33. package/dist/people/label-registry.js.map +1 -1
  34. package/dist/tsp/init-tsp.js +2 -2
  35. package/dist/tsp/init-tsp.js.map +1 -1
  36. package/dist/validate/validator.d.ts.map +1 -1
  37. package/dist/validate/validator.js +46 -0
  38. package/dist/validate/validator.js.map +1 -1
  39. package/package.json +1 -1
  40. package/typespec/main.tsp +5 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.1.0-preview.10] - 2026-04-08
11
+
12
+ ## [1.1.0-preview.9] - 2026-04-08
13
+
14
+ ### Fixed
15
+ - Restored `.NET` people payload serialization parity using final-stage label cleanup in `PeoplePayload.SerializeStringLabel(...)` and `PeoplePayload.SerializeCollectionLabel(...)`: collection `@odata.type` values now include the leading `#` (for example `#Collection(String)`), Kiota date objects are normalized back to `yyyy-MM-dd` strings, enum values are serialized as strings, and useful fields carried via `AdditionalData` are preserved instead of being dropped during normalization.
16
+ - Updated generated `.NET` `FromRow.cs` assignments to use typed `TransformProperty<T>(...)` calls, removing nullable cast warnings (`CS8600`/`CS8601`) caused by the previous `object?` cast path.
17
+
18
+ ## [1.1.0-preview.8] - 2026-04-08
19
+
20
+ ### Changed
21
+ - **For .NET people connectors with custom transforms:** The generated `PropertyTransformBase.cs` no longer embeds normalization logic in each serialization expression. Instead, hand-off to `PeoplePayload.SerializePeopleEntity(object)` which handles serialization + normalization (strips Kiota metadata, removes nulls, converts to camelCase) in one call. If you have custom `PropertyTransform.cs` overrides, they will automatically benefit from normalization; no code changes required. The method signature remains `protected virtual string? Transform<PropName>(object row)`.
22
+
23
+ ## [1.1.0-preview.7] - 2026-04-08
24
+
25
+ ## [1.1.0-preview.6] - 2026-04-07
26
+
27
+ ## [1.1.0-preview.5] - 2026-04-07
28
+
29
+ ### Changed
30
+ - Generated people connector `provision` commands no longer auto-register the connection as a profile source; use the dedicated `register-profile-source` command instead.
31
+
32
+ ## [1.1.0-preview.4] - 2026-04-07
33
+
34
+ ### Fixed
35
+ - Generated `.NET` people payload helpers no longer re-validate serialized JSON field names and read-only item facet fields at runtime; they now rely on schema validation and typed construction, while still enforcing collection limits.
36
+
37
+ ## [1.1.0-preview.3] - 2026-04-07
38
+
39
+ ### Fixed
40
+ - `cocogen update` now refreshes generated `.NET` `Program.cs` files even without `--include-scaffold`, so schema-driven entrypoint changes do not stay stale after updates.
41
+ - Validation now warns when people-label `@coco.source(..., to)` mappings reference unknown Graph target paths (for example `program.fieldOfStudy` instead of `program.fieldsOfStudy`) so fallback object generation is easier to diagnose.
42
+
43
+ ## [1.1.0-preview.2] - 2026-04-07
44
+
45
+ ### Fixed
46
+ - `npm run update-graph-profile-schema` now refreshes the profile CSDL snapshot from the official `microsoftgraph/msgraph-metadata` raw schema files because the live Graph `$metadata` endpoints no longer return XML reliably for this workflow.
47
+
48
+ ### Changed
49
+ - People connector metadata refresh and validation now recognize the five current beta-only labels documented for people connectors: `personEducationalActivities`, `personInterests`, `personLanguages`, `personPatents`, and `personPublications`.
50
+ - `externalConnection.contentCategory` now resolves to Graph `v1.0` capability in the generator metadata, matching `principal` and `principalCollection`.
51
+ - People profile source registration now resolves to Graph `v1.0` capability as well, so stable people schemas no longer require preview features unless they use beta-only labels.
52
+
10
53
  ## [1.1.0-preview.1] - 2026-03-31
11
54
 
12
55
  ### Changed
@@ -335,6 +378,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
335
378
  - Collection values no longer split on commas; use semicolons instead.
336
379
 
337
380
  [Unreleased]: https://github.com/wictorwilen/cocogen/compare/v1.0.16...HEAD
381
+ [1.1.0-preview.10]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.10
382
+ [1.1.0-preview.9]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.9
383
+ [1.1.0-preview.8]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.8
384
+ [1.1.0-preview.7]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.7
385
+ [1.1.0-preview.6]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.6
386
+ [1.1.0-preview.5]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.5
387
+ [1.1.0-preview.4]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.4
388
+ [1.1.0-preview.3]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.3
389
+ [1.1.0-preview.2]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.2
338
390
  [1.1.0-preview.1]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.1
339
391
  [1.0.50]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.50
340
392
  [1.0.49]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.49
package/README.md CHANGED
@@ -31,6 +31,7 @@
31
31
  ## What you can do with the generated project 🔧
32
32
  - ✅ Create or update an external connection
33
33
  - ✅ Patch schema changes
34
+ - ✅ Register a people profile source with a dedicated command
34
35
  - ✅ Ingest items from CSV (or your own datasource)
35
36
  - ✅ Retry throttled requests with backoff + logging
36
37
  - ✅ Customize transforms without losing changes on update
@@ -120,7 +121,7 @@ cocogen --help
120
121
  | `emit` | Emit cocogen IR as JSON | `--tsp <path>`, `--out <path>`, `--use-preview-features` |
121
122
 
122
123
  Notes:
123
- - `--use-preview-features` is required for Graph beta schemas (for example people connectors).
124
+ - `--use-preview-features` is required only when a schema uses Graph beta capabilities such as beta-only people labels.
124
125
 
125
126
  ### Create a starter TypeSpec file
126
127
 
@@ -136,7 +137,7 @@ npx @wictorwilen/cocogen@latest init --prompt
136
137
  npx @wictorwilen/cocogen@latest validate --tsp ./schema.tsp
137
138
  ```
138
139
 
139
- Use `--use-preview-features` for Graph beta schemas (for example people connectors).
140
+ Use `--use-preview-features` when cocogen reports a Graph beta requirement.
140
141
 
141
142
  ### Generate a runnable project
142
143
 
@@ -146,7 +147,7 @@ npx @wictorwilen/cocogen@latest generate --tsp ./schema.tsp --out ./my-connector
146
147
 
147
148
  Notes:
148
149
  - `cocogen` will fail fast if the schema is invalid.
149
- - Beta features require `--use-preview-features`.
150
+ - Graph beta features require `--use-preview-features`.
150
151
  - Use `--data-format custom` to emit a stub datasource for custom backends.
151
152
 
152
153
  ### Update generated code after changing TypeSpec
@@ -159,6 +160,8 @@ When you change the schema, regenerate only the TypeSpec-derived files:
159
160
  npx @wictorwilen/cocogen@latest update --out ./my-connector
160
161
  ```
161
162
 
163
+ For generated .NET projects, `update` also refreshes `Program.cs` because it carries schema-derived wiring such as the item model and people-connector provisioning flow.
164
+
162
165
  Override the TypeSpec entrypoint (also updates `cocogen.json`):
163
166
 
164
167
  ```bash