Skip to content

Commit 8d25ece

Browse files
committed
Refer to "non-compact" as "full" and don't use "channel root" term
Applies suggestions from REST SDK usage docs PR [1] [1] ably/docs#3258 (comment)
1 parent 1b07db6 commit 8d25ece

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

liveobjects.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type BatchFunction<T extends LiveObject> = (ctx: BatchContext<T>) => void
7373
export declare interface RestObject {
7474
/**
7575
* Reads object data from the channel in compact object response format.
76-
* Uses the channel's root object as the entrypoint when no objectId is provided.
76+
* If no `objectId` is provided then the entire channel object is returned.
7777
*
7878
* Returns a {@link RestObjectGetCompactResult} representing the logical structure of your data as a JSON-like value.
7979
* {@link LiveMap} instances appear as JSON objects with their entries, and {@link LiveCounter} instances appear
@@ -89,7 +89,7 @@ export declare interface RestObject {
8989
get(params?: RestObjectGetCompactParams): Promise<RestObjectGetCompactResult>;
9090
/**
9191
* Reads object data from the channel in full object response format.
92-
* Uses the channel's root object as the entrypoint when no objectId is provided.
92+
* If no `objectId` is provided then the entire channel object is returned.
9393
*
9494
* Returns a {@link RestObjectGetFullResult} with full object metadata and decoded object data values
9595
* (`bytes` decoded to `Buffer`/`ArrayBuffer`, `json` decoded to native objects/arrays).
@@ -104,7 +104,7 @@ export declare interface RestObject {
104104
get(params: RestObjectGetFullParams): Promise<RestObjectGetFullResult>;
105105
/**
106106
* Reads object data from the channel.
107-
* Uses the channel's root object as the entrypoint when no objectId is provided.
107+
* If no `objectId` is provided then the entire channel object is returned.
108108
*
109109
* When `compact` is `true` (the default), returns a {@link RestObjectGetCompactResult} representing the logical
110110
* structure of your data as a JSON-like value. {@link LiveMap} instances appear as JSON objects with their entries,
@@ -390,9 +390,9 @@ export interface RestObjectPublishResult {
390390
* Request parameters for {@link RestObject.get}.
391391
*/
392392
export interface RestObjectGetParams {
393-
/** The unique identifier of the object instance to fetch. If omitted, fetches from the channel's root object. */
393+
/** The unique identifier of the object instance to fetch. If omitted, fetches from the channel object. */
394394
objectId?: string;
395-
/** A dot-separated path to return a subset of the object. Evaluated relative to the root or the specified objectId. */
395+
/** A dot-separated path to return a subset of the object. Evaluated relative to the channel object or the specified objectId. */
396396
path?: string;
397397
/** When true (default), returns a values-only representation. When false, includes object IDs and type metadata. */
398398
compact?: boolean;
@@ -500,7 +500,7 @@ export type AnyRestLiveObject = {
500500
};
501501

502502
/**
503-
* A decoded leaf data value in the non-compact {@link RestObject.get} responses.
503+
* A decoded leaf data value in the full {@link RestObject.get} responses.
504504
*/
505505
type RestObjectData = Omit<ObjectData, 'value'>;
506506

src/plugins/liveobjects/restobject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const mapSemanticsWireToPublic: Record<WireObjectsMapSemantics, ObjectsMapSemant
4040
[WireObjectsMapSemantics.LWW]: 'lww',
4141
};
4242

43-
/** Wire format for a non-compact GET response: either a live object or a typed leaf value. */
43+
/** Wire format for a full GET response: either a live object or a typed leaf value. */
4444
type WireRestObjectGetFullResult = WireRestLiveObject | WireObjectData;
4545

4646
type WireRestLiveObject = WireRestLiveMap | WireRestLiveCounter | WireAnyRestLiveObject;
@@ -127,7 +127,7 @@ export class RestObject implements PublicRestObject {
127127
return decoded as RestObjectGetCompactResult;
128128
}
129129

130-
// Non-compact mode: response is a live object (map/counter) or a typed leaf ObjectData.
130+
// Full mode: response is a live object (map/counter) or a typed leaf ObjectData.
131131
// Decode wire values using objectmessage decoding.
132132
return this._decodeFullResponseNode(decoded as WireRestObjectGetFullResult, format);
133133
}

test/package/browser/template/src/index-liveobjects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ globalThis.testAblyPackage = async function () {
131131
// check RestObject is accessible on a REST channel
132132
const restObject: RestObject = restChannel.object;
133133

134-
// check get() returns correct types for compact and non-compact
134+
// check get() returns correct types for compact and full responses
135135
const compactResult: RestObjectGetCompactResult = await restObject.get();
136136
const compactWithParam: RestObjectGetCompactResult = await restObject.get({ compact: true });
137-
const nonCompactResult: RestObjectGetFullResult = await restObject.get({ compact: false });
137+
const fullResult: RestObjectGetFullResult = await restObject.get({ compact: false });
138138

139139
// check publish() returns correct type
140140
const publishResult: RestObjectPublishResult = await restObject.publish({

0 commit comments

Comments
 (0)