@onlyworlds/sdk 4.174.0 → 4.176.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 +20 -0
- package/dist/index.d.ts +38 -11
- package/dist/index.js +19 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.176.0] - 2026-11-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`front_door.charter_element` and `front_door.charter_skill_elements`**, which `GET /me`, `PUT /me/character` and an AI seat's join now serve: the Charter and its skills typed as `{type, id}`, so a reader knows which route fetches each. `OwFrontDoorCharter` (`type: 'law'`, or null where `charter` is) and `OwFrontDoorSkill` (`type: 'object'`, in `charter_skill`'s order) are exported.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **`OwSeat`'s descriptions of the Character right** follow the platform's: the owner may give a seat its Character without the right; once the right is cleared, sending the same Character again keeps it cleared, and only the owner's `may_change_character` true gives it back; and `may_change_character_note` also says why a seat can change its Character all the same (it made it, or it is a co-builder), not only why it cannot.
|
|
17
|
+
|
|
18
|
+
## [4.175.0] - 2026-11-16
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`OwApiError.isHostBlocked`: a write the host refused before the API saw it.** The host in front of onlyworlds.com answers some writes with a 403 whose body is an HTML page titled "Blocked", not the API's JSON envelope: text that holds a shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after a backtick, a semicolon or a pipe. Such an error read "OnlyWorlds API error 403" until now. It now says the host refused the request and nothing was written, and how to write the command so it passes (a fenced code block whose first line names a language, or no backtick). `code` stays null, as it is no API code, and `detail` keeps the page. Read on the page's title and on the body not being JSON, so the API's own 403s read as before.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`removeSeat`'s description** says when the Character a seat plays goes with it: only while it is as the seat's join left it (made by the join, named as the seat, supertype `Agent` alone, last written by the join, linked from nothing and played by no one else). Any other stays, one given to the seat to play included.
|
|
27
|
+
|
|
8
28
|
## [4.174.0] - 2026-11-16
|
|
9
29
|
|
|
10
30
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -3145,6 +3145,20 @@ interface OwFrontDoor {
|
|
|
3145
3145
|
charter: string | null;
|
|
3146
3146
|
/** The Objects the Charter's description names (by `ow://` link or id), in the order written, at most five; empty when none. */
|
|
3147
3147
|
charter_skill: string[];
|
|
3148
|
+
/** `charter` typed as an element: the Charter is a Law, read with `get('law', id)`. Null where `charter` is. */
|
|
3149
|
+
charter_element: OwFrontDoorCharter | null;
|
|
3150
|
+
/** `charter_skill` typed as elements, in the same order: each an Object, read with `get('object', id)`. Empty where `charter_skill` is. */
|
|
3151
|
+
charter_skill_elements: OwFrontDoorSkill[];
|
|
3152
|
+
}
|
|
3153
|
+
/** The Charter in `front_door.charter_element`: a Law by its type and id. */
|
|
3154
|
+
interface OwFrontDoorCharter {
|
|
3155
|
+
type: 'law';
|
|
3156
|
+
id: string;
|
|
3157
|
+
}
|
|
3158
|
+
/** One skill in `front_door.charter_skill_elements`: an Object by its type and id. */
|
|
3159
|
+
interface OwFrontDoorSkill {
|
|
3160
|
+
type: 'object';
|
|
3161
|
+
id: string;
|
|
3148
3162
|
}
|
|
3149
3163
|
/** One seat you answer for, a row of `front_door.my_seats`. */
|
|
3150
3164
|
interface OwMySeat {
|
|
@@ -3886,13 +3900,19 @@ interface OwSeat {
|
|
|
3886
3900
|
/** The latest use of the seat's key, or null. */
|
|
3887
3901
|
last_active: string | null;
|
|
3888
3902
|
/**
|
|
3889
|
-
* True when the seat may change, never delete, the Character it plays: the owner gave it that Character
|
|
3890
|
-
*
|
|
3891
|
-
*
|
|
3892
|
-
*
|
|
3903
|
+
* True when the seat may change, never delete, the Character it plays: the owner gave it that Character with the
|
|
3904
|
+
* right (the owner may also give it without, `may_change_character` false on the member's PATCH), or its sponsor
|
|
3905
|
+
* could change it. False says only that no such right is held: a co-builder seat changes everything and a seat
|
|
3906
|
+
* changes what it made. On a seat a member answers for it holds only while that member could change the
|
|
3907
|
+
* Character; once cleared, sending the same Character again keeps it cleared, and only the owner's
|
|
3908
|
+
* `may_change_character` true gives it back. False when the seat has no Character, and when its Character is kept
|
|
3909
|
+
* from you (`character` null).
|
|
3893
3910
|
*/
|
|
3894
3911
|
may_change_character: boolean;
|
|
3895
|
-
/**
|
|
3912
|
+
/**
|
|
3913
|
+
* A sentence: why the seat may not change the Character it plays, or, where it can change it all the same without
|
|
3914
|
+
* the right, why (it made it, or it is a co-builder). Null otherwise, and when its Character is kept from you.
|
|
3915
|
+
*/
|
|
3896
3916
|
may_change_character_note: string | null;
|
|
3897
3917
|
/** True when its member made it for their own AI to play their own Character: it plays what its sponsor plays, and its `may_change_character` is its sponsor's, until it is handed to someone else. */
|
|
3898
3918
|
follows_sponsor: boolean;
|
|
@@ -4245,6 +4265,14 @@ declare class OwApiError extends Error {
|
|
|
4245
4265
|
readonly retryAfter: number | null;
|
|
4246
4266
|
constructor(status: number, code: string | null, message: string, docUrl: string | null, detail: unknown, type?: string | null, param?: string | null, retryAfter?: number | null);
|
|
4247
4267
|
get isAuthError(): boolean;
|
|
4268
|
+
/**
|
|
4269
|
+
* The host in front of onlyworlds.com refused the request before the API saw it: a 403 whose body is an HTML
|
|
4270
|
+
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
4271
|
+
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
4272
|
+
* a backtick, a semicolon or a pipe; such a command passes in a fenced code block whose first line names a
|
|
4273
|
+
* language, or without the backtick. `code` is null (it is no API code) and `detail` keeps the page.
|
|
4274
|
+
*/
|
|
4275
|
+
get isHostBlocked(): boolean;
|
|
4248
4276
|
/** 422s/400s name the offending param/field -- typos error loudly platform-wide. */
|
|
4249
4277
|
get isValidationError(): boolean;
|
|
4250
4278
|
/**
|
|
@@ -4570,9 +4598,6 @@ declare class OwSignInError extends Error {
|
|
|
4570
4598
|
retryAfter?: number;
|
|
4571
4599
|
});
|
|
4572
4600
|
}
|
|
4573
|
-
/** Parse a wire envelope into OwApiError parts (exported for the error type-tests). */
|
|
4574
|
-
/** Parse the platform ERROR envelope into an OwApiError. (Renamed from parseEnvelope in 4.0 —
|
|
4575
|
-
* distinct from the world-export envelope, which is a different artifact entirely.) */
|
|
4576
4601
|
declare function parseErrorEnvelope(status: number, body: unknown, retryAfter?: number | null): OwApiError;
|
|
4577
4602
|
/** Build an OwApiError from a non-2xx response, tolerating non-JSON bodies. */
|
|
4578
4603
|
declare function errorFromResponse(res: Response): Promise<OwApiError>;
|
|
@@ -5397,8 +5422,10 @@ declare class OwV2Client {
|
|
|
5397
5422
|
rekeySeat(worldId: string, seatId: string): Promise<OwSeatCreated>;
|
|
5398
5423
|
/**
|
|
5399
5424
|
* DELETE /account/worlds/{worldId}/seats/{seatId} -- remove an agent seat: its sponsor or the
|
|
5400
|
-
* world's owner may. Its key and secret stop at once;
|
|
5401
|
-
*
|
|
5425
|
+
* world's owner may. Its key and secret stop at once; the Character it plays goes with it only
|
|
5426
|
+
* while it is as the join left one (made by the join, named as the seat, supertype `Agent` alone,
|
|
5427
|
+
* last written by the join, linked from nothing, played by no one else); any other stays, one
|
|
5428
|
+
* given to the seat to play included. Needs the client's `ow_a_` token.
|
|
5402
5429
|
*/
|
|
5403
5430
|
removeSeat(worldId: string, seatId: string): Promise<void>;
|
|
5404
5431
|
/**
|
|
@@ -8259,4 +8286,4 @@ declare class TokenResource {
|
|
|
8259
8286
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
8260
8287
|
}
|
|
8261
8288
|
|
|
8262
|
-
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, type OwAddressAt, OwAddressError, type OwAddressForm, type OwAddressFound, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, 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 OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayout3dHow, type OwLayout3dPart, type OwLayoutAround, type OwLayoutAroundOptions, type OwLayoutAroundPoint, type OwLayoutByKind, type OwLayoutByLinks3d, type OwLayoutByLinks3dOptions, type OwLayoutGraph, type OwLayoutOf, type OwLayoutPoint, 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 OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, 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 OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwReportGroup, type OwReportLine, type OwReportLineOptions, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, 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 OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwView, type OwViewRow, type OwViewsTable, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, 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, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, compareInstants, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8289
|
+
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, type OwAddressAt, OwAddressError, type OwAddressForm, type OwAddressFound, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, 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 OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwFrontDoorCharter, type OwFrontDoorSkill, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayout3dHow, type OwLayout3dPart, type OwLayoutAround, type OwLayoutAroundOptions, type OwLayoutAroundPoint, type OwLayoutByKind, type OwLayoutByLinks3d, type OwLayoutByLinks3dOptions, type OwLayoutGraph, type OwLayoutOf, type OwLayoutPoint, 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 OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, 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 OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwReportGroup, type OwReportLine, type OwReportLineOptions, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, 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 OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwView, type OwViewRow, type OwViewsTable, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, 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, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, compareInstants, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,16 @@ var OwApiError = class extends Error {
|
|
|
124
124
|
get isAuthError() {
|
|
125
125
|
return this.code === "invalid_credentials" || this.code === "key_revoked" || this.code === "world_gone";
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The host in front of onlyworlds.com refused the request before the API saw it: a 403 whose body is an HTML
|
|
129
|
+
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
130
|
+
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
131
|
+
* a backtick, a semicolon or a pipe; such a command passes in a fenced code block whose first line names a
|
|
132
|
+
* language, or without the backtick. `code` is null (it is no API code) and `detail` keeps the page.
|
|
133
|
+
*/
|
|
134
|
+
get isHostBlocked() {
|
|
135
|
+
return isHostBlockedPage(this.status, this.detail);
|
|
136
|
+
}
|
|
127
137
|
/** 422s/400s name the offending param/field -- typos error loudly platform-wide. */
|
|
128
138
|
get isValidationError() {
|
|
129
139
|
return this.status === 422 || this.status === 400;
|
|
@@ -517,7 +527,12 @@ var OwSignInError = class extends Error {
|
|
|
517
527
|
if (opts.retryAfter !== void 0) this.retryAfter = opts.retryAfter;
|
|
518
528
|
}
|
|
519
529
|
};
|
|
530
|
+
function isHostBlockedPage(status, body) {
|
|
531
|
+
return status === 403 && typeof body === "string" && /<title[^>]*>\s*Blocked\s*<\/title>/i.test(body);
|
|
532
|
+
}
|
|
533
|
+
var HOST_BLOCKED_MESSAGE = 'The host in front of onlyworlds.com refused this request before the API saw it (a 403 page titled "Blocked"), and nothing was written. It refuses text that holds a shell command such as python -m, python -c, perl -e, or curl or wget with an address, right after a backtick, a semicolon or a pipe. Put such a command in a fenced code block whose first line names a language, or write it without the backtick.';
|
|
520
534
|
function parseErrorEnvelope(status, body, retryAfter = null) {
|
|
535
|
+
if (isHostBlockedPage(status, body)) return new OwApiError(status, null, HOST_BLOCKED_MESSAGE, null, body, null, null, retryAfter);
|
|
521
536
|
const env = body && typeof body === "object" ? body : {};
|
|
522
537
|
const nested = typeof env.error === "object" && env.error !== null ? env.error : void 0;
|
|
523
538
|
const code = env.code ?? nested?.code ?? (typeof env.error === "string" ? env.error : null) ?? null;
|
|
@@ -1831,8 +1846,10 @@ var OwV2Client = class {
|
|
|
1831
1846
|
}
|
|
1832
1847
|
/**
|
|
1833
1848
|
* DELETE /account/worlds/{worldId}/seats/{seatId} -- remove an agent seat: its sponsor or the
|
|
1834
|
-
* world's owner may. Its key and secret stop at once;
|
|
1835
|
-
*
|
|
1849
|
+
* world's owner may. Its key and secret stop at once; the Character it plays goes with it only
|
|
1850
|
+
* while it is as the join left one (made by the join, named as the seat, supertype `Agent` alone,
|
|
1851
|
+
* last written by the join, linked from nothing, played by no one else); any other stays, one
|
|
1852
|
+
* given to the seat to play included. Needs the client's `ow_a_` token.
|
|
1836
1853
|
*/
|
|
1837
1854
|
async removeSeat(worldId, seatId) {
|
|
1838
1855
|
if (this.keyKind !== "account") {
|