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