@wictorwilen/cocogen 1.1.0-preview.1 → 1.1.0-preview.11
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/CHANGELOG.md +58 -0
- package/README.md +6 -3
- package/data/graph-capabilities.json +574 -73
- package/data/graph-external-connectors-principal.json +1 -1
- package/data/graph-profile-schema.json +322 -1
- package/dist/init/dotnet/generator.d.ts +2 -0
- package/dist/init/dotnet/generator.d.ts.map +1 -1
- package/dist/init/dotnet/generator.js +22 -31
- package/dist/init/dotnet/generator.js.map +1 -1
- package/dist/init/dotnet/people-entity.d.ts.map +1 -1
- package/dist/init/dotnet/people-entity.js +5 -4
- package/dist/init/dotnet/people-entity.js.map +1 -1
- package/dist/init/helpers/schema.js +5 -5
- package/dist/init/helpers/schema.js.map +1 -1
- package/dist/init/init.d.ts.map +1 -1
- package/dist/init/init.js +1 -0
- package/dist/init/init.js.map +1 -1
- package/dist/init/templates/dotnet/Core/ConnectorCore.cs.ejs +163 -26
- package/dist/init/templates/dotnet/Core/PeoplePayload.cs.ejs +145 -61
- package/dist/init/templates/dotnet/Generated/PropertyTransformBase.cs.ejs +7 -2
- package/dist/init/templates/dotnet/Program.commandline.cs.ejs +16 -8
- package/dist/init/templates/dotnet/PropertyTransform.cs.ejs +42 -1
- package/dist/init/templates/dotnet/README.md.ejs +3 -2
- package/dist/init/templates/dotnet/project.csproj.ejs +3 -0
- package/dist/init/templates/starter/AGENTS.md.ejs +5 -5
- package/dist/init/templates/ts/README.md.ejs +3 -2
- package/dist/init/templates/ts/src/cli.ts.ejs +14 -6
- package/dist/init/templates/ts/src/core/connectorCore.ts.ejs +62 -13
- package/dist/init/templates/ts/src/core/people.ts.ejs +23 -2
- package/dist/ir.d.ts +1 -1
- package/dist/ir.d.ts.map +1 -1
- package/dist/people/label-registry.d.ts.map +1 -1
- package/dist/people/label-registry.js +5 -0
- package/dist/people/label-registry.js.map +1 -1
- package/dist/tsp/init-tsp.js +2 -2
- package/dist/tsp/init-tsp.js.map +1 -1
- package/dist/validate/validator.d.ts.map +1 -1
- package/dist/validate/validator.js +46 -0
- package/dist/validate/validator.js.map +1 -1
- package/package.json +1 -1
- package/typespec/main.tsp +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,54 @@ 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.11] - 2026-04-09
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Generated TypeScript and .NET connector CLIs now support `--retry-attempts` (default `2`, max `10`) for ingestion; failed items are queued and retried after the initial batch pass completes, with retry-round backoff and final failed-item summaries.
|
|
14
|
+
|
|
15
|
+
## [1.1.0-preview.10] - 2026-04-08
|
|
16
|
+
|
|
17
|
+
## [1.1.0-preview.9] - 2026-04-08
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
|
|
23
|
+
## [1.1.0-preview.8] - 2026-04-08
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- **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)`.
|
|
27
|
+
|
|
28
|
+
## [1.1.0-preview.7] - 2026-04-08
|
|
29
|
+
|
|
30
|
+
## [1.1.0-preview.6] - 2026-04-07
|
|
31
|
+
|
|
32
|
+
## [1.1.0-preview.5] - 2026-04-07
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- Generated people connector `provision` commands no longer auto-register the connection as a profile source; use the dedicated `register-profile-source` command instead.
|
|
36
|
+
|
|
37
|
+
## [1.1.0-preview.4] - 2026-04-07
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- 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.
|
|
41
|
+
|
|
42
|
+
## [1.1.0-preview.3] - 2026-04-07
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- `cocogen update` now refreshes generated `.NET` `Program.cs` files even without `--include-scaffold`, so schema-driven entrypoint changes do not stay stale after updates.
|
|
46
|
+
- 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.
|
|
47
|
+
|
|
48
|
+
## [1.1.0-preview.2] - 2026-04-07
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- `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.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
- People connector metadata refresh and validation now recognize the five current beta-only labels documented for people connectors: `personEducationalActivities`, `personInterests`, `personLanguages`, `personPatents`, and `personPublications`.
|
|
55
|
+
- `externalConnection.contentCategory` now resolves to Graph `v1.0` capability in the generator metadata, matching `principal` and `principalCollection`.
|
|
56
|
+
- 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.
|
|
57
|
+
|
|
10
58
|
## [1.1.0-preview.1] - 2026-03-31
|
|
11
59
|
|
|
12
60
|
### Changed
|
|
@@ -335,6 +383,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
335
383
|
- Collection values no longer split on commas; use semicolons instead.
|
|
336
384
|
|
|
337
385
|
[Unreleased]: https://github.com/wictorwilen/cocogen/compare/v1.0.16...HEAD
|
|
386
|
+
[1.1.0-preview.11]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.11
|
|
387
|
+
[1.1.0-preview.10]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.10
|
|
388
|
+
[1.1.0-preview.9]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.9
|
|
389
|
+
[1.1.0-preview.8]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.8
|
|
390
|
+
[1.1.0-preview.7]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.7
|
|
391
|
+
[1.1.0-preview.6]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.6
|
|
392
|
+
[1.1.0-preview.5]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.5
|
|
393
|
+
[1.1.0-preview.4]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.4
|
|
394
|
+
[1.1.0-preview.3]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.3
|
|
395
|
+
[1.1.0-preview.2]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.2
|
|
338
396
|
[1.1.0-preview.1]: https://github.com/wictorwilen/cocogen/compare/main...v1.1.0-preview.1
|
|
339
397
|
[1.0.50]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.50
|
|
340
398
|
[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
|
|
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`
|
|
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
|
-
-
|
|
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
|