@nodaro/sdk 2.21.1 → 2.22.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 +49 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.js +49 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2724,10 +2724,44 @@ var CollectionsResource = class {
|
|
|
2724
2724
|
async delete(id) {
|
|
2725
2725
|
await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}`);
|
|
2726
2726
|
}
|
|
2727
|
-
/**
|
|
2727
|
+
/**
|
|
2728
|
+
* `GET /v1/collections/:id/records` → the records, newest first (`order: "oldest"`
|
|
2729
|
+
* flips it). Narrow with `q` (words), `since` / `until` (ISO) and `usage`
|
|
2730
|
+
* (`all`, `unused` — not used yet — or `used`); page with `cursor` / `limit`
|
|
2731
|
+
* (1-100, default 50). Each record carries `usedAt` / `usedBy`, and its
|
|
2732
|
+
* `source` the saving workflow's name and project when it is yours.
|
|
2733
|
+
*/
|
|
2728
2734
|
records(id, params = {}) {
|
|
2729
2735
|
return this.client.request("GET", `/v1/collections/${encodeURIComponent(id)}/records`, {
|
|
2730
|
-
query: {
|
|
2736
|
+
query: {
|
|
2737
|
+
q: params.q,
|
|
2738
|
+
since: params.since,
|
|
2739
|
+
until: params.until,
|
|
2740
|
+
usage: params.usage,
|
|
2741
|
+
status: params.status,
|
|
2742
|
+
order: params.order,
|
|
2743
|
+
cursor: params.cursor,
|
|
2744
|
+
offset: params.offset,
|
|
2745
|
+
limit: params.limit
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
/** `POST /v1/collections/:id/records/:recordId/restore` → bring a record back from the Trash; the record. */
|
|
2750
|
+
restoreRecord(id, recordId) {
|
|
2751
|
+
return this.client.request("POST", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/restore`);
|
|
2752
|
+
}
|
|
2753
|
+
/** `POST /v1/collections/:id/records/bulk` → move up to 100 records to the Trash, bring them back, or delete records already in the Trash for good, in one call. */
|
|
2754
|
+
bulkRecords(id, input) {
|
|
2755
|
+
return this.client.request("POST", `/v1/collections/${encodeURIComponent(id)}/records/bulk`, { body: input });
|
|
2756
|
+
}
|
|
2757
|
+
/**
|
|
2758
|
+
* `PATCH /v1/collections/:id/records/:recordId` → mark a record used (or not
|
|
2759
|
+
* used again). `source` says who is marking it (defaults to the API). A
|
|
2760
|
+
* server before the usage release answers `503 not_available`.
|
|
2761
|
+
*/
|
|
2762
|
+
setUsed(id, recordId, used, source) {
|
|
2763
|
+
return this.client.request("PATCH", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`, {
|
|
2764
|
+
body: { used, ...source ? { source } : {} }
|
|
2731
2765
|
});
|
|
2732
2766
|
}
|
|
2733
2767
|
/**
|
|
@@ -2743,17 +2777,22 @@ var CollectionsResource = class {
|
|
|
2743
2777
|
...opts.idempotencyKey ? { headers: { "Idempotency-Key": opts.idempotencyKey } } : {}
|
|
2744
2778
|
});
|
|
2745
2779
|
}
|
|
2746
|
-
/**
|
|
2780
|
+
/**
|
|
2781
|
+
* `DELETE /v1/collections/:id/records/:recordId` → the record moves to the
|
|
2782
|
+
* collection's Trash (`restoreRecord` brings it back; `deleteRecordForever`
|
|
2783
|
+
* removes it for good).
|
|
2784
|
+
*/
|
|
2747
2785
|
async deleteRecord(id, recordId) {
|
|
2748
|
-
await this.client.request(
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2786
|
+
await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`);
|
|
2787
|
+
}
|
|
2788
|
+
/** `DELETE /v1/collections/:id/records/:recordId/permanent` → a record already in the Trash is deleted for good (`409 not_in_trash` for a live one). */
|
|
2789
|
+
async deleteRecordForever(id, recordId) {
|
|
2790
|
+
await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/permanent`);
|
|
2752
2791
|
}
|
|
2753
|
-
/** `GET /v1/collections/:id/export` → the whole collection as CSV (default) or JSON text, newest first; `since` and `q` narrow it. */
|
|
2792
|
+
/** `GET /v1/collections/:id/export` → the whole collection as CSV (default) or JSON text, newest first; `since`, `until`, `usage` and `q` narrow it. */
|
|
2754
2793
|
export(id, params = {}) {
|
|
2755
2794
|
return this.client.requestText("GET", `/v1/collections/${encodeURIComponent(id)}/export`, {
|
|
2756
|
-
query: { format: params.format, since: params.since, q: params.q }
|
|
2795
|
+
query: { format: params.format, since: params.since, until: params.until, usage: params.usage, q: params.q }
|
|
2757
2796
|
});
|
|
2758
2797
|
}
|
|
2759
2798
|
};
|
|
@@ -3975,7 +4014,7 @@ var EditResource = class {
|
|
|
3975
4014
|
return shared.remapTranscriptThroughEdl(edl, transcript);
|
|
3976
4015
|
}
|
|
3977
4016
|
};
|
|
3978
|
-
var SDK_VERSION = "2.
|
|
4017
|
+
var SDK_VERSION = "2.22.0" ;
|
|
3979
4018
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
3980
4019
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
3981
4020
|
var NodaroClient = class _NodaroClient {
|