@narrative.io/data-collaboration-sdk-ts 3.5.1 → 3.7.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.
@@ -16,7 +16,7 @@ export type RunId = string;
16
16
  export type ClientOpId = string;
17
17
  export type ConversationVersion = number;
18
18
  export type ToolUseId = string;
19
- export type AgentModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-sonnet-5.0" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "anthropic.claude-opus-4.7" | "anthropic.claude-opus-4.8" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini" | (string & {});
19
+ export type AgentModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-sonnet-5.0" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "anthropic.claude-opus-4.7" | "anthropic.claude-opus-4.8" | "anthropic.claude-opus-5.0" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini" | (string & {});
20
20
  export type ExecutionCluster = "shared" | "dedicated";
21
21
  /** Subset of JSON Schema Draft 2020-12 accepted by Bedrock structured output. */
22
22
  export type JsonSchemaObject = Record<string, unknown>;
@@ -1,7 +1,7 @@
1
1
  import { BaseApi } from "../base-api";
2
2
  import { CompanyInfoApi } from "../company-info";
3
3
  import type { ApiRecords, Config } from "../types";
4
- import type { CreateMapping, Mapping, MappingExpressionDependencies, MappingTestResult, MappingTestResults, ObjectMapping, PropertyMapping, RawMappingDefinition, RawObjectMapping, RawPropertyMapping, RawValueMapping, ValueMapping } from "./types";
4
+ import type { CachedMapping, CreateMapping, Mapping, MappingDefinition, MappingExpressionDependencies, MappingTestResult, MappingTestResults, ObjectMapping, PropertyMapping, RawCachedMapping, RawMappingDefinition, RawObjectMapping, RawPropertyMapping, RawValueMapping, ValueMapping } from "./types";
5
5
  /**
6
6
  * Class representing the Mappings API.
7
7
  * Extends the BaseApi to provide functionalities specific to mappings.
@@ -111,4 +111,4 @@ declare class MappingsApi extends BaseApi {
111
111
  */
112
112
  getMapping(mappingId: string): Promise<Mapping>;
113
113
  }
114
- export { type CreateMapping, type Mapping, type MappingExpressionDependencies, MappingsApi, type MappingTestResult, type MappingTestResults, type ObjectMapping, type PropertyMapping, type RawMappingDefinition, type RawObjectMapping, type RawPropertyMapping, type RawValueMapping, type ValueMapping, };
114
+ export { type CachedMapping, type CreateMapping, type Mapping, type MappingDefinition, type MappingExpressionDependencies, MappingsApi, type MappingTestResult, type MappingTestResults, type ObjectMapping, type PropertyMapping, type RawCachedMapping, type RawMappingDefinition, type RawObjectMapping, type RawPropertyMapping, type RawValueMapping, type ValueMapping, };
@@ -3,7 +3,7 @@ export interface Mapping {
3
3
  attribute_id: number;
4
4
  created_at: string;
5
5
  dataset_id: number;
6
- mapping: ObjectMapping | ValueMapping;
6
+ mapping: MappingDefinition;
7
7
  status: MappingStatus;
8
8
  updated_at: string;
9
9
  created_by: number;
@@ -33,6 +33,16 @@ export interface RawValueMapping {
33
33
  type: "value_mapping";
34
34
  expression: string;
35
35
  }
36
+ /**
37
+ * Create/update shape for cached mappings.
38
+ * `cache_dataset_id` is assigned server-side and returned on the read shape (`CachedMapping`).
39
+ * Only valid on company-scoped create endpoints (e.g. `POST /mappings/companies/{company_id}`).
40
+ */
41
+ export interface RawCachedMapping {
42
+ type: "cached_mapping";
43
+ /** One or more SQL expressions evaluated against the source dataset to build the join key. */
44
+ input_expressions: string[];
45
+ }
36
46
  export interface PropertyMapping {
37
47
  path: string;
38
48
  expression: string;
@@ -47,7 +57,17 @@ export interface ValueMapping {
47
57
  expression: string;
48
58
  dependencies: MappingExpressionDependencies;
49
59
  }
50
- export type RawMappingDefinition = RawObjectMapping | RawValueMapping;
60
+ /** Read shape for cached mappings. See `RawCachedMapping` for create/update requests. */
61
+ export interface CachedMapping {
62
+ type: "cached_mapping";
63
+ /** Dataset that stores the input → mapped_value lookup rows for this mapping. */
64
+ cache_dataset_id: number;
65
+ /** One or more SQL expressions evaluated against the source dataset to build the join key. */
66
+ input_expressions: string[];
67
+ dependencies?: MappingExpressionDependencies;
68
+ }
69
+ export type MappingDefinition = ObjectMapping | ValueMapping | CachedMapping;
70
+ export type RawMappingDefinition = RawObjectMapping | RawValueMapping | RawCachedMapping;
51
71
  export interface CreateMapping {
52
72
  attribute_id: number;
53
73
  dataset_id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "3.5.1",
3
+ "version": "3.7.0",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",
@@ -30,14 +30,14 @@
30
30
  "@babel/core": "8.0.1",
31
31
  "@babel/preset-env": "8.0.2",
32
32
  "@babel/preset-typescript": "8.0.1",
33
- "@biomejs/biome": "2.5.2",
34
- "@commitlint/cli": "21.2.0",
33
+ "@biomejs/biome": "2.5.4",
34
+ "@commitlint/cli": "21.2.1",
35
35
  "@commitlint/config-conventional": "21.2.0",
36
36
  "@types/jest": "30.0.0",
37
37
  "@types/json-schema": "7.0.15",
38
38
  "babel-jest": "30.4.1",
39
39
  "jest": "30.4.2",
40
- "lefthook": "2.1.9",
40
+ "lefthook": "2.1.10",
41
41
  "ts-jest": "29.4.11",
42
42
  "typescript": "6.0.0-dev.20260416"
43
43
  },