@lumibase/sdk 0.17.0 → 0.19.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 CHANGED
@@ -656,7 +656,35 @@ function legacyRest() {
656
656
  releasePin: (id, field) => client.rawRequest(
657
657
  `${base}/${id}/pins/${encodeURIComponent(field)}`,
658
658
  { method: "DELETE" }
659
- )
659
+ ),
660
+ // Content versions — named parallel draft branches (content-versioning).
661
+ versions: {
662
+ list: (id) => client.rawRequest(`${base}/${id}/versions`),
663
+ create: (id, input) => client.rawRequest(`${base}/${id}/versions`, {
664
+ method: "POST",
665
+ body: JSON.stringify(input)
666
+ }),
667
+ get: (id, key) => client.rawRequest(
668
+ `${base}/${id}/versions/${encodeURIComponent(key)}`
669
+ ),
670
+ update: (id, key, patch) => client.rawRequest(
671
+ `${base}/${id}/versions/${encodeURIComponent(key)}`,
672
+ { method: "PATCH", body: JSON.stringify(patch) }
673
+ ),
674
+ delete: (id, key) => client.rawRequest(
675
+ `${base}/${id}/versions/${encodeURIComponent(key)}`,
676
+ { method: "DELETE" }
677
+ ),
678
+ compare: (id, key) => client.rawRequest(
679
+ `${base}/${id}/versions/${encodeURIComponent(key)}/compare`
680
+ ),
681
+ // Returns the promoted item; `meta.mainDiverged` flags that main
682
+ // changed after the branch was cut (review advised).
683
+ promote: (id, key) => client.rawRequest(
684
+ `${base}/${id}/versions/${encodeURIComponent(key)}/promote`,
685
+ { method: "POST" }
686
+ )
687
+ }
660
688
  };
661
689
  }
662
690
  const roles = {
@@ -757,6 +785,48 @@ function legacyRest() {
757
785
  }),
758
786
  delete: (id) => client.rawRequest(`/api/v1/translations/${id}`, { method: "DELETE" })
759
787
  };
788
+ const tm = {
789
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
790
+ list: (params) => {
791
+ const qs = new URLSearchParams();
792
+ if (params?.source) qs.set("source", params.source);
793
+ if (params?.target) qs.set("target", params.target);
794
+ if (params?.entrySource) qs.set("entrySource", params.entrySource);
795
+ if (params?.limit != null) qs.set("limit", String(params.limit));
796
+ if (params?.offset != null) qs.set("offset", String(params.offset));
797
+ const s = qs.toString();
798
+ return client.rawRequest(`/api/v1/tm${s ? `?${s}` : ""}`);
799
+ },
800
+ upsert: (input) => client.rawRequest("/api/v1/tm", {
801
+ method: "POST",
802
+ body: JSON.stringify(input)
803
+ }),
804
+ update: (id, patch) => client.rawRequest(`/api/v1/tm/${id}`, {
805
+ method: "PATCH",
806
+ body: JSON.stringify(patch)
807
+ }),
808
+ delete: (id) => client.rawRequest(`/api/v1/tm/${id}`, { method: "DELETE" }),
809
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
810
+ lookup: async (input) => {
811
+ const res = await client.rawRequest("/api/v1/tm/lookup", {
812
+ method: "POST",
813
+ body: JSON.stringify(input)
814
+ });
815
+ const m = res.data.match;
816
+ if (!m) return null;
817
+ return {
818
+ targetText: m.targetText,
819
+ similarity: m.score,
820
+ source: m.source ?? "human",
821
+ entryId: m.id
822
+ };
823
+ },
824
+ /** Full MT pipeline (TM → glossary → provider). */
825
+ translate: (input) => client.rawRequest(
826
+ "/api/v1/tm/translate",
827
+ { method: "POST", body: JSON.stringify(input) }
828
+ )
829
+ };
760
830
  const settings = {
761
831
  list: (scope) => client.rawRequest(`/api/v1/settings${scope ? `?scope=${scope}` : ""}`),
762
832
  get: (key) => client.rawRequest(`/api/v1/settings/${key}`),
@@ -773,6 +843,20 @@ function legacyRest() {
773
843
  body: JSON.stringify(patch)
774
844
  })
775
845
  };
846
+ const domains = {
847
+ list: () => client.rawRequest("/api/v1/domains"),
848
+ create: (input) => client.rawRequest("/api/v1/domains", {
849
+ method: "POST",
850
+ body: JSON.stringify(input)
851
+ }),
852
+ verify: (id) => client.rawRequest(`/api/v1/domains/${id}/verify`, {
853
+ method: "POST"
854
+ }),
855
+ setPrimary: (id) => client.rawRequest(`/api/v1/domains/${id}/primary`, {
856
+ method: "POST"
857
+ }),
858
+ delete: (id) => client.rawRequest(`/api/v1/domains/${id}`, { method: "DELETE" })
859
+ };
776
860
  const users = {
777
861
  list: () => client.rawRequest("/api/v1/users"),
778
862
  get: (id) => client.rawRequest(`/api/v1/users/${id}`),
@@ -836,6 +920,15 @@ function legacyRest() {
836
920
  body: JSON.stringify({ filename })
837
921
  })
838
922
  };
923
+ const uploads = {
924
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
925
+ getConfig: () => client.rawRequest("/api/v1/uploads/config"),
926
+ /** Update the per-site allowlist / size cap (site admin only). */
927
+ updateConfig: (patch) => client.rawRequest("/api/v1/uploads/config", {
928
+ method: "PUT",
929
+ body: JSON.stringify(patch)
930
+ })
931
+ };
839
932
  const webhooks = {
840
933
  list: () => client.rawRequest("/api/v1/webhooks"),
841
934
  create: (input) => client.rawRequest("/api/v1/webhooks", {
@@ -975,8 +1068,11 @@ function legacyRest() {
975
1068
  permissions,
976
1069
  presets,
977
1070
  translations,
1071
+ tm,
978
1072
  settings,
1073
+ uploads,
979
1074
  site,
1075
+ domains,
980
1076
  users,
981
1077
  teams,
982
1078
  folders,
package/dist/index.d.cts CHANGED
@@ -824,6 +824,63 @@ interface SettingResource {
824
824
  scope: string;
825
825
  updatedAt: string;
826
826
  }
827
+ /** A named parallel draft branch of a content item (content-versioning). */
828
+ interface ContentVersion {
829
+ id: string;
830
+ siteId: string;
831
+ itemId: string;
832
+ collectionId: string;
833
+ /** Stable slug, unique per item. */
834
+ key: string;
835
+ /** Human-readable label. */
836
+ name: string;
837
+ /** Snapshot of the item data for this branch. */
838
+ data: Record<string, unknown>;
839
+ /** Hash of main's data at snapshot time — detects divergence before promote. */
840
+ hash: string;
841
+ createdBy: string | null;
842
+ createdAt: string;
843
+ updatedAt: string;
844
+ /** True when main's data changed since this version branched (list only). */
845
+ mainChanged?: boolean;
846
+ }
847
+ /** One changed field between main and a version. */
848
+ interface VersionFieldChange {
849
+ field: string;
850
+ main: unknown;
851
+ version: unknown;
852
+ }
853
+ /** `GET …/versions/:key/compare` payload. */
854
+ interface VersionCompare {
855
+ main: Record<string, unknown>;
856
+ version: Record<string, unknown>;
857
+ changes: VersionFieldChange[];
858
+ }
859
+ /** Origin of a translation-memory entry. */
860
+ type TmSource = "human" | "mt" | "imported";
861
+ /** A stored translation-memory pair for a language pair. */
862
+ interface TmEntry {
863
+ id: string;
864
+ siteId: string;
865
+ sourceLang: string;
866
+ targetLang: string;
867
+ sourceText: string;
868
+ targetText: string;
869
+ context: string | null;
870
+ quality: number | null;
871
+ source: TmSource;
872
+ provider: string | null;
873
+ hits: number;
874
+ updatedAt: string;
875
+ }
876
+ /** A fuzzy-match suggestion surfaced from the TM store (score normalized to `similarity`). */
877
+ interface TmSuggestion {
878
+ targetText: string;
879
+ /** Levenshtein similarity 0–100. */
880
+ similarity: number;
881
+ source: TmSource;
882
+ entryId?: string;
883
+ }
827
884
  /** Site (tenant) configuration row — identity, branding and theme defaults. */
828
885
  interface SiteResource {
829
886
  id: string;
@@ -851,6 +908,35 @@ interface SiteResource {
851
908
  }
852
909
  /** PATCH payload for `/api/v1/site`; every field optional. */
853
910
  type SiteConfigUpdate = Partial<Omit<SiteResource, 'id' | 'createdAt' | 'updatedAt'>>;
911
+ /** One DNS record the operator must publish, surfaced verbatim in the UI. */
912
+ interface DomainVerificationRecord {
913
+ type: 'CNAME' | 'TXT';
914
+ name: string;
915
+ value: string;
916
+ purpose?: string;
917
+ }
918
+ /** A hostname registered for a site (free subdomain or custom domain). */
919
+ interface DomainResource {
920
+ id: string;
921
+ hostname: string;
922
+ kind: 'subdomain' | 'custom';
923
+ isPrimary: boolean;
924
+ status: 'pending_dns' | 'verifying' | 'active' | 'failed';
925
+ statusReason: string | null;
926
+ sslStatus: string | null;
927
+ verification: {
928
+ records: DomainVerificationRecord[];
929
+ };
930
+ verifiedAt: string | null;
931
+ createdAt: string;
932
+ updatedAt: string;
933
+ }
934
+ /** Body for `POST /api/v1/domains`. */
935
+ interface DomainCreateInput {
936
+ kind: 'subdomain' | 'custom';
937
+ /** Full FQDN for `custom`; bare DNS label for `subdomain`. */
938
+ hostname: string;
939
+ }
854
940
  type CdcConnectorType = "debezium_kafka" | "materialized_engine" | "airbyte";
855
941
  type CdcPipelineStatus = "active" | "paused" | "error" | "provisioning";
856
942
  type CdcDeploymentTarget = "docker_compose" | "cloudflare_workers";
@@ -998,6 +1084,22 @@ interface FileResource {
998
1084
  uploadedBy: string | null;
999
1085
  createdAt: string;
1000
1086
  }
1087
+ interface UploadTypeCatalogueEntry {
1088
+ mime: string;
1089
+ extensions: string[];
1090
+ label: string;
1091
+ note?: string;
1092
+ }
1093
+ interface UploadConfigResource {
1094
+ /** Maximum accepted upload size, in bytes. */
1095
+ maxBytes: number;
1096
+ /** Allowed MIME types (the enforced allowlist). */
1097
+ allowedMimeTypes: string[];
1098
+ /** Extensions derived from the allowlist, for the file picker `accept`. */
1099
+ allowedExtensions: string[];
1100
+ /** Full catalogue of selectable types (label + extensions per MIME). */
1101
+ catalogue: UploadTypeCatalogueEntry[];
1102
+ }
1001
1103
  interface WebhookResource {
1002
1104
  id: string;
1003
1105
  siteId: string;
@@ -1560,6 +1662,21 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1560
1662
  releasePin: (id: string, field: string) => Promise<LumiResponse<{
1561
1663
  pinnedFields: string[];
1562
1664
  }>>;
1665
+ versions: {
1666
+ list: (id: string) => Promise<LumiResponse<ContentVersion[]>>;
1667
+ create: (id: string, input: {
1668
+ key: string;
1669
+ name: string;
1670
+ }) => Promise<LumiResponse<ContentVersion>>;
1671
+ get: (id: string, key: string) => Promise<LumiResponse<ContentVersion>>;
1672
+ update: (id: string, key: string, patch: {
1673
+ data?: Record<string, unknown>;
1674
+ name?: string;
1675
+ }) => Promise<LumiResponse<ContentVersion>>;
1676
+ delete: (id: string, key: string) => Promise<LumiResponse<null>>;
1677
+ compare: (id: string, key: string) => Promise<LumiResponse<VersionCompare>>;
1678
+ promote: (id: string, key: string) => Promise<LumiResponse<ItemRow<TSchema[TName] extends Record<string, unknown> ? TSchema[TName] : Record<string, unknown>>>>;
1679
+ };
1563
1680
  };
1564
1681
  roles: {
1565
1682
  list: () => Promise<LumiResponse<RoleResource[]>>;
@@ -1682,16 +1799,79 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1682
1799
  update: (id: string, patch: Partial<TranslationResource>) => Promise<LumiResponse<TranslationResource>>;
1683
1800
  delete: (id: string) => Promise<LumiResponse<null>>;
1684
1801
  };
1802
+ tm: {
1803
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
1804
+ list: (params?: {
1805
+ source?: string;
1806
+ target?: string;
1807
+ entrySource?: TmSource;
1808
+ limit?: number;
1809
+ offset?: number;
1810
+ }) => Promise<LumiResponse<TmEntry[]>>;
1811
+ upsert: (input: {
1812
+ sourceLang: string;
1813
+ targetLang: string;
1814
+ sourceText: string;
1815
+ targetText: string;
1816
+ context?: string;
1817
+ quality?: number;
1818
+ source?: TmSource;
1819
+ provider?: string;
1820
+ }) => Promise<LumiResponse<TmEntry>>;
1821
+ update: (id: string, patch: {
1822
+ targetText?: string;
1823
+ quality?: number;
1824
+ context?: string | null;
1825
+ source?: TmSource;
1826
+ }) => Promise<LumiResponse<TmEntry>>;
1827
+ delete: (id: string) => Promise<LumiResponse<{
1828
+ id: string;
1829
+ }>>;
1830
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
1831
+ lookup: (input: {
1832
+ query: string;
1833
+ sourceLang: string;
1834
+ targetLang: string;
1835
+ threshold?: number;
1836
+ }) => Promise<TmSuggestion | null>;
1837
+ /** Full MT pipeline (TM → glossary → provider). */
1838
+ translate: (input: {
1839
+ text: string;
1840
+ from: string;
1841
+ to: string;
1842
+ provider?: string;
1843
+ }) => Promise<LumiResponse<{
1844
+ text: string;
1845
+ source?: string;
1846
+ provider?: string;
1847
+ }>>;
1848
+ };
1685
1849
  settings: {
1686
1850
  list: (scope?: string) => Promise<LumiResponse<SettingResource[]>>;
1687
1851
  get: (key: string) => Promise<LumiResponse<SettingResource>>;
1688
1852
  set: (key: string, value: Record<string, unknown>, scope?: string) => Promise<LumiResponse<SettingResource>>;
1689
1853
  delete: (key: string) => Promise<LumiResponse<null>>;
1690
1854
  };
1855
+ uploads: {
1856
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
1857
+ getConfig: () => Promise<LumiResponse<UploadConfigResource>>;
1858
+ /** Update the per-site allowlist / size cap (site admin only). */
1859
+ updateConfig: (patch: {
1860
+ maxBytes?: number;
1861
+ allowedMimeTypes?: string[];
1862
+ }) => Promise<LumiResponse<UploadConfigResource>>;
1863
+ };
1691
1864
  site: {
1692
1865
  get: () => Promise<LumiResponse<SiteResource>>;
1693
1866
  update: (patch: SiteConfigUpdate) => Promise<LumiResponse<SiteResource>>;
1694
1867
  };
1868
+ domains: {
1869
+ list: () => Promise<LumiResponse<DomainResource[]>>;
1870
+ create: (input: DomainCreateInput) => Promise<LumiResponse<DomainResource>>;
1871
+ verify: (id: string) => Promise<LumiResponse<DomainResource>>;
1872
+ setPrimary: (id: string) => Promise<LumiResponse<DomainResource>>;
1873
+ delete: (id: string) => Promise<LumiResponse<void>>;
1874
+ };
1695
1875
  users: {
1696
1876
  list: () => Promise<LumiResponse<UserResource[]>>;
1697
1877
  get: (id: string) => Promise<LumiResponse<UserResource>>;
@@ -1949,4 +2129,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
1949
2129
  */
1950
2130
  declare function jsonLdScript(item: unknown): string | undefined;
1951
2131
 
1952
- 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 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 TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, 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 };
2132
+ 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 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 VersionCompare, type VersionFieldChange, 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 };
package/dist/index.d.ts CHANGED
@@ -824,6 +824,63 @@ interface SettingResource {
824
824
  scope: string;
825
825
  updatedAt: string;
826
826
  }
827
+ /** A named parallel draft branch of a content item (content-versioning). */
828
+ interface ContentVersion {
829
+ id: string;
830
+ siteId: string;
831
+ itemId: string;
832
+ collectionId: string;
833
+ /** Stable slug, unique per item. */
834
+ key: string;
835
+ /** Human-readable label. */
836
+ name: string;
837
+ /** Snapshot of the item data for this branch. */
838
+ data: Record<string, unknown>;
839
+ /** Hash of main's data at snapshot time — detects divergence before promote. */
840
+ hash: string;
841
+ createdBy: string | null;
842
+ createdAt: string;
843
+ updatedAt: string;
844
+ /** True when main's data changed since this version branched (list only). */
845
+ mainChanged?: boolean;
846
+ }
847
+ /** One changed field between main and a version. */
848
+ interface VersionFieldChange {
849
+ field: string;
850
+ main: unknown;
851
+ version: unknown;
852
+ }
853
+ /** `GET …/versions/:key/compare` payload. */
854
+ interface VersionCompare {
855
+ main: Record<string, unknown>;
856
+ version: Record<string, unknown>;
857
+ changes: VersionFieldChange[];
858
+ }
859
+ /** Origin of a translation-memory entry. */
860
+ type TmSource = "human" | "mt" | "imported";
861
+ /** A stored translation-memory pair for a language pair. */
862
+ interface TmEntry {
863
+ id: string;
864
+ siteId: string;
865
+ sourceLang: string;
866
+ targetLang: string;
867
+ sourceText: string;
868
+ targetText: string;
869
+ context: string | null;
870
+ quality: number | null;
871
+ source: TmSource;
872
+ provider: string | null;
873
+ hits: number;
874
+ updatedAt: string;
875
+ }
876
+ /** A fuzzy-match suggestion surfaced from the TM store (score normalized to `similarity`). */
877
+ interface TmSuggestion {
878
+ targetText: string;
879
+ /** Levenshtein similarity 0–100. */
880
+ similarity: number;
881
+ source: TmSource;
882
+ entryId?: string;
883
+ }
827
884
  /** Site (tenant) configuration row — identity, branding and theme defaults. */
828
885
  interface SiteResource {
829
886
  id: string;
@@ -851,6 +908,35 @@ interface SiteResource {
851
908
  }
852
909
  /** PATCH payload for `/api/v1/site`; every field optional. */
853
910
  type SiteConfigUpdate = Partial<Omit<SiteResource, 'id' | 'createdAt' | 'updatedAt'>>;
911
+ /** One DNS record the operator must publish, surfaced verbatim in the UI. */
912
+ interface DomainVerificationRecord {
913
+ type: 'CNAME' | 'TXT';
914
+ name: string;
915
+ value: string;
916
+ purpose?: string;
917
+ }
918
+ /** A hostname registered for a site (free subdomain or custom domain). */
919
+ interface DomainResource {
920
+ id: string;
921
+ hostname: string;
922
+ kind: 'subdomain' | 'custom';
923
+ isPrimary: boolean;
924
+ status: 'pending_dns' | 'verifying' | 'active' | 'failed';
925
+ statusReason: string | null;
926
+ sslStatus: string | null;
927
+ verification: {
928
+ records: DomainVerificationRecord[];
929
+ };
930
+ verifiedAt: string | null;
931
+ createdAt: string;
932
+ updatedAt: string;
933
+ }
934
+ /** Body for `POST /api/v1/domains`. */
935
+ interface DomainCreateInput {
936
+ kind: 'subdomain' | 'custom';
937
+ /** Full FQDN for `custom`; bare DNS label for `subdomain`. */
938
+ hostname: string;
939
+ }
854
940
  type CdcConnectorType = "debezium_kafka" | "materialized_engine" | "airbyte";
855
941
  type CdcPipelineStatus = "active" | "paused" | "error" | "provisioning";
856
942
  type CdcDeploymentTarget = "docker_compose" | "cloudflare_workers";
@@ -998,6 +1084,22 @@ interface FileResource {
998
1084
  uploadedBy: string | null;
999
1085
  createdAt: string;
1000
1086
  }
1087
+ interface UploadTypeCatalogueEntry {
1088
+ mime: string;
1089
+ extensions: string[];
1090
+ label: string;
1091
+ note?: string;
1092
+ }
1093
+ interface UploadConfigResource {
1094
+ /** Maximum accepted upload size, in bytes. */
1095
+ maxBytes: number;
1096
+ /** Allowed MIME types (the enforced allowlist). */
1097
+ allowedMimeTypes: string[];
1098
+ /** Extensions derived from the allowlist, for the file picker `accept`. */
1099
+ allowedExtensions: string[];
1100
+ /** Full catalogue of selectable types (label + extensions per MIME). */
1101
+ catalogue: UploadTypeCatalogueEntry[];
1102
+ }
1001
1103
  interface WebhookResource {
1002
1104
  id: string;
1003
1105
  siteId: string;
@@ -1560,6 +1662,21 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1560
1662
  releasePin: (id: string, field: string) => Promise<LumiResponse<{
1561
1663
  pinnedFields: string[];
1562
1664
  }>>;
1665
+ versions: {
1666
+ list: (id: string) => Promise<LumiResponse<ContentVersion[]>>;
1667
+ create: (id: string, input: {
1668
+ key: string;
1669
+ name: string;
1670
+ }) => Promise<LumiResponse<ContentVersion>>;
1671
+ get: (id: string, key: string) => Promise<LumiResponse<ContentVersion>>;
1672
+ update: (id: string, key: string, patch: {
1673
+ data?: Record<string, unknown>;
1674
+ name?: string;
1675
+ }) => Promise<LumiResponse<ContentVersion>>;
1676
+ delete: (id: string, key: string) => Promise<LumiResponse<null>>;
1677
+ compare: (id: string, key: string) => Promise<LumiResponse<VersionCompare>>;
1678
+ promote: (id: string, key: string) => Promise<LumiResponse<ItemRow<TSchema[TName] extends Record<string, unknown> ? TSchema[TName] : Record<string, unknown>>>>;
1679
+ };
1563
1680
  };
1564
1681
  roles: {
1565
1682
  list: () => Promise<LumiResponse<RoleResource[]>>;
@@ -1682,16 +1799,79 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1682
1799
  update: (id: string, patch: Partial<TranslationResource>) => Promise<LumiResponse<TranslationResource>>;
1683
1800
  delete: (id: string) => Promise<LumiResponse<null>>;
1684
1801
  };
1802
+ tm: {
1803
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
1804
+ list: (params?: {
1805
+ source?: string;
1806
+ target?: string;
1807
+ entrySource?: TmSource;
1808
+ limit?: number;
1809
+ offset?: number;
1810
+ }) => Promise<LumiResponse<TmEntry[]>>;
1811
+ upsert: (input: {
1812
+ sourceLang: string;
1813
+ targetLang: string;
1814
+ sourceText: string;
1815
+ targetText: string;
1816
+ context?: string;
1817
+ quality?: number;
1818
+ source?: TmSource;
1819
+ provider?: string;
1820
+ }) => Promise<LumiResponse<TmEntry>>;
1821
+ update: (id: string, patch: {
1822
+ targetText?: string;
1823
+ quality?: number;
1824
+ context?: string | null;
1825
+ source?: TmSource;
1826
+ }) => Promise<LumiResponse<TmEntry>>;
1827
+ delete: (id: string) => Promise<LumiResponse<{
1828
+ id: string;
1829
+ }>>;
1830
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
1831
+ lookup: (input: {
1832
+ query: string;
1833
+ sourceLang: string;
1834
+ targetLang: string;
1835
+ threshold?: number;
1836
+ }) => Promise<TmSuggestion | null>;
1837
+ /** Full MT pipeline (TM → glossary → provider). */
1838
+ translate: (input: {
1839
+ text: string;
1840
+ from: string;
1841
+ to: string;
1842
+ provider?: string;
1843
+ }) => Promise<LumiResponse<{
1844
+ text: string;
1845
+ source?: string;
1846
+ provider?: string;
1847
+ }>>;
1848
+ };
1685
1849
  settings: {
1686
1850
  list: (scope?: string) => Promise<LumiResponse<SettingResource[]>>;
1687
1851
  get: (key: string) => Promise<LumiResponse<SettingResource>>;
1688
1852
  set: (key: string, value: Record<string, unknown>, scope?: string) => Promise<LumiResponse<SettingResource>>;
1689
1853
  delete: (key: string) => Promise<LumiResponse<null>>;
1690
1854
  };
1855
+ uploads: {
1856
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
1857
+ getConfig: () => Promise<LumiResponse<UploadConfigResource>>;
1858
+ /** Update the per-site allowlist / size cap (site admin only). */
1859
+ updateConfig: (patch: {
1860
+ maxBytes?: number;
1861
+ allowedMimeTypes?: string[];
1862
+ }) => Promise<LumiResponse<UploadConfigResource>>;
1863
+ };
1691
1864
  site: {
1692
1865
  get: () => Promise<LumiResponse<SiteResource>>;
1693
1866
  update: (patch: SiteConfigUpdate) => Promise<LumiResponse<SiteResource>>;
1694
1867
  };
1868
+ domains: {
1869
+ list: () => Promise<LumiResponse<DomainResource[]>>;
1870
+ create: (input: DomainCreateInput) => Promise<LumiResponse<DomainResource>>;
1871
+ verify: (id: string) => Promise<LumiResponse<DomainResource>>;
1872
+ setPrimary: (id: string) => Promise<LumiResponse<DomainResource>>;
1873
+ delete: (id: string) => Promise<LumiResponse<void>>;
1874
+ };
1695
1875
  users: {
1696
1876
  list: () => Promise<LumiResponse<UserResource[]>>;
1697
1877
  get: (id: string) => Promise<LumiResponse<UserResource>>;
@@ -1949,4 +2129,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
1949
2129
  */
1950
2130
  declare function jsonLdScript(item: unknown): string | undefined;
1951
2131
 
1952
- 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 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 TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, 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 };
2132
+ 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 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 VersionCompare, type VersionFieldChange, 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 };
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 = {
@@ -687,6 +715,48 @@ function legacyRest() {
687
715
  }),
688
716
  delete: (id) => client.rawRequest(`/api/v1/translations/${id}`, { method: "DELETE" })
689
717
  };
718
+ const tm = {
719
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
720
+ list: (params) => {
721
+ const qs = new URLSearchParams();
722
+ if (params?.source) qs.set("source", params.source);
723
+ if (params?.target) qs.set("target", params.target);
724
+ if (params?.entrySource) qs.set("entrySource", params.entrySource);
725
+ if (params?.limit != null) qs.set("limit", String(params.limit));
726
+ if (params?.offset != null) qs.set("offset", String(params.offset));
727
+ const s = qs.toString();
728
+ return client.rawRequest(`/api/v1/tm${s ? `?${s}` : ""}`);
729
+ },
730
+ upsert: (input) => client.rawRequest("/api/v1/tm", {
731
+ method: "POST",
732
+ body: JSON.stringify(input)
733
+ }),
734
+ update: (id, patch) => client.rawRequest(`/api/v1/tm/${id}`, {
735
+ method: "PATCH",
736
+ body: JSON.stringify(patch)
737
+ }),
738
+ delete: (id) => client.rawRequest(`/api/v1/tm/${id}`, { method: "DELETE" }),
739
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
740
+ lookup: async (input) => {
741
+ const res = await client.rawRequest("/api/v1/tm/lookup", {
742
+ method: "POST",
743
+ body: JSON.stringify(input)
744
+ });
745
+ const m = res.data.match;
746
+ if (!m) return null;
747
+ return {
748
+ targetText: m.targetText,
749
+ similarity: m.score,
750
+ source: m.source ?? "human",
751
+ entryId: m.id
752
+ };
753
+ },
754
+ /** Full MT pipeline (TM → glossary → provider). */
755
+ translate: (input) => client.rawRequest(
756
+ "/api/v1/tm/translate",
757
+ { method: "POST", body: JSON.stringify(input) }
758
+ )
759
+ };
690
760
  const settings = {
691
761
  list: (scope) => client.rawRequest(`/api/v1/settings${scope ? `?scope=${scope}` : ""}`),
692
762
  get: (key) => client.rawRequest(`/api/v1/settings/${key}`),
@@ -703,6 +773,20 @@ function legacyRest() {
703
773
  body: JSON.stringify(patch)
704
774
  })
705
775
  };
776
+ const domains = {
777
+ list: () => client.rawRequest("/api/v1/domains"),
778
+ create: (input) => client.rawRequest("/api/v1/domains", {
779
+ method: "POST",
780
+ body: JSON.stringify(input)
781
+ }),
782
+ verify: (id) => client.rawRequest(`/api/v1/domains/${id}/verify`, {
783
+ method: "POST"
784
+ }),
785
+ setPrimary: (id) => client.rawRequest(`/api/v1/domains/${id}/primary`, {
786
+ method: "POST"
787
+ }),
788
+ delete: (id) => client.rawRequest(`/api/v1/domains/${id}`, { method: "DELETE" })
789
+ };
706
790
  const users = {
707
791
  list: () => client.rawRequest("/api/v1/users"),
708
792
  get: (id) => client.rawRequest(`/api/v1/users/${id}`),
@@ -766,6 +850,15 @@ function legacyRest() {
766
850
  body: JSON.stringify({ filename })
767
851
  })
768
852
  };
853
+ const uploads = {
854
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
855
+ getConfig: () => client.rawRequest("/api/v1/uploads/config"),
856
+ /** Update the per-site allowlist / size cap (site admin only). */
857
+ updateConfig: (patch) => client.rawRequest("/api/v1/uploads/config", {
858
+ method: "PUT",
859
+ body: JSON.stringify(patch)
860
+ })
861
+ };
769
862
  const webhooks = {
770
863
  list: () => client.rawRequest("/api/v1/webhooks"),
771
864
  create: (input) => client.rawRequest("/api/v1/webhooks", {
@@ -905,8 +998,11 @@ function legacyRest() {
905
998
  permissions,
906
999
  presets,
907
1000
  translations,
1001
+ tm,
908
1002
  settings,
1003
+ uploads,
909
1004
  site,
1005
+ domains,
910
1006
  users,
911
1007
  teams,
912
1008
  folders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumibase/sdk",
3
- "version": "0.17.0",
3
+ "version": "0.19.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": "^3.2.6"
26
+ "vitest": "^4.1.10"
27
27
  },
28
28
  "files": [
29
29
  "dist"