@eventconnectors/ndtrc_model 1.1.0 → 1.2.1

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 (41) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +105 -0
  3. package/dist/index.cjs +930 -0
  4. package/dist/index.d.cts +58174 -0
  5. package/dist/index.d.ts +58174 -0
  6. package/dist/index.js +826 -0
  7. package/package.json +51 -10
  8. package/.claude/settings.local.json +0 -14
  9. package/CLAUDE.md +0 -54
  10. package/eventconnectors-ndtrc_model-1.0.4.tgz +0 -0
  11. package/index.js +0 -36
  12. package/src/__tests__/model.test.js +0 -327
  13. package/src/model/ConvertedEntry.js +0 -22
  14. package/src/model/FetchedEntry.js +0 -55
  15. package/src/model/ff/Acl.js +0 -13
  16. package/src/model/ff/ItemLink.js +0 -25
  17. package/src/model/ff/Route.js +0 -95
  18. package/src/model/ndtrc/Address.js +0 -70
  19. package/src/model/ndtrc/Calendar.js +0 -255
  20. package/src/model/ndtrc/Categories.js +0 -54
  21. package/src/model/ndtrc/ContactInfo.js +0 -188
  22. package/src/model/ndtrc/ExtraPriceInformation.js +0 -16
  23. package/src/model/ndtrc/File.js +0 -155
  24. package/src/model/ndtrc/GISCoordinate.js +0 -19
  25. package/src/model/ndtrc/Location.js +0 -23
  26. package/src/model/ndtrc/Performer.js +0 -9
  27. package/src/model/ndtrc/PriceElement.js +0 -64
  28. package/src/model/ndtrc/Promotion.js +0 -51
  29. package/src/model/ndtrc/RouteInfo.js +0 -34
  30. package/src/model/ndtrc/SubItemGroup.js +0 -102
  31. package/src/model/ndtrc/TRCItem.js +0 -136
  32. package/src/model/ndtrc/TRCItemCategories.js +0 -105
  33. package/src/model/ndtrc/TRCItemDetail.js +0 -10
  34. package/src/model/ndtrc/TRCItemGroup.js +0 -74
  35. package/src/model/ndtrc/TRCItemRelation.js +0 -13
  36. package/src/model/ndtrc/Translations.js +0 -8
  37. package/src/model/ndtrc/enums.js +0 -33
  38. package/src/resources/schema/NDTRC-types-EVENTS.txt +0 -0
  39. package/src/resources/schema/NDTRC-types-locaties.txt +0 -0
  40. package/src/util/CategoryMap.js +0 -194
  41. package/src/util/StringUtils.js +0 -12
package/package.json CHANGED
@@ -1,19 +1,60 @@
1
1
  {
2
2
  "name": "@eventconnectors/ndtrc_model",
3
- "version": "1.1.0",
4
- "main": "index.js",
3
+ "version": "1.2.1",
4
+ "description": "Zod schemas for the NDTRC tourism data model — TypeScript port of the Groovy ndtrc_model library",
5
+ "keywords": [
6
+ "ndtrc",
7
+ "eventconnectors",
8
+ "feed-factory",
9
+ "zod",
10
+ "tourism"
11
+ ],
12
+ "license": "Apache-2.0",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/TheFeedFactory/ndtrc_model.git",
16
+ "directory": "ts"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/TheFeedFactory/ndtrc_model/issues"
20
+ },
21
+ "homepage": "https://github.com/TheFeedFactory/ndtrc_model/tree/master/ts#readme",
22
+ "type": "module",
23
+ "main": "./dist/index.cjs",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "import": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/index.d.cts",
34
+ "default": "./dist/index.cjs"
35
+ }
36
+ }
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "README.md",
41
+ "LICENSE"
42
+ ],
5
43
  "scripts": {
6
- "test": "jest"
44
+ "build": "tsup",
45
+ "typecheck": "tsc --noEmit",
46
+ "test": "vitest run"
7
47
  },
8
48
  "dependencies": {
9
- "dayjs": "^1.11.19",
10
- "moment": "^2.30.1",
11
- "xmlbuilder": "^15.1.1"
49
+ "zod": "^3.24.4"
12
50
  },
13
51
  "devDependencies": {
14
- "jest": "^30.2.0"
52
+ "@types/node": "^25.6.0",
53
+ "tsup": "^8.4.0",
54
+ "typescript": "^5.8.3",
55
+ "vitest": "^3.1.3"
15
56
  },
16
- "private": false,
17
- "author": "wwwappz",
18
- "license": "MIT"
57
+ "engines": {
58
+ "node": ">=18"
59
+ }
19
60
  }
@@ -1,14 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm test)",
5
- "Bash(node -e:*)",
6
- "WebFetch(domain:github.com)",
7
- "WebFetch(domain:api.github.com)",
8
- "WebFetch(domain:raw.githubusercontent.com)",
9
- "Bash(npm publish:*)"
10
- ],
11
- "deny": [],
12
- "ask": []
13
- }
14
- }
package/CLAUDE.md DELETED
@@ -1,54 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- This is the `@eventconnectors/ndtrc_model` npm package - a Node.js data model library for NDTRC (Nationale Databank Toerisme en Recreatie Centraal), the Dutch national tourism and recreation database. It provides JavaScript classes for representing tourism events, locations, and related entities.
8
-
9
- ## Commands
10
-
11
- - **Run tests**: `npm test` (uses Jest)
12
- - **Install dependencies**: `npm install`
13
-
14
- ## Architecture
15
-
16
- ### Entry Point
17
- - `index.js` - Exports all model classes from a single entry point
18
-
19
- ### Model Classes (`src/model/`)
20
-
21
- **Core Entry Types:**
22
- - `FetchedEntry` - Raw data fetched from external sources (with `ExternalLocationInfo`)
23
- - `ConvertedEntry` - Processed entry containing a validated `TRCItem`
24
-
25
- **NDTRC Models (`src/model/ndtrc/`):**
26
- - `TRCItem` - Main entity representing an event/location with static enums `WFStatus` and `EntityType`
27
- - `TRCItemDetail` - Multilingual details (title, descriptions) per language
28
- - `Calendar` - Complex scheduling with single dates, pattern dates, and exception handling
29
- - `Location` - Location info with address and optional `LocationItem` reference
30
- - `TRCItemCategories` - Category assignments for items
31
-
32
- **Supporting Models:**
33
- - `Address`, `ContactInfo`, `GISCoordinate` - Location/contact data
34
- - `PriceElement`, `ExtraPriceInformation` - Pricing information
35
- - `File`, `Performer`, `Promotion` - Media and marketing
36
- - `Translations`, `RouteInfo`, `SubItemGroup`, `TRCItemGroup`, `TRCItemRelation`
37
-
38
- ### Utilities (`src/util/`)
39
- - `CategoryMap` - Maps external category names to NDTRC category IDs with associated tags
40
- - `Categories` - NDTRC category ID lookup table
41
-
42
- ### Key Patterns
43
-
44
- 1. **Constructor-based initialization**: All model classes use destructured object parameters with defaults
45
- 2. **Nested class instantiation**: Parent classes automatically instantiate child classes (e.g., `TRCItem` creates `Calendar`, `Location` instances)
46
- 3. **Moment.js dates**: Date fields use `moment` for parsing and manipulation
47
- 4. **Static enums**: Enums are defined as static properties on classes (e.g., `TRCItem.WFStatus`, `Calendar.CalendarType`)
48
-
49
- ### Entity Types
50
- - `EVENEMENT` - Event
51
- - `LOCATIE` - Location/venue
52
- - `EVENEMENTGROEP` - Event group
53
- - `PLAATSREGIO` - Place/region
54
- - `ROUTE` - Route
package/index.js DELETED
@@ -1,36 +0,0 @@
1
- // src/index.js
2
-
3
- // Exporteer alles in één keer vanuit de respectieve bestanden
4
-
5
- module.exports = {
6
- // FeedFactory Route Model
7
- Route: require("./src/model/ff/Route"),
8
- Acl: require("./src/model/ff/Acl"),
9
- ItemLink: require("./src/model/ff/ItemLink"),
10
-
11
- // Exporteer alle klassen uit de modelbestanden
12
- ConvertedEntry: require("./src/model/ConvertedEntry"),
13
- FetchedEntry: require("./src/model/FetchedEntry"),
14
- ExternalLocationInfo: require("./src/model/FetchedEntry").ExternalLocationInfo,
15
- Location: require("./src/model/ndtrc/Location"),
16
- PriceElement: require("./src/model/ndtrc/PriceElement"),
17
- TRCItem: require("./src/model/ndtrc/TRCItem"),
18
- TRCItemCategories: require("./src/model/ndtrc/TRCItemCategories"),
19
- File: require("./src/model/ndtrc/File"),
20
- GISCoordinate: require("./src/model/ndtrc/GISCoordinate"),
21
- Calendar: require("./src/model/ndtrc/Calendar"),
22
- Contactinfo: require("./src/model/ndtrc/ContactInfo"),
23
- TRCItemDetail: require("./src/model/ndtrc/TRCItemDetail"),
24
-
25
- Address: require("./src/model/ndtrc/Address"),
26
- ExtraPriceInformation: require("./src/model/ndtrc/ExtraPriceInformation"),
27
- Performer: require("./src/model/ndtrc/Performer"),
28
- Promotion: require("./src/model/ndtrc/Promotion"),
29
- RouteInfo: require("./src/model/ndtrc/RouteInfo"),
30
- SubItemGroup: require("./src/model/ndtrc/SubItemGroup"),
31
- Translations: require("./src/model/ndtrc/Translations"),
32
- TRCItemGroup: require("./src/model/ndtrc/TRCItemGroup"),
33
- TRCItemRelation: require("./src/model/ndtrc/TRCItemRelation"),
34
- Categories: require("./src/model/ndtrc/Categories"),
35
- CategoryMap: require("./src/util/CategoryMap"),
36
- };
@@ -1,327 +0,0 @@
1
- const {
2
- TRCItem,
3
- FetchedEntry: FetchedEntryModule,
4
- ExternalLocationInfo,
5
- ConvertedEntry,
6
- Location,
7
- Calendar: CalendarModule,
8
- Contactinfo,
9
- File,
10
- PriceElement,
11
- Performer,
12
- TRCItemDetail,
13
- Address,
14
- GISCoordinate,
15
- Categories,
16
- CategoryMap,
17
- } = require("../../index.js");
18
-
19
- const { FetchedEntry } = FetchedEntryModule;
20
- const { Calendar } = CalendarModule;
21
-
22
- describe("TRCItem", () => {
23
- test("should create with default values", () => {
24
- const item = new TRCItem();
25
- expect(item.trcid).toBe("");
26
- expect(item.published).toBe(false);
27
- expect(item.deleted).toBe(false);
28
- expect(item.forceOverwrite).toBe(false);
29
- });
30
-
31
- test("should create with custom values", () => {
32
- const item = new TRCItem({
33
- trcid: "test123",
34
- published: true,
35
- forceOverwrite: true,
36
- entitytype: TRCItem.EntityType.EVENEMENT,
37
- });
38
- expect(item.trcid).toBe("test123");
39
- expect(item.published).toBe(true);
40
- expect(item.forceOverwrite).toBe(true);
41
- expect(item.entitytype).toBe("EVENEMENT");
42
- });
43
-
44
- test("should have all EntityType values", () => {
45
- expect(TRCItem.EntityType.EVENEMENT).toBe("EVENEMENT");
46
- expect(TRCItem.EntityType.LOCATIE).toBe("LOCATIE");
47
- expect(TRCItem.EntityType.EVENEMENTGROEP).toBe("EVENEMENTGROEP");
48
- expect(TRCItem.EntityType.PLAATSREGIO).toBe("PLAATSREGIO");
49
- expect(TRCItem.EntityType.ROUTE).toBe("ROUTE");
50
- expect(TRCItem.EntityType.VENUE).toBe("VENUE");
51
- });
52
-
53
- test("should have all WFStatus values", () => {
54
- expect(TRCItem.WFStatus.DRAFT).toBe("draft");
55
- expect(TRCItem.WFStatus.READY_FOR_VALIDATION).toBe("readyforvalidation");
56
- expect(TRCItem.WFStatus.APPROVED).toBe("approved");
57
- expect(TRCItem.WFStatus.REJECTED).toBe("rejected");
58
- expect(TRCItem.WFStatus.DELETED).toBe("deleted");
59
- expect(TRCItem.WFStatus.ARCHIVED).toBe("archived");
60
- });
61
-
62
- test("should create nested objects", () => {
63
- const item = new TRCItem({
64
- trcid: "test",
65
- location: { label: "Test Location" },
66
- contactinfo: { label: "Test Contact" },
67
- performers: [{ label: "Artist 1" }],
68
- files: [{ filename: "image.jpg" }],
69
- trcItemDetails: [{ lang: "nl", title: "Test" }],
70
- });
71
- expect(item.location).toBeInstanceOf(Location);
72
- expect(item.contactinfo).toBeInstanceOf(Contactinfo);
73
- expect(item.performers).toHaveLength(1);
74
- expect(item.files).toHaveLength(1);
75
- expect(item.trcItemDetails).toHaveLength(1);
76
- });
77
- });
78
-
79
- describe("Location", () => {
80
- test("should create with default values", () => {
81
- const loc = new Location();
82
- expect(loc.label).toBe("");
83
- expect(loc.address).toBeNull();
84
- expect(loc.locationItem).toBeNull();
85
- expect(loc.venueItem).toBeNull();
86
- });
87
-
88
- test("should create with locationItem and venueItem", () => {
89
- const loc = new Location({
90
- label: "Test",
91
- locationItem: { id: "1", trcid: "loc1", text: "Location" },
92
- venueItem: { id: "2", trcid: "venue1", text: "Venue" },
93
- });
94
- expect(loc.locationItem.id).toBe("1");
95
- expect(loc.locationItem.trcid).toBe("loc1");
96
- expect(loc.venueItem.id).toBe("2");
97
- expect(loc.venueItem.trcid).toBe("venue1");
98
- });
99
-
100
- test("should create address", () => {
101
- const loc = new Location({
102
- address: { city: "Amsterdam", street: "Damrak" },
103
- });
104
- expect(loc.address).toBeInstanceOf(Address);
105
- expect(loc.address.city).toBe("Amsterdam");
106
- });
107
- });
108
-
109
- describe("Calendar", () => {
110
- test("should create with default values", () => {
111
- const cal = new Calendar();
112
- expect(cal.singleDates).toEqual([]);
113
- expect(cal.patternDates).toEqual([]);
114
- expect(cal.excludeholidays).toBe(false);
115
- expect(cal.cancelled).toBe(false);
116
- expect(cal.soldout).toBe(false);
117
- expect(cal.onrequest).toBe(false);
118
- expect(cal.alwaysopen).toBe(false);
119
- expect(cal.comment).toBeNull();
120
- expect(cal.calendarType).toBeNull();
121
- });
122
-
123
- test("should have CalendarType enum", () => {
124
- expect(Calendar.CalendarType.NONE).toBe("NONE");
125
- expect(Calendar.CalendarType.ALWAYSOPEN).toBe("ALWAYSOPEN");
126
- expect(Calendar.CalendarType.ONREQUEST).toBe("ONREQUEST");
127
- expect(Calendar.CalendarType.OPENINGTIMES).toBe("OPENINGTIMES");
128
- expect(Calendar.CalendarType.PATTERNDATES).toBe("PATTERNDATES");
129
- expect(Calendar.CalendarType.SINGLEDATES).toBe("SINGLEDATES");
130
- });
131
-
132
- test("should determine ALWAYSOPEN calendar type", () => {
133
- const cal = new Calendar();
134
- cal.alwaysopen = true;
135
- cal.determineCalendarType();
136
- expect(cal.calendarType).toBe("ALWAYSOPEN");
137
- });
138
-
139
- test("should determine ONREQUEST calendar type", () => {
140
- const cal = new Calendar();
141
- cal.onrequest = true;
142
- cal.determineCalendarType();
143
- expect(cal.calendarType).toBe("ONREQUEST");
144
- });
145
- });
146
-
147
- describe("Contactinfo", () => {
148
- test("should create with default values", () => {
149
- const contact = new Contactinfo();
150
- expect(contact.label).toBe("");
151
- expect(contact.mails).toEqual([]);
152
- expect(contact.phones).toEqual([]);
153
- expect(contact.urls).toEqual([]);
154
- });
155
-
156
- test("should create nested Mail objects", () => {
157
- const contact = new Contactinfo({
158
- mails: [{ email: "test@example.com" }],
159
- });
160
- expect(contact.mails).toHaveLength(1);
161
- expect(contact.mails[0].email).toBe("test@example.com");
162
- });
163
-
164
- test("should create nested Url objects", () => {
165
- const contact = new Contactinfo({
166
- urls: [{ url: "https://example.com", urlServiceType: "general" }],
167
- });
168
- expect(contact.urls).toHaveLength(1);
169
- expect(contact.urls[0].url).toBe("https://example.com");
170
- });
171
-
172
- test("should have all URLServiceType values", () => {
173
- const types = Contactinfo.Url.URLServiceType;
174
- expect(types.general).toBe("general");
175
- expect(types.booking).toBe("booking");
176
- expect(types.review).toBe("review");
177
- expect(types.video).toBe("video");
178
- expect(types.webshop).toBe("webshop");
179
- expect(types.socialmedia).toBe("socialmedia");
180
- expect(types.lastminute).toBe("lastminute");
181
- expect(types.virtualtour).toBe("virtualtour");
182
- expect(types.dmo).toBe("dmo");
183
- expect(types.sustainability).toBe("sustainability");
184
- expect(types.venuefinder).toBe("venuefinder");
185
- expect(types.travelbase).toBe("travelbase");
186
- });
187
- });
188
-
189
- describe("File", () => {
190
- test("should create with default values", () => {
191
- const file = new File();
192
- expect(file.trcid).toBe("");
193
- expect(file.main).toBe(false);
194
- expect(file.filename).toBe("");
195
- });
196
-
197
- test("should have FileType enum", () => {
198
- expect(File.FileType.jpeg).toBe("jpeg");
199
- expect(File.FileType.youtube).toBe("youtube");
200
- expect(File.FileType.vimeo).toBe("vimeo");
201
- });
202
-
203
- test("should have MediaType enum", () => {
204
- expect(File.MediaType.photo).toBe("photo");
205
- expect(File.MediaType.video).toBe("video");
206
- expect(File.MediaType.poster).toBe("poster");
207
- });
208
-
209
- test("should normalize YouTube URL", () => {
210
- const shortUrl = "https://youtu.be/dQw4w9WgXcQ";
211
- const normalized = File.normalizeYouTubeURL(shortUrl);
212
- expect(normalized).toBe("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
213
- });
214
-
215
- test("should extract YouTube video ID", () => {
216
- const url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
217
- const videoId = File.youtubeVideoID(url);
218
- expect(videoId).toBe("dQw4w9WgXcQ");
219
- });
220
- });
221
-
222
- describe("PriceElement", () => {
223
- test("should create with default values", () => {
224
- const price = new PriceElement();
225
- expect(price.freeentrance).toBe(false);
226
- expect(price.priceValue).toBeNull();
227
- expect(price.comments).toEqual([]);
228
- });
229
-
230
- test("should create with price value", () => {
231
- const price = new PriceElement({
232
- freeentrance: false,
233
- priceValue: { from: 10.0, until: 25.0 },
234
- });
235
- expect(price.priceValue.from).toBe(10.0);
236
- expect(price.priceValue.until).toBe(25.0);
237
- });
238
-
239
- test("should have PriceDescriptionValue enum", () => {
240
- const values = PriceElement.Description.PriceDescriptionValue;
241
- expect(values.Adults).toBe("Adults");
242
- expect(values.Children).toBe("Children");
243
- expect(values.Groups).toBe("Groups");
244
- expect(values.CJP).toBe("CJP");
245
- });
246
- });
247
-
248
- describe("FetchedEntry", () => {
249
- test("should create with default values", () => {
250
- const entry = new FetchedEntry();
251
- expect(entry.feed).toBe("");
252
- expect(entry.sourceId).toBe("");
253
- expect(entry.externalId).toBe("");
254
- });
255
-
256
- test("should create with custom values", () => {
257
- const entry = new FetchedEntry({
258
- feed: "test-feed",
259
- sourceId: "source-123",
260
- externalId: "ext-456",
261
- data: { key: "value" },
262
- });
263
- expect(entry.feed).toBe("test-feed");
264
- expect(entry.sourceId).toBe("source-123");
265
- expect(entry.data.key).toBe("value");
266
- });
267
- });
268
-
269
- describe("ConvertedEntry", () => {
270
- test("should create with default values", () => {
271
- const entry = new ConvertedEntry();
272
- expect(entry.label).toBe("");
273
- expect(entry.externalId).toBe("");
274
- expect(entry.trcItem).toBeNull();
275
- });
276
-
277
- test("should accept TRCItem instance", () => {
278
- const trcItem = new TRCItem({ trcid: "test" });
279
- const entry = new ConvertedEntry({
280
- label: "Test Entry",
281
- trcItem: trcItem,
282
- });
283
- expect(entry.trcItem).toBe(trcItem);
284
- });
285
- });
286
-
287
- describe("Address", () => {
288
- test("should create with default values", () => {
289
- const address = new Address();
290
- expect(address.city).toBe("");
291
- expect(address.country).toBe("NL");
292
- expect(address.main).toBe(false);
293
- });
294
-
295
- test("should normalize zipcode", () => {
296
- const address = new Address({ zipcode: "1234ab" });
297
- address.normaliseAdresItems();
298
- expect(address.zipcode).toBe("1234 AB");
299
- });
300
-
301
- test("should check isEmpty", () => {
302
- const emptyAddress = new Address();
303
- const filledAddress = new Address({ city: "Amsterdam" });
304
- expect(emptyAddress.isEmpty()).toBe(true);
305
- expect(filledAddress.isEmpty()).toBe(false);
306
- });
307
- });
308
-
309
- describe("Categories", () => {
310
- test("should have category mappings", () => {
311
- expect(Categories.categories).toBeDefined();
312
- expect(Categories.categories["Beurs"]).toBe("2.3.1");
313
- expect(Categories.categories["Film"]).toBe("2.5.2");
314
- });
315
- });
316
-
317
- describe("CategoryMap", () => {
318
- test("should have categoryMap", () => {
319
- expect(CategoryMap.CategoryMap.categoryMap).toBeDefined();
320
- expect(CategoryMap.CategoryMap.categoryMap["concert"].catId).toBe("2.6.5");
321
- });
322
-
323
- test("should have categoryType", () => {
324
- expect(CategoryMap.CategoryMap.categoryType).toBeDefined();
325
- expect(CategoryMap.CategoryMap.categoryType["Cabaret"]).toBe("2.9.1");
326
- });
327
- });
@@ -1,22 +0,0 @@
1
- const TRCItem = require('./ndtrc/TRCItem'); // Zorg ervoor dat je het juiste pad gebruikt naar de TRCItem-module
2
-
3
- class ConvertedEntry {
4
- constructor({
5
- label = '',
6
- created = null, // Verwacht een Date-object
7
- modified = null, // Verwacht een Date-object
8
- errorMessage = '',
9
- externalId = '',
10
- trcItem = null, // Verwacht een instantie van TRCItem
11
- } = {}) {
12
- this.label = label;
13
- this.created = created;
14
- this.modified = modified;
15
- this.errorMessage = errorMessage;
16
-
17
- this.externalId = externalId;
18
- this.trcItem = trcItem instanceof TRCItem ? trcItem : null; // Validatie dat het een TRCItem is
19
- }
20
- }
21
-
22
- module.exports = ConvertedEntry;
@@ -1,55 +0,0 @@
1
-
2
- class FetchedEntry {
3
- constructor({
4
- feed = '',
5
- sourceId = '',
6
- sourceUrl = '',
7
- errorMessage = '',
8
- label = '',
9
- created = null, // Verwacht een Date-object
10
- modified = null, // Verwacht een Date-object
11
- externalId = '',
12
- data = {}, // Verwacht een object met willekeurige sleutel-waarde paren
13
- externalLocationInfo = null, // Verwacht een instantie van ExternalLocationInfo
14
- } = {}) {
15
- this.feed = feed;
16
- this.sourceId = sourceId;
17
- this.sourceUrl = sourceUrl;
18
- this.errorMessage = errorMessage;
19
-
20
- this.label = label;
21
- this.created = created;
22
- this.modified = modified;
23
-
24
- this.externalId = externalId;
25
- this.data = data;
26
- this.externalLocationInfo = externalLocationInfo;
27
- }
28
- }
29
-
30
- class ExternalLocationInfo {
31
- constructor({
32
- externalId = '',
33
- locationName = '',
34
- address = '',
35
- housenr = '',
36
- zipcode = '',
37
- city = '',
38
- latitude = '',
39
- longitude = '',
40
- trcid = '',
41
- ffId = '',
42
- } = {}) {
43
- this.externalId = externalId;
44
- this.locationName = locationName;
45
- this.address = address;
46
- this.housenr = housenr;
47
- this.zipcode = zipcode;
48
- this.city = city;
49
- this.latitude = latitude;
50
- this.longitude = longitude;
51
- this.trcid = trcid;
52
- this.ffId = ffId;
53
- }
54
- }
55
- module.exports = { FetchedEntry, ExternalLocationInfo };
@@ -1,13 +0,0 @@
1
- class Acl {
2
- constructor({
3
- readers = [],
4
- editors = [],
5
- managers = []
6
- } = {}) {
7
- this.readers = readers;
8
- this.editors = editors;
9
- this.managers = managers;
10
- }
11
- }
12
-
13
- module.exports = Acl;
@@ -1,25 +0,0 @@
1
- class ItemLink {
2
- constructor({
3
- type = null,
4
- id = ''
5
- } = {}) {
6
- this.type = type;
7
- this.id = id;
8
- }
9
-
10
- static Type = {
11
- ALIAS: 'alias',
12
- COMMENT: 'comment',
13
- PARENT: 'parent',
14
- CHILD: 'child',
15
-
16
- fromString(type) {
17
- if (Object.values(ItemLink.Type).includes(type)) {
18
- return type;
19
- }
20
- throw new Error(`Invalid ItemLink Type: ${type}`);
21
- }
22
- };
23
- }
24
-
25
- module.exports = ItemLink;