@lumibase/sdk 0.18.0 → 0.20.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 +117 -1
- package/dist/index.d.cts +114 -1
- package/dist/index.d.ts +114 -1
- package/dist/index.js +110 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -27,9 +27,11 @@ __export(index_exports, {
|
|
|
27
27
|
checkCdcPipelineHealth: () => checkCdcPipelineHealth,
|
|
28
28
|
createAgentArtifact: () => createAgentArtifact,
|
|
29
29
|
createAgentGoal: () => createAgentGoal,
|
|
30
|
+
createBookmark: () => createBookmark,
|
|
30
31
|
createCdcPipeline: () => createCdcPipeline,
|
|
31
32
|
createLumiClient: () => createLumiClient,
|
|
32
33
|
decideAgentApproval: () => decideAgentApproval,
|
|
34
|
+
deleteBookmark: () => deleteBookmark,
|
|
33
35
|
deleteCdcPipeline: () => deleteCdcPipeline,
|
|
34
36
|
deployCdc: () => deployCdc,
|
|
35
37
|
dryRunAccessImport: () => dryRunAccessImport,
|
|
@@ -38,6 +40,7 @@ __export(index_exports, {
|
|
|
38
40
|
extractSeo: () => extractSeo,
|
|
39
41
|
generateAgentApp: () => generateAgentApp,
|
|
40
42
|
generateTypes: () => generateTypes,
|
|
43
|
+
getEffectivePreset: () => getEffectivePreset,
|
|
41
44
|
graphql: () => graphql,
|
|
42
45
|
importAccessManifest: () => importAccessManifest,
|
|
43
46
|
jsonLdScript: () => jsonLdScript,
|
|
@@ -47,7 +50,9 @@ __export(index_exports, {
|
|
|
47
50
|
listAgentGoals: () => listAgentGoals,
|
|
48
51
|
listAgentRuns: () => listAgentRuns,
|
|
49
52
|
listAgentTools: () => listAgentTools,
|
|
53
|
+
listBookmarks: () => listBookmarks,
|
|
50
54
|
listCdcPipelines: () => listCdcPipelines,
|
|
55
|
+
mediaUrl: () => mediaUrl,
|
|
51
56
|
publishAgentArtifact: () => publishAgentArtifact,
|
|
52
57
|
readAgentMemoryContext: () => readAgentMemoryContext,
|
|
53
58
|
readCdcPipeline: () => readCdcPipeline,
|
|
@@ -58,10 +63,12 @@ __export(index_exports, {
|
|
|
58
63
|
retryAgentRun: () => retryAgentRun,
|
|
59
64
|
rollbackAgentArtifact: () => rollbackAgentArtifact,
|
|
60
65
|
rollbackCdcDeployment: () => rollbackCdcDeployment,
|
|
66
|
+
saveUserView: () => saveUserView,
|
|
61
67
|
search: () => search,
|
|
62
68
|
startCdcPipeline: () => startCdcPipeline,
|
|
63
69
|
stopCdcPipeline: () => stopCdcPipeline,
|
|
64
70
|
toNextMetadata: () => toNextMetadata,
|
|
71
|
+
updateBookmark: () => updateBookmark,
|
|
65
72
|
updateCdcPipeline: () => updateCdcPipeline,
|
|
66
73
|
validateCdcDeploymentEnv: () => validateCdcDeploymentEnv,
|
|
67
74
|
writeAgentMemory: () => writeAgentMemory
|
|
@@ -656,7 +663,35 @@ function legacyRest() {
|
|
|
656
663
|
releasePin: (id, field) => client.rawRequest(
|
|
657
664
|
`${base}/${id}/pins/${encodeURIComponent(field)}`,
|
|
658
665
|
{ method: "DELETE" }
|
|
659
|
-
)
|
|
666
|
+
),
|
|
667
|
+
// Content versions — named parallel draft branches (content-versioning).
|
|
668
|
+
versions: {
|
|
669
|
+
list: (id) => client.rawRequest(`${base}/${id}/versions`),
|
|
670
|
+
create: (id, input) => client.rawRequest(`${base}/${id}/versions`, {
|
|
671
|
+
method: "POST",
|
|
672
|
+
body: JSON.stringify(input)
|
|
673
|
+
}),
|
|
674
|
+
get: (id, key) => client.rawRequest(
|
|
675
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`
|
|
676
|
+
),
|
|
677
|
+
update: (id, key, patch) => client.rawRequest(
|
|
678
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`,
|
|
679
|
+
{ method: "PATCH", body: JSON.stringify(patch) }
|
|
680
|
+
),
|
|
681
|
+
delete: (id, key) => client.rawRequest(
|
|
682
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`,
|
|
683
|
+
{ method: "DELETE" }
|
|
684
|
+
),
|
|
685
|
+
compare: (id, key) => client.rawRequest(
|
|
686
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}/compare`
|
|
687
|
+
),
|
|
688
|
+
// Returns the promoted item; `meta.mainDiverged` flags that main
|
|
689
|
+
// changed after the branch was cut (review advised).
|
|
690
|
+
promote: (id, key) => client.rawRequest(
|
|
691
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}/promote`,
|
|
692
|
+
{ method: "POST" }
|
|
693
|
+
)
|
|
694
|
+
}
|
|
660
695
|
};
|
|
661
696
|
}
|
|
662
697
|
const roles = {
|
|
@@ -1090,6 +1125,79 @@ function legacyRest() {
|
|
|
1090
1125
|
};
|
|
1091
1126
|
}
|
|
1092
1127
|
|
|
1128
|
+
// src/rest/gaps.ts
|
|
1129
|
+
function getEffectivePreset(collection) {
|
|
1130
|
+
return async (client) => {
|
|
1131
|
+
const res = await client.rawRequest(
|
|
1132
|
+
`/api/v1/presets/effective?collection=${encodeURIComponent(collection)}`
|
|
1133
|
+
);
|
|
1134
|
+
return res.data;
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
function listBookmarks(collection) {
|
|
1138
|
+
return async (client) => {
|
|
1139
|
+
const res = await client.rawRequest(
|
|
1140
|
+
`/api/v1/presets/bookmarks?collection=${encodeURIComponent(collection)}`
|
|
1141
|
+
);
|
|
1142
|
+
return res.data;
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
function saveUserView(input) {
|
|
1146
|
+
return async (client) => {
|
|
1147
|
+
const res = await client.rawRequest("/api/v1/presets", {
|
|
1148
|
+
method: "POST",
|
|
1149
|
+
body: JSON.stringify({ ...input, bookmark: null })
|
|
1150
|
+
});
|
|
1151
|
+
return res.data;
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
function createBookmark(input) {
|
|
1155
|
+
return async (client) => {
|
|
1156
|
+
const res = await client.rawRequest("/api/v1/presets", {
|
|
1157
|
+
method: "POST",
|
|
1158
|
+
body: JSON.stringify(input)
|
|
1159
|
+
});
|
|
1160
|
+
return res.data;
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
function updateBookmark(id, input) {
|
|
1164
|
+
return async (client) => {
|
|
1165
|
+
const res = await client.rawRequest(`/api/v1/presets/${encodeURIComponent(id)}`, {
|
|
1166
|
+
method: "PATCH",
|
|
1167
|
+
body: JSON.stringify(input)
|
|
1168
|
+
});
|
|
1169
|
+
return res.data;
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
function deleteBookmark(id) {
|
|
1173
|
+
return async (client) => {
|
|
1174
|
+
const res = await client.rawRequest(`/api/v1/presets/${encodeURIComponent(id)}`, {
|
|
1175
|
+
method: "DELETE"
|
|
1176
|
+
});
|
|
1177
|
+
return res.data;
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
function mediaUrl(key, transform, opts) {
|
|
1181
|
+
return (client) => {
|
|
1182
|
+
const base = client.url.replace(/\/$/, "");
|
|
1183
|
+
const path = `/api/v1/media/${key.split("/").map(encodeURIComponent).join("/")}`;
|
|
1184
|
+
if (!transform) return `${base}${path}`;
|
|
1185
|
+
const qs = new URLSearchParams();
|
|
1186
|
+
if ("preset" in transform) {
|
|
1187
|
+
qs.set("preset", transform.preset);
|
|
1188
|
+
} else {
|
|
1189
|
+
if (transform.width !== void 0) qs.set("width", String(transform.width));
|
|
1190
|
+
if (transform.height !== void 0) qs.set("height", String(transform.height));
|
|
1191
|
+
if (transform.format) qs.set("format", transform.format);
|
|
1192
|
+
if (transform.quality !== void 0) qs.set("quality", String(transform.quality));
|
|
1193
|
+
if (transform.fit) qs.set("fit", transform.fit);
|
|
1194
|
+
if (opts?.sign) qs.set("sig", opts.sign);
|
|
1195
|
+
}
|
|
1196
|
+
const query = qs.toString();
|
|
1197
|
+
return query ? `${base}${path}?${query}` : `${base}${path}`;
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1093
1201
|
// src/rest/index.ts
|
|
1094
1202
|
function search(query, params) {
|
|
1095
1203
|
return async (client) => {
|
|
@@ -1113,6 +1221,7 @@ function readItems(collection, params) {
|
|
|
1113
1221
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
1114
1222
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
1115
1223
|
if (params?.status) qs.set("status", params.status);
|
|
1224
|
+
if (params?.meta) qs.set("meta", params.meta);
|
|
1116
1225
|
const s = qs.toString();
|
|
1117
1226
|
const query = s ? `?${s}` : "";
|
|
1118
1227
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1564,9 +1673,11 @@ function jsonLdScript(item) {
|
|
|
1564
1673
|
checkCdcPipelineHealth,
|
|
1565
1674
|
createAgentArtifact,
|
|
1566
1675
|
createAgentGoal,
|
|
1676
|
+
createBookmark,
|
|
1567
1677
|
createCdcPipeline,
|
|
1568
1678
|
createLumiClient,
|
|
1569
1679
|
decideAgentApproval,
|
|
1680
|
+
deleteBookmark,
|
|
1570
1681
|
deleteCdcPipeline,
|
|
1571
1682
|
deployCdc,
|
|
1572
1683
|
dryRunAccessImport,
|
|
@@ -1575,6 +1686,7 @@ function jsonLdScript(item) {
|
|
|
1575
1686
|
extractSeo,
|
|
1576
1687
|
generateAgentApp,
|
|
1577
1688
|
generateTypes,
|
|
1689
|
+
getEffectivePreset,
|
|
1578
1690
|
graphql,
|
|
1579
1691
|
importAccessManifest,
|
|
1580
1692
|
jsonLdScript,
|
|
@@ -1584,7 +1696,9 @@ function jsonLdScript(item) {
|
|
|
1584
1696
|
listAgentGoals,
|
|
1585
1697
|
listAgentRuns,
|
|
1586
1698
|
listAgentTools,
|
|
1699
|
+
listBookmarks,
|
|
1587
1700
|
listCdcPipelines,
|
|
1701
|
+
mediaUrl,
|
|
1588
1702
|
publishAgentArtifact,
|
|
1589
1703
|
readAgentMemoryContext,
|
|
1590
1704
|
readCdcPipeline,
|
|
@@ -1595,10 +1709,12 @@ function jsonLdScript(item) {
|
|
|
1595
1709
|
retryAgentRun,
|
|
1596
1710
|
rollbackAgentArtifact,
|
|
1597
1711
|
rollbackCdcDeployment,
|
|
1712
|
+
saveUserView,
|
|
1598
1713
|
search,
|
|
1599
1714
|
startCdcPipeline,
|
|
1600
1715
|
stopCdcPipeline,
|
|
1601
1716
|
toNextMetadata,
|
|
1717
|
+
updateBookmark,
|
|
1602
1718
|
updateCdcPipeline,
|
|
1603
1719
|
validateCdcDeploymentEnv,
|
|
1604
1720
|
writeAgentMemory
|
package/dist/index.d.cts
CHANGED
|
@@ -377,6 +377,12 @@ interface ListItemsParams {
|
|
|
377
377
|
limit?: number;
|
|
378
378
|
offset?: number;
|
|
379
379
|
status?: string | null;
|
|
380
|
+
/**
|
|
381
|
+
* Controls whether the server computes the `count(*)` total. `'total_count'`
|
|
382
|
+
* (default) returns `meta.total`; `'none'` skips the extra aggregate query
|
|
383
|
+
* for a cheaper list (e.g. infinite scroll) and omits `meta.total`.
|
|
384
|
+
*/
|
|
385
|
+
meta?: 'total_count' | 'none';
|
|
380
386
|
}
|
|
381
387
|
/** Reserved metadata attributes present on every search hit. */
|
|
382
388
|
interface SearchHitMeta {
|
|
@@ -824,6 +830,38 @@ interface SettingResource {
|
|
|
824
830
|
scope: string;
|
|
825
831
|
updatedAt: string;
|
|
826
832
|
}
|
|
833
|
+
/** A named parallel draft branch of a content item (content-versioning). */
|
|
834
|
+
interface ContentVersion {
|
|
835
|
+
id: string;
|
|
836
|
+
siteId: string;
|
|
837
|
+
itemId: string;
|
|
838
|
+
collectionId: string;
|
|
839
|
+
/** Stable slug, unique per item. */
|
|
840
|
+
key: string;
|
|
841
|
+
/** Human-readable label. */
|
|
842
|
+
name: string;
|
|
843
|
+
/** Snapshot of the item data for this branch. */
|
|
844
|
+
data: Record<string, unknown>;
|
|
845
|
+
/** Hash of main's data at snapshot time — detects divergence before promote. */
|
|
846
|
+
hash: string;
|
|
847
|
+
createdBy: string | null;
|
|
848
|
+
createdAt: string;
|
|
849
|
+
updatedAt: string;
|
|
850
|
+
/** True when main's data changed since this version branched (list only). */
|
|
851
|
+
mainChanged?: boolean;
|
|
852
|
+
}
|
|
853
|
+
/** One changed field between main and a version. */
|
|
854
|
+
interface VersionFieldChange {
|
|
855
|
+
field: string;
|
|
856
|
+
main: unknown;
|
|
857
|
+
version: unknown;
|
|
858
|
+
}
|
|
859
|
+
/** `GET …/versions/:key/compare` payload. */
|
|
860
|
+
interface VersionCompare {
|
|
861
|
+
main: Record<string, unknown>;
|
|
862
|
+
version: Record<string, unknown>;
|
|
863
|
+
changes: VersionFieldChange[];
|
|
864
|
+
}
|
|
827
865
|
/** Origin of a translation-memory entry. */
|
|
828
866
|
type TmSource = "human" | "mt" | "imported";
|
|
829
867
|
/** A stored translation-memory pair for a language pair. */
|
|
@@ -1630,6 +1668,21 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1630
1668
|
releasePin: (id: string, field: string) => Promise<LumiResponse<{
|
|
1631
1669
|
pinnedFields: string[];
|
|
1632
1670
|
}>>;
|
|
1671
|
+
versions: {
|
|
1672
|
+
list: (id: string) => Promise<LumiResponse<ContentVersion[]>>;
|
|
1673
|
+
create: (id: string, input: {
|
|
1674
|
+
key: string;
|
|
1675
|
+
name: string;
|
|
1676
|
+
}) => Promise<LumiResponse<ContentVersion>>;
|
|
1677
|
+
get: (id: string, key: string) => Promise<LumiResponse<ContentVersion>>;
|
|
1678
|
+
update: (id: string, key: string, patch: {
|
|
1679
|
+
data?: Record<string, unknown>;
|
|
1680
|
+
name?: string;
|
|
1681
|
+
}) => Promise<LumiResponse<ContentVersion>>;
|
|
1682
|
+
delete: (id: string, key: string) => Promise<LumiResponse<null>>;
|
|
1683
|
+
compare: (id: string, key: string) => Promise<LumiResponse<VersionCompare>>;
|
|
1684
|
+
promote: (id: string, key: string) => Promise<LumiResponse<ItemRow<TSchema[TName] extends Record<string, unknown> ? TSchema[TName] : Record<string, unknown>>>>;
|
|
1685
|
+
};
|
|
1633
1686
|
};
|
|
1634
1687
|
roles: {
|
|
1635
1688
|
list: () => Promise<LumiResponse<RoleResource[]>>;
|
|
@@ -1950,6 +2003,66 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1950
2003
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1951
2004
|
};
|
|
1952
2005
|
|
|
2006
|
+
/**
|
|
2007
|
+
* SDK commands for view presets (presets-inheritance) and media transform URLs
|
|
2008
|
+
* (image-transform-dsl). Each is a command factory `(client) => Promise<T>`
|
|
2009
|
+
* used with `client.request(...)`, matching the rest of the REST module.
|
|
2010
|
+
*
|
|
2011
|
+
* Content-version and translation-memory helpers live in the core SDK
|
|
2012
|
+
* (`client.items(...).versions` and `client.tm`).
|
|
2013
|
+
*/
|
|
2014
|
+
|
|
2015
|
+
type PresetScope = "user" | "role" | "global";
|
|
2016
|
+
interface ViewPreset {
|
|
2017
|
+
id: string;
|
|
2018
|
+
bookmark: string | null;
|
|
2019
|
+
collection: string;
|
|
2020
|
+
userId: string | null;
|
|
2021
|
+
roleId: string | null;
|
|
2022
|
+
layout: string;
|
|
2023
|
+
layoutQuery: Record<string, unknown>;
|
|
2024
|
+
layoutOptions: Record<string, unknown>;
|
|
2025
|
+
search: string | null;
|
|
2026
|
+
filter: Record<string, unknown>;
|
|
2027
|
+
icon: string | null;
|
|
2028
|
+
color: string | null;
|
|
2029
|
+
refreshInterval: number;
|
|
2030
|
+
}
|
|
2031
|
+
interface ScopedViewPreset extends ViewPreset {
|
|
2032
|
+
sourceScope: PresetScope;
|
|
2033
|
+
roleDistance?: number;
|
|
2034
|
+
}
|
|
2035
|
+
declare function getEffectivePreset(collection: string): (client: LumiClient) => Promise<ScopedViewPreset | null>;
|
|
2036
|
+
declare function listBookmarks(collection: string): (client: LumiClient) => Promise<ScopedViewPreset[]>;
|
|
2037
|
+
/** Save (or overwrite) the acting user's default view for a collection. */
|
|
2038
|
+
declare function saveUserView(input: Partial<ViewPreset> & {
|
|
2039
|
+
collection: string;
|
|
2040
|
+
}): (client: LumiClient) => Promise<ViewPreset>;
|
|
2041
|
+
declare function createBookmark(input: Partial<ViewPreset> & {
|
|
2042
|
+
collection: string;
|
|
2043
|
+
bookmark: string;
|
|
2044
|
+
}): (client: LumiClient) => Promise<ViewPreset>;
|
|
2045
|
+
declare function updateBookmark(id: string, input: Partial<ViewPreset>): (client: LumiClient) => Promise<ViewPreset>;
|
|
2046
|
+
declare function deleteBookmark(id: string): (client: LumiClient) => Promise<null>;
|
|
2047
|
+
interface MediaTransform {
|
|
2048
|
+
width?: number;
|
|
2049
|
+
height?: number;
|
|
2050
|
+
format?: "webp" | "avif" | "jpeg" | "png";
|
|
2051
|
+
quality?: number;
|
|
2052
|
+
fit?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Build a delivery URL for a media asset, optionally with a transform. Pass a
|
|
2056
|
+
* `MediaTransform` for inline params, or `{ preset }` to reference a named
|
|
2057
|
+
* server-side preset. Returns a path relative to the API base — the SDK client
|
|
2058
|
+
* resolves it against its configured URL.
|
|
2059
|
+
*/
|
|
2060
|
+
declare function mediaUrl(key: string, transform?: MediaTransform | {
|
|
2061
|
+
preset: string;
|
|
2062
|
+
}, opts?: {
|
|
2063
|
+
sign?: string;
|
|
2064
|
+
}): (client: LumiClient) => string;
|
|
2065
|
+
|
|
1953
2066
|
/**
|
|
1954
2067
|
* Full-text search via `GET /api/v1/search`. Omit `params.collection` for a
|
|
1955
2068
|
* cross-collection (global) search that fans out over every collection of the
|
|
@@ -2082,4 +2195,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
2082
2195
|
*/
|
|
2083
2196
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
2084
2197
|
|
|
2085
|
-
export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createCdcPipeline, createLumiClient, decideAgentApproval, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listCdcPipelines, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
|
2198
|
+
export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type ContentVersion, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
package/dist/index.d.ts
CHANGED
|
@@ -377,6 +377,12 @@ interface ListItemsParams {
|
|
|
377
377
|
limit?: number;
|
|
378
378
|
offset?: number;
|
|
379
379
|
status?: string | null;
|
|
380
|
+
/**
|
|
381
|
+
* Controls whether the server computes the `count(*)` total. `'total_count'`
|
|
382
|
+
* (default) returns `meta.total`; `'none'` skips the extra aggregate query
|
|
383
|
+
* for a cheaper list (e.g. infinite scroll) and omits `meta.total`.
|
|
384
|
+
*/
|
|
385
|
+
meta?: 'total_count' | 'none';
|
|
380
386
|
}
|
|
381
387
|
/** Reserved metadata attributes present on every search hit. */
|
|
382
388
|
interface SearchHitMeta {
|
|
@@ -824,6 +830,38 @@ interface SettingResource {
|
|
|
824
830
|
scope: string;
|
|
825
831
|
updatedAt: string;
|
|
826
832
|
}
|
|
833
|
+
/** A named parallel draft branch of a content item (content-versioning). */
|
|
834
|
+
interface ContentVersion {
|
|
835
|
+
id: string;
|
|
836
|
+
siteId: string;
|
|
837
|
+
itemId: string;
|
|
838
|
+
collectionId: string;
|
|
839
|
+
/** Stable slug, unique per item. */
|
|
840
|
+
key: string;
|
|
841
|
+
/** Human-readable label. */
|
|
842
|
+
name: string;
|
|
843
|
+
/** Snapshot of the item data for this branch. */
|
|
844
|
+
data: Record<string, unknown>;
|
|
845
|
+
/** Hash of main's data at snapshot time — detects divergence before promote. */
|
|
846
|
+
hash: string;
|
|
847
|
+
createdBy: string | null;
|
|
848
|
+
createdAt: string;
|
|
849
|
+
updatedAt: string;
|
|
850
|
+
/** True when main's data changed since this version branched (list only). */
|
|
851
|
+
mainChanged?: boolean;
|
|
852
|
+
}
|
|
853
|
+
/** One changed field between main and a version. */
|
|
854
|
+
interface VersionFieldChange {
|
|
855
|
+
field: string;
|
|
856
|
+
main: unknown;
|
|
857
|
+
version: unknown;
|
|
858
|
+
}
|
|
859
|
+
/** `GET …/versions/:key/compare` payload. */
|
|
860
|
+
interface VersionCompare {
|
|
861
|
+
main: Record<string, unknown>;
|
|
862
|
+
version: Record<string, unknown>;
|
|
863
|
+
changes: VersionFieldChange[];
|
|
864
|
+
}
|
|
827
865
|
/** Origin of a translation-memory entry. */
|
|
828
866
|
type TmSource = "human" | "mt" | "imported";
|
|
829
867
|
/** A stored translation-memory pair for a language pair. */
|
|
@@ -1630,6 +1668,21 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1630
1668
|
releasePin: (id: string, field: string) => Promise<LumiResponse<{
|
|
1631
1669
|
pinnedFields: string[];
|
|
1632
1670
|
}>>;
|
|
1671
|
+
versions: {
|
|
1672
|
+
list: (id: string) => Promise<LumiResponse<ContentVersion[]>>;
|
|
1673
|
+
create: (id: string, input: {
|
|
1674
|
+
key: string;
|
|
1675
|
+
name: string;
|
|
1676
|
+
}) => Promise<LumiResponse<ContentVersion>>;
|
|
1677
|
+
get: (id: string, key: string) => Promise<LumiResponse<ContentVersion>>;
|
|
1678
|
+
update: (id: string, key: string, patch: {
|
|
1679
|
+
data?: Record<string, unknown>;
|
|
1680
|
+
name?: string;
|
|
1681
|
+
}) => Promise<LumiResponse<ContentVersion>>;
|
|
1682
|
+
delete: (id: string, key: string) => Promise<LumiResponse<null>>;
|
|
1683
|
+
compare: (id: string, key: string) => Promise<LumiResponse<VersionCompare>>;
|
|
1684
|
+
promote: (id: string, key: string) => Promise<LumiResponse<ItemRow<TSchema[TName] extends Record<string, unknown> ? TSchema[TName] : Record<string, unknown>>>>;
|
|
1685
|
+
};
|
|
1633
1686
|
};
|
|
1634
1687
|
roles: {
|
|
1635
1688
|
list: () => Promise<LumiResponse<RoleResource[]>>;
|
|
@@ -1950,6 +2003,66 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1950
2003
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1951
2004
|
};
|
|
1952
2005
|
|
|
2006
|
+
/**
|
|
2007
|
+
* SDK commands for view presets (presets-inheritance) and media transform URLs
|
|
2008
|
+
* (image-transform-dsl). Each is a command factory `(client) => Promise<T>`
|
|
2009
|
+
* used with `client.request(...)`, matching the rest of the REST module.
|
|
2010
|
+
*
|
|
2011
|
+
* Content-version and translation-memory helpers live in the core SDK
|
|
2012
|
+
* (`client.items(...).versions` and `client.tm`).
|
|
2013
|
+
*/
|
|
2014
|
+
|
|
2015
|
+
type PresetScope = "user" | "role" | "global";
|
|
2016
|
+
interface ViewPreset {
|
|
2017
|
+
id: string;
|
|
2018
|
+
bookmark: string | null;
|
|
2019
|
+
collection: string;
|
|
2020
|
+
userId: string | null;
|
|
2021
|
+
roleId: string | null;
|
|
2022
|
+
layout: string;
|
|
2023
|
+
layoutQuery: Record<string, unknown>;
|
|
2024
|
+
layoutOptions: Record<string, unknown>;
|
|
2025
|
+
search: string | null;
|
|
2026
|
+
filter: Record<string, unknown>;
|
|
2027
|
+
icon: string | null;
|
|
2028
|
+
color: string | null;
|
|
2029
|
+
refreshInterval: number;
|
|
2030
|
+
}
|
|
2031
|
+
interface ScopedViewPreset extends ViewPreset {
|
|
2032
|
+
sourceScope: PresetScope;
|
|
2033
|
+
roleDistance?: number;
|
|
2034
|
+
}
|
|
2035
|
+
declare function getEffectivePreset(collection: string): (client: LumiClient) => Promise<ScopedViewPreset | null>;
|
|
2036
|
+
declare function listBookmarks(collection: string): (client: LumiClient) => Promise<ScopedViewPreset[]>;
|
|
2037
|
+
/** Save (or overwrite) the acting user's default view for a collection. */
|
|
2038
|
+
declare function saveUserView(input: Partial<ViewPreset> & {
|
|
2039
|
+
collection: string;
|
|
2040
|
+
}): (client: LumiClient) => Promise<ViewPreset>;
|
|
2041
|
+
declare function createBookmark(input: Partial<ViewPreset> & {
|
|
2042
|
+
collection: string;
|
|
2043
|
+
bookmark: string;
|
|
2044
|
+
}): (client: LumiClient) => Promise<ViewPreset>;
|
|
2045
|
+
declare function updateBookmark(id: string, input: Partial<ViewPreset>): (client: LumiClient) => Promise<ViewPreset>;
|
|
2046
|
+
declare function deleteBookmark(id: string): (client: LumiClient) => Promise<null>;
|
|
2047
|
+
interface MediaTransform {
|
|
2048
|
+
width?: number;
|
|
2049
|
+
height?: number;
|
|
2050
|
+
format?: "webp" | "avif" | "jpeg" | "png";
|
|
2051
|
+
quality?: number;
|
|
2052
|
+
fit?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Build a delivery URL for a media asset, optionally with a transform. Pass a
|
|
2056
|
+
* `MediaTransform` for inline params, or `{ preset }` to reference a named
|
|
2057
|
+
* server-side preset. Returns a path relative to the API base — the SDK client
|
|
2058
|
+
* resolves it against its configured URL.
|
|
2059
|
+
*/
|
|
2060
|
+
declare function mediaUrl(key: string, transform?: MediaTransform | {
|
|
2061
|
+
preset: string;
|
|
2062
|
+
}, opts?: {
|
|
2063
|
+
sign?: string;
|
|
2064
|
+
}): (client: LumiClient) => string;
|
|
2065
|
+
|
|
1953
2066
|
/**
|
|
1954
2067
|
* Full-text search via `GET /api/v1/search`. Omit `params.collection` for a
|
|
1955
2068
|
* cross-collection (global) search that fans out over every collection of the
|
|
@@ -2082,4 +2195,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
2082
2195
|
*/
|
|
2083
2196
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
2084
2197
|
|
|
2085
|
-
export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createCdcPipeline, createLumiClient, decideAgentApproval, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listCdcPipelines, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
|
2198
|
+
export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type ContentVersion, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
package/dist/index.js
CHANGED
|
@@ -586,7 +586,35 @@ function legacyRest() {
|
|
|
586
586
|
releasePin: (id, field) => client.rawRequest(
|
|
587
587
|
`${base}/${id}/pins/${encodeURIComponent(field)}`,
|
|
588
588
|
{ method: "DELETE" }
|
|
589
|
-
)
|
|
589
|
+
),
|
|
590
|
+
// Content versions — named parallel draft branches (content-versioning).
|
|
591
|
+
versions: {
|
|
592
|
+
list: (id) => client.rawRequest(`${base}/${id}/versions`),
|
|
593
|
+
create: (id, input) => client.rawRequest(`${base}/${id}/versions`, {
|
|
594
|
+
method: "POST",
|
|
595
|
+
body: JSON.stringify(input)
|
|
596
|
+
}),
|
|
597
|
+
get: (id, key) => client.rawRequest(
|
|
598
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`
|
|
599
|
+
),
|
|
600
|
+
update: (id, key, patch) => client.rawRequest(
|
|
601
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`,
|
|
602
|
+
{ method: "PATCH", body: JSON.stringify(patch) }
|
|
603
|
+
),
|
|
604
|
+
delete: (id, key) => client.rawRequest(
|
|
605
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}`,
|
|
606
|
+
{ method: "DELETE" }
|
|
607
|
+
),
|
|
608
|
+
compare: (id, key) => client.rawRequest(
|
|
609
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}/compare`
|
|
610
|
+
),
|
|
611
|
+
// Returns the promoted item; `meta.mainDiverged` flags that main
|
|
612
|
+
// changed after the branch was cut (review advised).
|
|
613
|
+
promote: (id, key) => client.rawRequest(
|
|
614
|
+
`${base}/${id}/versions/${encodeURIComponent(key)}/promote`,
|
|
615
|
+
{ method: "POST" }
|
|
616
|
+
)
|
|
617
|
+
}
|
|
590
618
|
};
|
|
591
619
|
}
|
|
592
620
|
const roles = {
|
|
@@ -1020,6 +1048,79 @@ function legacyRest() {
|
|
|
1020
1048
|
};
|
|
1021
1049
|
}
|
|
1022
1050
|
|
|
1051
|
+
// src/rest/gaps.ts
|
|
1052
|
+
function getEffectivePreset(collection) {
|
|
1053
|
+
return async (client) => {
|
|
1054
|
+
const res = await client.rawRequest(
|
|
1055
|
+
`/api/v1/presets/effective?collection=${encodeURIComponent(collection)}`
|
|
1056
|
+
);
|
|
1057
|
+
return res.data;
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
function listBookmarks(collection) {
|
|
1061
|
+
return async (client) => {
|
|
1062
|
+
const res = await client.rawRequest(
|
|
1063
|
+
`/api/v1/presets/bookmarks?collection=${encodeURIComponent(collection)}`
|
|
1064
|
+
);
|
|
1065
|
+
return res.data;
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function saveUserView(input) {
|
|
1069
|
+
return async (client) => {
|
|
1070
|
+
const res = await client.rawRequest("/api/v1/presets", {
|
|
1071
|
+
method: "POST",
|
|
1072
|
+
body: JSON.stringify({ ...input, bookmark: null })
|
|
1073
|
+
});
|
|
1074
|
+
return res.data;
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
function createBookmark(input) {
|
|
1078
|
+
return async (client) => {
|
|
1079
|
+
const res = await client.rawRequest("/api/v1/presets", {
|
|
1080
|
+
method: "POST",
|
|
1081
|
+
body: JSON.stringify(input)
|
|
1082
|
+
});
|
|
1083
|
+
return res.data;
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
function updateBookmark(id, input) {
|
|
1087
|
+
return async (client) => {
|
|
1088
|
+
const res = await client.rawRequest(`/api/v1/presets/${encodeURIComponent(id)}`, {
|
|
1089
|
+
method: "PATCH",
|
|
1090
|
+
body: JSON.stringify(input)
|
|
1091
|
+
});
|
|
1092
|
+
return res.data;
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function deleteBookmark(id) {
|
|
1096
|
+
return async (client) => {
|
|
1097
|
+
const res = await client.rawRequest(`/api/v1/presets/${encodeURIComponent(id)}`, {
|
|
1098
|
+
method: "DELETE"
|
|
1099
|
+
});
|
|
1100
|
+
return res.data;
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
function mediaUrl(key, transform, opts) {
|
|
1104
|
+
return (client) => {
|
|
1105
|
+
const base = client.url.replace(/\/$/, "");
|
|
1106
|
+
const path = `/api/v1/media/${key.split("/").map(encodeURIComponent).join("/")}`;
|
|
1107
|
+
if (!transform) return `${base}${path}`;
|
|
1108
|
+
const qs = new URLSearchParams();
|
|
1109
|
+
if ("preset" in transform) {
|
|
1110
|
+
qs.set("preset", transform.preset);
|
|
1111
|
+
} else {
|
|
1112
|
+
if (transform.width !== void 0) qs.set("width", String(transform.width));
|
|
1113
|
+
if (transform.height !== void 0) qs.set("height", String(transform.height));
|
|
1114
|
+
if (transform.format) qs.set("format", transform.format);
|
|
1115
|
+
if (transform.quality !== void 0) qs.set("quality", String(transform.quality));
|
|
1116
|
+
if (transform.fit) qs.set("fit", transform.fit);
|
|
1117
|
+
if (opts?.sign) qs.set("sig", opts.sign);
|
|
1118
|
+
}
|
|
1119
|
+
const query = qs.toString();
|
|
1120
|
+
return query ? `${base}${path}?${query}` : `${base}${path}`;
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1023
1124
|
// src/rest/index.ts
|
|
1024
1125
|
function search(query, params) {
|
|
1025
1126
|
return async (client) => {
|
|
@@ -1043,6 +1144,7 @@ function readItems(collection, params) {
|
|
|
1043
1144
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
1044
1145
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
1045
1146
|
if (params?.status) qs.set("status", params.status);
|
|
1147
|
+
if (params?.meta) qs.set("meta", params.meta);
|
|
1046
1148
|
const s = qs.toString();
|
|
1047
1149
|
const query = s ? `?${s}` : "";
|
|
1048
1150
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1493,9 +1595,11 @@ export {
|
|
|
1493
1595
|
checkCdcPipelineHealth,
|
|
1494
1596
|
createAgentArtifact,
|
|
1495
1597
|
createAgentGoal,
|
|
1598
|
+
createBookmark,
|
|
1496
1599
|
createCdcPipeline,
|
|
1497
1600
|
createLumiClient,
|
|
1498
1601
|
decideAgentApproval,
|
|
1602
|
+
deleteBookmark,
|
|
1499
1603
|
deleteCdcPipeline,
|
|
1500
1604
|
deployCdc,
|
|
1501
1605
|
dryRunAccessImport,
|
|
@@ -1504,6 +1608,7 @@ export {
|
|
|
1504
1608
|
extractSeo,
|
|
1505
1609
|
generateAgentApp,
|
|
1506
1610
|
generateTypes,
|
|
1611
|
+
getEffectivePreset,
|
|
1507
1612
|
graphql,
|
|
1508
1613
|
importAccessManifest,
|
|
1509
1614
|
jsonLdScript,
|
|
@@ -1513,7 +1618,9 @@ export {
|
|
|
1513
1618
|
listAgentGoals,
|
|
1514
1619
|
listAgentRuns,
|
|
1515
1620
|
listAgentTools,
|
|
1621
|
+
listBookmarks,
|
|
1516
1622
|
listCdcPipelines,
|
|
1623
|
+
mediaUrl,
|
|
1517
1624
|
publishAgentArtifact,
|
|
1518
1625
|
readAgentMemoryContext,
|
|
1519
1626
|
readCdcPipeline,
|
|
@@ -1524,10 +1631,12 @@ export {
|
|
|
1524
1631
|
retryAgentRun,
|
|
1525
1632
|
rollbackAgentArtifact,
|
|
1526
1633
|
rollbackCdcDeployment,
|
|
1634
|
+
saveUserView,
|
|
1527
1635
|
search,
|
|
1528
1636
|
startCdcPipeline,
|
|
1529
1637
|
stopCdcPipeline,
|
|
1530
1638
|
toNextMetadata,
|
|
1639
|
+
updateBookmark,
|
|
1531
1640
|
updateCdcPipeline,
|
|
1532
1641
|
validateCdcDeploymentEnv,
|
|
1533
1642
|
writeAgentMemory
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumibase/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "LumiBase JS SDK (REST + WebSocket) + typegen core. Isomorphic ESM.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.5.1",
|
|
25
25
|
"typescript": "^5.6.2",
|
|
26
|
-
"vitest": "^
|
|
26
|
+
"vitest": "^4.1.10"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|