@lumibase/sdk 0.11.0 → 0.13.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 +52 -2
- package/dist/index.d.cts +113 -2
- package/dist/index.d.ts +113 -2
- package/dist/index.js +51 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
retryAgentRun: () => retryAgentRun,
|
|
58
58
|
rollbackAgentArtifact: () => rollbackAgentArtifact,
|
|
59
59
|
rollbackCdcDeployment: () => rollbackCdcDeployment,
|
|
60
|
+
search: () => search,
|
|
60
61
|
startCdcPipeline: () => startCdcPipeline,
|
|
61
62
|
stopCdcPipeline: () => stopCdcPipeline,
|
|
62
63
|
toNextMetadata: () => toNextMetadata,
|
|
@@ -454,7 +455,6 @@ function legacyRest() {
|
|
|
454
455
|
if (params.offset !== void 0)
|
|
455
456
|
qs.set("offset", String(params.offset));
|
|
456
457
|
if (params.status) qs.set("status", params.status);
|
|
457
|
-
if (params.search) qs.set("search", params.search);
|
|
458
458
|
const s = qs.toString();
|
|
459
459
|
return s ? `?${s}` : "";
|
|
460
460
|
}
|
|
@@ -768,6 +768,41 @@ function legacyRest() {
|
|
|
768
768
|
method: "POST"
|
|
769
769
|
})
|
|
770
770
|
};
|
|
771
|
+
const me = {
|
|
772
|
+
getPreferences: () => client.rawRequest("/api/v1/me/preferences"),
|
|
773
|
+
updatePreferences: (patch) => client.rawRequest("/api/v1/me/preferences", {
|
|
774
|
+
method: "PATCH",
|
|
775
|
+
body: JSON.stringify(patch)
|
|
776
|
+
})
|
|
777
|
+
};
|
|
778
|
+
const deployments = {
|
|
779
|
+
targets: {
|
|
780
|
+
list: () => client.rawRequest("/api/v1/deployments/targets"),
|
|
781
|
+
create: (input) => client.rawRequest("/api/v1/deployments/targets", {
|
|
782
|
+
method: "POST",
|
|
783
|
+
body: JSON.stringify(input)
|
|
784
|
+
}),
|
|
785
|
+
update: (id, patch) => client.rawRequest(`/api/v1/deployments/targets/${id}`, {
|
|
786
|
+
method: "PATCH",
|
|
787
|
+
body: JSON.stringify(patch)
|
|
788
|
+
}),
|
|
789
|
+
delete: (id) => client.rawRequest(`/api/v1/deployments/targets/${id}`, { method: "DELETE" }),
|
|
790
|
+
deploy: (id, input = {}) => client.rawRequest(`/api/v1/deployments/targets/${id}/deploy`, {
|
|
791
|
+
method: "POST",
|
|
792
|
+
body: JSON.stringify(input)
|
|
793
|
+
})
|
|
794
|
+
},
|
|
795
|
+
list: (params) => {
|
|
796
|
+
const qs = new URLSearchParams();
|
|
797
|
+
if (params?.targetId) qs.set("targetId", params.targetId);
|
|
798
|
+
if (params?.status) qs.set("status", params.status);
|
|
799
|
+
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
800
|
+
return client.rawRequest(`/api/v1/deployments${suffix}`);
|
|
801
|
+
},
|
|
802
|
+
get: (id) => client.rawRequest(`/api/v1/deployments/${id}`),
|
|
803
|
+
logs: (id) => client.rawRequest(`/api/v1/deployments/${id}/logs`),
|
|
804
|
+
refresh: (id) => client.rawRequest(`/api/v1/deployments/${id}/refresh`, { method: "POST" })
|
|
805
|
+
};
|
|
771
806
|
return {
|
|
772
807
|
schema,
|
|
773
808
|
items,
|
|
@@ -776,6 +811,7 @@ function legacyRest() {
|
|
|
776
811
|
access,
|
|
777
812
|
apiKeys,
|
|
778
813
|
shares,
|
|
814
|
+
me,
|
|
779
815
|
permissions,
|
|
780
816
|
presets,
|
|
781
817
|
translations,
|
|
@@ -788,6 +824,7 @@ function legacyRest() {
|
|
|
788
824
|
webhooks,
|
|
789
825
|
activity,
|
|
790
826
|
extensions,
|
|
827
|
+
deployments,
|
|
791
828
|
realtime: {
|
|
792
829
|
/**
|
|
793
830
|
* Create a RealtimeClient for the current site.
|
|
@@ -826,6 +863,19 @@ function legacyRest() {
|
|
|
826
863
|
}
|
|
827
864
|
|
|
828
865
|
// src/rest/index.ts
|
|
866
|
+
function search(query, params) {
|
|
867
|
+
return async (client) => {
|
|
868
|
+
const qs = new URLSearchParams();
|
|
869
|
+
qs.set("q", query);
|
|
870
|
+
if (params?.collection) qs.set("collection", params.collection);
|
|
871
|
+
if (params?.filter) qs.set("filter", params.filter);
|
|
872
|
+
if (params?.sort?.length) qs.set("sort", params.sort.join(","));
|
|
873
|
+
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
874
|
+
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
875
|
+
const res = await client.rawRequest(`/api/v1/search?${qs.toString()}`);
|
|
876
|
+
return res;
|
|
877
|
+
};
|
|
878
|
+
}
|
|
829
879
|
function readItems(collection, params) {
|
|
830
880
|
return async (client) => {
|
|
831
881
|
const qs = new URLSearchParams();
|
|
@@ -835,7 +885,6 @@ function readItems(collection, params) {
|
|
|
835
885
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
836
886
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
837
887
|
if (params?.status) qs.set("status", params.status);
|
|
838
|
-
if (params?.search) qs.set("search", params.search);
|
|
839
888
|
const s = qs.toString();
|
|
840
889
|
const query = s ? `?${s}` : "";
|
|
841
890
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1317,6 +1366,7 @@ function jsonLdScript(item) {
|
|
|
1317
1366
|
retryAgentRun,
|
|
1318
1367
|
rollbackAgentArtifact,
|
|
1319
1368
|
rollbackCdcDeployment,
|
|
1369
|
+
search,
|
|
1320
1370
|
startCdcPipeline,
|
|
1321
1371
|
stopCdcPipeline,
|
|
1322
1372
|
toNextMetadata,
|
package/dist/index.d.cts
CHANGED
|
@@ -376,7 +376,42 @@ interface ListItemsParams {
|
|
|
376
376
|
limit?: number;
|
|
377
377
|
offset?: number;
|
|
378
378
|
status?: string | null;
|
|
379
|
-
|
|
379
|
+
}
|
|
380
|
+
/** Reserved metadata attributes present on every search hit. */
|
|
381
|
+
interface SearchHitMeta {
|
|
382
|
+
/** Which collection the hit belongs to. */
|
|
383
|
+
_collection?: string;
|
|
384
|
+
/** Human-readable display title derived at index time. */
|
|
385
|
+
_title?: string;
|
|
386
|
+
/** Item update timestamp, if available. */
|
|
387
|
+
_updatedAt?: string | number;
|
|
388
|
+
}
|
|
389
|
+
type SearchHit = SearchHitMeta & Record<string, unknown>;
|
|
390
|
+
interface SearchParams {
|
|
391
|
+
/** Restrict to one collection. Omit for cross-collection (global) search. */
|
|
392
|
+
collection?: string;
|
|
393
|
+
/** MeiliSearch filter expression. */
|
|
394
|
+
filter?: string;
|
|
395
|
+
/** Sort directives, e.g. `["_updatedAt:desc"]`. */
|
|
396
|
+
sort?: string[];
|
|
397
|
+
limit?: number;
|
|
398
|
+
offset?: number;
|
|
399
|
+
}
|
|
400
|
+
interface SearchResponse {
|
|
401
|
+
data: SearchHit[];
|
|
402
|
+
meta: {
|
|
403
|
+
query: string;
|
|
404
|
+
limit: number;
|
|
405
|
+
offset: number;
|
|
406
|
+
totalHits?: number;
|
|
407
|
+
processingTimeMs?: number;
|
|
408
|
+
/** Single-collection search: the collection searched. */
|
|
409
|
+
collection?: string;
|
|
410
|
+
/** Cross-collection search: the collections fanned out over. */
|
|
411
|
+
collections?: string[];
|
|
412
|
+
/** Cross-collection search: true when the collection set was capped. */
|
|
413
|
+
truncated?: boolean;
|
|
414
|
+
};
|
|
380
415
|
}
|
|
381
416
|
interface ItemRow<TData extends Record<string, unknown> = Record<string, unknown>> {
|
|
382
417
|
id: string;
|
|
@@ -1170,6 +1205,37 @@ interface CreateSCIMTokenParams {
|
|
|
1170
1205
|
/** Number of days until expiry. Default: 90. Max: 365. */
|
|
1171
1206
|
lifespanDays?: number;
|
|
1172
1207
|
}
|
|
1208
|
+
/** Deployment integrations (spec: deployment-integrations). Token never serialized. */
|
|
1209
|
+
interface DeploymentTargetResource {
|
|
1210
|
+
id: string;
|
|
1211
|
+
provider: "vercel" | "netlify";
|
|
1212
|
+
name: string;
|
|
1213
|
+
projectId: string;
|
|
1214
|
+
defaultBranch: string | null;
|
|
1215
|
+
productionUrl: string | null;
|
|
1216
|
+
status: string;
|
|
1217
|
+
createdAt: string;
|
|
1218
|
+
updatedAt: string;
|
|
1219
|
+
}
|
|
1220
|
+
interface DeploymentResource {
|
|
1221
|
+
id: string;
|
|
1222
|
+
siteId: string;
|
|
1223
|
+
targetId: string;
|
|
1224
|
+
provider: string;
|
|
1225
|
+
providerDeploymentId: string | null;
|
|
1226
|
+
status: "queued" | "building" | "ready" | "error" | "canceled";
|
|
1227
|
+
branch: string | null;
|
|
1228
|
+
commitSha: string | null;
|
|
1229
|
+
commitMessage: string | null;
|
|
1230
|
+
url: string | null;
|
|
1231
|
+
triggeredBy: string | null;
|
|
1232
|
+
triggerSource: "manual" | "auto" | "agent";
|
|
1233
|
+
errorMessage: string | null;
|
|
1234
|
+
logExcerpt: string | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
updatedAt: string;
|
|
1237
|
+
completedAt: string | null;
|
|
1238
|
+
}
|
|
1173
1239
|
|
|
1174
1240
|
/**
|
|
1175
1241
|
* LumiBase JS SDK
|
|
@@ -1319,6 +1385,19 @@ declare class RealtimeClient {
|
|
|
1319
1385
|
private _sendRaw;
|
|
1320
1386
|
}
|
|
1321
1387
|
|
|
1388
|
+
/**
|
|
1389
|
+
* Loose shape for `users.preferences`. The CMS validates the strict schema
|
|
1390
|
+
* (`@lumibase/shared/schemas#UserPreferences`); the SDK stays decoupled and
|
|
1391
|
+
* passes the blob through, so callers keep full type-safety on the Studio side
|
|
1392
|
+
* where the shared schema is imported.
|
|
1393
|
+
*/
|
|
1394
|
+
interface UserPreferencesPayload {
|
|
1395
|
+
language?: string;
|
|
1396
|
+
theme?: "auto" | "light" | "dark";
|
|
1397
|
+
timezone?: string;
|
|
1398
|
+
keybindings?: Record<string, string>;
|
|
1399
|
+
[key: string]: unknown;
|
|
1400
|
+
}
|
|
1322
1401
|
declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClient<TSchema>) => {
|
|
1323
1402
|
schema: {
|
|
1324
1403
|
collections: {
|
|
@@ -1479,6 +1558,10 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1479
1558
|
create: (input: ShareCreateInput) => Promise<LumiResponse<ShareSecretResult>>;
|
|
1480
1559
|
revoke: (id: string) => Promise<LumiResponse<ShareResource>>;
|
|
1481
1560
|
};
|
|
1561
|
+
me: {
|
|
1562
|
+
getPreferences: () => Promise<LumiResponse<UserPreferencesPayload>>;
|
|
1563
|
+
updatePreferences: (patch: UserPreferencesPayload) => Promise<LumiResponse<UserPreferencesPayload>>;
|
|
1564
|
+
};
|
|
1482
1565
|
permissions: {
|
|
1483
1566
|
me: () => Promise<LumiResponse<PermissionBundle>>;
|
|
1484
1567
|
check: (input: {
|
|
@@ -1598,6 +1681,27 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1598
1681
|
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<ExtensionResource>>;
|
|
1599
1682
|
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1600
1683
|
};
|
|
1684
|
+
deployments: {
|
|
1685
|
+
targets: {
|
|
1686
|
+
list: () => Promise<LumiResponse<DeploymentTargetResource[]>>;
|
|
1687
|
+
create: (input: Record<string, unknown>) => Promise<LumiResponse<DeploymentTargetResource>>;
|
|
1688
|
+
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<DeploymentTargetResource>>;
|
|
1689
|
+
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1690
|
+
deploy: (id: string, input?: {
|
|
1691
|
+
branch?: string;
|
|
1692
|
+
reason?: string;
|
|
1693
|
+
}) => Promise<LumiResponse<DeploymentResource>>;
|
|
1694
|
+
};
|
|
1695
|
+
list: (params?: {
|
|
1696
|
+
targetId?: string;
|
|
1697
|
+
status?: string;
|
|
1698
|
+
}) => Promise<LumiResponse<DeploymentResource[]>>;
|
|
1699
|
+
get: (id: string) => Promise<LumiResponse<DeploymentResource>>;
|
|
1700
|
+
logs: (id: string) => Promise<LumiResponse<{
|
|
1701
|
+
log: string;
|
|
1702
|
+
}>>;
|
|
1703
|
+
refresh: (id: string) => Promise<LumiResponse<DeploymentResource>>;
|
|
1704
|
+
};
|
|
1601
1705
|
realtime: {
|
|
1602
1706
|
/**
|
|
1603
1707
|
* Create a RealtimeClient for the current site.
|
|
@@ -1625,6 +1729,13 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1625
1729
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1626
1730
|
};
|
|
1627
1731
|
|
|
1732
|
+
/**
|
|
1733
|
+
* Full-text search via `GET /api/v1/search`. Omit `params.collection` for a
|
|
1734
|
+
* cross-collection (global) search that fans out over every collection of the
|
|
1735
|
+
* current site; pass it to scope to one collection. Diacritics-insensitive
|
|
1736
|
+
* matching (e.g. "ha noi" → "Hà Nội") is handled server-side by MeiliSearch.
|
|
1737
|
+
*/
|
|
1738
|
+
declare function search<Schema extends DefaultSchema>(query: string, params?: SearchParams): (client: LumiClient<Schema>) => Promise<SearchResponse>;
|
|
1628
1739
|
declare function readItems<Schema extends DefaultSchema, Collection extends keyof Schema & string, Row = ItemRow<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>, ListResp = ListItemsResponse<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>>(collection: Collection, params?: ListItemsParams): (client: LumiClient<Schema>) => Promise<ListResp>;
|
|
1629
1740
|
declare function readItem<Schema extends DefaultSchema, Collection extends keyof Schema & string, Row = ItemRow<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>>(collection: Collection, id: string, fields?: string[]): (client: LumiClient<Schema>) => Promise<Row>;
|
|
1630
1741
|
declare function exportAccessManifest(): (client: LumiClient) => Promise<AccessExportManifest>;
|
|
@@ -1750,4 +1861,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
1750
1861
|
*/
|
|
1751
1862
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
1752
1863
|
|
|
1753
|
-
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, 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 CollectionInput, type CollectionResource, type CompiledPermission, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, 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 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 SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StorageMode, type TeamMemberResource, type TeamResource, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UserResource, 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, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
|
1864
|
+
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, 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 CollectionInput, type CollectionResource, type CompiledPermission, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, 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 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 StorageMode, type TeamMemberResource, type TeamResource, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UserPreferencesPayload, type UserResource, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -376,7 +376,42 @@ interface ListItemsParams {
|
|
|
376
376
|
limit?: number;
|
|
377
377
|
offset?: number;
|
|
378
378
|
status?: string | null;
|
|
379
|
-
|
|
379
|
+
}
|
|
380
|
+
/** Reserved metadata attributes present on every search hit. */
|
|
381
|
+
interface SearchHitMeta {
|
|
382
|
+
/** Which collection the hit belongs to. */
|
|
383
|
+
_collection?: string;
|
|
384
|
+
/** Human-readable display title derived at index time. */
|
|
385
|
+
_title?: string;
|
|
386
|
+
/** Item update timestamp, if available. */
|
|
387
|
+
_updatedAt?: string | number;
|
|
388
|
+
}
|
|
389
|
+
type SearchHit = SearchHitMeta & Record<string, unknown>;
|
|
390
|
+
interface SearchParams {
|
|
391
|
+
/** Restrict to one collection. Omit for cross-collection (global) search. */
|
|
392
|
+
collection?: string;
|
|
393
|
+
/** MeiliSearch filter expression. */
|
|
394
|
+
filter?: string;
|
|
395
|
+
/** Sort directives, e.g. `["_updatedAt:desc"]`. */
|
|
396
|
+
sort?: string[];
|
|
397
|
+
limit?: number;
|
|
398
|
+
offset?: number;
|
|
399
|
+
}
|
|
400
|
+
interface SearchResponse {
|
|
401
|
+
data: SearchHit[];
|
|
402
|
+
meta: {
|
|
403
|
+
query: string;
|
|
404
|
+
limit: number;
|
|
405
|
+
offset: number;
|
|
406
|
+
totalHits?: number;
|
|
407
|
+
processingTimeMs?: number;
|
|
408
|
+
/** Single-collection search: the collection searched. */
|
|
409
|
+
collection?: string;
|
|
410
|
+
/** Cross-collection search: the collections fanned out over. */
|
|
411
|
+
collections?: string[];
|
|
412
|
+
/** Cross-collection search: true when the collection set was capped. */
|
|
413
|
+
truncated?: boolean;
|
|
414
|
+
};
|
|
380
415
|
}
|
|
381
416
|
interface ItemRow<TData extends Record<string, unknown> = Record<string, unknown>> {
|
|
382
417
|
id: string;
|
|
@@ -1170,6 +1205,37 @@ interface CreateSCIMTokenParams {
|
|
|
1170
1205
|
/** Number of days until expiry. Default: 90. Max: 365. */
|
|
1171
1206
|
lifespanDays?: number;
|
|
1172
1207
|
}
|
|
1208
|
+
/** Deployment integrations (spec: deployment-integrations). Token never serialized. */
|
|
1209
|
+
interface DeploymentTargetResource {
|
|
1210
|
+
id: string;
|
|
1211
|
+
provider: "vercel" | "netlify";
|
|
1212
|
+
name: string;
|
|
1213
|
+
projectId: string;
|
|
1214
|
+
defaultBranch: string | null;
|
|
1215
|
+
productionUrl: string | null;
|
|
1216
|
+
status: string;
|
|
1217
|
+
createdAt: string;
|
|
1218
|
+
updatedAt: string;
|
|
1219
|
+
}
|
|
1220
|
+
interface DeploymentResource {
|
|
1221
|
+
id: string;
|
|
1222
|
+
siteId: string;
|
|
1223
|
+
targetId: string;
|
|
1224
|
+
provider: string;
|
|
1225
|
+
providerDeploymentId: string | null;
|
|
1226
|
+
status: "queued" | "building" | "ready" | "error" | "canceled";
|
|
1227
|
+
branch: string | null;
|
|
1228
|
+
commitSha: string | null;
|
|
1229
|
+
commitMessage: string | null;
|
|
1230
|
+
url: string | null;
|
|
1231
|
+
triggeredBy: string | null;
|
|
1232
|
+
triggerSource: "manual" | "auto" | "agent";
|
|
1233
|
+
errorMessage: string | null;
|
|
1234
|
+
logExcerpt: string | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
updatedAt: string;
|
|
1237
|
+
completedAt: string | null;
|
|
1238
|
+
}
|
|
1173
1239
|
|
|
1174
1240
|
/**
|
|
1175
1241
|
* LumiBase JS SDK
|
|
@@ -1319,6 +1385,19 @@ declare class RealtimeClient {
|
|
|
1319
1385
|
private _sendRaw;
|
|
1320
1386
|
}
|
|
1321
1387
|
|
|
1388
|
+
/**
|
|
1389
|
+
* Loose shape for `users.preferences`. The CMS validates the strict schema
|
|
1390
|
+
* (`@lumibase/shared/schemas#UserPreferences`); the SDK stays decoupled and
|
|
1391
|
+
* passes the blob through, so callers keep full type-safety on the Studio side
|
|
1392
|
+
* where the shared schema is imported.
|
|
1393
|
+
*/
|
|
1394
|
+
interface UserPreferencesPayload {
|
|
1395
|
+
language?: string;
|
|
1396
|
+
theme?: "auto" | "light" | "dark";
|
|
1397
|
+
timezone?: string;
|
|
1398
|
+
keybindings?: Record<string, string>;
|
|
1399
|
+
[key: string]: unknown;
|
|
1400
|
+
}
|
|
1322
1401
|
declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClient<TSchema>) => {
|
|
1323
1402
|
schema: {
|
|
1324
1403
|
collections: {
|
|
@@ -1479,6 +1558,10 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1479
1558
|
create: (input: ShareCreateInput) => Promise<LumiResponse<ShareSecretResult>>;
|
|
1480
1559
|
revoke: (id: string) => Promise<LumiResponse<ShareResource>>;
|
|
1481
1560
|
};
|
|
1561
|
+
me: {
|
|
1562
|
+
getPreferences: () => Promise<LumiResponse<UserPreferencesPayload>>;
|
|
1563
|
+
updatePreferences: (patch: UserPreferencesPayload) => Promise<LumiResponse<UserPreferencesPayload>>;
|
|
1564
|
+
};
|
|
1482
1565
|
permissions: {
|
|
1483
1566
|
me: () => Promise<LumiResponse<PermissionBundle>>;
|
|
1484
1567
|
check: (input: {
|
|
@@ -1598,6 +1681,27 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1598
1681
|
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<ExtensionResource>>;
|
|
1599
1682
|
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1600
1683
|
};
|
|
1684
|
+
deployments: {
|
|
1685
|
+
targets: {
|
|
1686
|
+
list: () => Promise<LumiResponse<DeploymentTargetResource[]>>;
|
|
1687
|
+
create: (input: Record<string, unknown>) => Promise<LumiResponse<DeploymentTargetResource>>;
|
|
1688
|
+
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<DeploymentTargetResource>>;
|
|
1689
|
+
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1690
|
+
deploy: (id: string, input?: {
|
|
1691
|
+
branch?: string;
|
|
1692
|
+
reason?: string;
|
|
1693
|
+
}) => Promise<LumiResponse<DeploymentResource>>;
|
|
1694
|
+
};
|
|
1695
|
+
list: (params?: {
|
|
1696
|
+
targetId?: string;
|
|
1697
|
+
status?: string;
|
|
1698
|
+
}) => Promise<LumiResponse<DeploymentResource[]>>;
|
|
1699
|
+
get: (id: string) => Promise<LumiResponse<DeploymentResource>>;
|
|
1700
|
+
logs: (id: string) => Promise<LumiResponse<{
|
|
1701
|
+
log: string;
|
|
1702
|
+
}>>;
|
|
1703
|
+
refresh: (id: string) => Promise<LumiResponse<DeploymentResource>>;
|
|
1704
|
+
};
|
|
1601
1705
|
realtime: {
|
|
1602
1706
|
/**
|
|
1603
1707
|
* Create a RealtimeClient for the current site.
|
|
@@ -1625,6 +1729,13 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1625
1729
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1626
1730
|
};
|
|
1627
1731
|
|
|
1732
|
+
/**
|
|
1733
|
+
* Full-text search via `GET /api/v1/search`. Omit `params.collection` for a
|
|
1734
|
+
* cross-collection (global) search that fans out over every collection of the
|
|
1735
|
+
* current site; pass it to scope to one collection. Diacritics-insensitive
|
|
1736
|
+
* matching (e.g. "ha noi" → "Hà Nội") is handled server-side by MeiliSearch.
|
|
1737
|
+
*/
|
|
1738
|
+
declare function search<Schema extends DefaultSchema>(query: string, params?: SearchParams): (client: LumiClient<Schema>) => Promise<SearchResponse>;
|
|
1628
1739
|
declare function readItems<Schema extends DefaultSchema, Collection extends keyof Schema & string, Row = ItemRow<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>, ListResp = ListItemsResponse<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>>(collection: Collection, params?: ListItemsParams): (client: LumiClient<Schema>) => Promise<ListResp>;
|
|
1629
1740
|
declare function readItem<Schema extends DefaultSchema, Collection extends keyof Schema & string, Row = ItemRow<Schema[Collection] extends Record<string, unknown> ? Schema[Collection] : Record<string, unknown>>>(collection: Collection, id: string, fields?: string[]): (client: LumiClient<Schema>) => Promise<Row>;
|
|
1630
1741
|
declare function exportAccessManifest(): (client: LumiClient) => Promise<AccessExportManifest>;
|
|
@@ -1750,4 +1861,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
1750
1861
|
*/
|
|
1751
1862
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
1752
1863
|
|
|
1753
|
-
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, 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 CollectionInput, type CollectionResource, type CompiledPermission, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, 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 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 SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StorageMode, type TeamMemberResource, type TeamResource, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UserResource, 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, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
|
|
1864
|
+
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, 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 CollectionInput, type CollectionResource, type CompiledPermission, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, 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 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 StorageMode, type TeamMemberResource, type TeamResource, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UserPreferencesPayload, type UserResource, 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 };
|
package/dist/index.js
CHANGED
|
@@ -386,7 +386,6 @@ function legacyRest() {
|
|
|
386
386
|
if (params.offset !== void 0)
|
|
387
387
|
qs.set("offset", String(params.offset));
|
|
388
388
|
if (params.status) qs.set("status", params.status);
|
|
389
|
-
if (params.search) qs.set("search", params.search);
|
|
390
389
|
const s = qs.toString();
|
|
391
390
|
return s ? `?${s}` : "";
|
|
392
391
|
}
|
|
@@ -700,6 +699,41 @@ function legacyRest() {
|
|
|
700
699
|
method: "POST"
|
|
701
700
|
})
|
|
702
701
|
};
|
|
702
|
+
const me = {
|
|
703
|
+
getPreferences: () => client.rawRequest("/api/v1/me/preferences"),
|
|
704
|
+
updatePreferences: (patch) => client.rawRequest("/api/v1/me/preferences", {
|
|
705
|
+
method: "PATCH",
|
|
706
|
+
body: JSON.stringify(patch)
|
|
707
|
+
})
|
|
708
|
+
};
|
|
709
|
+
const deployments = {
|
|
710
|
+
targets: {
|
|
711
|
+
list: () => client.rawRequest("/api/v1/deployments/targets"),
|
|
712
|
+
create: (input) => client.rawRequest("/api/v1/deployments/targets", {
|
|
713
|
+
method: "POST",
|
|
714
|
+
body: JSON.stringify(input)
|
|
715
|
+
}),
|
|
716
|
+
update: (id, patch) => client.rawRequest(`/api/v1/deployments/targets/${id}`, {
|
|
717
|
+
method: "PATCH",
|
|
718
|
+
body: JSON.stringify(patch)
|
|
719
|
+
}),
|
|
720
|
+
delete: (id) => client.rawRequest(`/api/v1/deployments/targets/${id}`, { method: "DELETE" }),
|
|
721
|
+
deploy: (id, input = {}) => client.rawRequest(`/api/v1/deployments/targets/${id}/deploy`, {
|
|
722
|
+
method: "POST",
|
|
723
|
+
body: JSON.stringify(input)
|
|
724
|
+
})
|
|
725
|
+
},
|
|
726
|
+
list: (params) => {
|
|
727
|
+
const qs = new URLSearchParams();
|
|
728
|
+
if (params?.targetId) qs.set("targetId", params.targetId);
|
|
729
|
+
if (params?.status) qs.set("status", params.status);
|
|
730
|
+
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
731
|
+
return client.rawRequest(`/api/v1/deployments${suffix}`);
|
|
732
|
+
},
|
|
733
|
+
get: (id) => client.rawRequest(`/api/v1/deployments/${id}`),
|
|
734
|
+
logs: (id) => client.rawRequest(`/api/v1/deployments/${id}/logs`),
|
|
735
|
+
refresh: (id) => client.rawRequest(`/api/v1/deployments/${id}/refresh`, { method: "POST" })
|
|
736
|
+
};
|
|
703
737
|
return {
|
|
704
738
|
schema,
|
|
705
739
|
items,
|
|
@@ -708,6 +742,7 @@ function legacyRest() {
|
|
|
708
742
|
access,
|
|
709
743
|
apiKeys,
|
|
710
744
|
shares,
|
|
745
|
+
me,
|
|
711
746
|
permissions,
|
|
712
747
|
presets,
|
|
713
748
|
translations,
|
|
@@ -720,6 +755,7 @@ function legacyRest() {
|
|
|
720
755
|
webhooks,
|
|
721
756
|
activity,
|
|
722
757
|
extensions,
|
|
758
|
+
deployments,
|
|
723
759
|
realtime: {
|
|
724
760
|
/**
|
|
725
761
|
* Create a RealtimeClient for the current site.
|
|
@@ -758,6 +794,19 @@ function legacyRest() {
|
|
|
758
794
|
}
|
|
759
795
|
|
|
760
796
|
// src/rest/index.ts
|
|
797
|
+
function search(query, params) {
|
|
798
|
+
return async (client) => {
|
|
799
|
+
const qs = new URLSearchParams();
|
|
800
|
+
qs.set("q", query);
|
|
801
|
+
if (params?.collection) qs.set("collection", params.collection);
|
|
802
|
+
if (params?.filter) qs.set("filter", params.filter);
|
|
803
|
+
if (params?.sort?.length) qs.set("sort", params.sort.join(","));
|
|
804
|
+
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
805
|
+
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
806
|
+
const res = await client.rawRequest(`/api/v1/search?${qs.toString()}`);
|
|
807
|
+
return res;
|
|
808
|
+
};
|
|
809
|
+
}
|
|
761
810
|
function readItems(collection, params) {
|
|
762
811
|
return async (client) => {
|
|
763
812
|
const qs = new URLSearchParams();
|
|
@@ -767,7 +816,6 @@ function readItems(collection, params) {
|
|
|
767
816
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
768
817
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
769
818
|
if (params?.status) qs.set("status", params.status);
|
|
770
|
-
if (params?.search) qs.set("search", params.search);
|
|
771
819
|
const s = qs.toString();
|
|
772
820
|
const query = s ? `?${s}` : "";
|
|
773
821
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1248,6 +1296,7 @@ export {
|
|
|
1248
1296
|
retryAgentRun,
|
|
1249
1297
|
rollbackAgentArtifact,
|
|
1250
1298
|
rollbackCdcDeployment,
|
|
1299
|
+
search,
|
|
1251
1300
|
startCdcPipeline,
|
|
1252
1301
|
stopCdcPipeline,
|
|
1253
1302
|
toNextMetadata,
|