@nodaro/sdk 1.13.1 → 1.14.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/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -592,12 +592,29 @@ var CharactersResource = class {
|
|
|
592
592
|
* pass `archived: true` to fetch soft-deleted rows for an "archive" view.
|
|
593
593
|
* When `projectId` is set, only characters belonging to that project are
|
|
594
594
|
* returned.
|
|
595
|
+
*
|
|
596
|
+
* Cursor-paginated: a response carrying a non-null `nextCursor` means more
|
|
597
|
+
* rows exist. Pass it back as `cursor` to fetch the next page, and keep going
|
|
598
|
+
* until `nextCursor` is `null` — a single call returns at most `limit` rows
|
|
599
|
+
* (default 100), so treating one call as "all characters" silently truncates
|
|
600
|
+
* the list for anyone past that count.
|
|
601
|
+
*
|
|
602
|
+
* ```ts
|
|
603
|
+
* const all: Character[] = []
|
|
604
|
+
* let cursor: string | undefined
|
|
605
|
+
* do {
|
|
606
|
+
* const page = await client.characters.list({ cursor })
|
|
607
|
+
* all.push(...page.characters)
|
|
608
|
+
* cursor = page.nextCursor ?? undefined
|
|
609
|
+
* } while (cursor)
|
|
610
|
+
* ```
|
|
595
611
|
*/
|
|
596
612
|
list(params = {}) {
|
|
597
613
|
const query = {};
|
|
598
614
|
if (params.projectId) query.projectId = params.projectId;
|
|
599
615
|
if (params.archived) query.archived = "true";
|
|
600
616
|
if (params.limit !== void 0) query.limit = String(params.limit);
|
|
617
|
+
if (params.cursor) query.cursor = params.cursor;
|
|
601
618
|
return this.client.request("GET", "/v1/characters", { query });
|
|
602
619
|
}
|
|
603
620
|
/**
|
|
@@ -2153,7 +2170,7 @@ var TutorialsResource = class {
|
|
|
2153
2170
|
};
|
|
2154
2171
|
|
|
2155
2172
|
// src/client.ts
|
|
2156
|
-
var SDK_VERSION = "1.
|
|
2173
|
+
var SDK_VERSION = "1.14.0" ;
|
|
2157
2174
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
2158
2175
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
2159
2176
|
var NodaroClient = class {
|