@narrative.io/data-collaboration-sdk-ts 2.94.0 → 2.95.0-beta.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/build/apps/index.d.ts +7 -0
- package/build/apps/index.js +9 -0
- package/build/collaboration-policy/core/filter-builder.js +7 -1
- package/build/collaboration-policy/core/jsonschema/json-schema-types.d.ts +45 -0
- package/build/collaboration-policy/core/jsonschema/json-schema-types.js +1 -0
- package/build/collaboration-policy/core/jsonschema/policy-branches.d.ts +49 -0
- package/build/collaboration-policy/core/jsonschema/policy-branches.js +1 -0
- package/build/collaboration-policy/core/jsonschema/policy-evaluator.d.ts +22 -0
- package/build/collaboration-policy/core/jsonschema/policy-evaluator.js +260 -0
- package/build/collaboration-policy/core/jsonschema/sql-builder.d.ts +79 -0
- package/build/collaboration-policy/core/jsonschema/sql-builder.js +305 -0
- package/build/collaboration-policy/core/jsonschema/sql-poc.d.ts +79 -0
- package/build/collaboration-policy/core/jsonschema/sql-poc.js +305 -0
- package/build/collaboration-policy/core/sql-builder.js +11 -9
- package/build/collaboration-policy/core/types.d.ts +81 -10
- package/build/collaboration-policy/index.d.ts +5 -4
- package/build/collaboration-policy/index.js +4 -3
- package/build/collaboration-policy/useCollaborationPolicy.d.ts +13 -4
- package/build/collaboration-policy/useCollaborationPolicy.js +23 -1
- package/build/collaboration-policy/utils/path-helpers.d.ts +7 -3
- package/build/collaboration-policy/utils/path-helpers.js +6 -22
- package/build/compute-pools/index.d.ts +10 -0
- package/build/compute-pools/index.js +21 -0
- package/build/compute-pools/types.d.ts +97 -0
- package/build/compute-pools/types.js +1 -0
- package/build/data-planes/index.d.ts +2 -0
- package/build/data-planes/index.js +6 -0
- package/build/data-planes/types.d.ts +11 -1
- package/build/datasets/index.d.ts +11 -2
- package/build/datasets/index.js +12 -0
- package/build/datasets/types.d.ts +4 -0
- package/build/index.d.ts +4 -1
- package/build/index.js +4 -0
- package/build/nql/SubstraitParser.d.ts +771 -0
- package/build/nql/SubstraitParser.js +797 -0
- package/package.json +10 -9
- package/build/collaboration-policy/types/collaboration-policy.d.ts +0 -1370
- package/build/collaboration-policy/types/collaboration-policy.js +0 -274
- package/build/collaboration-policy/types/index.d.ts +0 -2
- package/build/collaboration-policy/types/index.js +0 -1
|
@@ -41,30 +41,34 @@ function parseDurationToMilliseconds(duration) {
|
|
|
41
41
|
* The smallest duration means the most frequent refresh rate.
|
|
42
42
|
*
|
|
43
43
|
* @param schedules - Array of ISO 8601 duration strings
|
|
44
|
-
* @returns The smallest duration
|
|
44
|
+
* @returns The smallest duration as an ISO 8601 string, or "P1M" (1 month) if no schedules provided
|
|
45
45
|
*/
|
|
46
46
|
function getSmallestRefreshSchedule(schedules) {
|
|
47
|
-
// Default to monthly
|
|
48
|
-
const
|
|
47
|
+
// Default to monthly
|
|
48
|
+
const defaultMonthly = "P1M";
|
|
49
49
|
if (schedules.length === 0) {
|
|
50
|
-
return
|
|
50
|
+
return defaultMonthly;
|
|
51
51
|
}
|
|
52
52
|
if (schedules.length === 1) {
|
|
53
53
|
try {
|
|
54
|
-
return
|
|
54
|
+
// Validate by parsing, but return the original string
|
|
55
|
+
parseDurationToMilliseconds(schedules[0]);
|
|
56
|
+
return schedules[0];
|
|
55
57
|
}
|
|
56
58
|
catch (error) {
|
|
57
59
|
console.warn(`Invalid refresh schedule: ${schedules[0]}, using default`, error);
|
|
58
|
-
return
|
|
60
|
+
return defaultMonthly;
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
// Find the schedule with the smallest duration (most frequent refresh)
|
|
62
64
|
let smallestValue = Number.MAX_SAFE_INTEGER;
|
|
65
|
+
let smallestSchedule = null;
|
|
63
66
|
for (const schedule of schedules) {
|
|
64
67
|
try {
|
|
65
68
|
const value = parseDurationToMilliseconds(schedule);
|
|
66
69
|
if (value < smallestValue) {
|
|
67
70
|
smallestValue = value;
|
|
71
|
+
smallestSchedule = schedule;
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
catch (error) {
|
|
@@ -73,9 +77,7 @@ function getSmallestRefreshSchedule(schedules) {
|
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
// If all schedules failed to parse, return default
|
|
76
|
-
return
|
|
77
|
-
? defaultMonthlyMs
|
|
78
|
-
: smallestValue;
|
|
80
|
+
return smallestSchedule ?? defaultMonthly;
|
|
79
81
|
}
|
|
80
82
|
/**
|
|
81
83
|
* Builds structured WHERE clauses for a single branch node
|
|
@@ -1,20 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* PathValue describes a path to a subfield, expressed as either dot notation
|
|
3
|
+
* or a JSON Pointer. Used in filter attribute references to specify which
|
|
4
|
+
* subfield of an attribute to operate on.
|
|
5
|
+
*/
|
|
6
|
+
export type PathValue = {
|
|
7
|
+
dot: string;
|
|
8
|
+
} | {
|
|
9
|
+
pointer: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An attribute reference within a filter expression.
|
|
13
|
+
*/
|
|
14
|
+
export interface FilterAttributeRef {
|
|
15
|
+
type: "attribute";
|
|
16
|
+
attribute_name: string;
|
|
17
|
+
path?: PathValue;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A filter expression: a literal value or an attribute reference.
|
|
21
|
+
*/
|
|
22
|
+
export type FilterExpression = string | number | boolean | FilterAttributeRef;
|
|
23
|
+
/**
|
|
24
|
+
* PolicyFilter is a single filter entry in a policy definition.
|
|
25
|
+
*
|
|
26
|
+
* This is the canonical filter type used across the codebase (JSON-Schema
|
|
27
|
+
* filters, SQL builder, etc.).
|
|
28
|
+
*/
|
|
29
|
+
export type PolicyFilter = PolicyFilterAndOr | PolicyFilterNot | PolicyFilterIsNull | PolicyFilterIn | PolicyFilterCompare | PolicyFilterBetween;
|
|
30
|
+
interface PolicyFilterBase {
|
|
31
|
+
stage?: "generation";
|
|
32
|
+
name?: string;
|
|
33
|
+
required?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface PolicyFilterAndOr extends PolicyFilterBase {
|
|
36
|
+
op: "and" | "or";
|
|
37
|
+
args: FilterExpression[];
|
|
38
|
+
}
|
|
39
|
+
interface PolicyFilterNot extends PolicyFilterBase {
|
|
40
|
+
op: "not";
|
|
41
|
+
args: FilterExpression[];
|
|
42
|
+
}
|
|
43
|
+
interface PolicyFilterIsNull extends PolicyFilterBase {
|
|
44
|
+
op: "is_null" | "is_not_null";
|
|
45
|
+
left: FilterExpression;
|
|
46
|
+
}
|
|
47
|
+
interface PolicyFilterIn extends PolicyFilterBase {
|
|
48
|
+
op: "in" | "not in";
|
|
49
|
+
left: FilterExpression;
|
|
50
|
+
right: FilterExpression[];
|
|
51
|
+
}
|
|
52
|
+
interface PolicyFilterCompare extends PolicyFilterBase {
|
|
53
|
+
op: "=" | "<>" | ">" | ">=" | "<" | "<=" | "like" | "not like";
|
|
54
|
+
left: FilterExpression;
|
|
55
|
+
right: FilterExpression;
|
|
56
|
+
}
|
|
57
|
+
interface PolicyFilterBetween extends PolicyFilterBase {
|
|
58
|
+
op: "between";
|
|
59
|
+
operand: FilterExpression;
|
|
60
|
+
lower: FilterExpression;
|
|
61
|
+
upper: FilterExpression;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Map from attribute name -> set of normalized paths that must be selected
|
|
65
|
+
* for SQL generation.
|
|
66
|
+
*/
|
|
9
67
|
export type AttributePathIndex = Map<string, Set<string>>;
|
|
68
|
+
/**
|
|
69
|
+
* A logical group of SQL fragments combined by an operation.
|
|
70
|
+
*/
|
|
10
71
|
export interface PolicySqlGroup {
|
|
11
72
|
fragments: Array<string | PolicySqlGroup>;
|
|
12
73
|
operation: "AND" | "OR";
|
|
13
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Core SQL fragments required to represent a set of collaboration policies.
|
|
77
|
+
*/
|
|
14
78
|
export interface PolicySqlFragments {
|
|
15
79
|
select: string[];
|
|
16
80
|
where: Array<PolicySqlGroup | string>;
|
|
17
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Full result of applying collaboration policies to a dataset, including:
|
|
84
|
+
* - which policies were applied
|
|
85
|
+
* - which were skipped and why
|
|
86
|
+
* - warnings
|
|
87
|
+
* - the minimum refresh schedule across applied policies
|
|
88
|
+
*/
|
|
18
89
|
export interface PolicyMatchResult extends PolicySqlFragments {
|
|
19
90
|
appliedPolicies: string[];
|
|
20
91
|
skippedPolicies: Array<{
|
|
@@ -23,7 +94,7 @@ export interface PolicyMatchResult extends PolicySqlFragments {
|
|
|
23
94
|
details: string[];
|
|
24
95
|
}>;
|
|
25
96
|
warnings: string[];
|
|
26
|
-
/** The minimum refresh schedule
|
|
27
|
-
refresh_schedule:
|
|
97
|
+
/** The minimum refresh schedule as an ISO 8601 duration string across all evaluated policies */
|
|
98
|
+
refresh_schedule: string;
|
|
28
99
|
}
|
|
29
100
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
1
|
+
export type { JsonSchemaConnectorPolicy } from "./core/jsonschema/json-schema-types";
|
|
2
|
+
export { evaluateJsonSchemaPolicies } from "./core/jsonschema/policy-evaluator";
|
|
3
|
+
export { buildPolicySql, buildPolicySqlWithJsonSchema, buildPolicySqlWithValidation, categorizePolicies, type JsonSchemaPolicyMatchResult, } from "./core/jsonschema/sql-builder";
|
|
4
|
+
export type { AttributePathIndex, FilterAttributeRef, FilterExpression, PathValue, PolicyFilter, PolicyMatchResult, PolicySqlFragments, PolicySqlGroup, } from "./core/types";
|
|
5
|
+
export { default as useCollaborationPolicy } from "./useCollaborationPolicy";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { buildPolicySql, buildPolicySqlWithValidation, categorizePolicies, } from "./core/sql-builder";
|
|
3
|
-
|
|
1
|
+
export { evaluateJsonSchemaPolicies } from "./core/jsonschema/policy-evaluator";
|
|
2
|
+
export { buildPolicySql, buildPolicySqlWithJsonSchema, buildPolicySqlWithValidation, categorizePolicies, } from "./core/jsonschema/sql-builder";
|
|
3
|
+
// Hook-style entrypoint
|
|
4
|
+
export { default as useCollaborationPolicy } from "./useCollaborationPolicy";
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { Attribute } from "../attributes/types";
|
|
2
2
|
import type { Dataset } from "../datasets/types";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { JsonSchemaConnectorPolicy } from "./core/jsonschema/json-schema-types";
|
|
4
|
+
import type { PolicyMatchResult, PolicySqlFragments } from "./core/types";
|
|
5
|
+
/**
|
|
6
|
+
* Hook-style wrapper that exposes collaboration policy helpers.
|
|
7
|
+
*
|
|
8
|
+
* Public API surface:
|
|
9
|
+
* - categorizePolicies
|
|
10
|
+
* - buildPolicySql
|
|
11
|
+
* - buildPolicySqlWithValidation
|
|
12
|
+
*/
|
|
5
13
|
export default function useCollaborationPolicy(): {
|
|
6
|
-
getEligibleConnectorsPolicies: (dataset: Dataset, policies:
|
|
7
|
-
buildPolicySqlFragments: (dataset: Dataset, policies:
|
|
14
|
+
getEligibleConnectorsPolicies: (dataset: Dataset, policies: JsonSchemaConnectorPolicy[], attributes: Attribute[]) => JsonSchemaConnectorPolicy[];
|
|
15
|
+
buildPolicySqlFragments: (dataset: Dataset, policies: JsonSchemaConnectorPolicy[], attributes: Attribute[]) => PolicySqlFragments;
|
|
16
|
+
buildPolicySqlWithValidationJsonSchema: (dataset: Dataset, policies: JsonSchemaConnectorPolicy[], attributes: Attribute[]) => PolicyMatchResult;
|
|
8
17
|
};
|
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { buildPolicySql, categorizePolicies } from "./core/sql-builder";
|
|
1
|
+
import { buildPolicySql, buildPolicySqlWithValidation, categorizePolicies, } from "./core/jsonschema/sql-builder";
|
|
2
|
+
/**
|
|
3
|
+
* Hook-style wrapper that exposes collaboration policy helpers.
|
|
4
|
+
*
|
|
5
|
+
* Public API surface:
|
|
6
|
+
* - categorizePolicies
|
|
7
|
+
* - buildPolicySql
|
|
8
|
+
* - buildPolicySqlWithValidation
|
|
9
|
+
*/
|
|
2
10
|
export default function useCollaborationPolicy() {
|
|
11
|
+
/**
|
|
12
|
+
* Get policies that are compatible with a dataset using the JSON-Schema policy system.
|
|
13
|
+
*/
|
|
3
14
|
const getEligibleConnectorsPolicies = (dataset, policies, attributes) => {
|
|
4
15
|
const { matching } = categorizePolicies(policies, dataset, attributes);
|
|
5
16
|
return matching;
|
|
6
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Build SQL fragments using JSON-Schema policies, without per-policy validation.
|
|
20
|
+
*/
|
|
7
21
|
const buildPolicySqlFragments = (dataset, policies, attributes) => {
|
|
8
22
|
return buildPolicySql(dataset, policies, attributes);
|
|
9
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Validate each JSON-Schema policy against the dataset and build SQL
|
|
26
|
+
* plus metadata (appliedPolicies, skippedPolicies, etc.).
|
|
27
|
+
*/
|
|
28
|
+
const buildPolicySqlWithValidationJsonSchema = (dataset, policies, attributes) => {
|
|
29
|
+
return buildPolicySqlWithValidation(dataset, policies, attributes);
|
|
30
|
+
};
|
|
10
31
|
return {
|
|
11
32
|
getEligibleConnectorsPolicies,
|
|
12
33
|
buildPolicySqlFragments,
|
|
34
|
+
buildPolicySqlWithValidationJsonSchema,
|
|
13
35
|
};
|
|
14
36
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { PathValue } from "../core/types";
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a PathValue (dot notation or JSON pointer) into a simple dot-notation string.
|
|
4
|
+
*
|
|
5
|
+
* @param path - A PathValue with either `{ dot: "..." }` or `{ pointer: "..." }` format.
|
|
6
|
+
* @returns Normalized dot-notation string, or empty string for undefined/null.
|
|
7
|
+
*/
|
|
4
8
|
export declare function normalizePathValue(path?: PathValue): string;
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
attributePaths.add(normalized);
|
|
8
|
-
index.set(attribute.name, attributePaths);
|
|
9
|
-
}
|
|
10
|
-
function determineDefaultPath(attribute) {
|
|
11
|
-
if (attribute.type === "object" && "properties" in attribute) {
|
|
12
|
-
const properties = attribute.properties ?? {};
|
|
13
|
-
if ("value" in properties) {
|
|
14
|
-
return "value";
|
|
15
|
-
}
|
|
16
|
-
const [firstKey] = Object.keys(properties);
|
|
17
|
-
if (firstKey) {
|
|
18
|
-
return firstKey;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a PathValue (dot notation or JSON pointer) into a simple dot-notation string.
|
|
3
|
+
*
|
|
4
|
+
* @param path - A PathValue with either `{ dot: "..." }` or `{ pointer: "..." }` format.
|
|
5
|
+
* @returns Normalized dot-notation string, or empty string for undefined/null.
|
|
6
|
+
*/
|
|
23
7
|
export function normalizePathValue(path) {
|
|
24
8
|
if (!path) {
|
|
25
9
|
return "";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
import type { ComputePoolResponse, CreateComputePoolRequest, ListComputePoolsParams, ListComputePoolsResponse, UpdateComputePoolRequest } from "./types";
|
|
3
|
+
export declare class ComputePoolsApi extends BaseApi {
|
|
4
|
+
private computePoolsResourcePath;
|
|
5
|
+
listComputePools(dataPlaneId: string, params?: ListComputePoolsParams): Promise<ListComputePoolsResponse>;
|
|
6
|
+
createComputePool(dataPlaneId: string, request: CreateComputePoolRequest): Promise<ComputePoolResponse>;
|
|
7
|
+
getComputePool(dataPlaneId: string, computePoolId: string): Promise<ComputePoolResponse>;
|
|
8
|
+
updateComputePool(dataPlaneId: string, computePoolId: string, request: UpdateComputePoolRequest): Promise<ComputePoolResponse>;
|
|
9
|
+
archiveComputePool(dataPlaneId: string, computePoolId: string): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
export class ComputePoolsApi extends BaseApi {
|
|
3
|
+
computePoolsResourcePath(dataPlaneId) {
|
|
4
|
+
return `data-planes/${dataPlaneId}/compute-pools`;
|
|
5
|
+
}
|
|
6
|
+
async listComputePools(dataPlaneId, params) {
|
|
7
|
+
return await this.get(this.computePoolsResourcePath(dataPlaneId), params);
|
|
8
|
+
}
|
|
9
|
+
async createComputePool(dataPlaneId, request) {
|
|
10
|
+
return await this.post(this.computePoolsResourcePath(dataPlaneId), request);
|
|
11
|
+
}
|
|
12
|
+
async getComputePool(dataPlaneId, computePoolId) {
|
|
13
|
+
return await this.get(`${this.computePoolsResourcePath(dataPlaneId)}/${computePoolId}`);
|
|
14
|
+
}
|
|
15
|
+
async updateComputePool(dataPlaneId, computePoolId, request) {
|
|
16
|
+
return await this.put(`${this.computePoolsResourcePath(dataPlaneId)}/${computePoolId}`, request);
|
|
17
|
+
}
|
|
18
|
+
async archiveComputePool(dataPlaneId, computePoolId) {
|
|
19
|
+
await this.delete(`${this.computePoolsResourcePath(dataPlaneId)}/${computePoolId}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type ComputePoolType = "owned" | "shared";
|
|
2
|
+
export type ComputePoolStatus = "active" | "archived";
|
|
3
|
+
export type SnowflakeWarehouseSize = "x-small" | "small" | "medium" | "large" | "x-large" | "2x-large" | "3x-large" | "4x-large" | "5x-large" | "6x-large";
|
|
4
|
+
export type SnowflakeWarehouseType = "standard" | "snowpark_optimized";
|
|
5
|
+
export type ScalingPolicy = "standard" | "economy";
|
|
6
|
+
export interface SnowflakeWarehouseExternalId {
|
|
7
|
+
type: "snowflake_warehouse";
|
|
8
|
+
name: string;
|
|
9
|
+
alias: string;
|
|
10
|
+
}
|
|
11
|
+
export type ComputePoolExternalId = SnowflakeWarehouseExternalId;
|
|
12
|
+
export interface SnowflakeWarehouseProvider {
|
|
13
|
+
type: "snowflake_warehouse";
|
|
14
|
+
size?: SnowflakeWarehouseSize;
|
|
15
|
+
warehouse_type?: SnowflakeWarehouseType;
|
|
16
|
+
auto_suspend?: number;
|
|
17
|
+
auto_resume?: boolean;
|
|
18
|
+
min_cluster_count?: number;
|
|
19
|
+
max_cluster_count?: number;
|
|
20
|
+
scaling_policy?: ScalingPolicy;
|
|
21
|
+
max_concurrency_level?: number;
|
|
22
|
+
statement_timeout_in_seconds?: number;
|
|
23
|
+
statement_queued_timeout_in_seconds?: number;
|
|
24
|
+
enable_query_acceleration?: boolean;
|
|
25
|
+
query_acceleration_max_scale_factor?: number;
|
|
26
|
+
resource_constraint?: string;
|
|
27
|
+
comment?: string;
|
|
28
|
+
}
|
|
29
|
+
export type ComputePoolProvider = SnowflakeWarehouseProvider;
|
|
30
|
+
export interface ParticipantsAll {
|
|
31
|
+
type: "all";
|
|
32
|
+
}
|
|
33
|
+
export interface ParticipantsNone {
|
|
34
|
+
type: "none";
|
|
35
|
+
}
|
|
36
|
+
export interface ParticipantsInclusion {
|
|
37
|
+
type: "inclusion";
|
|
38
|
+
company_ids: number[];
|
|
39
|
+
}
|
|
40
|
+
export type Participants = ParticipantsAll | ParticipantsNone | ParticipantsInclusion;
|
|
41
|
+
export interface ComputePoolCollaborators {
|
|
42
|
+
use: Participants;
|
|
43
|
+
}
|
|
44
|
+
export interface ComputePoolOwnedResponse {
|
|
45
|
+
type: "owned";
|
|
46
|
+
id: string;
|
|
47
|
+
company_id: number;
|
|
48
|
+
data_plane_id: string;
|
|
49
|
+
external_id: ComputePoolExternalId;
|
|
50
|
+
name: string;
|
|
51
|
+
display_name: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
status: ComputePoolStatus;
|
|
54
|
+
created_at: string;
|
|
55
|
+
updated_at?: string;
|
|
56
|
+
tags: string[];
|
|
57
|
+
provider: ComputePoolProvider;
|
|
58
|
+
collaborators: ComputePoolCollaborators;
|
|
59
|
+
}
|
|
60
|
+
export interface ComputePoolSharedResponse {
|
|
61
|
+
type: "shared";
|
|
62
|
+
id: string;
|
|
63
|
+
company_id: number;
|
|
64
|
+
data_plane_id: string;
|
|
65
|
+
external_id: ComputePoolExternalId;
|
|
66
|
+
name: string;
|
|
67
|
+
display_name: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
status: ComputePoolStatus;
|
|
70
|
+
created_at: string;
|
|
71
|
+
updated_at?: string;
|
|
72
|
+
tags: string[];
|
|
73
|
+
provider: ComputePoolProvider;
|
|
74
|
+
}
|
|
75
|
+
export type ComputePoolResponse = ComputePoolOwnedResponse | ComputePoolSharedResponse;
|
|
76
|
+
export interface CreateComputePoolRequest {
|
|
77
|
+
external_id: ComputePoolExternalId;
|
|
78
|
+
name: string;
|
|
79
|
+
display_name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
tags?: string[];
|
|
82
|
+
collaborators?: ComputePoolCollaborators;
|
|
83
|
+
provider: ComputePoolProvider;
|
|
84
|
+
}
|
|
85
|
+
export interface UpdateComputePoolRequest {
|
|
86
|
+
display_name?: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
tags?: string[];
|
|
89
|
+
provider?: ComputePoolProvider;
|
|
90
|
+
collaborators?: ComputePoolCollaborators;
|
|
91
|
+
}
|
|
92
|
+
export interface ListComputePoolsResponse {
|
|
93
|
+
records: ComputePoolResponse[];
|
|
94
|
+
}
|
|
95
|
+
export type ListComputePoolsParams = {
|
|
96
|
+
status?: ComputePoolStatus;
|
|
97
|
+
} & Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,4 +4,6 @@ import type { DataPlane } from "./types";
|
|
|
4
4
|
export declare class DataPlaneApi extends BaseApi {
|
|
5
5
|
getDataPlanes(): Promise<ApiRecords<DataPlane>>;
|
|
6
6
|
getDataPlane(dataPlaneId: string): Promise<DataPlane>;
|
|
7
|
+
setDefaultComputePool(dataPlaneId: string, computePoolId: string): Promise<DataPlane>;
|
|
8
|
+
clearDefaultComputePool(dataPlaneId: string): Promise<void>;
|
|
7
9
|
}
|
|
@@ -7,4 +7,10 @@ export class DataPlaneApi extends BaseApi {
|
|
|
7
7
|
async getDataPlane(dataPlaneId) {
|
|
8
8
|
return await this.get(`${resourceName}/${dataPlaneId}`);
|
|
9
9
|
}
|
|
10
|
+
async setDefaultComputePool(dataPlaneId, computePoolId) {
|
|
11
|
+
return await this.put(`${resourceName}/${dataPlaneId}/default-compute-pool/${computePoolId}`, undefined);
|
|
12
|
+
}
|
|
13
|
+
async clearDefaultComputePool(dataPlaneId) {
|
|
14
|
+
await this.delete(`${resourceName}/${dataPlaneId}/default-compute-pool`);
|
|
15
|
+
}
|
|
10
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ComputePoolResponse, Participants } from "../compute-pools/types";
|
|
1
2
|
export type DataPlaneType = "owned" | "shared";
|
|
2
|
-
export type DataPlaneStatus = "active" | "inactive";
|
|
3
|
+
export type DataPlaneStatus = "active" | "inactive" | "archived";
|
|
3
4
|
export type DataPlanePlatformType = "platform_snowflake" | "platform_shared_snowflake" | "platform_aws" | "platform_shared_aws";
|
|
4
5
|
export type DataPlaneRegionType = "region_aws";
|
|
5
6
|
export interface DataPlanePlatformRegion {
|
|
@@ -13,6 +14,9 @@ export interface DataPlanePlatform {
|
|
|
13
14
|
organization_name: string;
|
|
14
15
|
region: DataPlanePlatformRegion;
|
|
15
16
|
}
|
|
17
|
+
export interface DataPlaneCollaborators {
|
|
18
|
+
use: Participants;
|
|
19
|
+
}
|
|
16
20
|
export interface DataPlane {
|
|
17
21
|
type: DataPlaneType;
|
|
18
22
|
id: string;
|
|
@@ -23,4 +27,10 @@ export interface DataPlane {
|
|
|
23
27
|
platform: DataPlanePlatform;
|
|
24
28
|
status: DataPlaneStatus;
|
|
25
29
|
updated_at: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
last_heartbeat_at?: string;
|
|
33
|
+
default_compute_pool_id?: string;
|
|
34
|
+
compute_pools?: ComputePoolResponse[];
|
|
35
|
+
collaborators?: DataPlaneCollaborators;
|
|
26
36
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { UnknownJob } from "src/jobs/types";
|
|
2
2
|
import { BaseApi } from "../base-api";
|
|
3
3
|
import type { ApiRecords } from "../types";
|
|
4
|
-
import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RecalculationInfo, RetentionPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotRange, UpdateDatasetRefreshScheduleRequest, UpdateDatasetRequest, Value } from "./types";
|
|
5
|
-
export type { FilePerSnapshotResponse, Dataset, RetentionPolicy, DatasetTableSummaryAPIResponse, ColumnStatistics, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, SchemaArrayItemsPrimitive, SchemaArrayItemsObject, SchemaArrayItemsArray, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value, CreateDatasetRequest, UpdateDatasetRefreshScheduleRequest, CreateDatasetRefreshScheduleRequest, };
|
|
4
|
+
import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset, DatasetInterfaceValidation, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RecalculationInfo, RetentionPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotRange, UpdateDatasetRefreshScheduleRequest, UpdateDatasetRequest, Value } from "./types";
|
|
5
|
+
export type { FilePerSnapshotResponse, Dataset, RetentionPolicy, DatasetTableSummaryAPIResponse, ColumnStatistics, UpdateDatasetRequest, SchemaFileConfigType, SchemaPropertiesType, DatasetStatus, DatasetWriteMode, SchemaFileConfig, SchemaProperties, SchemaProperty, SchemaPrimitiveProperty, SchemaObjectProperty, SchemaArrayProperty, SchemaArrayItems, SchemaArrayItemsPrimitive, SchemaArrayItemsObject, SchemaArrayItemsArray, Schema, AdvancedStatisticsMetadata, SnapshotRange, Configuration, Columns, ColumnSummary, BasicStatistics, AdvancedStatistics, Histogram, Value, CreateDatasetRequest, UpdateDatasetRefreshScheduleRequest, CreateDatasetRefreshScheduleRequest, DatasetInterfaceValidation, };
|
|
6
6
|
/**
|
|
7
7
|
* @module DatasetApi
|
|
8
8
|
* @description This module provides methods for fetching datasets.
|
|
@@ -215,4 +215,13 @@ export declare class DatasetApi extends BaseApi {
|
|
|
215
215
|
createDatasetRefreshSchedule(datasetId: number, refreshSchedule: CreateDatasetRefreshScheduleRequest): Promise<void>;
|
|
216
216
|
updateDatasetRefreshSchedule(datasetId: number, refreshSchedule: UpdateDatasetRefreshScheduleRequest): Promise<void>;
|
|
217
217
|
deleteDatasetRefreshSchedule(datasetId: number): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* Validate which connector interfaces are compatible with a dataset.
|
|
220
|
+
* Filtered by the user's installed apps and optionally by tags.
|
|
221
|
+
*
|
|
222
|
+
* @param {number} datasetId - The ID of the dataset to validate interfaces against.
|
|
223
|
+
* @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
|
|
224
|
+
* @returns {Promise<DatasetInterfaceValidation>} - Accepted interface IDs and per-interface validation errors.
|
|
225
|
+
*/
|
|
226
|
+
getDatasetInterfaces(datasetId: number, tags?: string[]): Promise<DatasetInterfaceValidation>;
|
|
218
227
|
}
|
package/build/datasets/index.js
CHANGED
|
@@ -287,4 +287,16 @@ export class DatasetApi extends BaseApi {
|
|
|
287
287
|
async deleteDatasetRefreshSchedule(datasetId) {
|
|
288
288
|
await this.delete(`${resourceName}/${datasetId}/refresh-schedule`);
|
|
289
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Validate which connector interfaces are compatible with a dataset.
|
|
292
|
+
* Filtered by the user's installed apps and optionally by tags.
|
|
293
|
+
*
|
|
294
|
+
* @param {number} datasetId - The ID of the dataset to validate interfaces against.
|
|
295
|
+
* @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
|
|
296
|
+
* @returns {Promise<DatasetInterfaceValidation>} - Accepted interface IDs and per-interface validation errors.
|
|
297
|
+
*/
|
|
298
|
+
async getDatasetInterfaces(datasetId, tags) {
|
|
299
|
+
const queryString = this.constructQueryString(tags != null ? { tags } : undefined);
|
|
300
|
+
return await this.get(`${resourceName}/${datasetId}/interfaces${queryString}`);
|
|
301
|
+
}
|
|
290
302
|
}
|
|
@@ -244,6 +244,10 @@ export interface CreateDatasetRequest {
|
|
|
244
244
|
export interface IngestDatasetFileRequest {
|
|
245
245
|
source_file: string;
|
|
246
246
|
}
|
|
247
|
+
export interface DatasetInterfaceValidation {
|
|
248
|
+
accepted: string[];
|
|
249
|
+
errors: Record<string, string[]>;
|
|
250
|
+
}
|
|
247
251
|
export interface UpdateDatasetRefreshScheduleRequest {
|
|
248
252
|
cron?: string;
|
|
249
253
|
cron_zone_id?: string;
|
package/build/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./authentication";
|
|
|
7
7
|
export * from "./base-api";
|
|
8
8
|
export * from "./collaboration-policy";
|
|
9
9
|
export * from "./company-info";
|
|
10
|
+
export * from "./compute-pools";
|
|
11
|
+
export * from "./compute-pools/types";
|
|
10
12
|
export * from "./connections";
|
|
11
13
|
export * from "./contracts";
|
|
12
14
|
export * from "./data-planes";
|
|
@@ -57,6 +59,7 @@ import { AttributeApi, AttributeApiV2 } from "./attributes";
|
|
|
57
59
|
import { AuthenticationApi } from "./authentication";
|
|
58
60
|
import { BaseApi } from "./base-api";
|
|
59
61
|
import { CompanyInfoApi } from "./company-info";
|
|
62
|
+
import { ComputePoolsApi } from "./compute-pools";
|
|
60
63
|
import { ConnectionsApi } from "./connections";
|
|
61
64
|
import { ContractsApi } from "./contracts";
|
|
62
65
|
import { DataPlaneApi } from "./data-planes";
|
|
@@ -83,6 +86,6 @@ import { WhoAmIApi } from "./whoami";
|
|
|
83
86
|
import { WorkflowsApi } from "./workflows";
|
|
84
87
|
declare class NarrativeApi extends BaseApi {
|
|
85
88
|
}
|
|
86
|
-
interface NarrativeApi extends BaseApi, HealthCheckApi, AccessTokensApi, DataPlaneApi, DatasetApi, RosettaStoneApi, AttributeApi, AttributeApiV2, PingApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi, JobsApi, QueriesApi, ViewsApi, ModelsApi, ModelTrainingApi, ModelInferenceApi, EncryptionMaterialApi, WhoAmIApi, WorkflowsApi {
|
|
89
|
+
interface NarrativeApi extends BaseApi, HealthCheckApi, AccessTokensApi, DataPlaneApi, DatasetApi, RosettaStoneApi, AttributeApi, AttributeApiV2, PingApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi, JobsApi, QueriesApi, ViewsApi, ModelsApi, ModelTrainingApi, ModelInferenceApi, EncryptionMaterialApi, WhoAmIApi, WorkflowsApi, ComputePoolsApi {
|
|
87
90
|
}
|
|
88
91
|
export { NarrativeApi };
|
package/build/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./authentication";
|
|
|
7
7
|
export * from "./base-api";
|
|
8
8
|
export * from "./collaboration-policy";
|
|
9
9
|
export * from "./company-info";
|
|
10
|
+
export * from "./compute-pools";
|
|
11
|
+
export * from "./compute-pools/types";
|
|
10
12
|
export * from "./connections";
|
|
11
13
|
export * from "./contracts";
|
|
12
14
|
export * from "./data-planes";
|
|
@@ -58,6 +60,7 @@ import { AuthenticationApi } from "./authentication";
|
|
|
58
60
|
// Handle the NarrativeApi class with mixins
|
|
59
61
|
import { BaseApi } from "./base-api";
|
|
60
62
|
import { CompanyInfoApi } from "./company-info";
|
|
63
|
+
import { ComputePoolsApi } from "./compute-pools";
|
|
61
64
|
import { ConnectionsApi } from "./connections";
|
|
62
65
|
import { ContractsApi } from "./contracts";
|
|
63
66
|
import { DataPlaneApi } from "./data-planes";
|
|
@@ -118,5 +121,6 @@ applyMixins(NarrativeApi, [
|
|
|
118
121
|
EncryptionMaterialApi,
|
|
119
122
|
WhoAmIApi,
|
|
120
123
|
WorkflowsApi,
|
|
124
|
+
ComputePoolsApi,
|
|
121
125
|
]);
|
|
122
126
|
export { NarrativeApi };
|