@wictorwilen/cocogen 1.0.24 → 1.0.25
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
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.25] - 2026-01-21
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- .NET CSV datasource/CLI now alias schema model types to avoid namespace/type name collisions (e.g., `Skills` as namespace).
|
|
14
|
+
|
|
10
15
|
## [1.0.24] - 2026-01-21
|
|
11
16
|
|
|
12
17
|
### Changed
|
|
@@ -80,6 +85,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
80
85
|
- Collection values no longer split on commas; use semicolons instead.
|
|
81
86
|
|
|
82
87
|
[Unreleased]: https://github.com/wictorwilen/cocogen/compare/v1.0.16...HEAD
|
|
88
|
+
[1.0.25]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.25
|
|
83
89
|
[1.0.24]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.24
|
|
84
90
|
[1.0.22]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.22
|
|
85
91
|
[1.0.21]: https://github.com/wictorwilen/cocogen/compare/main...v1.0.21
|
|
@@ -5,13 +5,14 @@ using System.Runtime.CompilerServices;
|
|
|
5
5
|
using CsvHelper;
|
|
6
6
|
|
|
7
7
|
using <%= schemaNamespace %>;
|
|
8
|
+
using ItemModel = <%= schemaNamespace %>.<%= itemTypeName %>;
|
|
8
9
|
|
|
9
10
|
namespace <%= namespaceName %>.Datasource;
|
|
10
11
|
|
|
11
12
|
/// <summary>
|
|
12
13
|
/// CSV-based datasource (default). Replace with your own IItemSource as needed.
|
|
13
14
|
/// </summary>
|
|
14
|
-
public sealed class CsvItemSource : IItemSource
|
|
15
|
+
public sealed class CsvItemSource : IItemSource<ItemModel>
|
|
15
16
|
{
|
|
16
17
|
private readonly string _csvPath;
|
|
17
18
|
|
|
@@ -26,7 +27,7 @@ public sealed class CsvItemSource : IItemSource<<%= itemTypeName %>>
|
|
|
26
27
|
/// <summary>
|
|
27
28
|
/// Stream items from the CSV file and map each row to the schema model.
|
|
28
29
|
/// </summary>
|
|
29
|
-
public async IAsyncEnumerable
|
|
30
|
+
public async IAsyncEnumerable<ItemModel> GetItemsAsync([EnumeratorCancellation] CancellationToken cancellationToken = default)
|
|
30
31
|
{
|
|
31
32
|
// CsvHelper is sync; we still expose async enumeration for consistency.
|
|
32
33
|
using var reader = new StreamReader(_csvPath);
|
|
@@ -14,6 +14,7 @@ using System.Threading;
|
|
|
14
14
|
using <%= namespaceName %>.Core;
|
|
15
15
|
using <%= namespaceName %>.Datasource;
|
|
16
16
|
using <%= schemaNamespace %>;
|
|
17
|
+
using ItemModel = <%= schemaNamespace %>.<%= itemTypeName %>;
|
|
17
18
|
|
|
18
19
|
var configuration = new ConfigurationBuilder()
|
|
19
20
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
@@ -127,9 +128,9 @@ GraphServiceClient CreateGraphClient()
|
|
|
127
128
|
return graph;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
ConnectorCore
|
|
131
|
+
ConnectorCore<ItemModel> BuildConnectorCore(GraphServiceClient? graph, TokenCredential? credential, string connectionId)
|
|
131
132
|
{
|
|
132
|
-
return new ConnectorCore
|
|
133
|
+
return new ConnectorCore<ItemModel>(
|
|
133
134
|
graph,
|
|
134
135
|
credential,
|
|
135
136
|
new ItemPayloadAdapter(),
|
|
@@ -181,7 +182,7 @@ async Task IngestAsync(string? csvPath, bool dryRun, int? limit, bool verbose, b
|
|
|
181
182
|
var path = string.IsNullOrWhiteSpace(csvPath) ? configuredCsv : csvPath;
|
|
182
183
|
|
|
183
184
|
// Swap this for any IItemSource implementation (API, DB, queue, etc.).
|
|
184
|
-
IItemSource
|
|
185
|
+
IItemSource<ItemModel> source = new CsvItemSource(path);
|
|
185
186
|
var core = BuildConnectorCore(graph, credential, connectionId);
|
|
186
187
|
|
|
187
188
|
await core.IngestAsync(source, dryRun, limit, verbose, failFast);
|