@onlyworlds/sdk 4.46.0 → 4.47.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +94 -1
- package/dist/index.js +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.47.0] - 2026-10-22
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `draught(characterId, policy)`: `GET /character/{id}/context` (keel PR 155, D143, live 2026-10-22 02:05), one Character's context in one read, typed as `OwDraught` with the policy's seven keys (`components`, `mode`, `asOf`, `undated`, `since`, `budget`, `depth`) as `OwDraughtPolicy`.
|
|
12
|
+
- `list` takes `ids` (1 to 200, the list's own order; one the key cannot see is absent) and `createdBy` (a membership id, or `'owner'`), the two list filters of the same PR; both were already reachable through `filter`.
|
|
13
|
+
|
|
8
14
|
## [4.46.0] - 2026-10-22
|
|
9
15
|
|
|
10
16
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -2431,6 +2431,83 @@ interface OwSignedIn {
|
|
|
2431
2431
|
* (`'collaborator'`, with `member_role` the membership's role). Keys by name and last four only,
|
|
2432
2432
|
* never the key; on a shared world only the member's own keys (keel H8).
|
|
2433
2433
|
*/
|
|
2434
|
+
/** The draught's policy (keel PR 155, D143): what GET /character/{id}/context serves and how. */
|
|
2435
|
+
interface OwDraughtPolicy {
|
|
2436
|
+
/** Sections to serve; default every one but `messages`. */
|
|
2437
|
+
components?: OwDraughtComponent[];
|
|
2438
|
+
/** `voice`: her slice, as she would read (default). `act`: through the caller's own view. */
|
|
2439
|
+
mode?: 'voice' | 'act';
|
|
2440
|
+
/** The horizon in the world's time unit; default the world's `time_range_current`. */
|
|
2441
|
+
asOf?: number;
|
|
2442
|
+
/** Undated Events: `include` (default, marked `dated: false`, after the dated) or `exclude`. */
|
|
2443
|
+
undated?: 'include' | 'exclude';
|
|
2444
|
+
/** For `recent`: a /changes cursor, or an ISO 8601 time (as /changes' `after`). Absent, `recent` is empty. */
|
|
2445
|
+
since?: string;
|
|
2446
|
+
/** Items per section, 1 to 1000, default 50; `cut` says what was dropped. */
|
|
2447
|
+
budget?: number;
|
|
2448
|
+
/** The sheet's reach: 1 (default) what her own element links to, 0 none. */
|
|
2449
|
+
depth?: 0 | 1;
|
|
2450
|
+
}
|
|
2451
|
+
type OwDraughtComponent = 'self' | 'role' | 'work' | 'style' | 'events' | 'knowledge' | 'names' | 'sheet' | 'recent' | 'messages' | 'roster';
|
|
2452
|
+
/** An element as the draught serves it: the list route's body plus how it got here. */
|
|
2453
|
+
type OwDraughtItem = OwElement & {
|
|
2454
|
+
/** The link fields that brought it (on the element, or on her own element in `sheet`). */
|
|
2455
|
+
via: string[];
|
|
2456
|
+
/** How many of the packet's elements link to it. */
|
|
2457
|
+
her_links: number;
|
|
2458
|
+
grade: 'whole' | 'known_of';
|
|
2459
|
+
/** On an Event: false when it carries no date (ranked after the dated). */
|
|
2460
|
+
dated?: boolean;
|
|
2461
|
+
};
|
|
2462
|
+
/** One Character's context in one read, GET /character/{id}/context (keel PR 155, D143; the draught). */
|
|
2463
|
+
interface OwDraught {
|
|
2464
|
+
world: {
|
|
2465
|
+
id: string;
|
|
2466
|
+
name: string;
|
|
2467
|
+
description: string;
|
|
2468
|
+
};
|
|
2469
|
+
/** The world's own time fields, as it carries them. */
|
|
2470
|
+
calendar: Record<string, unknown>;
|
|
2471
|
+
as_of: number | null;
|
|
2472
|
+
now: number | null;
|
|
2473
|
+
mode: 'voice' | 'act';
|
|
2474
|
+
/** The policy served under, every key resolved. */
|
|
2475
|
+
policy: Record<string, unknown>;
|
|
2476
|
+
/** {section: items the budget dropped}; empty when whole. */
|
|
2477
|
+
cut: Record<string, number>;
|
|
2478
|
+
recent_cursor: string | null;
|
|
2479
|
+
recent_more: boolean | null;
|
|
2480
|
+
/** Her own element (`self: true`), or a stub when this reader knows her only as known of. */
|
|
2481
|
+
character: (OwElement & {
|
|
2482
|
+
self: true;
|
|
2483
|
+
grade: 'whole' | 'known_of';
|
|
2484
|
+
}) | null;
|
|
2485
|
+
role?: OwDraughtItem[];
|
|
2486
|
+
work?: OwDraughtItem[];
|
|
2487
|
+
style?: OwDraughtItem | null;
|
|
2488
|
+
events?: OwDraughtItem[];
|
|
2489
|
+
knowledge?: OwDraughtItem[];
|
|
2490
|
+
/** Everything else that names her, by type. */
|
|
2491
|
+
names?: Record<string, OwDraughtItem[]>;
|
|
2492
|
+
sheet?: OwDraughtItem[];
|
|
2493
|
+
messages?: OwDraughtItem[];
|
|
2494
|
+
recent?: Array<{
|
|
2495
|
+
op: 'upsert' | 'delete';
|
|
2496
|
+
type: string;
|
|
2497
|
+
id: string;
|
|
2498
|
+
when: string | null;
|
|
2499
|
+
who: string | null;
|
|
2500
|
+
[k: string]: unknown;
|
|
2501
|
+
}>;
|
|
2502
|
+
roster?: Array<{
|
|
2503
|
+
id: string | null;
|
|
2504
|
+
kind: string;
|
|
2505
|
+
role: string;
|
|
2506
|
+
character: string | null;
|
|
2507
|
+
status: string;
|
|
2508
|
+
name: string;
|
|
2509
|
+
}>;
|
|
2510
|
+
}
|
|
2434
2511
|
interface OwAccountWorld {
|
|
2435
2512
|
id: string;
|
|
2436
2513
|
name: string;
|
|
@@ -2639,6 +2716,10 @@ interface OwFileDownload {
|
|
|
2639
2716
|
interface ListParams {
|
|
2640
2717
|
limit?: number;
|
|
2641
2718
|
cursor?: string;
|
|
2719
|
+
/** Only these ids (1 to 200), in the list's own order; one this key cannot see is simply absent (keel PR 155). */
|
|
2720
|
+
ids?: string[];
|
|
2721
|
+
/** A membership id, or `'owner'` for the owner's own writes: only what that member created (keel PR 155). */
|
|
2722
|
+
createdBy?: string;
|
|
2642
2723
|
/** One-level stub expansion, e.g. ['friends', 'location']. */
|
|
2643
2724
|
expand?: string[];
|
|
2644
2725
|
/** Sparse include-set of field names. */
|
|
@@ -3065,6 +3146,18 @@ declare class OwV2Client {
|
|
|
3065
3146
|
members(): Promise<OwMember[]>;
|
|
3066
3147
|
/** GET /{type}/ -- one cursor page. */
|
|
3067
3148
|
list(type: ElementType | string, params?: ListParams): Promise<OwPage>;
|
|
3149
|
+
/**
|
|
3150
|
+
* GET /character/{id}/context -- the draught (keel PR 155, D143): what one Character knows, as the
|
|
3151
|
+
* recorded world holds it, in one read: her element, what she holds and sits in, her open work,
|
|
3152
|
+
* how she works, the Events she was in, the Narratives she knows, everything else that names
|
|
3153
|
+
* her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
|
|
3154
|
+
* calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
|
|
3155
|
+
* and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
|
|
3156
|
+
* Character they can see; a player seat or a guest for its own Character only (another id is
|
|
3157
|
+
* 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
|
|
3158
|
+
* empty means the serving is partial. Served `Cache-Control: private, no-store`.
|
|
3159
|
+
*/
|
|
3160
|
+
draught(characterId: string, policy?: OwDraughtPolicy): Promise<OwDraught>;
|
|
3068
3161
|
/** Cursor-walk every page of a type. Politeness: uses config pageSize. */
|
|
3069
3162
|
listAll(type: ElementType | string, params?: Omit<ListParams, 'cursor'>): AsyncGenerator<OwElement>;
|
|
3070
3163
|
/**
|
|
@@ -4607,4 +4700,4 @@ declare class TokenResource {
|
|
|
4607
4700
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
4608
4701
|
}
|
|
4609
4702
|
|
|
4610
|
-
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
|
4703
|
+
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -559,11 +559,36 @@ var OwV2Client = class {
|
|
|
559
559
|
cursor: params.cursor,
|
|
560
560
|
expand: params.expand?.join(","),
|
|
561
561
|
fields: params.fields?.join(","),
|
|
562
|
+
ids: params.ids?.join(","),
|
|
563
|
+
created_by: params.createdBy,
|
|
562
564
|
...params.filter,
|
|
563
565
|
as: params.viewAs
|
|
564
566
|
});
|
|
565
567
|
return this.request("GET", `/${type}/`, { query });
|
|
566
568
|
}
|
|
569
|
+
/**
|
|
570
|
+
* GET /character/{id}/context -- the draught (keel PR 155, D143): what one Character knows, as the
|
|
571
|
+
* recorded world holds it, in one read: her element, what she holds and sits in, her open work,
|
|
572
|
+
* how she works, the Events she was in, the Narratives she knows, everything else that names
|
|
573
|
+
* her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
|
|
574
|
+
* calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
|
|
575
|
+
* and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
|
|
576
|
+
* Character they can see; a player seat or a guest for its own Character only (another id is
|
|
577
|
+
* 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
|
|
578
|
+
* empty means the serving is partial. Served `Cache-Control: private, no-store`.
|
|
579
|
+
*/
|
|
580
|
+
async draught(characterId, policy = {}) {
|
|
581
|
+
const query = buildQuery({
|
|
582
|
+
components: policy.components?.join(","),
|
|
583
|
+
mode: policy.mode,
|
|
584
|
+
as_of: policy.asOf,
|
|
585
|
+
undated: policy.undated,
|
|
586
|
+
since: policy.since,
|
|
587
|
+
budget: policy.budget,
|
|
588
|
+
depth: policy.depth
|
|
589
|
+
});
|
|
590
|
+
return this.request("GET", `/character/${characterId}/context`, { query });
|
|
591
|
+
}
|
|
567
592
|
/** Cursor-walk every page of a type. Politeness: uses config pageSize. */
|
|
568
593
|
async *listAll(type, params = {}) {
|
|
569
594
|
let cursor;
|