@lumibase/sdk 0.12.0 → 0.14.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 +44 -2
- package/dist/index.d.cts +96 -2
- package/dist/index.d.ts +96 -2
- package/dist/index.js +43 -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
|
}
|
|
@@ -775,6 +775,34 @@ function legacyRest() {
|
|
|
775
775
|
body: JSON.stringify(patch)
|
|
776
776
|
})
|
|
777
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
|
+
};
|
|
778
806
|
return {
|
|
779
807
|
schema,
|
|
780
808
|
items,
|
|
@@ -796,6 +824,7 @@ function legacyRest() {
|
|
|
796
824
|
webhooks,
|
|
797
825
|
activity,
|
|
798
826
|
extensions,
|
|
827
|
+
deployments,
|
|
799
828
|
realtime: {
|
|
800
829
|
/**
|
|
801
830
|
* Create a RealtimeClient for the current site.
|
|
@@ -834,6 +863,19 @@ function legacyRest() {
|
|
|
834
863
|
}
|
|
835
864
|
|
|
836
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
|
+
}
|
|
837
879
|
function readItems(collection, params) {
|
|
838
880
|
return async (client) => {
|
|
839
881
|
const qs = new URLSearchParams();
|
|
@@ -843,7 +885,6 @@ function readItems(collection, params) {
|
|
|
843
885
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
844
886
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
845
887
|
if (params?.status) qs.set("status", params.status);
|
|
846
|
-
if (params?.search) qs.set("search", params.search);
|
|
847
888
|
const s = qs.toString();
|
|
848
889
|
const query = s ? `?${s}` : "";
|
|
849
890
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1325,6 +1366,7 @@ function jsonLdScript(item) {
|
|
|
1325
1366
|
retryAgentRun,
|
|
1326
1367
|
rollbackAgentArtifact,
|
|
1327
1368
|
rollbackCdcDeployment,
|
|
1369
|
+
search,
|
|
1328
1370
|
startCdcPipeline,
|
|
1329
1371
|
stopCdcPipeline,
|
|
1330
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
|
|
@@ -1615,6 +1681,27 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1615
1681
|
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<ExtensionResource>>;
|
|
1616
1682
|
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1617
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
|
+
};
|
|
1618
1705
|
realtime: {
|
|
1619
1706
|
/**
|
|
1620
1707
|
* Create a RealtimeClient for the current site.
|
|
@@ -1642,6 +1729,13 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1642
1729
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1643
1730
|
};
|
|
1644
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>;
|
|
1645
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>;
|
|
1646
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>;
|
|
1647
1741
|
declare function exportAccessManifest(): (client: LumiClient) => Promise<AccessExportManifest>;
|
|
@@ -1767,4 +1861,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
1767
1861
|
*/
|
|
1768
1862
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
1769
1863
|
|
|
1770
|
-
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 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, 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
|
|
@@ -1615,6 +1681,27 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1615
1681
|
update: (id: string, patch: Record<string, unknown>) => Promise<LumiResponse<ExtensionResource>>;
|
|
1616
1682
|
delete: (id: string) => Promise<LumiResponse<null>>;
|
|
1617
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
|
+
};
|
|
1618
1705
|
realtime: {
|
|
1619
1706
|
/**
|
|
1620
1707
|
* Create a RealtimeClient for the current site.
|
|
@@ -1642,6 +1729,13 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
|
|
|
1642
1729
|
request: <T>(path: string, init?: RequestInit) => Promise<LumiResponse<T>>;
|
|
1643
1730
|
};
|
|
1644
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>;
|
|
1645
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>;
|
|
1646
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>;
|
|
1647
1741
|
declare function exportAccessManifest(): (client: LumiClient) => Promise<AccessExportManifest>;
|
|
@@ -1767,4 +1861,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
|
|
|
1767
1861
|
*/
|
|
1768
1862
|
declare function jsonLdScript(item: unknown): string | undefined;
|
|
1769
1863
|
|
|
1770
|
-
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 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, 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
|
}
|
|
@@ -707,6 +706,34 @@ function legacyRest() {
|
|
|
707
706
|
body: JSON.stringify(patch)
|
|
708
707
|
})
|
|
709
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
|
+
};
|
|
710
737
|
return {
|
|
711
738
|
schema,
|
|
712
739
|
items,
|
|
@@ -728,6 +755,7 @@ function legacyRest() {
|
|
|
728
755
|
webhooks,
|
|
729
756
|
activity,
|
|
730
757
|
extensions,
|
|
758
|
+
deployments,
|
|
731
759
|
realtime: {
|
|
732
760
|
/**
|
|
733
761
|
* Create a RealtimeClient for the current site.
|
|
@@ -766,6 +794,19 @@ function legacyRest() {
|
|
|
766
794
|
}
|
|
767
795
|
|
|
768
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
|
+
}
|
|
769
810
|
function readItems(collection, params) {
|
|
770
811
|
return async (client) => {
|
|
771
812
|
const qs = new URLSearchParams();
|
|
@@ -775,7 +816,6 @@ function readItems(collection, params) {
|
|
|
775
816
|
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
776
817
|
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
777
818
|
if (params?.status) qs.set("status", params.status);
|
|
778
|
-
if (params?.search) qs.set("search", params.search);
|
|
779
819
|
const s = qs.toString();
|
|
780
820
|
const query = s ? `?${s}` : "";
|
|
781
821
|
const res = await client.rawRequest(`/api/v1/items/${collection}${query}`);
|
|
@@ -1256,6 +1296,7 @@ export {
|
|
|
1256
1296
|
retryAgentRun,
|
|
1257
1297
|
rollbackAgentArtifact,
|
|
1258
1298
|
rollbackCdcDeployment,
|
|
1299
|
+
search,
|
|
1259
1300
|
startCdcPipeline,
|
|
1260
1301
|
stopCdcPipeline,
|
|
1261
1302
|
toNextMetadata,
|