@superatomai/sdk-node 0.0.83-dsp → 0.0.84-dsp

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.d.mts CHANGED
@@ -4437,6 +4437,29 @@ interface RowFilter {
4437
4437
  */
4438
4438
  label?: string;
4439
4439
  }
4440
+ /**
4441
+ * One table of an exception. Either `link` + `columns`, or `own`.
4442
+ * - `link`: the column that points at the scope table (or, for the scope table itself, its key).
4443
+ * - `columns`: the only columns with real values on rows that are not the user's own; the
4444
+ * rest are NULL there. The user's own rows keep every column.
4445
+ * - `own`: for a table with no stamp column, a predicate for the user's own rows (`{t}` is the
4446
+ * table); its other rows are not visible at all.
4447
+ */
4448
+ interface PolicyExceptionTable {
4449
+ link?: string;
4450
+ columns?: string[];
4451
+ own?: string;
4452
+ }
4453
+ /**
4454
+ * A named grant: extra rows a restricted user may see outside their branch. `visibleKeys` is
4455
+ * one admin-written SELECT of key values of the scope table (one column): the rows that become visible. Each table
4456
+ * then follows its own stamp. Enforced by the rewriter.
4457
+ */
4458
+ interface PolicyException {
4459
+ name?: string;
4460
+ visibleKeys?: string;
4461
+ tables: Record<string, PolicyExceptionTable>;
4462
+ }
4440
4463
  /**
4441
4464
  * What one user may see in one source. `sourceId` is not optional in spirit: a
4442
4465
  * filter naming a column of one database must never be injected into another's
@@ -4450,6 +4473,8 @@ interface SourcePolicy {
4450
4473
  rowFilters?: RowFilter[];
4451
4474
  /** Gate 3. Empty means no table restriction — see SQL-AUTHORIZATION-DESIGN.md. */
4452
4475
  readableTables?: string[];
4476
+ /** Grants outside the scope above. Empty or absent means none. */
4477
+ exceptions?: PolicyException[];
4453
4478
  }
4454
4479
  interface RequestContext {
4455
4480
  principal: Principal;
@@ -6056,4 +6081,4 @@ declare class SuperatomSDK {
6056
6081
  getConversationSimilarityThreshold(): number;
6057
6082
  }
6058
6083
 
6059
- export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type ResolvedAccess, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, accessFromConfig, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
6084
+ export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type PolicyException, type PolicyExceptionTable, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type ResolvedAccess, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, accessFromConfig, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
package/dist/index.d.ts CHANGED
@@ -4437,6 +4437,29 @@ interface RowFilter {
4437
4437
  */
4438
4438
  label?: string;
4439
4439
  }
4440
+ /**
4441
+ * One table of an exception. Either `link` + `columns`, or `own`.
4442
+ * - `link`: the column that points at the scope table (or, for the scope table itself, its key).
4443
+ * - `columns`: the only columns with real values on rows that are not the user's own; the
4444
+ * rest are NULL there. The user's own rows keep every column.
4445
+ * - `own`: for a table with no stamp column, a predicate for the user's own rows (`{t}` is the
4446
+ * table); its other rows are not visible at all.
4447
+ */
4448
+ interface PolicyExceptionTable {
4449
+ link?: string;
4450
+ columns?: string[];
4451
+ own?: string;
4452
+ }
4453
+ /**
4454
+ * A named grant: extra rows a restricted user may see outside their branch. `visibleKeys` is
4455
+ * one admin-written SELECT of key values of the scope table (one column): the rows that become visible. Each table
4456
+ * then follows its own stamp. Enforced by the rewriter.
4457
+ */
4458
+ interface PolicyException {
4459
+ name?: string;
4460
+ visibleKeys?: string;
4461
+ tables: Record<string, PolicyExceptionTable>;
4462
+ }
4440
4463
  /**
4441
4464
  * What one user may see in one source. `sourceId` is not optional in spirit: a
4442
4465
  * filter naming a column of one database must never be injected into another's
@@ -4450,6 +4473,8 @@ interface SourcePolicy {
4450
4473
  rowFilters?: RowFilter[];
4451
4474
  /** Gate 3. Empty means no table restriction — see SQL-AUTHORIZATION-DESIGN.md. */
4452
4475
  readableTables?: string[];
4476
+ /** Grants outside the scope above. Empty or absent means none. */
4477
+ exceptions?: PolicyException[];
4453
4478
  }
4454
4479
  interface RequestContext {
4455
4480
  principal: Principal;
@@ -6056,4 +6081,4 @@ declare class SuperatomSDK {
6056
6081
  getConversationSimilarityThreshold(): number;
6057
6082
  }
6058
6083
 
6059
- export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type ResolvedAccess, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, accessFromConfig, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
6084
+ export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type PolicyException, type PolicyExceptionTable, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type ResolvedAccess, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, accessFromConfig, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
package/dist/index.js CHANGED
@@ -2001,6 +2001,7 @@ function canonicalPolicies(policies) {
2001
2001
  const norm = policies.map((p) => ({
2002
2002
  s: p.sourceId ?? "*",
2003
2003
  t: [...p.readableTables ?? []].sort(),
2004
+ x: JSON.stringify(p.exceptions ?? []),
2004
2005
  f: (p.rowFilters ?? []).map((f) => ({
2005
2006
  t: f.table ?? "*",
2006
2007
  c: f.column,
@@ -2677,6 +2678,38 @@ function accessFromConfig(config2) {
2677
2678
  allowedSources: scoped ? allowedSourcesFrom(scoped.allowedSources) : null
2678
2679
  };
2679
2680
  }
2681
+ function exceptionsFromConfig(raw) {
2682
+ if (!Array.isArray(raw)) return [];
2683
+ const str = (v) => typeof v === "string" && v.trim() ? v.trim() : void 0;
2684
+ const out = [];
2685
+ for (const item of raw) {
2686
+ if (!item || typeof item !== "object") continue;
2687
+ const x = item;
2688
+ const name = typeof x.name === "string" && x.name ? x.name : void 0;
2689
+ if (!x.tables || typeof x.tables !== "object") continue;
2690
+ const visibleKeys = str(x.visibleKeys);
2691
+ const tables = {};
2692
+ for (const [table, spec] of Object.entries(x.tables)) {
2693
+ if (!table || !spec || typeof spec !== "object") continue;
2694
+ const s = spec;
2695
+ const link = str(s.link);
2696
+ const own = str(s.own);
2697
+ const columns = Array.isArray(s.columns) ? s.columns.filter((c) => typeof c === "string" && !!c) : [];
2698
+ let bad = null;
2699
+ if (!own && !link) bad = 'it has neither "link" nor "own"';
2700
+ else if (!own && columns.length === 0) bad = 'it lists no "columns"';
2701
+ else if (!own && !visibleKeys) bad = 'the exception has no "visibleKeys"';
2702
+ if (bad) {
2703
+ logger.warn(`[RequestIdentity] Exception "${name ?? "?"}": table "${table}" dropped because ${bad}.`);
2704
+ continue;
2705
+ }
2706
+ tables[table] = own ? { own } : { link, columns };
2707
+ }
2708
+ if (Object.keys(tables).length === 0) continue;
2709
+ out.push({ name, visibleKeys, tables });
2710
+ }
2711
+ return out;
2712
+ }
2680
2713
  function policiesFromConfig(config2) {
2681
2714
  const raw = scopedForm(config2)?.policies ?? config2;
2682
2715
  const entries = Array.isArray(raw) ? raw : [raw];
@@ -2702,6 +2735,7 @@ function policiesFromConfig(config2) {
2702
2735
  });
2703
2736
  }
2704
2737
  const readableTables = Array.isArray(e.readableTables) ? e.readableTables.filter((t) => typeof t === "string" && !!t) : [];
2738
+ const exceptions = exceptionsFromConfig(e.exceptions);
2705
2739
  if (rowFilters.length === 0 && readableTables.length === 0) continue;
2706
2740
  const label = typeof e.label === "string" && e.label.trim() ? e.label.trim() : void 0;
2707
2741
  if (!label && rowFilters.some((f) => !f.label) && !warnedUnlabelled) {
@@ -2714,7 +2748,8 @@ function policiesFromConfig(config2) {
2714
2748
  sourceId: typeof e.sourceId === "string" && e.sourceId ? e.sourceId : null,
2715
2749
  label,
2716
2750
  rowFilters,
2717
- readableTables
2751
+ readableTables,
2752
+ exceptions
2718
2753
  });
2719
2754
  }
2720
2755
  return out;
package/dist/index.mjs CHANGED
@@ -1889,6 +1889,7 @@ function canonicalPolicies(policies) {
1889
1889
  const norm = policies.map((p) => ({
1890
1890
  s: p.sourceId ?? "*",
1891
1891
  t: [...p.readableTables ?? []].sort(),
1892
+ x: JSON.stringify(p.exceptions ?? []),
1892
1893
  f: (p.rowFilters ?? []).map((f) => ({
1893
1894
  t: f.table ?? "*",
1894
1895
  c: f.column,
@@ -2565,6 +2566,38 @@ function accessFromConfig(config2) {
2565
2566
  allowedSources: scoped ? allowedSourcesFrom(scoped.allowedSources) : null
2566
2567
  };
2567
2568
  }
2569
+ function exceptionsFromConfig(raw) {
2570
+ if (!Array.isArray(raw)) return [];
2571
+ const str = (v) => typeof v === "string" && v.trim() ? v.trim() : void 0;
2572
+ const out = [];
2573
+ for (const item of raw) {
2574
+ if (!item || typeof item !== "object") continue;
2575
+ const x = item;
2576
+ const name = typeof x.name === "string" && x.name ? x.name : void 0;
2577
+ if (!x.tables || typeof x.tables !== "object") continue;
2578
+ const visibleKeys = str(x.visibleKeys);
2579
+ const tables = {};
2580
+ for (const [table, spec] of Object.entries(x.tables)) {
2581
+ if (!table || !spec || typeof spec !== "object") continue;
2582
+ const s = spec;
2583
+ const link = str(s.link);
2584
+ const own = str(s.own);
2585
+ const columns = Array.isArray(s.columns) ? s.columns.filter((c) => typeof c === "string" && !!c) : [];
2586
+ let bad = null;
2587
+ if (!own && !link) bad = 'it has neither "link" nor "own"';
2588
+ else if (!own && columns.length === 0) bad = 'it lists no "columns"';
2589
+ else if (!own && !visibleKeys) bad = 'the exception has no "visibleKeys"';
2590
+ if (bad) {
2591
+ logger.warn(`[RequestIdentity] Exception "${name ?? "?"}": table "${table}" dropped because ${bad}.`);
2592
+ continue;
2593
+ }
2594
+ tables[table] = own ? { own } : { link, columns };
2595
+ }
2596
+ if (Object.keys(tables).length === 0) continue;
2597
+ out.push({ name, visibleKeys, tables });
2598
+ }
2599
+ return out;
2600
+ }
2568
2601
  function policiesFromConfig(config2) {
2569
2602
  const raw = scopedForm(config2)?.policies ?? config2;
2570
2603
  const entries = Array.isArray(raw) ? raw : [raw];
@@ -2590,6 +2623,7 @@ function policiesFromConfig(config2) {
2590
2623
  });
2591
2624
  }
2592
2625
  const readableTables = Array.isArray(e.readableTables) ? e.readableTables.filter((t) => typeof t === "string" && !!t) : [];
2626
+ const exceptions = exceptionsFromConfig(e.exceptions);
2593
2627
  if (rowFilters.length === 0 && readableTables.length === 0) continue;
2594
2628
  const label = typeof e.label === "string" && e.label.trim() ? e.label.trim() : void 0;
2595
2629
  if (!label && rowFilters.some((f) => !f.label) && !warnedUnlabelled) {
@@ -2602,7 +2636,8 @@ function policiesFromConfig(config2) {
2602
2636
  sourceId: typeof e.sourceId === "string" && e.sourceId ? e.sourceId : null,
2603
2637
  label,
2604
2638
  rowFilters,
2605
- readableTables
2639
+ readableTables,
2640
+ exceptions
2606
2641
  });
2607
2642
  }
2608
2643
  return out;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superatomai/sdk-node",
3
- "version": "0.0.83-dsp",
3
+ "version": "0.0.84-dsp",
4
4
  "description": "Node.js TypeScript SDK for Superatom",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",