@lumibase/sdk 0.24.0 → 0.25.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
@@ -1035,6 +1035,31 @@ function legacyRest() {
1035
1035
  delete: (id) => client.rawRequest(`/api/v1/extensions/${id}`, { method: "DELETE" })
1036
1036
  };
1037
1037
  const access = {
1038
+ /**
1039
+ * Non-staff permission picker (`/api/v1/access/grants`). One call
1040
+ * returns the site's grantable collections plus every realm's limits and
1041
+ * current grants, so a client never has to hard-code which actions a
1042
+ * realm may hold.
1043
+ */
1044
+ grants: {
1045
+ state: () => client.rawRequest("/api/v1/access/grants"),
1046
+ enable: (realm) => client.rawRequest(
1047
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/enable`,
1048
+ { method: "POST" }
1049
+ ),
1050
+ disable: (realm) => client.rawRequest(
1051
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/disable`,
1052
+ { method: "POST" }
1053
+ ),
1054
+ grant: (realm, input) => client.rawRequest(`/api/v1/access/grants/${encodeURIComponent(realm)}`, {
1055
+ method: "POST",
1056
+ body: JSON.stringify(input)
1057
+ }),
1058
+ revoke: (realm, collection, action = "read") => client.rawRequest(
1059
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/${encodeURIComponent(collection)}/${encodeURIComponent(action)}`,
1060
+ { method: "DELETE" }
1061
+ )
1062
+ },
1038
1063
  checkConflicts: (input) => client.rawRequest("/api/v1/access/conflicts/check", {
1039
1064
  method: "POST",
1040
1065
  body: JSON.stringify(input)
@@ -1063,6 +1088,14 @@ function legacyRest() {
1063
1088
  method: "POST",
1064
1089
  body: JSON.stringify(input)
1065
1090
  }),
1091
+ /**
1092
+ * Replace the key's browser-origin allowlist without rotating the token.
1093
+ * Pass `[]` to remove the constraint entirely.
1094
+ */
1095
+ setAllowedOrigins: (id, allowedOrigins) => client.rawRequest(`/api/v1/api-keys/${id}/allowed-origins`, {
1096
+ method: "PATCH",
1097
+ body: JSON.stringify({ allowedOrigins })
1098
+ }),
1066
1099
  revoke: (id) => client.rawRequest(`/api/v1/api-keys/${id}/revoke`, {
1067
1100
  method: "POST"
1068
1101
  }),
package/dist/index.d.cts CHANGED
@@ -578,6 +578,51 @@ interface AccessConflictCheckInput {
578
578
  addPolicies?: string[];
579
579
  removePolicies?: string[];
580
580
  }
581
+ /** Actions an operator may grant to a non-staff realm. */
582
+ type GrantAction = "read" | "create" | "update" | "delete";
583
+ /** One `(collection, action)` grant held by a realm. */
584
+ interface RealmAccessGrant {
585
+ collection: string;
586
+ action: GrantAction;
587
+ /** Row scope: only `status = 'published'` rows. */
588
+ publishedOnly: boolean;
589
+ /** Row scope: only rows the principal created. Never set for `public`. */
590
+ ownOnly: boolean;
591
+ /** Field whitelist; `["*"]` = all, `["-secret"]` excludes. */
592
+ fields: string[];
593
+ }
594
+ /**
595
+ * A non-staff realm as the picker sees it: what it may be granted, and what it
596
+ * currently holds. `allowedActions` and `supportsOwnOnly` are served by the
597
+ * API rather than hard-coded client-side, so a realm's limits are stated once.
598
+ */
599
+ interface RealmAccessDescriptor {
600
+ key: "public" | "subscriber";
601
+ label: string;
602
+ summary: string;
603
+ allowedActions: GrantAction[];
604
+ supportsOwnOnly: boolean;
605
+ /** Whether an operator can turn the realm on and off (public only). */
606
+ togglable: boolean;
607
+ enabled: boolean;
608
+ grants: RealmAccessGrant[];
609
+ }
610
+ interface RealmAccessState {
611
+ /** Grantable collections: non-system, non-hidden. */
612
+ collections: Array<{
613
+ name: string;
614
+ label: string | null;
615
+ }>;
616
+ realms: RealmAccessDescriptor[];
617
+ }
618
+ interface RealmGrantInput {
619
+ collection: string;
620
+ /** Defaults to `read`. */
621
+ action?: GrantAction;
622
+ publishedOnly?: boolean;
623
+ ownOnly?: boolean;
624
+ fields?: string[];
625
+ }
581
626
  declare const ACCESS_EXPORT_SCHEMA = "lumibase.access@v1";
582
627
  type AccessImportMode = "merge" | "replace-managed" | "replace-all";
583
628
  interface AccessExportManifest {
@@ -729,6 +774,15 @@ interface ApiKeyResource {
729
774
  lastUsedIp: string | null;
730
775
  lastUsedUserAgent: string | null;
731
776
  metadata: Record<string, unknown>;
777
+ /**
778
+ * True for a client-embeddable `lbk_pub_…` key. Derived from the prefix
779
+ * server-side, so it always matches the token the client actually holds.
780
+ *
781
+ * A publishable key is NOT a secret — treat its scope as fully public.
782
+ */
783
+ publishable: boolean;
784
+ /** Origins the key may be used from in a browser. Empty = no constraint. */
785
+ allowedOrigins: string[];
732
786
  createdAt: string;
733
787
  roles: Array<{
734
788
  roleId: string;
@@ -744,6 +798,10 @@ interface ApiKeyCreateInput {
744
798
  description?: string;
745
799
  expiresAt?: string | Date | null;
746
800
  metadata?: Record<string, unknown>;
801
+ /** Mint a client-embeddable `lbk_pub_…` token. Defaults to false. */
802
+ publishable?: boolean;
803
+ /** Browser origins the key may be used from. Empty/omitted = no constraint. */
804
+ allowedOrigins?: string[];
747
805
  }
748
806
  interface ApiKeyRotateInput {
749
807
  expiresAt?: string | Date | null;
@@ -1869,6 +1927,28 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1869
1927
  detachUser: (id: string, userId: string) => Promise<LumiResponse<null>>;
1870
1928
  };
1871
1929
  access: {
1930
+ /**
1931
+ * Non-staff permission picker (`/api/v1/access/grants`). One call
1932
+ * returns the site's grantable collections plus every realm's limits and
1933
+ * current grants, so a client never has to hard-code which actions a
1934
+ * realm may hold.
1935
+ */
1936
+ grants: {
1937
+ state: () => Promise<LumiResponse<RealmAccessState>>;
1938
+ enable: (realm: string) => Promise<LumiResponse<{
1939
+ enabled: boolean;
1940
+ roleId: string;
1941
+ policyId: string;
1942
+ }>>;
1943
+ disable: (realm: string) => Promise<LumiResponse<{
1944
+ enabled: boolean;
1945
+ removed: boolean;
1946
+ }>>;
1947
+ grant: (realm: string, input: RealmGrantInput) => Promise<LumiResponse<RealmAccessGrant>>;
1948
+ revoke: (realm: string, collection: string, action?: GrantAction) => Promise<LumiResponse<{
1949
+ removed: boolean;
1950
+ }>>;
1951
+ };
1872
1952
  checkConflicts: (input: AccessConflictCheckInput) => Promise<LumiResponse<AccessConflictReport>>;
1873
1953
  exportManifest: () => Promise<LumiResponse<AccessExportManifest>>;
1874
1954
  dryRunImport: (manifest: AccessExportManifest) => Promise<LumiResponse<AccessImportDryRunResult>>;
@@ -1879,6 +1959,11 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1879
1959
  get: (id: string) => Promise<LumiResponse<ApiKeyResource>>;
1880
1960
  create: (input: ApiKeyCreateInput) => Promise<LumiResponse<ApiKeySecretResult>>;
1881
1961
  rotate: (id: string, input?: ApiKeyRotateInput) => Promise<LumiResponse<ApiKeySecretResult>>;
1962
+ /**
1963
+ * Replace the key's browser-origin allowlist without rotating the token.
1964
+ * Pass `[]` to remove the constraint entirely.
1965
+ */
1966
+ setAllowedOrigins: (id: string, allowedOrigins: string[]) => Promise<LumiResponse<ApiKeyResource>>;
1882
1967
  revoke: (id: string) => Promise<LumiResponse<ApiKeyResource>>;
1883
1968
  attachRole: (id: string, input: {
1884
1969
  roleId: string;
@@ -2353,4 +2438,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
2353
2438
  */
2354
2439
  declare function jsonLdScript(item: unknown): string | undefined;
2355
2440
 
2356
- 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 CdcActorType, type CdcConnectorType, type CdcDeliveryResource, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcEventEnvelope, type CdcFeedPage, type CdcFeedReadParams, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcOperation, type CdcPayloadMode, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcReplayInput, type CdcRollbackResult, type CdcSource, type CdcSubscriptionCreateInput, type CdcSubscriptionKind, type CdcSubscriptionPatchInput, type CdcSubscriptionResource, type CdcSubscriptionStatus, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type ContentVersion, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, ackCdcSubscription, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createCdcSubscription, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deleteCdcSubscription, deployCdc, dispatchCdcSubscription, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, listCdcSubscriptionDeliveries, listCdcSubscriptions, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcEvents, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readCdcSubscription, readItem, readItems, replayCdcSubscription, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, updateCdcSubscription, validateCdcDeploymentEnv, writeAgentMemory };
2441
+ 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 CdcActorType, type CdcConnectorType, type CdcDeliveryResource, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcEventEnvelope, type CdcFeedPage, type CdcFeedReadParams, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcOperation, type CdcPayloadMode, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcReplayInput, type CdcRollbackResult, type CdcSource, type CdcSubscriptionCreateInput, type CdcSubscriptionKind, type CdcSubscriptionPatchInput, type CdcSubscriptionResource, type CdcSubscriptionStatus, 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 GrantAction, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, type RealmAccessDescriptor, type RealmAccessGrant, type RealmAccessState, type RealmGrantInput, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, ackCdcSubscription, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createCdcSubscription, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deleteCdcSubscription, deployCdc, dispatchCdcSubscription, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, listCdcSubscriptionDeliveries, listCdcSubscriptions, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcEvents, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readCdcSubscription, readItem, readItems, replayCdcSubscription, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, updateCdcSubscription, validateCdcDeploymentEnv, writeAgentMemory };
package/dist/index.d.ts CHANGED
@@ -578,6 +578,51 @@ interface AccessConflictCheckInput {
578
578
  addPolicies?: string[];
579
579
  removePolicies?: string[];
580
580
  }
581
+ /** Actions an operator may grant to a non-staff realm. */
582
+ type GrantAction = "read" | "create" | "update" | "delete";
583
+ /** One `(collection, action)` grant held by a realm. */
584
+ interface RealmAccessGrant {
585
+ collection: string;
586
+ action: GrantAction;
587
+ /** Row scope: only `status = 'published'` rows. */
588
+ publishedOnly: boolean;
589
+ /** Row scope: only rows the principal created. Never set for `public`. */
590
+ ownOnly: boolean;
591
+ /** Field whitelist; `["*"]` = all, `["-secret"]` excludes. */
592
+ fields: string[];
593
+ }
594
+ /**
595
+ * A non-staff realm as the picker sees it: what it may be granted, and what it
596
+ * currently holds. `allowedActions` and `supportsOwnOnly` are served by the
597
+ * API rather than hard-coded client-side, so a realm's limits are stated once.
598
+ */
599
+ interface RealmAccessDescriptor {
600
+ key: "public" | "subscriber";
601
+ label: string;
602
+ summary: string;
603
+ allowedActions: GrantAction[];
604
+ supportsOwnOnly: boolean;
605
+ /** Whether an operator can turn the realm on and off (public only). */
606
+ togglable: boolean;
607
+ enabled: boolean;
608
+ grants: RealmAccessGrant[];
609
+ }
610
+ interface RealmAccessState {
611
+ /** Grantable collections: non-system, non-hidden. */
612
+ collections: Array<{
613
+ name: string;
614
+ label: string | null;
615
+ }>;
616
+ realms: RealmAccessDescriptor[];
617
+ }
618
+ interface RealmGrantInput {
619
+ collection: string;
620
+ /** Defaults to `read`. */
621
+ action?: GrantAction;
622
+ publishedOnly?: boolean;
623
+ ownOnly?: boolean;
624
+ fields?: string[];
625
+ }
581
626
  declare const ACCESS_EXPORT_SCHEMA = "lumibase.access@v1";
582
627
  type AccessImportMode = "merge" | "replace-managed" | "replace-all";
583
628
  interface AccessExportManifest {
@@ -729,6 +774,15 @@ interface ApiKeyResource {
729
774
  lastUsedIp: string | null;
730
775
  lastUsedUserAgent: string | null;
731
776
  metadata: Record<string, unknown>;
777
+ /**
778
+ * True for a client-embeddable `lbk_pub_…` key. Derived from the prefix
779
+ * server-side, so it always matches the token the client actually holds.
780
+ *
781
+ * A publishable key is NOT a secret — treat its scope as fully public.
782
+ */
783
+ publishable: boolean;
784
+ /** Origins the key may be used from in a browser. Empty = no constraint. */
785
+ allowedOrigins: string[];
732
786
  createdAt: string;
733
787
  roles: Array<{
734
788
  roleId: string;
@@ -744,6 +798,10 @@ interface ApiKeyCreateInput {
744
798
  description?: string;
745
799
  expiresAt?: string | Date | null;
746
800
  metadata?: Record<string, unknown>;
801
+ /** Mint a client-embeddable `lbk_pub_…` token. Defaults to false. */
802
+ publishable?: boolean;
803
+ /** Browser origins the key may be used from. Empty/omitted = no constraint. */
804
+ allowedOrigins?: string[];
747
805
  }
748
806
  interface ApiKeyRotateInput {
749
807
  expiresAt?: string | Date | null;
@@ -1869,6 +1927,28 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1869
1927
  detachUser: (id: string, userId: string) => Promise<LumiResponse<null>>;
1870
1928
  };
1871
1929
  access: {
1930
+ /**
1931
+ * Non-staff permission picker (`/api/v1/access/grants`). One call
1932
+ * returns the site's grantable collections plus every realm's limits and
1933
+ * current grants, so a client never has to hard-code which actions a
1934
+ * realm may hold.
1935
+ */
1936
+ grants: {
1937
+ state: () => Promise<LumiResponse<RealmAccessState>>;
1938
+ enable: (realm: string) => Promise<LumiResponse<{
1939
+ enabled: boolean;
1940
+ roleId: string;
1941
+ policyId: string;
1942
+ }>>;
1943
+ disable: (realm: string) => Promise<LumiResponse<{
1944
+ enabled: boolean;
1945
+ removed: boolean;
1946
+ }>>;
1947
+ grant: (realm: string, input: RealmGrantInput) => Promise<LumiResponse<RealmAccessGrant>>;
1948
+ revoke: (realm: string, collection: string, action?: GrantAction) => Promise<LumiResponse<{
1949
+ removed: boolean;
1950
+ }>>;
1951
+ };
1872
1952
  checkConflicts: (input: AccessConflictCheckInput) => Promise<LumiResponse<AccessConflictReport>>;
1873
1953
  exportManifest: () => Promise<LumiResponse<AccessExportManifest>>;
1874
1954
  dryRunImport: (manifest: AccessExportManifest) => Promise<LumiResponse<AccessImportDryRunResult>>;
@@ -1879,6 +1959,11 @@ declare function legacyRest(): <TSchema extends DefaultSchema>(client: LumiClien
1879
1959
  get: (id: string) => Promise<LumiResponse<ApiKeyResource>>;
1880
1960
  create: (input: ApiKeyCreateInput) => Promise<LumiResponse<ApiKeySecretResult>>;
1881
1961
  rotate: (id: string, input?: ApiKeyRotateInput) => Promise<LumiResponse<ApiKeySecretResult>>;
1962
+ /**
1963
+ * Replace the key's browser-origin allowlist without rotating the token.
1964
+ * Pass `[]` to remove the constraint entirely.
1965
+ */
1966
+ setAllowedOrigins: (id: string, allowedOrigins: string[]) => Promise<LumiResponse<ApiKeyResource>>;
1882
1967
  revoke: (id: string) => Promise<LumiResponse<ApiKeyResource>>;
1883
1968
  attachRole: (id: string, input: {
1884
1969
  roleId: string;
@@ -2353,4 +2438,4 @@ declare function toNextMetadata(item: unknown): Record<string, unknown>;
2353
2438
  */
2354
2439
  declare function jsonLdScript(item: unknown): string | undefined;
2355
2440
 
2356
- 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 CdcActorType, type CdcConnectorType, type CdcDeliveryResource, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcEventEnvelope, type CdcFeedPage, type CdcFeedReadParams, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcOperation, type CdcPayloadMode, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcReplayInput, type CdcRollbackResult, type CdcSource, type CdcSubscriptionCreateInput, type CdcSubscriptionKind, type CdcSubscriptionPatchInput, type CdcSubscriptionResource, type CdcSubscriptionStatus, type CdcValidateEnvInput, type ChannelEventCallback, type CollectionInput, type CollectionResource, type CompiledPermission, type ConnectionStatus, type ContentVersion, type CreateSCIMTokenParams, type DefaultSchema, type DeliverySeo, type DeploymentResource, type DeploymentTargetResource, type DomainCreateInput, type DomainResource, type DomainVerificationRecord, type ExtensionResource, type FieldDeleteOptions, type FieldInput, type FieldMutationOptions, type FieldRenameInput, type FieldResource, type FileResource, type FlowGraph, type FlowNode, type FlowResource, type FlowRun, type FlowRunResult, type FlowRunStatus, type FlowStatus, type FlowTriggerType, type FolderResource, type GenerateOptions, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, ackCdcSubscription, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createCdcSubscription, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deleteCdcSubscription, deployCdc, dispatchCdcSubscription, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, listCdcSubscriptionDeliveries, listCdcSubscriptions, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcEvents, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readCdcSubscription, readItem, readItems, replayCdcSubscription, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, updateCdcSubscription, validateCdcDeploymentEnv, writeAgentMemory };
2441
+ 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 CdcActorType, type CdcConnectorType, type CdcDeliveryResource, type CdcDeployInput, type CdcDeploymentResult, type CdcDeploymentStatus, type CdcDeploymentStep, type CdcDeploymentTarget, type CdcEnvValidationResult, type CdcEventEnvelope, type CdcFeedPage, type CdcFeedReadParams, type CdcHealthCheckResult, type CdcHealthMetricEntry, type CdcOperation, type CdcPayloadMode, type CdcPipelineCreateInput, type CdcPipelineMetrics, type CdcPipelinePatchInput, type CdcPipelineResource, type CdcPipelineStatus, type CdcReplayInput, type CdcRollbackResult, type CdcSource, type CdcSubscriptionCreateInput, type CdcSubscriptionKind, type CdcSubscriptionPatchInput, type CdcSubscriptionResource, type CdcSubscriptionStatus, 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 GrantAction, type GraphQLExtension, type ID, type ItemFilter, type ItemFilterOp, type ItemRow, type ListItemsParams, type ListItemsResponse, type ListMarketplaceExtensionsParams, type Locale, type LumiClient, type LumiClientOptions, LumiError, type LumiErrorBody, type LumiResponse, type MarketplaceExtension, type MarketplaceListResponse, type MaterializeDataResponse, type MaterializeProjection, type MaterializeRefreshResult, type MaterializeRefreshStrategy, type MaterializedCollection, type MediaTransform, type NotificationCallback, type PermissionAction, type PermissionBundle, type PermissionCheckResult, type PermissionRow, type PolicyDetail, type PolicyResource, type PresenceCallback, type PresenceEntry, type PresetResource, type PresetScope, type PrimaryKeyType, type RealmAccessDescriptor, type RealmAccessGrant, type RealmAccessState, type RealmGrantInput, RealtimeClient, type RealtimeEvent, type RealtimeEventCallback, type RelationInput, type RelationResource, type RelationType, type RevisionRow, type RoleDetail, type RoleResource, type SCIMTokenCreated, type SCIMTokenMeta, type SCIMTokenRotated, type SchemaApplyInput, type SchemaApplyResult, type SchemaChangedEvent, type SchemaDiff, type SchemaDiffEntry, type SchemaDiffInput, type SchemaDiffRisk, type SchemaRuntimeImpact, type ScopedViewPreset, type SearchHit, type SearchHitMeta, type SearchParams, type SearchResponse, type SettingResource, type ShareCreateInput, type ShareResource, type ShareSecretResult, type SiteConfigUpdate, type SiteResource, type StatusCallback, type StorageMode, type TeamMemberResource, type TeamResource, type TmEntry, type TmSource, type TmSuggestion, type TranslationResource, type TypegenCollection, type TypegenField, type TypegenManifest, type TypegenRelation, type TypegenSchemaFilters, type UploadConfigResource, type UploadTypeCatalogueEntry, type UserPreferencesPayload, type UserResource, type VersionCompare, type VersionFieldChange, type ViewPreset, type WebSocketFactory, type WebSocketLike, type WebhookResource, ackCdcSubscription, checkCdcPipelineHealth, createAgentArtifact, createAgentGoal, createBookmark, createCdcPipeline, createCdcSubscription, createLumiClient, decideAgentApproval, deleteBookmark, deleteCdcPipeline, deleteCdcSubscription, deployCdc, dispatchCdcSubscription, dryRunAccessImport, evaluateAgentArtifact, exportAccessManifest, extractSeo, generateAgentApp, generateTypes, getEffectivePreset, graphql, importAccessManifest, jsonLdScript, legacyRest, listAgentApprovals, listAgentArtifacts, listAgentGoals, listAgentRuns, listAgentTools, listBookmarks, listCdcPipelines, listCdcSubscriptionDeliveries, listCdcSubscriptions, mediaUrl, publishAgentArtifact, readAgentMemoryContext, readCdcEvents, readCdcPipeline, readCdcPipelineMetricHistory, readCdcPipelineMetrics, readCdcSubscription, readItem, readItems, replayCdcSubscription, retryAgentRun, rollbackAgentArtifact, rollbackCdcDeployment, saveUserView, search, startCdcPipeline, stopCdcPipeline, toNextMetadata, updateBookmark, updateCdcPipeline, updateCdcSubscription, validateCdcDeploymentEnv, writeAgentMemory };
package/dist/index.js CHANGED
@@ -948,6 +948,31 @@ function legacyRest() {
948
948
  delete: (id) => client.rawRequest(`/api/v1/extensions/${id}`, { method: "DELETE" })
949
949
  };
950
950
  const access = {
951
+ /**
952
+ * Non-staff permission picker (`/api/v1/access/grants`). One call
953
+ * returns the site's grantable collections plus every realm's limits and
954
+ * current grants, so a client never has to hard-code which actions a
955
+ * realm may hold.
956
+ */
957
+ grants: {
958
+ state: () => client.rawRequest("/api/v1/access/grants"),
959
+ enable: (realm) => client.rawRequest(
960
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/enable`,
961
+ { method: "POST" }
962
+ ),
963
+ disable: (realm) => client.rawRequest(
964
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/disable`,
965
+ { method: "POST" }
966
+ ),
967
+ grant: (realm, input) => client.rawRequest(`/api/v1/access/grants/${encodeURIComponent(realm)}`, {
968
+ method: "POST",
969
+ body: JSON.stringify(input)
970
+ }),
971
+ revoke: (realm, collection, action = "read") => client.rawRequest(
972
+ `/api/v1/access/grants/${encodeURIComponent(realm)}/${encodeURIComponent(collection)}/${encodeURIComponent(action)}`,
973
+ { method: "DELETE" }
974
+ )
975
+ },
951
976
  checkConflicts: (input) => client.rawRequest("/api/v1/access/conflicts/check", {
952
977
  method: "POST",
953
978
  body: JSON.stringify(input)
@@ -976,6 +1001,14 @@ function legacyRest() {
976
1001
  method: "POST",
977
1002
  body: JSON.stringify(input)
978
1003
  }),
1004
+ /**
1005
+ * Replace the key's browser-origin allowlist without rotating the token.
1006
+ * Pass `[]` to remove the constraint entirely.
1007
+ */
1008
+ setAllowedOrigins: (id, allowedOrigins) => client.rawRequest(`/api/v1/api-keys/${id}/allowed-origins`, {
1009
+ method: "PATCH",
1010
+ body: JSON.stringify({ allowedOrigins })
1011
+ }),
979
1012
  revoke: (id) => client.rawRequest(`/api/v1/api-keys/${id}/revoke`, {
980
1013
  method: "POST"
981
1014
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumibase/sdk",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "LumiBase JS SDK (REST + WebSocket) + typegen core. Isomorphic ESM.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",