@objectstack/client 5.0.0 → 5.2.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.d.mts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -476,6 +476,22 @@ var ObjectStackClient = class {
|
|
|
476
476
|
});
|
|
477
477
|
return this.unwrapResponse(res);
|
|
478
478
|
},
|
|
479
|
+
/**
|
|
480
|
+
* Get the durable change-log for a specific metadata item.
|
|
481
|
+
* Returns events recorded in `sys_metadata_history` for every
|
|
482
|
+
* overlay put/delete, ordered by `event_seq` ascending. Non-overlay
|
|
483
|
+
* metadata types return an empty list.
|
|
484
|
+
*/
|
|
485
|
+
getHistory: async (type, name, options) => {
|
|
486
|
+
const route = this.getRoute("metadata");
|
|
487
|
+
const params = new URLSearchParams();
|
|
488
|
+
if (options?.sinceSeq !== void 0) params.set("sinceSeq", String(options.sinceSeq));
|
|
489
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
490
|
+
const qs = params.toString();
|
|
491
|
+
const url = `${this.baseUrl}${route}/${encodeURIComponent(type)}/${encodeURIComponent(name)}/history${qs ? `?${qs}` : ""}`;
|
|
492
|
+
const res = await this.fetch(url);
|
|
493
|
+
return this.unwrapResponse(res);
|
|
494
|
+
},
|
|
479
495
|
/**
|
|
480
496
|
* Get object metadata with cache support
|
|
481
497
|
* Supports ETag-based conditional requests for efficient caching
|
|
@@ -2970,6 +2986,16 @@ var ScopedProjectClient = class {
|
|
|
2970
2986
|
method: "DELETE"
|
|
2971
2987
|
});
|
|
2972
2988
|
return this.parent._unwrap(res);
|
|
2989
|
+
},
|
|
2990
|
+
getHistory: async (type, name, options) => {
|
|
2991
|
+
const params = new URLSearchParams();
|
|
2992
|
+
if (options?.sinceSeq !== void 0) params.set("sinceSeq", String(options.sinceSeq));
|
|
2993
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
2994
|
+
const qs = params.toString();
|
|
2995
|
+
const res = await this.parent._fetch(
|
|
2996
|
+
this.url(`/meta/${encodeURIComponent(type)}/${encodeURIComponent(name)}/history${qs ? `?${qs}` : ""}`)
|
|
2997
|
+
);
|
|
2998
|
+
return this.parent._unwrap(res);
|
|
2973
2999
|
}
|
|
2974
3000
|
};
|
|
2975
3001
|
/**
|