@objectstack/client 4.2.0 → 5.1.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.d.mts
CHANGED
|
@@ -491,6 +491,32 @@ declare class ObjectStackClient {
|
|
|
491
491
|
name: string;
|
|
492
492
|
deleted: boolean;
|
|
493
493
|
}>;
|
|
494
|
+
/**
|
|
495
|
+
* Get the durable change-log for a specific metadata item.
|
|
496
|
+
* Returns events recorded in `sys_metadata_history` for every
|
|
497
|
+
* overlay put/delete, ordered by `event_seq` ascending. Non-overlay
|
|
498
|
+
* metadata types return an empty list.
|
|
499
|
+
*/
|
|
500
|
+
getHistory: (type: string, name: string, options?: {
|
|
501
|
+
sinceSeq?: number;
|
|
502
|
+
limit?: number;
|
|
503
|
+
}) => Promise<{
|
|
504
|
+
events: Array<{
|
|
505
|
+
seq: number;
|
|
506
|
+
op: string;
|
|
507
|
+
ref: {
|
|
508
|
+
org?: string;
|
|
509
|
+
type: string;
|
|
510
|
+
name: string;
|
|
511
|
+
};
|
|
512
|
+
hash: string | null;
|
|
513
|
+
parentHash: string | null;
|
|
514
|
+
actor: string;
|
|
515
|
+
message?: string;
|
|
516
|
+
ts: string;
|
|
517
|
+
source: string;
|
|
518
|
+
}>;
|
|
519
|
+
}>;
|
|
494
520
|
/**
|
|
495
521
|
* Get object metadata with cache support
|
|
496
522
|
* Supports ETag-based conditional requests for efficient caching
|
|
@@ -1933,6 +1959,10 @@ declare class ScopedProjectClient {
|
|
|
1933
1959
|
name: string;
|
|
1934
1960
|
deleted: boolean;
|
|
1935
1961
|
}>;
|
|
1962
|
+
getHistory: (type: string, name: string, options?: {
|
|
1963
|
+
sinceSeq?: number;
|
|
1964
|
+
limit?: number;
|
|
1965
|
+
}) => Promise<unknown>;
|
|
1936
1966
|
};
|
|
1937
1967
|
/**
|
|
1938
1968
|
* Data operations scoped to this project.
|
package/dist/index.d.ts
CHANGED
|
@@ -491,6 +491,32 @@ declare class ObjectStackClient {
|
|
|
491
491
|
name: string;
|
|
492
492
|
deleted: boolean;
|
|
493
493
|
}>;
|
|
494
|
+
/**
|
|
495
|
+
* Get the durable change-log for a specific metadata item.
|
|
496
|
+
* Returns events recorded in `sys_metadata_history` for every
|
|
497
|
+
* overlay put/delete, ordered by `event_seq` ascending. Non-overlay
|
|
498
|
+
* metadata types return an empty list.
|
|
499
|
+
*/
|
|
500
|
+
getHistory: (type: string, name: string, options?: {
|
|
501
|
+
sinceSeq?: number;
|
|
502
|
+
limit?: number;
|
|
503
|
+
}) => Promise<{
|
|
504
|
+
events: Array<{
|
|
505
|
+
seq: number;
|
|
506
|
+
op: string;
|
|
507
|
+
ref: {
|
|
508
|
+
org?: string;
|
|
509
|
+
type: string;
|
|
510
|
+
name: string;
|
|
511
|
+
};
|
|
512
|
+
hash: string | null;
|
|
513
|
+
parentHash: string | null;
|
|
514
|
+
actor: string;
|
|
515
|
+
message?: string;
|
|
516
|
+
ts: string;
|
|
517
|
+
source: string;
|
|
518
|
+
}>;
|
|
519
|
+
}>;
|
|
494
520
|
/**
|
|
495
521
|
* Get object metadata with cache support
|
|
496
522
|
* Supports ETag-based conditional requests for efficient caching
|
|
@@ -1933,6 +1959,10 @@ declare class ScopedProjectClient {
|
|
|
1933
1959
|
name: string;
|
|
1934
1960
|
deleted: boolean;
|
|
1935
1961
|
}>;
|
|
1962
|
+
getHistory: (type: string, name: string, options?: {
|
|
1963
|
+
sinceSeq?: number;
|
|
1964
|
+
limit?: number;
|
|
1965
|
+
}) => Promise<unknown>;
|
|
1936
1966
|
};
|
|
1937
1967
|
/**
|
|
1938
1968
|
* Data operations scoped to this project.
|
package/dist/index.js
CHANGED
|
@@ -506,6 +506,22 @@ var ObjectStackClient = class {
|
|
|
506
506
|
});
|
|
507
507
|
return this.unwrapResponse(res);
|
|
508
508
|
},
|
|
509
|
+
/**
|
|
510
|
+
* Get the durable change-log for a specific metadata item.
|
|
511
|
+
* Returns events recorded in `sys_metadata_history` for every
|
|
512
|
+
* overlay put/delete, ordered by `event_seq` ascending. Non-overlay
|
|
513
|
+
* metadata types return an empty list.
|
|
514
|
+
*/
|
|
515
|
+
getHistory: async (type, name, options) => {
|
|
516
|
+
const route = this.getRoute("metadata");
|
|
517
|
+
const params = new URLSearchParams();
|
|
518
|
+
if (options?.sinceSeq !== void 0) params.set("sinceSeq", String(options.sinceSeq));
|
|
519
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
520
|
+
const qs = params.toString();
|
|
521
|
+
const url = `${this.baseUrl}${route}/${encodeURIComponent(type)}/${encodeURIComponent(name)}/history${qs ? `?${qs}` : ""}`;
|
|
522
|
+
const res = await this.fetch(url);
|
|
523
|
+
return this.unwrapResponse(res);
|
|
524
|
+
},
|
|
509
525
|
/**
|
|
510
526
|
* Get object metadata with cache support
|
|
511
527
|
* Supports ETag-based conditional requests for efficient caching
|
|
@@ -3000,6 +3016,16 @@ var ScopedProjectClient = class {
|
|
|
3000
3016
|
method: "DELETE"
|
|
3001
3017
|
});
|
|
3002
3018
|
return this.parent._unwrap(res);
|
|
3019
|
+
},
|
|
3020
|
+
getHistory: async (type, name, options) => {
|
|
3021
|
+
const params = new URLSearchParams();
|
|
3022
|
+
if (options?.sinceSeq !== void 0) params.set("sinceSeq", String(options.sinceSeq));
|
|
3023
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
3024
|
+
const qs = params.toString();
|
|
3025
|
+
const res = await this.parent._fetch(
|
|
3026
|
+
this.url(`/meta/${encodeURIComponent(type)}/${encodeURIComponent(name)}/history${qs ? `?${qs}` : ""}`)
|
|
3027
|
+
);
|
|
3028
|
+
return this.parent._unwrap(res);
|
|
3003
3029
|
}
|
|
3004
3030
|
};
|
|
3005
3031
|
/**
|