@lumibase/sdk 0.16.0 → 0.18.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
@@ -757,6 +757,48 @@ function legacyRest() {
757
757
  }),
758
758
  delete: (id) => client.rawRequest(`/api/v1/translations/${id}`, { method: "DELETE" })
759
759
  };
760
+ const tm = {
761
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
762
+ list: (params) => {
763
+ const qs = new URLSearchParams();
764
+ if (params?.source) qs.set("source", params.source);
765
+ if (params?.target) qs.set("target", params.target);
766
+ if (params?.entrySource) qs.set("entrySource", params.entrySource);
767
+ if (params?.limit != null) qs.set("limit", String(params.limit));
768
+ if (params?.offset != null) qs.set("offset", String(params.offset));
769
+ const s = qs.toString();
770
+ return client.rawRequest(`/api/v1/tm${s ? `?${s}` : ""}`);
771
+ },
772
+ upsert: (input) => client.rawRequest("/api/v1/tm", {
773
+ method: "POST",
774
+ body: JSON.stringify(input)
775
+ }),
776
+ update: (id, patch) => client.rawRequest(`/api/v1/tm/${id}`, {
777
+ method: "PATCH",
778
+ body: JSON.stringify(patch)
779
+ }),
780
+ delete: (id) => client.rawRequest(`/api/v1/tm/${id}`, { method: "DELETE" }),
781
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
782
+ lookup: async (input) => {
783
+ const res = await client.rawRequest("/api/v1/tm/lookup", {
784
+ method: "POST",
785
+ body: JSON.stringify(input)
786
+ });
787
+ const m = res.data.match;
788
+ if (!m) return null;
789
+ return {
790
+ targetText: m.targetText,
791
+ similarity: m.score,
792
+ source: m.source ?? "human",
793
+ entryId: m.id
794
+ };
795
+ },
796
+ /** Full MT pipeline (TM → glossary → provider). */
797
+ translate: (input) => client.rawRequest(
798
+ "/api/v1/tm/translate",
799
+ { method: "POST", body: JSON.stringify(input) }
800
+ )
801
+ };
760
802
  const settings = {
761
803
  list: (scope) => client.rawRequest(`/api/v1/settings${scope ? `?scope=${scope}` : ""}`),
762
804
  get: (key) => client.rawRequest(`/api/v1/settings/${key}`),
@@ -773,6 +815,20 @@ function legacyRest() {
773
815
  body: JSON.stringify(patch)
774
816
  })
775
817
  };
818
+ const domains = {
819
+ list: () => client.rawRequest("/api/v1/domains"),
820
+ create: (input) => client.rawRequest("/api/v1/domains", {
821
+ method: "POST",
822
+ body: JSON.stringify(input)
823
+ }),
824
+ verify: (id) => client.rawRequest(`/api/v1/domains/${id}/verify`, {
825
+ method: "POST"
826
+ }),
827
+ setPrimary: (id) => client.rawRequest(`/api/v1/domains/${id}/primary`, {
828
+ method: "POST"
829
+ }),
830
+ delete: (id) => client.rawRequest(`/api/v1/domains/${id}`, { method: "DELETE" })
831
+ };
776
832
  const users = {
777
833
  list: () => client.rawRequest("/api/v1/users"),
778
834
  get: (id) => client.rawRequest(`/api/v1/users/${id}`),
@@ -836,6 +892,15 @@ function legacyRest() {
836
892
  body: JSON.stringify({ filename })
837
893
  })
838
894
  };
895
+ const uploads = {
896
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
897
+ getConfig: () => client.rawRequest("/api/v1/uploads/config"),
898
+ /** Update the per-site allowlist / size cap (site admin only). */
899
+ updateConfig: (patch) => client.rawRequest("/api/v1/uploads/config", {
900
+ method: "PUT",
901
+ body: JSON.stringify(patch)
902
+ })
903
+ };
839
904
  const webhooks = {
840
905
  list: () => client.rawRequest("/api/v1/webhooks"),
841
906
  create: (input) => client.rawRequest("/api/v1/webhooks", {
@@ -975,8 +1040,11 @@ function legacyRest() {
975
1040
  permissions,
976
1041
  presets,
977
1042
  translations,
1043
+ tm,
978
1044
  settings,
1045
+ uploads,
979
1046
  site,
1047
+ domains,
980
1048
  users,
981
1049
  teams,
982
1050
  folders,
package/dist/index.d.cts CHANGED
@@ -361,10 +361,11 @@ interface TypegenSchemaFilters {
361
361
  include?: string[];
362
362
  exclude?: string[];
363
363
  }
364
- type ItemFilterOp = "_eq" | "_neq" | "_in" | "_nin" | "_gt" | "_gte" | "_lt" | "_lte" | "_contains" | "_starts_with" | "_ends_with" | "_null" | "_nnull";
364
+ type ItemFilterOp = "_eq" | "_neq" | "_in" | "_nin" | "_gt" | "_gte" | "_lt" | "_lte" | "_contains" | "_starts_with" | "_ends_with" | "_null" | "_nnull" | "_json_contains" | "_has_key" | "_has_any_keys" | "_has_all_keys";
365
365
  interface ItemFilter {
366
366
  _and?: ItemFilter[];
367
367
  _or?: ItemFilter[];
368
+ /** Field key; may be a dotted path into nested JSON, e.g. "meta.author.country". */
368
369
  [key: string]: {
369
370
  [op in ItemFilterOp]?: unknown;
370
371
  } | ItemFilter[] | undefined;
@@ -823,6 +824,31 @@ interface SettingResource {
823
824
  scope: string;
824
825
  updatedAt: string;
825
826
  }
827
+ /** Origin of a translation-memory entry. */
828
+ type TmSource = "human" | "mt" | "imported";
829
+ /** A stored translation-memory pair for a language pair. */
830
+ interface TmEntry {
831
+ id: string;
832
+ siteId: string;
833
+ sourceLang: string;
834
+ targetLang: string;
835
+ sourceText: string;
836
+ targetText: string;
837
+ context: string | null;
838
+ quality: number | null;
839
+ source: TmSource;
840
+ provider: string | null;
841
+ hits: number;
842
+ updatedAt: string;
843
+ }
844
+ /** A fuzzy-match suggestion surfaced from the TM store (score normalized to `similarity`). */
845
+ interface TmSuggestion {
846
+ targetText: string;
847
+ /** Levenshtein similarity 0–100. */
848
+ similarity: number;
849
+ source: TmSource;
850
+ entryId?: string;
851
+ }
826
852
  /** Site (tenant) configuration row — identity, branding and theme defaults. */
827
853
  interface SiteResource {
828
854
  id: string;
@@ -833,6 +859,8 @@ interface SiteResource {
833
859
  descriptor: string | null;
834
860
  defaultLanguage: string;
835
861
  defaultAppearance: string;
862
+ /** Default Studio save action: `stay` | `return` | `create_new`. */
863
+ defaultSaveAction: string;
836
864
  branding: {
837
865
  logoUrl?: string;
838
866
  faviconUrl?: string;
@@ -848,6 +876,35 @@ interface SiteResource {
848
876
  }
849
877
  /** PATCH payload for `/api/v1/site`; every field optional. */
850
878
  type SiteConfigUpdate = Partial<Omit<SiteResource, 'id' | 'createdAt' | 'updatedAt'>>;
879
+ /** One DNS record the operator must publish, surfaced verbatim in the UI. */
880
+ interface DomainVerificationRecord {
881
+ type: 'CNAME' | 'TXT';
882
+ name: string;
883
+ value: string;
884
+ purpose?: string;
885
+ }
886
+ /** A hostname registered for a site (free subdomain or custom domain). */
887
+ interface DomainResource {
888
+ id: string;
889
+ hostname: string;
890
+ kind: 'subdomain' | 'custom';
891
+ isPrimary: boolean;
892
+ status: 'pending_dns' | 'verifying' | 'active' | 'failed';
893
+ statusReason: string | null;
894
+ sslStatus: string | null;
895
+ verification: {
896
+ records: DomainVerificationRecord[];
897
+ };
898
+ verifiedAt: string | null;
899
+ createdAt: string;
900
+ updatedAt: string;
901
+ }
902
+ /** Body for `POST /api/v1/domains`. */
903
+ interface DomainCreateInput {
904
+ kind: 'subdomain' | 'custom';
905
+ /** Full FQDN for `custom`; bare DNS label for `subdomain`. */
906
+ hostname: string;
907
+ }
851
908
  type CdcConnectorType = "debezium_kafka" | "materialized_engine" | "airbyte";
852
909
  type CdcPipelineStatus = "active" | "paused" | "error" | "provisioning";
853
910
  type CdcDeploymentTarget = "docker_compose" | "cloudflare_workers";
@@ -995,6 +1052,22 @@ interface FileResource {
995
1052
  uploadedBy: string | null;
996
1053
  createdAt: string;
997
1054
  }
1055
+ interface UploadTypeCatalogueEntry {
1056
+ mime: string;
1057
+ extensions: string[];
1058
+ label: string;
1059
+ note?: string;
1060
+ }
1061
+ interface UploadConfigResource {
1062
+ /** Maximum accepted upload size, in bytes. */
1063
+ maxBytes: number;
1064
+ /** Allowed MIME types (the enforced allowlist). */
1065
+ allowedMimeTypes: string[];
1066
+ /** Extensions derived from the allowlist, for the file picker `accept`. */
1067
+ allowedExtensions: string[];
1068
+ /** Full catalogue of selectable types (label + extensions per MIME). */
1069
+ catalogue: UploadTypeCatalogueEntry[];
1070
+ }
998
1071
  interface WebhookResource {
999
1072
  id: string;
1000
1073
  siteId: string;
@@ -1679,16 +1752,79 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1679
1752
  update: (id: string, patch: Partial<TranslationResource>) => Promise<LumiResponse<TranslationResource>>;
1680
1753
  delete: (id: string) => Promise<LumiResponse<null>>;
1681
1754
  };
1755
+ tm: {
1756
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
1757
+ list: (params?: {
1758
+ source?: string;
1759
+ target?: string;
1760
+ entrySource?: TmSource;
1761
+ limit?: number;
1762
+ offset?: number;
1763
+ }) => Promise<LumiResponse<TmEntry[]>>;
1764
+ upsert: (input: {
1765
+ sourceLang: string;
1766
+ targetLang: string;
1767
+ sourceText: string;
1768
+ targetText: string;
1769
+ context?: string;
1770
+ quality?: number;
1771
+ source?: TmSource;
1772
+ provider?: string;
1773
+ }) => Promise<LumiResponse<TmEntry>>;
1774
+ update: (id: string, patch: {
1775
+ targetText?: string;
1776
+ quality?: number;
1777
+ context?: string | null;
1778
+ source?: TmSource;
1779
+ }) => Promise<LumiResponse<TmEntry>>;
1780
+ delete: (id: string) => Promise<LumiResponse<{
1781
+ id: string;
1782
+ }>>;
1783
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
1784
+ lookup: (input: {
1785
+ query: string;
1786
+ sourceLang: string;
1787
+ targetLang: string;
1788
+ threshold?: number;
1789
+ }) => Promise<TmSuggestion | null>;
1790
+ /** Full MT pipeline (TM → glossary → provider). */
1791
+ translate: (input: {
1792
+ text: string;
1793
+ from: string;
1794
+ to: string;
1795
+ provider?: string;
1796
+ }) => Promise<LumiResponse<{
1797
+ text: string;
1798
+ source?: string;
1799
+ provider?: string;
1800
+ }>>;
1801
+ };
1682
1802
  settings: {
1683
1803
  list: (scope?: string) => Promise<LumiResponse<SettingResource[]>>;
1684
1804
  get: (key: string) => Promise<LumiResponse<SettingResource>>;
1685
1805
  set: (key: string, value: Record<string, unknown>, scope?: string) => Promise<LumiResponse<SettingResource>>;
1686
1806
  delete: (key: string) => Promise<LumiResponse<null>>;
1687
1807
  };
1808
+ uploads: {
1809
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
1810
+ getConfig: () => Promise<LumiResponse<UploadConfigResource>>;
1811
+ /** Update the per-site allowlist / size cap (site admin only). */
1812
+ updateConfig: (patch: {
1813
+ maxBytes?: number;
1814
+ allowedMimeTypes?: string[];
1815
+ }) => Promise<LumiResponse<UploadConfigResource>>;
1816
+ };
1688
1817
  site: {
1689
1818
  get: () => Promise<LumiResponse<SiteResource>>;
1690
1819
  update: (patch: SiteConfigUpdate) => Promise<LumiResponse<SiteResource>>;
1691
1820
  };
1821
+ domains: {
1822
+ list: () => Promise<LumiResponse<DomainResource[]>>;
1823
+ create: (input: DomainCreateInput) => Promise<LumiResponse<DomainResource>>;
1824
+ verify: (id: string) => Promise<LumiResponse<DomainResource>>;
1825
+ setPrimary: (id: string) => Promise<LumiResponse<DomainResource>>;
1826
+ delete: (id: string) => Promise<LumiResponse<void>>;
1827
+ };
1692
1828
  users: {
1693
1829
  list: () => Promise<LumiResponse<UserResource[]>>;
1694
1830
  get: (id: string) => Promise<LumiResponse<UserResource>>;
@@ -1946,4 +2082,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
1946
2082
  */
1947
2083
  declare function jsonLdScript(item: unknown): string | undefined;
1948
2084
 
1949
- 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 };
2085
+ export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createCdcPipeline, createLumiClient, decideAgentApproval, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listCdcPipelines, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
package/dist/index.d.ts CHANGED
@@ -361,10 +361,11 @@ interface TypegenSchemaFilters {
361
361
  include?: string[];
362
362
  exclude?: string[];
363
363
  }
364
- type ItemFilterOp = "_eq" | "_neq" | "_in" | "_nin" | "_gt" | "_gte" | "_lt" | "_lte" | "_contains" | "_starts_with" | "_ends_with" | "_null" | "_nnull";
364
+ type ItemFilterOp = "_eq" | "_neq" | "_in" | "_nin" | "_gt" | "_gte" | "_lt" | "_lte" | "_contains" | "_starts_with" | "_ends_with" | "_null" | "_nnull" | "_json_contains" | "_has_key" | "_has_any_keys" | "_has_all_keys";
365
365
  interface ItemFilter {
366
366
  _and?: ItemFilter[];
367
367
  _or?: ItemFilter[];
368
+ /** Field key; may be a dotted path into nested JSON, e.g. "meta.author.country". */
368
369
  [key: string]: {
369
370
  [op in ItemFilterOp]?: unknown;
370
371
  } | ItemFilter[] | undefined;
@@ -823,6 +824,31 @@ interface SettingResource {
823
824
  scope: string;
824
825
  updatedAt: string;
825
826
  }
827
+ /** Origin of a translation-memory entry. */
828
+ type TmSource = "human" | "mt" | "imported";
829
+ /** A stored translation-memory pair for a language pair. */
830
+ interface TmEntry {
831
+ id: string;
832
+ siteId: string;
833
+ sourceLang: string;
834
+ targetLang: string;
835
+ sourceText: string;
836
+ targetText: string;
837
+ context: string | null;
838
+ quality: number | null;
839
+ source: TmSource;
840
+ provider: string | null;
841
+ hits: number;
842
+ updatedAt: string;
843
+ }
844
+ /** A fuzzy-match suggestion surfaced from the TM store (score normalized to `similarity`). */
845
+ interface TmSuggestion {
846
+ targetText: string;
847
+ /** Levenshtein similarity 0–100. */
848
+ similarity: number;
849
+ source: TmSource;
850
+ entryId?: string;
851
+ }
826
852
  /** Site (tenant) configuration row — identity, branding and theme defaults. */
827
853
  interface SiteResource {
828
854
  id: string;
@@ -833,6 +859,8 @@ interface SiteResource {
833
859
  descriptor: string | null;
834
860
  defaultLanguage: string;
835
861
  defaultAppearance: string;
862
+ /** Default Studio save action: `stay` | `return` | `create_new`. */
863
+ defaultSaveAction: string;
836
864
  branding: {
837
865
  logoUrl?: string;
838
866
  faviconUrl?: string;
@@ -848,6 +876,35 @@ interface SiteResource {
848
876
  }
849
877
  /** PATCH payload for `/api/v1/site`; every field optional. */
850
878
  type SiteConfigUpdate = Partial<Omit<SiteResource, 'id' | 'createdAt' | 'updatedAt'>>;
879
+ /** One DNS record the operator must publish, surfaced verbatim in the UI. */
880
+ interface DomainVerificationRecord {
881
+ type: 'CNAME' | 'TXT';
882
+ name: string;
883
+ value: string;
884
+ purpose?: string;
885
+ }
886
+ /** A hostname registered for a site (free subdomain or custom domain). */
887
+ interface DomainResource {
888
+ id: string;
889
+ hostname: string;
890
+ kind: 'subdomain' | 'custom';
891
+ isPrimary: boolean;
892
+ status: 'pending_dns' | 'verifying' | 'active' | 'failed';
893
+ statusReason: string | null;
894
+ sslStatus: string | null;
895
+ verification: {
896
+ records: DomainVerificationRecord[];
897
+ };
898
+ verifiedAt: string | null;
899
+ createdAt: string;
900
+ updatedAt: string;
901
+ }
902
+ /** Body for `POST /api/v1/domains`. */
903
+ interface DomainCreateInput {
904
+ kind: 'subdomain' | 'custom';
905
+ /** Full FQDN for `custom`; bare DNS label for `subdomain`. */
906
+ hostname: string;
907
+ }
851
908
  type CdcConnectorType = "debezium_kafka" | "materialized_engine" | "airbyte";
852
909
  type CdcPipelineStatus = "active" | "paused" | "error" | "provisioning";
853
910
  type CdcDeploymentTarget = "docker_compose" | "cloudflare_workers";
@@ -995,6 +1052,22 @@ interface FileResource {
995
1052
  uploadedBy: string | null;
996
1053
  createdAt: string;
997
1054
  }
1055
+ interface UploadTypeCatalogueEntry {
1056
+ mime: string;
1057
+ extensions: string[];
1058
+ label: string;
1059
+ note?: string;
1060
+ }
1061
+ interface UploadConfigResource {
1062
+ /** Maximum accepted upload size, in bytes. */
1063
+ maxBytes: number;
1064
+ /** Allowed MIME types (the enforced allowlist). */
1065
+ allowedMimeTypes: string[];
1066
+ /** Extensions derived from the allowlist, for the file picker `accept`. */
1067
+ allowedExtensions: string[];
1068
+ /** Full catalogue of selectable types (label + extensions per MIME). */
1069
+ catalogue: UploadTypeCatalogueEntry[];
1070
+ }
998
1071
  interface WebhookResource {
999
1072
  id: string;
1000
1073
  siteId: string;
@@ -1679,16 +1752,79 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1679
1752
  update: (id: string, patch: Partial<TranslationResource>) => Promise<LumiResponse<TranslationResource>>;
1680
1753
  delete: (id: string) => Promise<LumiResponse<null>>;
1681
1754
  };
1755
+ tm: {
1756
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
1757
+ list: (params?: {
1758
+ source?: string;
1759
+ target?: string;
1760
+ entrySource?: TmSource;
1761
+ limit?: number;
1762
+ offset?: number;
1763
+ }) => Promise<LumiResponse<TmEntry[]>>;
1764
+ upsert: (input: {
1765
+ sourceLang: string;
1766
+ targetLang: string;
1767
+ sourceText: string;
1768
+ targetText: string;
1769
+ context?: string;
1770
+ quality?: number;
1771
+ source?: TmSource;
1772
+ provider?: string;
1773
+ }) => Promise<LumiResponse<TmEntry>>;
1774
+ update: (id: string, patch: {
1775
+ targetText?: string;
1776
+ quality?: number;
1777
+ context?: string | null;
1778
+ source?: TmSource;
1779
+ }) => Promise<LumiResponse<TmEntry>>;
1780
+ delete: (id: string) => Promise<LumiResponse<{
1781
+ id: string;
1782
+ }>>;
1783
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
1784
+ lookup: (input: {
1785
+ query: string;
1786
+ sourceLang: string;
1787
+ targetLang: string;
1788
+ threshold?: number;
1789
+ }) => Promise<TmSuggestion | null>;
1790
+ /** Full MT pipeline (TM → glossary → provider). */
1791
+ translate: (input: {
1792
+ text: string;
1793
+ from: string;
1794
+ to: string;
1795
+ provider?: string;
1796
+ }) => Promise<LumiResponse<{
1797
+ text: string;
1798
+ source?: string;
1799
+ provider?: string;
1800
+ }>>;
1801
+ };
1682
1802
  settings: {
1683
1803
  list: (scope?: string) => Promise<LumiResponse<SettingResource[]>>;
1684
1804
  get: (key: string) => Promise<LumiResponse<SettingResource>>;
1685
1805
  set: (key: string, value: Record<string, unknown>, scope?: string) => Promise<LumiResponse<SettingResource>>;
1686
1806
  delete: (key: string) => Promise<LumiResponse<null>>;
1687
1807
  };
1808
+ uploads: {
1809
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
1810
+ getConfig: () => Promise<LumiResponse<UploadConfigResource>>;
1811
+ /** Update the per-site allowlist / size cap (site admin only). */
1812
+ updateConfig: (patch: {
1813
+ maxBytes?: number;
1814
+ allowedMimeTypes?: string[];
1815
+ }) => Promise<LumiResponse<UploadConfigResource>>;
1816
+ };
1688
1817
  site: {
1689
1818
  get: () => Promise<LumiResponse<SiteResource>>;
1690
1819
  update: (patch: SiteConfigUpdate) => Promise<LumiResponse<SiteResource>>;
1691
1820
  };
1821
+ domains: {
1822
+ list: () => Promise<LumiResponse<DomainResource[]>>;
1823
+ create: (input: DomainCreateInput) => Promise<LumiResponse<DomainResource>>;
1824
+ verify: (id: string) => Promise<LumiResponse<DomainResource>>;
1825
+ setPrimary: (id: string) => Promise<LumiResponse<DomainResource>>;
1826
+ delete: (id: string) => Promise<LumiResponse<void>>;
1827
+ };
1692
1828
  users: {
1693
1829
  list: () => Promise<LumiResponse<UserResource[]>>;
1694
1830
  get: (id: string) => Promise<LumiResponse<UserResource>>;
@@ -1946,4 +2082,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
1946
2082
  */
1947
2083
  declare function jsonLdScript(item: unknown): string | undefined;
1948
2084
 
1949
- 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 };
2085
+ export { ACCESS_EXPORT_SCHEMA, type AIApproval, type AIApprovalStatus, type AIChatResponse, type AIChatStatus, type AIContentAssistResult, type AIConversation, type AIFieldSuggestion, type AIMessage, type AccessConflict, type AccessConflictCheckInput, type AccessConflictReport, type AccessExportApiKey, type AccessExportBindings, type AccessExportManifest, type AccessExportPermission, type AccessExportPolicy, type AccessExportRole, type AccessImportApplyResult, type AccessImportDiff, type AccessImportDiffEntry, type AccessImportDiffSection, type AccessImportDryRunResult, type AccessImportIssue, type AccessImportMode, type AccessImportOptions, type AccessImportSummary, type ActivityResource, type AgentApprovalResource, type AgentArtifactCreateInput, type AgentArtifactResource, type AgentArtifactType, type AgentEvaluationResource, type AgentGenerateAppInput, type AgentGenerateAppResult, type AgentGoalCreateInput, type AgentGoalResource, type AgentMemoryContext, type AgentMemoryResource, type AgentMemoryWriteInput, type AgentRiskLevel, type AgentRunResource, type AgentToolResource, type ApiKeyCreateInput, type ApiKeyPolicyAttachment, type ApiKeyResource, type ApiKeyRoleAttachment, type ApiKeyRotateInput, type ApiKeySecretResult, AudienceClient, type AudienceClientOptions, type AudienceEvent, type AudienceNotification, type Brand, type CdcConnectorType, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcRollbackResult, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type WebSocketFactory, type WebSocketLike, type WebhookResource, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createCdcPipeline, createLumiClient, decideAgentApproval, deleteCdcPipeline, deployCdc, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listCdcPipelines, publishAgentArtifact, readAgentMemoryContext, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readItem, readItems, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateCdcPipeline, validateCdcDeploymentEnv, writeAgentMemory };
package/dist/index.js CHANGED
@@ -687,6 +687,48 @@ function legacyRest() {
687
687
  }),
688
688
  delete: (id) => client.rawRequest(`/api/v1/translations/${id}`, { method: "DELETE" })
689
689
  };
690
+ const tm = {
691
+ /** List TM entries. Filters: source/target lang pair + `entrySource` (human|mt|imported). Returns the full response so callers can read pagination `meta`. */
692
+ list: (params) => {
693
+ const qs = new URLSearchParams();
694
+ if (params?.source) qs.set("source", params.source);
695
+ if (params?.target) qs.set("target", params.target);
696
+ if (params?.entrySource) qs.set("entrySource", params.entrySource);
697
+ if (params?.limit != null) qs.set("limit", String(params.limit));
698
+ if (params?.offset != null) qs.set("offset", String(params.offset));
699
+ const s = qs.toString();
700
+ return client.rawRequest(`/api/v1/tm${s ? `?${s}` : ""}`);
701
+ },
702
+ upsert: (input) => client.rawRequest("/api/v1/tm", {
703
+ method: "POST",
704
+ body: JSON.stringify(input)
705
+ }),
706
+ update: (id, patch) => client.rawRequest(`/api/v1/tm/${id}`, {
707
+ method: "PATCH",
708
+ body: JSON.stringify(patch)
709
+ }),
710
+ delete: (id) => client.rawRequest(`/api/v1/tm/${id}`, { method: "DELETE" }),
711
+ /** Fuzzy TM lookup. Normalizes the route's `{ match: { targetText, score } | null }` to a `TmSuggestion | null`. */
712
+ lookup: async (input) => {
713
+ const res = await client.rawRequest("/api/v1/tm/lookup", {
714
+ method: "POST",
715
+ body: JSON.stringify(input)
716
+ });
717
+ const m = res.data.match;
718
+ if (!m) return null;
719
+ return {
720
+ targetText: m.targetText,
721
+ similarity: m.score,
722
+ source: m.source ?? "human",
723
+ entryId: m.id
724
+ };
725
+ },
726
+ /** Full MT pipeline (TM → glossary → provider). */
727
+ translate: (input) => client.rawRequest(
728
+ "/api/v1/tm/translate",
729
+ { method: "POST", body: JSON.stringify(input) }
730
+ )
731
+ };
690
732
  const settings = {
691
733
  list: (scope) => client.rawRequest(`/api/v1/settings${scope ? `?scope=${scope}` : ""}`),
692
734
  get: (key) => client.rawRequest(`/api/v1/settings/${key}`),
@@ -703,6 +745,20 @@ function legacyRest() {
703
745
  body: JSON.stringify(patch)
704
746
  })
705
747
  };
748
+ const domains = {
749
+ list: () => client.rawRequest("/api/v1/domains"),
750
+ create: (input) => client.rawRequest("/api/v1/domains", {
751
+ method: "POST",
752
+ body: JSON.stringify(input)
753
+ }),
754
+ verify: (id) => client.rawRequest(`/api/v1/domains/${id}/verify`, {
755
+ method: "POST"
756
+ }),
757
+ setPrimary: (id) => client.rawRequest(`/api/v1/domains/${id}/primary`, {
758
+ method: "POST"
759
+ }),
760
+ delete: (id) => client.rawRequest(`/api/v1/domains/${id}`, { method: "DELETE" })
761
+ };
706
762
  const users = {
707
763
  list: () => client.rawRequest("/api/v1/users"),
708
764
  get: (id) => client.rawRequest(`/api/v1/users/${id}`),
@@ -766,6 +822,15 @@ function legacyRest() {
766
822
  body: JSON.stringify({ filename })
767
823
  })
768
824
  };
825
+ const uploads = {
826
+ /** Effective upload policy + catalogue — drives the picker's `accept`. */
827
+ getConfig: () => client.rawRequest("/api/v1/uploads/config"),
828
+ /** Update the per-site allowlist / size cap (site admin only). */
829
+ updateConfig: (patch) => client.rawRequest("/api/v1/uploads/config", {
830
+ method: "PUT",
831
+ body: JSON.stringify(patch)
832
+ })
833
+ };
769
834
  const webhooks = {
770
835
  list: () => client.rawRequest("/api/v1/webhooks"),
771
836
  create: (input) => client.rawRequest("/api/v1/webhooks", {
@@ -905,8 +970,11 @@ function legacyRest() {
905
970
  permissions,
906
971
  presets,
907
972
  translations,
973
+ tm,
908
974
  settings,
975
+ uploads,
909
976
  site,
977
+ domains,
910
978
  users,
911
979
  teams,
912
980
  folders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumibase/sdk",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "LumiBase JS SDK (REST + WebSocket) + typegen core. Isomorphic ESM.",
5
5
  "type": "module",
6
6
  "repository": {