@onlyworlds/sdk 1.2.0 → 1.3.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/dist/index.mjs CHANGED
@@ -144,267 +144,462 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
144
144
  ElementType2["Zone"] = "zone";
145
145
  return ElementType2;
146
146
  })(ElementType || {});
147
- var FIELD_MAPPINGS = {
147
+ var FIELD_SCHEMA = {
148
148
  ability: {
149
- tradition: "construct",
150
- source: "phenomenon",
151
- locus: "location",
152
- effects: "phenomenon",
153
- talents: "trait",
154
- requisites: "construct",
155
- instruments: "object",
156
- systems: "construct"
149
+ // Text fields
150
+ activation: { type: "text" },
151
+ duration: { type: "text" },
152
+ potency: { type: "text" },
153
+ range: { type: "text" },
154
+ challenges: { type: "text" },
155
+ prevalence: { type: "text" },
156
+ // Link fields
157
+ tradition: { type: "single_link", target: "construct" },
158
+ source: { type: "single_link", target: "phenomenon" },
159
+ locus: { type: "single_link", target: "location" },
160
+ effects: { type: "multi_link", target: "phenomenon" },
161
+ talents: { type: "multi_link", target: "trait" },
162
+ requisites: { type: "multi_link", target: "construct" },
163
+ instruments: { type: "multi_link", target: "object" },
164
+ systems: { type: "multi_link", target: "construct" }
157
165
  },
158
166
  character: {
159
- birthplace: "location",
160
- location: "location",
161
- species: "species",
162
- traits: "trait",
163
- abilities: "ability",
164
- languages: "language",
165
- objects: "object",
166
- institutions: "institution",
167
- family: "family",
168
- friends: "character",
169
- rivals: "character"
167
+ // Text fields
168
+ physicality: { type: "text" },
169
+ mentality: { type: "text" },
170
+ height: { type: "text" },
171
+ weight: { type: "text" },
172
+ background: { type: "text" },
173
+ motivations: { type: "text" },
174
+ birth_date: { type: "text" },
175
+ reputation: { type: "text" },
176
+ charisma: { type: "text" },
177
+ coercion: { type: "text" },
178
+ competence: { type: "text" },
179
+ compassion: { type: "text" },
180
+ creativity: { type: "text" },
181
+ courage: { type: "text" },
182
+ level: { type: "text" },
183
+ hit_points: { type: "text" },
184
+ STR: { type: "text" },
185
+ DEX: { type: "text" },
186
+ CON: { type: "text" },
187
+ INT: { type: "text" },
188
+ WIS: { type: "text" },
189
+ CHA: { type: "text" },
190
+ // Link fields
191
+ birthplace: { type: "single_link", target: "location" },
192
+ location: { type: "single_link", target: "location" },
193
+ species: { type: "multi_link", target: "species" },
194
+ traits: { type: "multi_link", target: "trait" },
195
+ abilities: { type: "multi_link", target: "ability" },
196
+ languages: { type: "multi_link", target: "language" },
197
+ objects: { type: "multi_link", target: "object" },
198
+ institutions: { type: "multi_link", target: "institution" },
199
+ family: { type: "multi_link", target: "family" },
200
+ friends: { type: "multi_link", target: "character" },
201
+ rivals: { type: "multi_link", target: "character" }
170
202
  },
171
203
  collective: {
172
- operator: "institution",
173
- equipment: "construct",
174
- abilities: "ability",
175
- symbolism: "construct",
176
- species: "species",
177
- characters: "character",
178
- creatures: "creature",
179
- phenomena: "phenomenon"
204
+ // Text fields
205
+ composition: { type: "text" },
206
+ count: { type: "text" },
207
+ formation_date: { type: "text" },
208
+ activity: { type: "text" },
209
+ disposition: { type: "text" },
210
+ state: { type: "text" },
211
+ // Link fields
212
+ operator: { type: "single_link", target: "institution" },
213
+ equipment: { type: "multi_link", target: "construct" },
214
+ abilities: { type: "multi_link", target: "ability" },
215
+ symbolism: { type: "multi_link", target: "construct" },
216
+ species: { type: "multi_link", target: "species" },
217
+ characters: { type: "multi_link", target: "character" },
218
+ creatures: { type: "multi_link", target: "creature" },
219
+ phenomena: { type: "multi_link", target: "phenomenon" }
180
220
  },
181
221
  construct: {
182
- founder: "character",
183
- custodian: "institution",
184
- characters: "character",
185
- objects: "object",
186
- locations: "location",
187
- species: "species",
188
- creatures: "creature",
189
- institutions: "institution",
190
- traits: "trait",
191
- collectives: "collective",
192
- zones: "zone",
193
- abilities: "ability",
194
- phenomena: "phenomenon",
195
- languages: "language",
196
- families: "family",
197
- relations: "relation",
198
- titles: "title",
199
- constructs: "construct",
200
- events: "event",
201
- narratives: "narrative"
222
+ // Text fields
223
+ rationale: { type: "text" },
224
+ history: { type: "text" },
225
+ status: { type: "text" },
226
+ reach: { type: "text" },
227
+ start_date: { type: "text" },
228
+ end_date: { type: "text" },
229
+ // Link fields
230
+ founder: { type: "single_link", target: "character" },
231
+ custodian: { type: "single_link", target: "institution" },
232
+ characters: { type: "multi_link", target: "character" },
233
+ objects: { type: "multi_link", target: "object" },
234
+ locations: { type: "multi_link", target: "location" },
235
+ species: { type: "multi_link", target: "species" },
236
+ creatures: { type: "multi_link", target: "creature" },
237
+ institutions: { type: "multi_link", target: "institution" },
238
+ traits: { type: "multi_link", target: "trait" },
239
+ collectives: { type: "multi_link", target: "collective" },
240
+ zones: { type: "multi_link", target: "zone" },
241
+ abilities: { type: "multi_link", target: "ability" },
242
+ phenomena: { type: "multi_link", target: "phenomenon" },
243
+ languages: { type: "multi_link", target: "language" },
244
+ families: { type: "multi_link", target: "family" },
245
+ relations: { type: "multi_link", target: "relation" },
246
+ titles: { type: "multi_link", target: "title" },
247
+ constructs: { type: "multi_link", target: "construct" },
248
+ events: { type: "multi_link", target: "event" },
249
+ narratives: { type: "multi_link", target: "narrative" }
202
250
  },
203
251
  creature: {
204
- location: "location",
205
- zone: "zone",
206
- species: "species",
207
- traits: "trait",
208
- abilities: "ability",
209
- languages: "language",
210
- actions: "ability"
252
+ // Text fields
253
+ appearance: { type: "text" },
254
+ weight: { type: "text" },
255
+ height: { type: "text" },
256
+ habits: { type: "text" },
257
+ demeanor: { type: "text" },
258
+ status: { type: "text" },
259
+ birth_date: { type: "text" },
260
+ challenge_rating: { type: "text" },
261
+ hit_points: { type: "text" },
262
+ armor_class: { type: "text" },
263
+ speed: { type: "text" },
264
+ // Link fields
265
+ location: { type: "single_link", target: "location" },
266
+ zone: { type: "single_link", target: "zone" },
267
+ species: { type: "multi_link", target: "species" },
268
+ traits: { type: "multi_link", target: "trait" },
269
+ abilities: { type: "multi_link", target: "ability" },
270
+ languages: { type: "multi_link", target: "language" },
271
+ actions: { type: "multi_link", target: "ability" }
211
272
  },
212
273
  event: {
213
- triggers: "event",
214
- characters: "character",
215
- objects: "object",
216
- locations: "location",
217
- species: "species",
218
- creatures: "creature",
219
- institutions: "institution",
220
- traits: "trait",
221
- collectives: "collective",
222
- zones: "zone",
223
- abilities: "ability",
224
- phenomena: "phenomenon",
225
- languages: "language",
226
- families: "family",
227
- relations: "relation",
228
- titles: "title",
229
- constructs: "construct"
274
+ // Text fields
275
+ history: { type: "text" },
276
+ challenges: { type: "text" },
277
+ consequences: { type: "text" },
278
+ start_date: { type: "text" },
279
+ end_date: { type: "text" },
280
+ // Link fields
281
+ triggers: { type: "multi_link", target: "event" },
282
+ characters: { type: "multi_link", target: "character" },
283
+ objects: { type: "multi_link", target: "object" },
284
+ locations: { type: "multi_link", target: "location" },
285
+ species: { type: "multi_link", target: "species" },
286
+ creatures: { type: "multi_link", target: "creature" },
287
+ institutions: { type: "multi_link", target: "institution" },
288
+ traits: { type: "multi_link", target: "trait" },
289
+ collectives: { type: "multi_link", target: "collective" },
290
+ zones: { type: "multi_link", target: "zone" },
291
+ abilities: { type: "multi_link", target: "ability" },
292
+ phenomena: { type: "multi_link", target: "phenomenon" },
293
+ languages: { type: "multi_link", target: "language" },
294
+ families: { type: "multi_link", target: "family" },
295
+ relations: { type: "multi_link", target: "relation" },
296
+ titles: { type: "multi_link", target: "title" },
297
+ constructs: { type: "multi_link", target: "construct" }
230
298
  },
231
299
  family: {
232
- traditions: "construct",
233
- traits: "trait",
234
- abilities: "ability",
235
- languages: "language",
236
- ancestors: "character",
237
- estates: "location",
238
- governs: "institution",
239
- heirlooms: "object",
240
- creatures: "creature"
300
+ // Text fields
301
+ spirit: { type: "text" },
302
+ history: { type: "text" },
303
+ reputation: { type: "text" },
304
+ // Link fields
305
+ traditions: { type: "multi_link", target: "construct" },
306
+ traits: { type: "multi_link", target: "trait" },
307
+ abilities: { type: "multi_link", target: "ability" },
308
+ languages: { type: "multi_link", target: "language" },
309
+ ancestors: { type: "multi_link", target: "character" },
310
+ estates: { type: "multi_link", target: "location" },
311
+ governs: { type: "multi_link", target: "institution" },
312
+ heirlooms: { type: "multi_link", target: "object" },
313
+ creatures: { type: "multi_link", target: "creature" }
241
314
  },
242
315
  institution: {
243
- parent_institution: "institution",
244
- zones: "zone",
245
- objects: "object",
246
- creatures: "creature",
247
- allies: "institution",
248
- adversaries: "institution",
249
- constructs: "construct"
316
+ // Text fields
317
+ doctrine: { type: "text" },
318
+ founding_date: { type: "text" },
319
+ status: { type: "text" },
320
+ // Link fields
321
+ parent_institution: { type: "single_link", target: "institution" },
322
+ zones: { type: "multi_link", target: "zone" },
323
+ objects: { type: "multi_link", target: "object" },
324
+ creatures: { type: "multi_link", target: "creature" },
325
+ allies: { type: "multi_link", target: "institution" },
326
+ adversaries: { type: "multi_link", target: "institution" },
327
+ constructs: { type: "multi_link", target: "construct" }
250
328
  },
251
329
  language: {
252
- classification: "construct",
253
- spread: "location",
254
- dialects: "language"
330
+ // Text fields
331
+ phonology: { type: "text" },
332
+ grammar: { type: "text" },
333
+ lexicon: { type: "text" },
334
+ writing: { type: "text" },
335
+ status: { type: "text" },
336
+ // Link fields
337
+ classification: { type: "single_link", target: "construct" },
338
+ spread: { type: "multi_link", target: "location" },
339
+ dialects: { type: "multi_link", target: "language" }
255
340
  },
256
341
  law: {
257
- parent_law: "law",
258
- author: "institution",
259
- penalties: "construct",
260
- locations: "location",
261
- zones: "zone",
262
- prohibitions: "construct",
263
- adjudicators: "title",
264
- enforcers: "title"
342
+ // Text fields
343
+ declaration: { type: "text" },
344
+ purpose: { type: "text" },
345
+ date: { type: "text" },
346
+ // Link fields
347
+ parent_law: { type: "single_link", target: "law" },
348
+ author: { type: "single_link", target: "institution" },
349
+ penalties: { type: "multi_link", target: "construct" },
350
+ locations: { type: "multi_link", target: "location" },
351
+ zones: { type: "multi_link", target: "zone" },
352
+ prohibitions: { type: "multi_link", target: "construct" },
353
+ adjudicators: { type: "multi_link", target: "title" },
354
+ enforcers: { type: "multi_link", target: "title" }
265
355
  },
266
356
  location: {
267
- parent_location: "location",
268
- primary_power: "institution",
269
- governing_title: "title",
270
- zone: "zone",
271
- rival: "location",
272
- partner: "location",
273
- populations: "collective",
274
- secondary_powers: "institution",
275
- founders: "character",
276
- cults: "construct",
277
- delicacies: "species",
278
- extraction_methods: "construct",
279
- extraction_goods: "construct",
280
- industry_methods: "construct",
281
- industry_goods: "construct",
282
- extraction_markets: "location",
283
- industry_markets: "location",
284
- currencies: "construct",
285
- buildings: "object",
286
- building_methods: "construct",
287
- fighters: "construct",
288
- defensive_objects: "object"
357
+ // Text fields
358
+ form: { type: "text" },
359
+ function: { type: "text" },
360
+ founding_date: { type: "text" },
361
+ political_climate: { type: "text" },
362
+ customs: { type: "text" },
363
+ infrastructure: { type: "text" },
364
+ architecture: { type: "text" },
365
+ defensibility: { type: "text" },
366
+ elevation: { type: "text" },
367
+ // Link fields
368
+ parent_location: { type: "single_link", target: "location" },
369
+ primary_power: { type: "single_link", target: "institution" },
370
+ governing_title: { type: "single_link", target: "title" },
371
+ zone: { type: "single_link", target: "zone" },
372
+ rival: { type: "single_link", target: "location" },
373
+ partner: { type: "single_link", target: "location" },
374
+ populations: { type: "multi_link", target: "collective" },
375
+ secondary_powers: { type: "multi_link", target: "institution" },
376
+ founders: { type: "multi_link", target: "character" },
377
+ cults: { type: "multi_link", target: "construct" },
378
+ delicacies: { type: "multi_link", target: "species" },
379
+ extraction_methods: { type: "multi_link", target: "construct" },
380
+ extraction_goods: { type: "multi_link", target: "construct" },
381
+ industry_methods: { type: "multi_link", target: "construct" },
382
+ industry_goods: { type: "multi_link", target: "construct" },
383
+ extraction_markets: { type: "multi_link", target: "location" },
384
+ industry_markets: { type: "multi_link", target: "location" },
385
+ currencies: { type: "multi_link", target: "construct" },
386
+ buildings: { type: "multi_link", target: "object" },
387
+ building_methods: { type: "multi_link", target: "construct" },
388
+ fighters: { type: "multi_link", target: "construct" },
389
+ defensive_objects: { type: "multi_link", target: "object" }
289
390
  },
290
391
  map: {
291
- parent_map: "map",
292
- location: "location"
392
+ // Text fields
393
+ background_color: { type: "text" },
394
+ hierarchy: { type: "text" },
395
+ width: { type: "text" },
396
+ height: { type: "text" },
397
+ depth: { type: "text" },
398
+ // Link fields
399
+ parent_map: { type: "single_link", target: "map" },
400
+ location: { type: "single_link", target: "location" }
293
401
  },
294
402
  marker: {
295
- map: "map",
296
- zone: "zone"
403
+ // Integer fields
404
+ x: { type: "integer" },
405
+ y: { type: "integer" },
406
+ z: { type: "integer" },
407
+ // Link fields
408
+ map: { type: "single_link", target: "map" },
409
+ zone: { type: "single_link", target: "zone" }
297
410
  },
298
411
  narrative: {
299
- parent_narrative: "narrative",
300
- protagonist: "character",
301
- antagonist: "character",
302
- narrator: "character",
303
- conservator: "institution",
304
- events: "event",
305
- characters: "character",
306
- objects: "object",
307
- locations: "location",
308
- species: "species",
309
- creatures: "creature",
310
- institutions: "institution",
311
- traits: "trait",
312
- collectives: "collective",
313
- zones: "zone",
314
- abilities: "ability",
315
- phenomena: "phenomenon",
316
- languages: "language",
317
- families: "family",
318
- relations: "relation",
319
- titles: "title",
320
- constructs: "construct",
321
- laws: "law"
412
+ // Text fields
413
+ story: { type: "text" },
414
+ consequences: { type: "text" },
415
+ start_date: { type: "text" },
416
+ end_date: { type: "text" },
417
+ order: { type: "text" },
418
+ // Link fields
419
+ parent_narrative: { type: "single_link", target: "narrative" },
420
+ protagonist: { type: "single_link", target: "character" },
421
+ antagonist: { type: "single_link", target: "character" },
422
+ narrator: { type: "single_link", target: "character" },
423
+ conservator: { type: "single_link", target: "institution" },
424
+ events: { type: "multi_link", target: "event" },
425
+ characters: { type: "multi_link", target: "character" },
426
+ objects: { type: "multi_link", target: "object" },
427
+ locations: { type: "multi_link", target: "location" },
428
+ species: { type: "multi_link", target: "species" },
429
+ creatures: { type: "multi_link", target: "creature" },
430
+ institutions: { type: "multi_link", target: "institution" },
431
+ traits: { type: "multi_link", target: "trait" },
432
+ collectives: { type: "multi_link", target: "collective" },
433
+ zones: { type: "multi_link", target: "zone" },
434
+ abilities: { type: "multi_link", target: "ability" },
435
+ phenomena: { type: "multi_link", target: "phenomenon" },
436
+ languages: { type: "multi_link", target: "language" },
437
+ families: { type: "multi_link", target: "family" },
438
+ relations: { type: "multi_link", target: "relation" },
439
+ titles: { type: "multi_link", target: "title" },
440
+ constructs: { type: "multi_link", target: "construct" },
441
+ laws: { type: "multi_link", target: "law" }
322
442
  },
323
443
  object: {
324
- parent_object: "object",
325
- location: "location",
326
- language: "language",
327
- materials: "construct",
328
- technology: "construct",
329
- effects: "phenomenon",
330
- abilities: "ability",
331
- consumes: "construct",
332
- affinities: "trait"
444
+ // Text fields
445
+ aesthetics: { type: "text" },
446
+ weight: { type: "text" },
447
+ amount: { type: "text" },
448
+ utility: { type: "text" },
449
+ origins: { type: "text" },
450
+ // Link fields
451
+ parent_object: { type: "single_link", target: "object" },
452
+ location: { type: "single_link", target: "location" },
453
+ language: { type: "single_link", target: "language" },
454
+ materials: { type: "multi_link", target: "construct" },
455
+ technology: { type: "multi_link", target: "construct" },
456
+ effects: { type: "multi_link", target: "phenomenon" },
457
+ abilities: { type: "multi_link", target: "ability" },
458
+ consumes: { type: "multi_link", target: "construct" },
459
+ affinities: { type: "multi_link", target: "trait" }
333
460
  },
334
461
  phenomenon: {
335
- system: "phenomenon",
336
- catalysts: "object",
337
- empowerments: "ability",
338
- triggers: "construct",
339
- wielders: "character",
340
- environments: "location"
462
+ // Text fields
463
+ expression: { type: "text" },
464
+ effects: { type: "text" },
465
+ duration: { type: "text" },
466
+ mythology: { type: "text" },
467
+ // Link fields
468
+ system: { type: "single_link", target: "phenomenon" },
469
+ catalysts: { type: "multi_link", target: "object" },
470
+ empowerments: { type: "multi_link", target: "ability" },
471
+ triggers: { type: "multi_link", target: "construct" },
472
+ wielders: { type: "multi_link", target: "character" },
473
+ environments: { type: "multi_link", target: "location" }
341
474
  },
342
475
  pin: {
343
- map: "map",
344
- element_id: "any_element"
476
+ // Special fields
477
+ element_type: { type: "text" },
478
+ // ElementType enum value
479
+ // Integer fields
480
+ x: { type: "integer" },
481
+ y: { type: "integer" },
482
+ z: { type: "integer" },
483
+ // Link fields
484
+ map: { type: "single_link", target: "map" },
485
+ element_id: { type: "single_link", target: "any" }
486
+ // Can reference any element
345
487
  },
346
488
  relation: {
347
- actor: "character",
348
- characters: "character",
349
- objects: "object",
350
- locations: "location",
351
- species: "species",
352
- creatures: "creature",
353
- institutions: "institution",
354
- traits: "trait",
355
- collectives: "collective",
356
- zones: "zone",
357
- abilities: "ability",
358
- phenomena: "phenomenon",
359
- languages: "language",
360
- families: "family",
361
- titles: "title",
362
- constructs: "construct",
363
- events: "event",
364
- narratives: "narrative"
489
+ // Text fields
490
+ background: { type: "text" },
491
+ start_date: { type: "text" },
492
+ end_date: { type: "text" },
493
+ intensity: { type: "text" },
494
+ // Link fields
495
+ actor: { type: "single_link", target: "character" },
496
+ characters: { type: "multi_link", target: "character" },
497
+ objects: { type: "multi_link", target: "object" },
498
+ locations: { type: "multi_link", target: "location" },
499
+ species: { type: "multi_link", target: "species" },
500
+ creatures: { type: "multi_link", target: "creature" },
501
+ institutions: { type: "multi_link", target: "institution" },
502
+ traits: { type: "multi_link", target: "trait" },
503
+ collectives: { type: "multi_link", target: "collective" },
504
+ zones: { type: "multi_link", target: "zone" },
505
+ abilities: { type: "multi_link", target: "ability" },
506
+ phenomena: { type: "multi_link", target: "phenomenon" },
507
+ languages: { type: "multi_link", target: "language" },
508
+ families: { type: "multi_link", target: "family" },
509
+ titles: { type: "multi_link", target: "title" },
510
+ constructs: { type: "multi_link", target: "construct" },
511
+ events: { type: "multi_link", target: "event" },
512
+ narratives: { type: "multi_link", target: "narrative" }
365
513
  },
366
514
  species: {
367
- parent_species: "species",
368
- nourishment: "species",
369
- reproduction: "construct",
370
- adaptations: "ability",
371
- traits: "trait",
372
- locations: "location",
373
- zones: "zone",
374
- affinities: "phenomenon"
515
+ // Text fields
516
+ appearance: { type: "text" },
517
+ life_span: { type: "text" },
518
+ weight: { type: "text" },
519
+ instincts: { type: "text" },
520
+ sociality: { type: "text" },
521
+ temperament: { type: "text" },
522
+ communication: { type: "text" },
523
+ aggression: { type: "text" },
524
+ role: { type: "text" },
525
+ // Link fields
526
+ parent_species: { type: "single_link", target: "species" },
527
+ nourishment: { type: "multi_link", target: "species" },
528
+ reproduction: { type: "multi_link", target: "construct" },
529
+ adaptations: { type: "multi_link", target: "ability" },
530
+ traits: { type: "multi_link", target: "trait" },
531
+ locations: { type: "multi_link", target: "location" },
532
+ zones: { type: "multi_link", target: "zone" },
533
+ affinities: { type: "multi_link", target: "phenomenon" }
375
534
  },
376
535
  title: {
377
- issuer: "institution",
378
- body: "institution",
379
- superior_title: "title",
380
- holders: "character",
381
- symbols: "object",
382
- characters: "character",
383
- institutions: "institution",
384
- families: "family",
385
- zones: "zone",
386
- locations: "location",
387
- objects: "object",
388
- constructs: "construct",
389
- laws: "law",
390
- collectives: "collective",
391
- creatures: "creature",
392
- phenomena: "phenomenon",
393
- species: "species",
394
- languages: "language"
536
+ // Text fields
537
+ authority: { type: "text" },
538
+ eligibility: { type: "text" },
539
+ grant_date: { type: "text" },
540
+ revoke_date: { type: "text" },
541
+ status: { type: "text" },
542
+ history: { type: "text" },
543
+ // Link fields
544
+ issuer: { type: "single_link", target: "institution" },
545
+ body: { type: "single_link", target: "institution" },
546
+ superior_title: { type: "single_link", target: "title" },
547
+ holders: { type: "multi_link", target: "character" },
548
+ symbols: { type: "multi_link", target: "object" },
549
+ characters: { type: "multi_link", target: "character" },
550
+ institutions: { type: "multi_link", target: "institution" },
551
+ families: { type: "multi_link", target: "family" },
552
+ zones: { type: "multi_link", target: "zone" },
553
+ locations: { type: "multi_link", target: "location" },
554
+ objects: { type: "multi_link", target: "object" },
555
+ constructs: { type: "multi_link", target: "construct" },
556
+ laws: { type: "multi_link", target: "law" },
557
+ collectives: { type: "multi_link", target: "collective" },
558
+ creatures: { type: "multi_link", target: "creature" },
559
+ phenomena: { type: "multi_link", target: "phenomenon" },
560
+ species: { type: "multi_link", target: "species" },
561
+ languages: { type: "multi_link", target: "language" }
395
562
  },
396
563
  trait: {
397
- anti_trait: "trait",
398
- empowered_abilities: "ability"
564
+ // Text fields
565
+ social_effects: { type: "text" },
566
+ physical_effects: { type: "text" },
567
+ functional_effects: { type: "text" },
568
+ personality_effects: { type: "text" },
569
+ behaviour_effects: { type: "text" },
570
+ charisma: { type: "text" },
571
+ coercion: { type: "text" },
572
+ competence: { type: "text" },
573
+ compassion: { type: "text" },
574
+ creativity: { type: "text" },
575
+ courage: { type: "text" },
576
+ significance: { type: "text" },
577
+ // Link fields
578
+ anti_trait: { type: "single_link", target: "trait" },
579
+ empowered_abilities: { type: "multi_link", target: "ability" }
399
580
  },
400
581
  zone: {
401
- phenomena: "phenomenon",
402
- linked_zones: "zone",
403
- populations: "collective",
404
- titles: "title",
405
- principles: "construct"
582
+ // Text fields
583
+ role: { type: "text" },
584
+ start_date: { type: "text" },
585
+ end_date: { type: "text" },
586
+ context: { type: "text" },
587
+ // Link fields
588
+ phenomena: { type: "multi_link", target: "phenomenon" },
589
+ linked_zones: { type: "multi_link", target: "zone" },
590
+ populations: { type: "multi_link", target: "collective" },
591
+ titles: { type: "multi_link", target: "title" },
592
+ principles: { type: "multi_link", target: "construct" }
406
593
  }
407
594
  };
595
+ var FIELD_MAPPINGS = Object.fromEntries(
596
+ Object.entries(FIELD_SCHEMA).map(([elementType, fields]) => [
597
+ elementType,
598
+ Object.fromEntries(
599
+ Object.entries(fields).filter(([_, fieldInfo]) => ["single_link", "multi_link"].includes(fieldInfo.type)).map(([fieldName, fieldInfo]) => [fieldName, fieldInfo.target])
600
+ )
601
+ ])
602
+ );
408
603
  function createElementId(id) {
409
604
  return id;
410
605
  }
@@ -417,6 +612,7 @@ function createAnyElementId(id) {
417
612
  export {
418
613
  ElementType,
419
614
  FIELD_MAPPINGS,
615
+ FIELD_SCHEMA,
420
616
  OnlyWorldsClient,
421
617
  createAnyElementId,
422
618
  createElementId,