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