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