@onlyworlds/sdk 4.91.1 → 4.92.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/AGENTS.md +1 -1
- package/CHANGELOG.md +17 -0
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +142 -5
- package/dist/index.js +43 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# For AI agents using @onlyworlds/sdk
|
|
2
2
|
|
|
3
|
-
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.80** (canonical 00.33.00).
|
|
4
4
|
This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
|
|
5
5
|
re-read against it, the check fails rather than letting this document rot quietly.
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.92.0] - 2026-10-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **The server's lens routes.** `setMyLenses(lensIds)`: `PUT /me/lenses`, the lenses this key's holder starts with, lens ids in order (0 to 20, `[]` for none, which is a choice); a world write key with its PIN, answering GET /me's body as `OwMe`; no `X-OW-Agent` or `X-OW-Client`, which the document declares on neither; an account token, or anything but a list, is a TypeError before sending. `worldLenses(worldId, { resolve, readAs })`: `GET /world/{world_id}/lenses`, every lens in the world this key can see with its recipe echoed, the Titles it is the default for and whether this key chose it, `resolve: true` adding each lens's `reading` and `readAs` (the owner only, with `resolve`) reading as another reader; a read, so no PIN; typed `OwWorldLenses` (`data: OwWorldLens[]`, `read_as`), its reading `OwWorldLensReading`; `resolve` is true or false, and an account token is a TypeError before sending.
|
|
13
|
+
- **`draught(characterId, { lens })`**: a lens id, sent as `lens`; the packet then carries `lenses`, one frame with that lens read for this key's own view (`OwDraught.lenses`, each frame an `OwDraughtLens`: `id`, and `name`, `rows`, `cut`, `mail`, `skipped`, `unreadable` as served). With no lens and no policy key but `compact`, keel adds one frame per lens chosen with `setMyLenses`. `lens` beside `depth` or `budget` is keel's 422. The options fence takes the new key; a misspelt one is still a TypeError before sending.
|
|
14
|
+
- **`OwMe.lenses` and `OwMember.lenses`**: the lenses the key's holder, or a roster row, chose, lens ids in order; GET /me and GET /members now serve them.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Schema repinned to schema-dist `v0.33.0-dist.80`** (from dist.79; the same canonical 00.33.00, so `ONLYWORLDS_VERSION` stays `'00.33.00'` and no element field moved). Serial 80 writes the lens profile's five rulings into its page and adds four lens cases, 88 in all; `resolveLens` already answers every one, so the reader is unchanged.
|
|
19
|
+
- **`x_served_trimmed` is documented on a lens too**: keel now serves the mark on a Construct, a lens whose hidden anchors were left out, naming those anchor fields, then `notes`. `OwElementBase`'s comment said it rode only a message; the generator's text now names both, and nothing else changes (the SDK never strips the mark from a body it is given, on any type).
|
|
20
|
+
|
|
21
|
+
### Not added
|
|
22
|
+
|
|
23
|
+
- `PATCH /account/worlds/{world_id}/members/{member_id}` now takes `lenses`, but the SDK has no method for that route, so none is added here.
|
|
24
|
+
|
|
8
25
|
## [4.91.1] - 2026-10-27
|
|
9
26
|
|
|
10
27
|
### Changed
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.80** — canonical schema **00.33.00**, published 2026-10-27.
|
|
4
4
|
|
|
5
5
|
GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
|
|
6
6
|
Written for both humans and AI agents reading this package locally.
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Derived from base_properties.yaml: `World` is dropped (the API rejects it in
|
|
4
4
|
* bodies -- the key determines the world) and the eight server-managed fields are
|
|
5
5
|
* added, since they ride every wire body and appear in no element YAML; `known_of`
|
|
6
|
-
* rides only a stub, `x_served_trimmed` only a message whose ids were left out. */
|
|
6
|
+
* rides only a stub, `x_served_trimmed` only a message or a lens whose ids were left out. */
|
|
7
7
|
interface OwElementBase {
|
|
8
8
|
/** Element type slug (server-managed, read-only). */
|
|
9
9
|
type: string;
|
|
@@ -37,7 +37,7 @@ interface OwElementBase {
|
|
|
37
37
|
hidden?: true;
|
|
38
38
|
/** Present, and true, only on a stub (server-managed, read-only): an element a guest or player reaches only through its own Character's sheet. A stub keeps id, type, name, description, supertype, subtype, image_url, created_at, updated_at and change_seq, and the fields its type lists in PUBLIC_FIELDS with their values; every other field reads unset ("", null, []), created_by/changed_by/changed_via null, no extension fields, and its files are 404. Its empties are not values and not a deletion: never write a stub back. Absent: the element is whole. See isKnownOf(). */
|
|
39
39
|
known_of?: true;
|
|
40
|
-
/** Served only, on a message (the message profile, schema-dist `profiles/message.md`): present when ids in `characters` or `narrator` were left out because this reader may not see them, naming those fields (`characters` before `narrator`)
|
|
40
|
+
/** Served only, on a message or a lens, never which ids or how many. On a message (the message profile, schema-dist `profiles/message.md`): present when ids in `characters` or `narrator` were left out because this reader may not see them, naming those fields (`characters` before `narrator`). An empty `characters` with `characters` named here is to someone the reader cannot see, never to everyone; a null `narrator` with `narrator` named is a sender the reader cannot see. On a lens (a Construct with supertype Lens, schema-dist `profiles/lens.md`): present when anchor ids were left out because this reader may not see them, naming those anchor fields in the schema's order, then `notes` when an anchor's note was left out of `x_lens` with it. A lens whose anchor fields are empty and that carries the mark is anchored (it resolves to nothing for this reader), never a filter over the whole world. Absent when nothing was left out, and always for the keyless public reader; on a lens also always for the world's owner, its co-builders and keys the owner minted. A write that carries it is refused (422 `served_trimmed_not_writable`): never send it back. See hasUnseenRecipients(), senderStatus() and resolveLens(). */
|
|
41
41
|
x_served_trimmed?: string[];
|
|
42
42
|
/** Namespaced extension fields (atlas_* / shadow_* / x_*), returned verbatim. */
|
|
43
43
|
[ext: string]: unknown;
|
|
@@ -2568,6 +2568,11 @@ interface OwMe {
|
|
|
2568
2568
|
membership: string | null;
|
|
2569
2569
|
/** The member's Character, or null (null too when it is hidden from this key). */
|
|
2570
2570
|
character: string | null;
|
|
2571
|
+
/**
|
|
2572
|
+
* The lenses you chose (setMyLenses), lens ids in your order; empty for none, which is a choice.
|
|
2573
|
+
* The draught reads them when you name no lens and no policy.
|
|
2574
|
+
*/
|
|
2575
|
+
lenses: string[];
|
|
2571
2576
|
/** Agent seats only: the agent's name. */
|
|
2572
2577
|
name?: string;
|
|
2573
2578
|
/** Who you are here, who answers for you, and the house rules. */
|
|
@@ -2629,6 +2634,11 @@ interface OwMember {
|
|
|
2629
2634
|
status: 'active' | 'removed';
|
|
2630
2635
|
/** Agent rows only: the agent's name. */
|
|
2631
2636
|
name?: string;
|
|
2637
|
+
/**
|
|
2638
|
+
* The lenses this row chose, lens ids in its order (the owner row: the owner's own); empty for
|
|
2639
|
+
* none, which is a choice. A lens this key cannot see is left out of what it is shown.
|
|
2640
|
+
*/
|
|
2641
|
+
lenses: string[];
|
|
2632
2642
|
[k: string]: unknown;
|
|
2633
2643
|
}
|
|
2634
2644
|
/** GET /account/allowance: the account's token rating and what is left of it today (keel 872431f, 2026-10-14). */
|
|
@@ -2822,6 +2832,14 @@ interface OwDraughtPolicy {
|
|
|
2822
2832
|
* with `compact` the answer is typed `OwDraughtCompact`.
|
|
2823
2833
|
*/
|
|
2824
2834
|
compact?: boolean;
|
|
2835
|
+
/**
|
|
2836
|
+
* A lens id (the lens profile: a Construct with supertype Lens): the packet adds `lenses`, one
|
|
2837
|
+
* frame with that lens read for the caller's own view. The lens carries its own reach and limit in
|
|
2838
|
+
* its `x_lens`, so `lens` beside `depth` or `budget` is a 422 (`param` lens); a lens the caller
|
|
2839
|
+
* cannot see, or an id that is no lens, is a 404. Without `lens`, and with no other policy key but
|
|
2840
|
+
* `compact`, the packet adds one frame per lens the caller chose (setMyLenses), in its order.
|
|
2841
|
+
*/
|
|
2842
|
+
lens?: string;
|
|
2825
2843
|
}
|
|
2826
2844
|
/**
|
|
2827
2845
|
* A section of the draught, in the packet's order (keel's COMPONENTS). `messages`, `room` (the room profile's other
|
|
@@ -2912,6 +2930,98 @@ interface OwDraught {
|
|
|
2912
2930
|
status: string;
|
|
2913
2931
|
name: string;
|
|
2914
2932
|
}>;
|
|
2933
|
+
/**
|
|
2934
|
+
* Present only with `lens` (one frame), or, with no lens and no policy key but `compact`, when the
|
|
2935
|
+
* caller chose lenses (one frame each, in its order). Each lens is read for the caller's own view, never past it.
|
|
2936
|
+
*/
|
|
2937
|
+
lenses?: OwDraughtLens[];
|
|
2938
|
+
}
|
|
2939
|
+
/** One frame of the draught's `lenses`: one lens read for the caller's own view. */
|
|
2940
|
+
interface OwDraughtLens {
|
|
2941
|
+
id: string;
|
|
2942
|
+
name?: string;
|
|
2943
|
+
/**
|
|
2944
|
+
* What the lens keeps, in the profile's order (its anchors in its link order, then by type in the
|
|
2945
|
+
* schema's order, newest first, then by id), each as its `show` makes it: the body as served (under
|
|
2946
|
+
* `compact` less its empty fields), its first line, or its name; a kept anchor carries its `note`.
|
|
2947
|
+
*/
|
|
2948
|
+
rows?: Array<Record<string, unknown>>;
|
|
2949
|
+
/** How many the reading cut, by reason (budget, types, window, undated, after_as_of, hops_not_served; for the owner alone anchor_not_visible and not_visible). */
|
|
2950
|
+
cut?: Record<string, number>;
|
|
2951
|
+
/** With a mail rule: unread and read ids, rows, cut by reason, totals. */
|
|
2952
|
+
mail?: Record<string, unknown>;
|
|
2953
|
+
/** A chosen lens not read: retired, a template, or one the caller can no longer see (deleted or hidden since). It stays chosen. */
|
|
2954
|
+
skipped?: 'retired' | 'template' | 'not_found';
|
|
2955
|
+
/** The `x_lens` key holding a value outside the profile's table: nothing is read. */
|
|
2956
|
+
unreadable?: string;
|
|
2957
|
+
}
|
|
2958
|
+
/** GET /world/{worldId}/lenses (worldLenses): every lens in the world the caller can see. */
|
|
2959
|
+
interface OwWorldLenses {
|
|
2960
|
+
data: OwWorldLens[];
|
|
2961
|
+
/** The reader the owner read as (`readAs`), or null. */
|
|
2962
|
+
read_as: string | null;
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* One lens of worldLenses: its recipe echoed, the Titles it is the default for and whether the
|
|
2966
|
+
* caller chose it; with `resolve`, its `reading`. The owner also gets `chosen_by` and `health`.
|
|
2967
|
+
*/
|
|
2968
|
+
interface OwWorldLens {
|
|
2969
|
+
id: string;
|
|
2970
|
+
name: string;
|
|
2971
|
+
/** The lens element as this caller is served it (an anchor it cannot see left out, with `x_served_trimmed`). */
|
|
2972
|
+
element: OwElement;
|
|
2973
|
+
/** Subtype Template: it reads nothing until copied and pointed. */
|
|
2974
|
+
template: boolean;
|
|
2975
|
+
/** Status retired: no seat starts with it; a seat that chose it keeps it, and the reading skips it. */
|
|
2976
|
+
retired: boolean;
|
|
2977
|
+
/** The lens's `x_lens` with every default the profile names filled in; null for an unreadable lens. */
|
|
2978
|
+
x_lens: {
|
|
2979
|
+
depth: 0 | 1 | 2;
|
|
2980
|
+
types: string[];
|
|
2981
|
+
window: number | null;
|
|
2982
|
+
from: number | null;
|
|
2983
|
+
to: number | null;
|
|
2984
|
+
undated: 'include' | 'exclude';
|
|
2985
|
+
show: 'full' | 'first_line' | 'name';
|
|
2986
|
+
budget: number;
|
|
2987
|
+
mail: 'unread_full_read_titles' | 'all' | 'none';
|
|
2988
|
+
notes: Record<string, string>;
|
|
2989
|
+
} | null;
|
|
2990
|
+
/** Present when `x_lens` holds a value outside the profile's table: the key refused. Nothing is resolved. */
|
|
2991
|
+
unreadable?: string;
|
|
2992
|
+
/** The Titles it is the default for: everyone holding one starts with it. */
|
|
2993
|
+
titles: string[];
|
|
2994
|
+
/** This caller chose it (OwMe's `lenses`). */
|
|
2995
|
+
chosen: boolean;
|
|
2996
|
+
/** The owner only: the memberships that chose it (null for the owner). */
|
|
2997
|
+
chosen_by?: Array<string | null>;
|
|
2998
|
+
/** The owner only: `empty` (it resolves to nothing for the owner), `over_budget` (the owner's reading cuts by budget), `retired_assigned` (retired and still chosen by a seat). */
|
|
2999
|
+
health?: {
|
|
3000
|
+
empty: boolean;
|
|
3001
|
+
over_budget: boolean;
|
|
3002
|
+
retired_assigned: boolean;
|
|
3003
|
+
};
|
|
3004
|
+
/** With `resolve`: the reading of the lens for this caller (or the reader `readAs` names). */
|
|
3005
|
+
reading?: OwWorldLensReading;
|
|
3006
|
+
}
|
|
3007
|
+
/** A lens's reading on worldLenses with `resolve`: what it keeps and what it cut, with why. */
|
|
3008
|
+
interface OwWorldLensReading {
|
|
3009
|
+
/** The kept elements in the profile's order, each as `show` makes it; a kept anchor's row carries its `note`. */
|
|
3010
|
+
rows: Array<Record<string, unknown>>;
|
|
3011
|
+
/** How many elements the reading cut, by reason; a reason with none is absent. */
|
|
3012
|
+
cut: Record<string, number>;
|
|
3013
|
+
/** The elements cut for each reason, at most 100 named per reason (`cut` keeps the whole count). */
|
|
3014
|
+
cut_rows: Record<string, Array<{
|
|
3015
|
+
id: string;
|
|
3016
|
+
type: string;
|
|
3017
|
+
name: string;
|
|
3018
|
+
}>>;
|
|
3019
|
+
/** Kept plus cut: "keeps X of the Y it reached". */
|
|
3020
|
+
reached: number;
|
|
3021
|
+
/** Notes on ids that are not anchors of the lens, ignored. */
|
|
3022
|
+
notes_ignored: number;
|
|
3023
|
+
/** With a mail rule: `unread` and `read` (ids), `rows`, `cut` by reason and `totals`. */
|
|
3024
|
+
mail?: Record<string, unknown>;
|
|
2915
3025
|
}
|
|
2916
3026
|
interface OwAccountWorld {
|
|
2917
3027
|
id: string;
|
|
@@ -3740,6 +3850,31 @@ declare class OwV2Client {
|
|
|
3740
3850
|
* patchWorld) or a read key. A guest's view resets once.
|
|
3741
3851
|
*/
|
|
3742
3852
|
setMyCharacter(character: string | null): Promise<OwMe>;
|
|
3853
|
+
/**
|
|
3854
|
+
* PUT /me/lenses -- choose the lenses this key's holder starts with: lens ids in order, 0 to 20,
|
|
3855
|
+
* repeats dropped by keel; an empty list is a choice too (the draught then adds no frame). Any write
|
|
3856
|
+
* key of the world, with its PIN, sets its own holder's list: a person member's, an agent seat's, or
|
|
3857
|
+
* on the owner's keys the owner's own; answers GET /me's body. The draught reads the list whenever it
|
|
3858
|
+
* is given no lens and no policy. 404 for a lens this key cannot see; 422 `not_a_lens`,
|
|
3859
|
+
* `lens_is_template` or `lens_hidden` (`param` lenses); 403 for a read key. A lens only narrows what
|
|
3860
|
+
* the holder may already read. A world key's call; an account token is a TypeError before sending.
|
|
3861
|
+
*/
|
|
3862
|
+
setMyLenses(lensIds: string[]): Promise<OwMe>;
|
|
3863
|
+
/**
|
|
3864
|
+
* GET /world/{worldId}/lenses -- every lens in the world this key can see, templates included and
|
|
3865
|
+
* marked, each with its recipe echoed (`x_lens`, defaults filled in), the Titles it is the default
|
|
3866
|
+
* for and whether this key chose it. `resolve: true` adds each lens's `reading` for this key: the kept
|
|
3867
|
+
* rows, the cut by reason, the mail part. The owner also gets `chosen_by`, `health` and the two counts
|
|
3868
|
+
* of what a reader cannot see; with `resolve`, the owner may `readAs` another reader (`guest`,
|
|
3869
|
+
* `contributor`, `co-builder`, `public`, or a membership id of this world): 403
|
|
3870
|
+
* `read_as_owner_only` from any other key, 422 without `resolve`. `worldId` is the key's own world
|
|
3871
|
+
* (another is a 404). A world key's call; an account token is a TypeError before sending. Served
|
|
3872
|
+
* `Cache-Control: private, no-store`.
|
|
3873
|
+
*/
|
|
3874
|
+
worldLenses(worldId: string, opts?: {
|
|
3875
|
+
resolve?: boolean;
|
|
3876
|
+
readAs?: string;
|
|
3877
|
+
}): Promise<OwWorldLenses>;
|
|
3743
3878
|
me(): Promise<OwMe>;
|
|
3744
3879
|
/**
|
|
3745
3880
|
* GET /members -- the world's roster: each member's id (null for the owner), kind, role,
|
|
@@ -3768,8 +3903,10 @@ declare class OwV2Client {
|
|
|
3768
3903
|
* the frame and every null kept, and leaves out each element body's empty fields (`null`, `""`,
|
|
3769
3904
|
* `[]`, `{}`; `id`, `type` and `name` always stay), answered as `OwDraughtCompact`. A Message
|
|
3770
3905
|
* without the room mark is placed as any Narrative unless `messages` is named, when it is there
|
|
3771
|
-
* and in no other section; a room-marked Message is in `messages` or nowhere.
|
|
3772
|
-
* `
|
|
3906
|
+
* and in no other section; a room-marked Message is in `messages` or nowhere. `lens` (a lens id)
|
|
3907
|
+
* adds `lenses`, one frame with that lens read for this key's own view (beside `depth` or `budget`
|
|
3908
|
+
* a 422); with no policy key but `compact`, the packet adds one frame per lens chosen with
|
|
3909
|
+
* setMyLenses. Served `Cache-Control: private, no-store`.
|
|
3773
3910
|
*/
|
|
3774
3911
|
draught(characterId: string, policy?: OwDraughtPolicy & {
|
|
3775
3912
|
compact?: false;
|
|
@@ -6080,4 +6217,4 @@ declare class TokenResource {
|
|
|
6080
6217
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
6081
6218
|
}
|
|
6082
6219
|
|
|
6083
|
-
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, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, 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, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, 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, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, handsOnAsProposed, hasUnseenRecipients, intercalaryInYear, isAddressedTo, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, lensesInUse, lookupWorld, monthStartSteps, nfc, noteOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, recipientsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, senderStatus, simpleCaseFold, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
|
6220
|
+
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, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, 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, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLens, type OwWorldLensReading, type OwWorldLenses, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, 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, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, handsOnAsProposed, hasUnseenRecipients, intercalaryInYear, isAddressedTo, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, lensesInUse, lookupWorld, monthStartSteps, nfc, noteOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, recipientsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, senderStatus, simpleCaseFold, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -688,6 +688,46 @@ var OwV2Client = class {
|
|
|
688
688
|
}
|
|
689
689
|
return this.request("PUT", "/me/character", { write: true, body: { character } });
|
|
690
690
|
}
|
|
691
|
+
/**
|
|
692
|
+
* PUT /me/lenses -- choose the lenses this key's holder starts with: lens ids in order, 0 to 20,
|
|
693
|
+
* repeats dropped by keel; an empty list is a choice too (the draught then adds no frame). Any write
|
|
694
|
+
* key of the world, with its PIN, sets its own holder's list: a person member's, an agent seat's, or
|
|
695
|
+
* on the owner's keys the owner's own; answers GET /me's body. The draught reads the list whenever it
|
|
696
|
+
* is given no lens and no policy. 404 for a lens this key cannot see; 422 `not_a_lens`,
|
|
697
|
+
* `lens_is_template` or `lens_hidden` (`param` lenses); 403 for a read key. A lens only narrows what
|
|
698
|
+
* the holder may already read. A world key's call; an account token is a TypeError before sending.
|
|
699
|
+
*/
|
|
700
|
+
async setMyLenses(lensIds) {
|
|
701
|
+
if (this.keyKind === "account") {
|
|
702
|
+
throw new TypeError("setMyLenses needs a world key: an account token is not a member of one world");
|
|
703
|
+
}
|
|
704
|
+
if (!Array.isArray(lensIds)) {
|
|
705
|
+
throw new TypeError("setMyLenses: lensIds is a list of lens ids ([] for none). Nothing was sent.");
|
|
706
|
+
}
|
|
707
|
+
return this.request("PUT", "/me/lenses", { body: { lenses: lensIds } });
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* GET /world/{worldId}/lenses -- every lens in the world this key can see, templates included and
|
|
711
|
+
* marked, each with its recipe echoed (`x_lens`, defaults filled in), the Titles it is the default
|
|
712
|
+
* for and whether this key chose it. `resolve: true` adds each lens's `reading` for this key: the kept
|
|
713
|
+
* rows, the cut by reason, the mail part. The owner also gets `chosen_by`, `health` and the two counts
|
|
714
|
+
* of what a reader cannot see; with `resolve`, the owner may `readAs` another reader (`guest`,
|
|
715
|
+
* `contributor`, `co-builder`, `public`, or a membership id of this world): 403
|
|
716
|
+
* `read_as_owner_only` from any other key, 422 without `resolve`. `worldId` is the key's own world
|
|
717
|
+
* (another is a 404). A world key's call; an account token is a TypeError before sending. Served
|
|
718
|
+
* `Cache-Control: private, no-store`.
|
|
719
|
+
*/
|
|
720
|
+
async worldLenses(worldId, opts = {}) {
|
|
721
|
+
only("worldLenses", opts, ["resolve", "readAs"]);
|
|
722
|
+
if (this.keyKind === "account") {
|
|
723
|
+
throw new TypeError("worldLenses needs a world key: an account token is not a member of one world");
|
|
724
|
+
}
|
|
725
|
+
if (opts.resolve !== void 0 && typeof opts.resolve !== "boolean") {
|
|
726
|
+
throw new TypeError("worldLenses: resolve is true or false. Nothing was sent.");
|
|
727
|
+
}
|
|
728
|
+
const query = buildQuery({ resolve: opts.resolve, read_as: opts.readAs });
|
|
729
|
+
return this.request("GET", `/world/${encodeURIComponent(worldId)}/lenses`, { query });
|
|
730
|
+
}
|
|
691
731
|
async me() {
|
|
692
732
|
if (this.keyKind === "account") {
|
|
693
733
|
throw new TypeError("me needs a world key: an account token is not a member of one world");
|
|
@@ -729,7 +769,7 @@ var OwV2Client = class {
|
|
|
729
769
|
return this.request("GET", `/${type}/`, { query, worldRead: true, ...withSignal(params.signal) });
|
|
730
770
|
}
|
|
731
771
|
async draught(characterId, policy = {}) {
|
|
732
|
-
only("draught", policy, ["components", "mode", "asOf", "undated", "since", "budget", "depth", "compact"]);
|
|
772
|
+
only("draught", policy, ["components", "mode", "asOf", "undated", "since", "budget", "depth", "compact", "lens"]);
|
|
733
773
|
if (policy.compact !== void 0 && typeof policy.compact !== "boolean") {
|
|
734
774
|
throw new TypeError("draught: compact is true or false. Nothing was sent.");
|
|
735
775
|
}
|
|
@@ -741,7 +781,8 @@ var OwV2Client = class {
|
|
|
741
781
|
since: policy.since,
|
|
742
782
|
budget: policy.budget,
|
|
743
783
|
depth: policy.depth,
|
|
744
|
-
compact: policy.compact
|
|
784
|
+
compact: policy.compact,
|
|
785
|
+
lens: policy.lens
|
|
745
786
|
});
|
|
746
787
|
return this.request("GET", `/character/${characterId}/context`, { query });
|
|
747
788
|
}
|