@narrative.io/data-collaboration-sdk-ts 2.101.1-beta.0 → 2.102.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/agents/index.d.ts +63 -0
- package/build/agents/index.js +92 -0
- package/build/agents/types.d.ts +188 -0
- package/build/agents/types.js +22 -0
- package/build/apps/index.d.ts +0 -7
- package/build/apps/index.js +0 -9
- package/build/collaboration-policy/core/filter-builder.js +1 -7
- package/build/collaboration-policy/core/types.d.ts +10 -81
- package/build/collaboration-policy/index.d.ts +4 -5
- package/build/collaboration-policy/index.js +3 -4
- package/build/collaboration-policy/types/collaboration-policy.d.ts +20 -20
- package/build/collaboration-policy/useCollaborationPolicy.d.ts +4 -13
- package/build/collaboration-policy/useCollaborationPolicy.js +1 -23
- package/build/collaboration-policy/utils/path-helpers.d.ts +3 -7
- package/build/collaboration-policy/utils/path-helpers.js +22 -6
- package/build/datasets/index.d.ts +2 -11
- package/build/datasets/index.js +0 -12
- package/build/datasets/types.d.ts +0 -25
- package/build/index.d.ts +3 -1
- package/build/index.js +3 -0
- package/build/nql/types.d.ts +13 -13
- package/build/nql/types.js +20 -5
- package/package.json +9 -10
- package/build/collaboration-policy/core/jsonschema/json-schema-types.d.ts +0 -45
- package/build/collaboration-policy/core/jsonschema/json-schema-types.js +0 -1
- package/build/collaboration-policy/core/jsonschema/policy-branches.d.ts +0 -49
- package/build/collaboration-policy/core/jsonschema/policy-branches.js +0 -1
- package/build/collaboration-policy/core/jsonschema/policy-evaluator.d.ts +0 -22
- package/build/collaboration-policy/core/jsonschema/policy-evaluator.js +0 -250
- package/build/collaboration-policy/core/jsonschema/sql-builder.d.ts +0 -79
- package/build/collaboration-policy/core/jsonschema/sql-builder.js +0 -306
- package/build/collaboration-policy/core/jsonschema/sql-poc.d.ts +0 -79
- package/build/collaboration-policy/core/jsonschema/sql-poc.js +0 -305
- package/build/nql/SubstraitParser.d.ts +0 -771
- package/build/nql/SubstraitParser.js +0 -797
|
@@ -551,12 +551,12 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
551
551
|
name: z.ZodOptional<z.ZodString>;
|
|
552
552
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
553
553
|
args: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
554
|
+
type: z.ZodLiteral<"attribute">;
|
|
554
555
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
555
556
|
dot: z.ZodString;
|
|
556
557
|
}, z.core.$strict>, z.ZodObject<{
|
|
557
558
|
pointer: z.ZodString;
|
|
558
559
|
}, z.core.$strict>]>>;
|
|
559
|
-
type: z.ZodLiteral<"attribute">;
|
|
560
560
|
attribute_name: z.ZodString;
|
|
561
561
|
}, z.core.$strict>]>>;
|
|
562
562
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -565,12 +565,12 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
565
565
|
name: z.ZodOptional<z.ZodString>;
|
|
566
566
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
567
567
|
args: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
568
|
+
type: z.ZodLiteral<"attribute">;
|
|
568
569
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
569
570
|
dot: z.ZodString;
|
|
570
571
|
}, z.core.$strict>, z.ZodObject<{
|
|
571
572
|
pointer: z.ZodString;
|
|
572
573
|
}, z.core.$strict>]>>;
|
|
573
|
-
type: z.ZodLiteral<"attribute">;
|
|
574
574
|
attribute_name: z.ZodString;
|
|
575
575
|
}, z.core.$strict>]>>;
|
|
576
576
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -582,12 +582,12 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
582
582
|
name: z.ZodOptional<z.ZodString>;
|
|
583
583
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
584
584
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
585
|
+
type: z.ZodLiteral<"attribute">;
|
|
585
586
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
586
587
|
dot: z.ZodString;
|
|
587
588
|
}, z.core.$strict>, z.ZodObject<{
|
|
588
589
|
pointer: z.ZodString;
|
|
589
590
|
}, z.core.$strict>]>>;
|
|
590
|
-
type: z.ZodLiteral<"attribute">;
|
|
591
591
|
attribute_name: z.ZodString;
|
|
592
592
|
}, z.core.$strict>]>;
|
|
593
593
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -599,21 +599,21 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
599
599
|
name: z.ZodOptional<z.ZodString>;
|
|
600
600
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
601
601
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
602
|
+
type: z.ZodLiteral<"attribute">;
|
|
602
603
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
603
604
|
dot: z.ZodString;
|
|
604
605
|
}, z.core.$strict>, z.ZodObject<{
|
|
605
606
|
pointer: z.ZodString;
|
|
606
607
|
}, z.core.$strict>]>>;
|
|
607
|
-
type: z.ZodLiteral<"attribute">;
|
|
608
608
|
attribute_name: z.ZodString;
|
|
609
609
|
}, z.core.$strict>]>;
|
|
610
610
|
right: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
611
|
+
type: z.ZodLiteral<"attribute">;
|
|
611
612
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
612
613
|
dot: z.ZodString;
|
|
613
614
|
}, z.core.$strict>, z.ZodObject<{
|
|
614
615
|
pointer: z.ZodString;
|
|
615
616
|
}, z.core.$strict>]>>;
|
|
616
|
-
type: z.ZodLiteral<"attribute">;
|
|
617
617
|
attribute_name: z.ZodString;
|
|
618
618
|
}, z.core.$strict>]>>;
|
|
619
619
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -631,21 +631,21 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
631
631
|
name: z.ZodOptional<z.ZodString>;
|
|
632
632
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
633
633
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
634
|
+
type: z.ZodLiteral<"attribute">;
|
|
634
635
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
635
636
|
dot: z.ZodString;
|
|
636
637
|
}, z.core.$strict>, z.ZodObject<{
|
|
637
638
|
pointer: z.ZodString;
|
|
638
639
|
}, z.core.$strict>]>>;
|
|
639
|
-
type: z.ZodLiteral<"attribute">;
|
|
640
640
|
attribute_name: z.ZodString;
|
|
641
641
|
}, z.core.$strict>]>;
|
|
642
642
|
right: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
643
|
+
type: z.ZodLiteral<"attribute">;
|
|
643
644
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
644
645
|
dot: z.ZodString;
|
|
645
646
|
}, z.core.$strict>, z.ZodObject<{
|
|
646
647
|
pointer: z.ZodString;
|
|
647
648
|
}, z.core.$strict>]>>;
|
|
648
|
-
type: z.ZodLiteral<"attribute">;
|
|
649
649
|
attribute_name: z.ZodString;
|
|
650
650
|
}, z.core.$strict>]>;
|
|
651
651
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -654,30 +654,30 @@ declare const CollaborationPolicy: z.ZodObject<{
|
|
|
654
654
|
name: z.ZodOptional<z.ZodString>;
|
|
655
655
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
656
656
|
operand: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
657
|
+
type: z.ZodLiteral<"attribute">;
|
|
657
658
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
658
659
|
dot: z.ZodString;
|
|
659
660
|
}, z.core.$strict>, z.ZodObject<{
|
|
660
661
|
pointer: z.ZodString;
|
|
661
662
|
}, z.core.$strict>]>>;
|
|
662
|
-
type: z.ZodLiteral<"attribute">;
|
|
663
663
|
attribute_name: z.ZodString;
|
|
664
664
|
}, z.core.$strict>]>;
|
|
665
665
|
lower: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
666
|
+
type: z.ZodLiteral<"attribute">;
|
|
666
667
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
667
668
|
dot: z.ZodString;
|
|
668
669
|
}, z.core.$strict>, z.ZodObject<{
|
|
669
670
|
pointer: z.ZodString;
|
|
670
671
|
}, z.core.$strict>]>>;
|
|
671
|
-
type: z.ZodLiteral<"attribute">;
|
|
672
672
|
attribute_name: z.ZodString;
|
|
673
673
|
}, z.core.$strict>]>;
|
|
674
674
|
upper: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
675
|
+
type: z.ZodLiteral<"attribute">;
|
|
675
676
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
676
677
|
dot: z.ZodString;
|
|
677
678
|
}, z.core.$strict>, z.ZodObject<{
|
|
678
679
|
pointer: z.ZodString;
|
|
679
680
|
}, z.core.$strict>]>>;
|
|
680
|
-
type: z.ZodLiteral<"attribute">;
|
|
681
681
|
attribute_name: z.ZodString;
|
|
682
682
|
}, z.core.$strict>]>;
|
|
683
683
|
}, z.core.$strict>]>>>;
|
|
@@ -1235,12 +1235,12 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1235
1235
|
name: z.ZodOptional<z.ZodString>;
|
|
1236
1236
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1237
1237
|
args: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1238
|
+
type: z.ZodLiteral<"attribute">;
|
|
1238
1239
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1239
1240
|
dot: z.ZodString;
|
|
1240
1241
|
}, z.core.$strict>, z.ZodObject<{
|
|
1241
1242
|
pointer: z.ZodString;
|
|
1242
1243
|
}, z.core.$strict>]>>;
|
|
1243
|
-
type: z.ZodLiteral<"attribute">;
|
|
1244
1244
|
attribute_name: z.ZodString;
|
|
1245
1245
|
}, z.core.$strict>]>>;
|
|
1246
1246
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1249,12 +1249,12 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1249
1249
|
name: z.ZodOptional<z.ZodString>;
|
|
1250
1250
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1251
1251
|
args: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1252
|
+
type: z.ZodLiteral<"attribute">;
|
|
1252
1253
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1253
1254
|
dot: z.ZodString;
|
|
1254
1255
|
}, z.core.$strict>, z.ZodObject<{
|
|
1255
1256
|
pointer: z.ZodString;
|
|
1256
1257
|
}, z.core.$strict>]>>;
|
|
1257
|
-
type: z.ZodLiteral<"attribute">;
|
|
1258
1258
|
attribute_name: z.ZodString;
|
|
1259
1259
|
}, z.core.$strict>]>>;
|
|
1260
1260
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1266,12 +1266,12 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1266
1266
|
name: z.ZodOptional<z.ZodString>;
|
|
1267
1267
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1268
1268
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1269
|
+
type: z.ZodLiteral<"attribute">;
|
|
1269
1270
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1270
1271
|
dot: z.ZodString;
|
|
1271
1272
|
}, z.core.$strict>, z.ZodObject<{
|
|
1272
1273
|
pointer: z.ZodString;
|
|
1273
1274
|
}, z.core.$strict>]>>;
|
|
1274
|
-
type: z.ZodLiteral<"attribute">;
|
|
1275
1275
|
attribute_name: z.ZodString;
|
|
1276
1276
|
}, z.core.$strict>]>;
|
|
1277
1277
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1283,21 +1283,21 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1283
1283
|
name: z.ZodOptional<z.ZodString>;
|
|
1284
1284
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1285
1285
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1286
|
+
type: z.ZodLiteral<"attribute">;
|
|
1286
1287
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1287
1288
|
dot: z.ZodString;
|
|
1288
1289
|
}, z.core.$strict>, z.ZodObject<{
|
|
1289
1290
|
pointer: z.ZodString;
|
|
1290
1291
|
}, z.core.$strict>]>>;
|
|
1291
|
-
type: z.ZodLiteral<"attribute">;
|
|
1292
1292
|
attribute_name: z.ZodString;
|
|
1293
1293
|
}, z.core.$strict>]>;
|
|
1294
1294
|
right: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1295
|
+
type: z.ZodLiteral<"attribute">;
|
|
1295
1296
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1296
1297
|
dot: z.ZodString;
|
|
1297
1298
|
}, z.core.$strict>, z.ZodObject<{
|
|
1298
1299
|
pointer: z.ZodString;
|
|
1299
1300
|
}, z.core.$strict>]>>;
|
|
1300
|
-
type: z.ZodLiteral<"attribute">;
|
|
1301
1301
|
attribute_name: z.ZodString;
|
|
1302
1302
|
}, z.core.$strict>]>>;
|
|
1303
1303
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1315,21 +1315,21 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1315
1315
|
name: z.ZodOptional<z.ZodString>;
|
|
1316
1316
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1317
1317
|
left: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1318
|
+
type: z.ZodLiteral<"attribute">;
|
|
1318
1319
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1319
1320
|
dot: z.ZodString;
|
|
1320
1321
|
}, z.core.$strict>, z.ZodObject<{
|
|
1321
1322
|
pointer: z.ZodString;
|
|
1322
1323
|
}, z.core.$strict>]>>;
|
|
1323
|
-
type: z.ZodLiteral<"attribute">;
|
|
1324
1324
|
attribute_name: z.ZodString;
|
|
1325
1325
|
}, z.core.$strict>]>;
|
|
1326
1326
|
right: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1327
|
+
type: z.ZodLiteral<"attribute">;
|
|
1327
1328
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1328
1329
|
dot: z.ZodString;
|
|
1329
1330
|
}, z.core.$strict>, z.ZodObject<{
|
|
1330
1331
|
pointer: z.ZodString;
|
|
1331
1332
|
}, z.core.$strict>]>>;
|
|
1332
|
-
type: z.ZodLiteral<"attribute">;
|
|
1333
1333
|
attribute_name: z.ZodString;
|
|
1334
1334
|
}, z.core.$strict>]>;
|
|
1335
1335
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1338,30 +1338,30 @@ export declare function buildCollaborationPolicyJsonSchema(options?: JsonSchemaO
|
|
|
1338
1338
|
name: z.ZodOptional<z.ZodString>;
|
|
1339
1339
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1340
1340
|
operand: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1341
|
+
type: z.ZodLiteral<"attribute">;
|
|
1341
1342
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1342
1343
|
dot: z.ZodString;
|
|
1343
1344
|
}, z.core.$strict>, z.ZodObject<{
|
|
1344
1345
|
pointer: z.ZodString;
|
|
1345
1346
|
}, z.core.$strict>]>>;
|
|
1346
|
-
type: z.ZodLiteral<"attribute">;
|
|
1347
1347
|
attribute_name: z.ZodString;
|
|
1348
1348
|
}, z.core.$strict>]>;
|
|
1349
1349
|
lower: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1350
|
+
type: z.ZodLiteral<"attribute">;
|
|
1350
1351
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1351
1352
|
dot: z.ZodString;
|
|
1352
1353
|
}, z.core.$strict>, z.ZodObject<{
|
|
1353
1354
|
pointer: z.ZodString;
|
|
1354
1355
|
}, z.core.$strict>]>>;
|
|
1355
|
-
type: z.ZodLiteral<"attribute">;
|
|
1356
1356
|
attribute_name: z.ZodString;
|
|
1357
1357
|
}, z.core.$strict>]>;
|
|
1358
1358
|
upper: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1359
|
+
type: z.ZodLiteral<"attribute">;
|
|
1359
1360
|
path: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1360
1361
|
dot: z.ZodString;
|
|
1361
1362
|
}, z.core.$strict>, z.ZodObject<{
|
|
1362
1363
|
pointer: z.ZodString;
|
|
1363
1364
|
}, z.core.$strict>]>>;
|
|
1364
|
-
type: z.ZodLiteral<"attribute">;
|
|
1365
1365
|
attribute_name: z.ZodString;
|
|
1366
1366
|
}, z.core.$strict>]>;
|
|
1367
1367
|
}, z.core.$strict>]>>>;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { Attribute } from "../attributes/types";
|
|
2
2
|
import type { Dataset } from "../datasets/types";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
/**
|
|
6
|
-
* Hook-style wrapper that exposes collaboration policy helpers.
|
|
7
|
-
*
|
|
8
|
-
* Public API surface:
|
|
9
|
-
* - categorizePolicies
|
|
10
|
-
* - buildPolicySql
|
|
11
|
-
* - buildPolicySqlWithValidation
|
|
12
|
-
*/
|
|
3
|
+
import type { PolicySqlFragments } from "./core/types";
|
|
4
|
+
import type { CollaborationPolicyType } from "./types";
|
|
13
5
|
export default function useCollaborationPolicy(): {
|
|
14
|
-
getEligibleConnectorsPolicies: (dataset: Dataset, policies:
|
|
15
|
-
buildPolicySqlFragments: (dataset: Dataset, policies:
|
|
16
|
-
buildPolicySqlWithValidationJsonSchema: (dataset: Dataset, policies: JsonSchemaConnectorPolicy[], attributes: Attribute[]) => PolicyMatchResult;
|
|
6
|
+
getEligibleConnectorsPolicies: (dataset: Dataset, policies: CollaborationPolicyType[], attributes: Attribute[]) => CollaborationPolicyType[];
|
|
7
|
+
buildPolicySqlFragments: (dataset: Dataset, policies: CollaborationPolicyType[], attributes: Attribute[]) => PolicySqlFragments;
|
|
17
8
|
};
|
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import { buildPolicySql,
|
|
2
|
-
/**
|
|
3
|
-
* Hook-style wrapper that exposes collaboration policy helpers.
|
|
4
|
-
*
|
|
5
|
-
* Public API surface:
|
|
6
|
-
* - categorizePolicies
|
|
7
|
-
* - buildPolicySql
|
|
8
|
-
* - buildPolicySqlWithValidation
|
|
9
|
-
*/
|
|
1
|
+
import { buildPolicySql, categorizePolicies } from "./core/sql-builder";
|
|
10
2
|
export default function useCollaborationPolicy() {
|
|
11
|
-
/**
|
|
12
|
-
* Get policies that are compatible with a dataset using the JSON-Schema policy system.
|
|
13
|
-
*/
|
|
14
3
|
const getEligibleConnectorsPolicies = (dataset, policies, attributes) => {
|
|
15
4
|
const { matching } = categorizePolicies(policies, dataset, attributes);
|
|
16
5
|
return matching;
|
|
17
6
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Build SQL fragments using JSON-Schema policies, without per-policy validation.
|
|
20
|
-
*/
|
|
21
7
|
const buildPolicySqlFragments = (dataset, policies, attributes) => {
|
|
22
8
|
return buildPolicySql(dataset, policies, attributes);
|
|
23
9
|
};
|
|
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
|
-
};
|
|
31
10
|
return {
|
|
32
11
|
getEligibleConnectorsPolicies,
|
|
33
12
|
buildPolicySqlFragments,
|
|
34
|
-
buildPolicySqlWithValidationJsonSchema,
|
|
35
13
|
};
|
|
36
14
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
*/
|
|
1
|
+
import type { Attribute } from "../../attributes/types";
|
|
2
|
+
import type { AttributePathIndex, PathValue } from "../core/types";
|
|
3
|
+
export declare function markAttributePath(index: AttributePathIndex, attribute: Attribute, path: string): void;
|
|
8
4
|
export declare function normalizePathValue(path?: PathValue): string;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function markAttributePath(index, attribute, path) {
|
|
2
|
+
const attributePaths = index.get(attribute.name) ?? new Set();
|
|
3
|
+
// Use the provided path, even if it's an empty string (which represents the root attribute)
|
|
4
|
+
const normalized = path !== undefined && path !== null
|
|
5
|
+
? path
|
|
6
|
+
: determineDefaultPath(attribute);
|
|
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
|
+
}
|
|
7
23
|
export function normalizePathValue(path) {
|
|
8
24
|
if (!path) {
|
|
9
25
|
return "";
|
|
@@ -2,9 +2,9 @@ import type { UnknownJob } from "src/jobs/types";
|
|
|
2
2
|
import { BaseApi } from "../base-api";
|
|
3
3
|
import type { ApiRecords } from "../types";
|
|
4
4
|
import type { DatasetStatisticsConfiguration, StatisticsConfigurationResponse } from "./statistics-types";
|
|
5
|
-
import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset,
|
|
5
|
+
import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RecalculationInfo, RetentionPolicy, RetentionScheduleConfig, RowClock, RowTTLPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotAgeExpression, SnapshotRange, SnapshotTTLPolicy, TableClock, TableClockKind, TableTTLPolicy, TTLPolicy, TTLPolicyKind, UpdateDatasetRefreshScheduleRequest, UpdateDatasetRequest, UpsertRetentionPoliciesRequest, Value } from "./types";
|
|
6
6
|
export type { CronRefresh, DatasetFieldConfig, DatasetFieldNamespace, DatasetStatisticsConfiguration, HistogramOptions, HistogramOverflow, ManualRefresh, NestedNodeConfig, NestedPropertyConfig, NonPrimitiveNodeConfig, OnUpdateRefresh, PrimitiveNodeConfig, RefreshTrigger, RosettaStoneFieldConfig, RosettaStoneFieldNamespace, StatConfig, StatisticsConfigurationResponse, StatName, StatOptions, } from "./statistics-types";
|
|
7
|
-
export type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset,
|
|
7
|
+
export type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, RetentionPolicy, RetentionScheduleConfig, RowClock, RowTTLPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotAgeExpression, SnapshotRange, SnapshotTTLPolicy, TableClock, TableClockKind, TableTTLPolicy, TTLPolicy, TTLPolicyKind, UpdateDatasetRefreshScheduleRequest, UpdateDatasetRequest, UpsertRetentionPoliciesRequest, Value, };
|
|
8
8
|
/**
|
|
9
9
|
* @module DatasetApi
|
|
10
10
|
* @description This module provides methods for fetching datasets.
|
|
@@ -221,15 +221,6 @@ export declare class DatasetApi extends BaseApi {
|
|
|
221
221
|
createDatasetRefreshSchedule(datasetId: number, refreshSchedule: CreateDatasetRefreshScheduleRequest): Promise<void>;
|
|
222
222
|
updateDatasetRefreshSchedule(datasetId: number, refreshSchedule: UpdateDatasetRefreshScheduleRequest): Promise<void>;
|
|
223
223
|
deleteDatasetRefreshSchedule(datasetId: number): Promise<void>;
|
|
224
|
-
/**
|
|
225
|
-
* Validate which connector interfaces are compatible with a dataset.
|
|
226
|
-
* Filtered by the user's installed apps and optionally by tags.
|
|
227
|
-
*
|
|
228
|
-
* @param {number} datasetId - The ID of the dataset to validate interfaces against.
|
|
229
|
-
* @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
|
|
230
|
-
* @returns {Promise<DatasetInterfaceValidation>} - Accepted interface IDs and per-interface validation errors.
|
|
231
|
-
*/
|
|
232
|
-
getDatasetInterfaces(datasetId: number, tags?: string[]): Promise<DatasetInterfaceValidation>;
|
|
233
224
|
putStatisticsConfiguration(datasetId: number, configuration: DatasetStatisticsConfiguration): Promise<StatisticsConfigurationResponse>;
|
|
234
225
|
getStatisticsConfiguration(datasetId: number): Promise<StatisticsConfigurationResponse>;
|
|
235
226
|
deleteStatisticsConfiguration(datasetId: number): Promise<StatisticsConfigurationResponse>;
|
package/build/datasets/index.js
CHANGED
|
@@ -295,18 +295,6 @@ export class DatasetApi extends BaseApi {
|
|
|
295
295
|
async deleteDatasetRefreshSchedule(datasetId) {
|
|
296
296
|
await this.delete(`${resourceName}/${datasetId}/refresh-schedule`);
|
|
297
297
|
}
|
|
298
|
-
/**
|
|
299
|
-
* Validate which connector interfaces are compatible with a dataset.
|
|
300
|
-
* Filtered by the user's installed apps and optionally by tags.
|
|
301
|
-
*
|
|
302
|
-
* @param {number} datasetId - The ID of the dataset to validate interfaces against.
|
|
303
|
-
* @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
|
|
304
|
-
* @returns {Promise<DatasetInterfaceValidation>} - Accepted interface IDs and per-interface validation errors.
|
|
305
|
-
*/
|
|
306
|
-
async getDatasetInterfaces(datasetId, tags) {
|
|
307
|
-
const queryString = this.constructQueryString(tags != null ? { tags } : undefined);
|
|
308
|
-
return await this.get(`${resourceName}/${datasetId}/interfaces${queryString}`);
|
|
309
|
-
}
|
|
310
298
|
async putStatisticsConfiguration(datasetId, configuration) {
|
|
311
299
|
return await this.put(`${resourceName}/${datasetId}/statistics-configuration`, configuration);
|
|
312
300
|
}
|
|
@@ -294,31 +294,6 @@ export interface CreateDatasetRequest {
|
|
|
294
294
|
export interface IngestDatasetFileRequest {
|
|
295
295
|
source_file: string;
|
|
296
296
|
}
|
|
297
|
-
export interface DatasetInterfaceRef {
|
|
298
|
-
app_id: number;
|
|
299
|
-
interface_id: string;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* A JSON-Schema 2020-12 "Basic" output node, used recursively in validation errors.
|
|
303
|
-
* `errors` is keyed by JSON-Schema keyword (`"required"`, `"type"`, etc.); values
|
|
304
|
-
* are human-readable strings.
|
|
305
|
-
*/
|
|
306
|
-
export interface JsonSchemaValidationNode {
|
|
307
|
-
valid: boolean;
|
|
308
|
-
evaluationPath: string;
|
|
309
|
-
schemaLocation: string;
|
|
310
|
-
instanceLocation: string;
|
|
311
|
-
errors?: Record<string, string>;
|
|
312
|
-
details?: JsonSchemaValidationNode[];
|
|
313
|
-
}
|
|
314
|
-
export interface DatasetInterfaceError extends DatasetInterfaceRef {
|
|
315
|
-
details: JsonSchemaValidationNode;
|
|
316
|
-
}
|
|
317
|
-
export interface DatasetInterfaceValidation {
|
|
318
|
-
dataset_id: number;
|
|
319
|
-
accepted: DatasetInterfaceRef[];
|
|
320
|
-
errors: DatasetInterfaceError[];
|
|
321
|
-
}
|
|
322
297
|
export interface UpdateDatasetRefreshScheduleRequest {
|
|
323
298
|
cron?: string;
|
|
324
299
|
cron_zone_id?: string;
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./access-rules/";
|
|
2
2
|
export * from "./access-tokens";
|
|
3
3
|
export { resources } from "./access-tokens/types";
|
|
4
|
+
export * from "./agents";
|
|
4
5
|
export type { App } from "./apps";
|
|
5
6
|
export * from "./attributes";
|
|
6
7
|
export * from "./authentication";
|
|
@@ -55,6 +56,7 @@ export * from "./workflows";
|
|
|
55
56
|
export * from "./workflows/types";
|
|
56
57
|
import { AccessRulesApi } from "./access-rules/";
|
|
57
58
|
import { AccessTokensApi } from "./access-tokens";
|
|
59
|
+
import { AgentsApi } from "./agents";
|
|
58
60
|
import { AppsApi } from "./apps";
|
|
59
61
|
import { AttributeApi, AttributeApiV2 } from "./attributes";
|
|
60
62
|
import { AuthenticationApi } from "./authentication";
|
|
@@ -87,6 +89,6 @@ import { WhoAmIApi } from "./whoami";
|
|
|
87
89
|
import { WorkflowsApi } from "./workflows";
|
|
88
90
|
declare class NarrativeApi extends BaseApi {
|
|
89
91
|
}
|
|
90
|
-
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 {
|
|
92
|
+
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, AgentsApi {
|
|
91
93
|
}
|
|
92
94
|
export { NarrativeApi };
|
package/build/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export * from "./access-rules/";
|
|
3
3
|
export * from "./access-tokens";
|
|
4
4
|
export { resources } from "./access-tokens/types";
|
|
5
|
+
export * from "./agents";
|
|
5
6
|
export * from "./attributes";
|
|
6
7
|
export * from "./authentication";
|
|
7
8
|
export * from "./base-api";
|
|
@@ -55,6 +56,7 @@ export * from "./workflows";
|
|
|
55
56
|
export * from "./workflows/types";
|
|
56
57
|
import { AccessRulesApi } from "./access-rules/";
|
|
57
58
|
import { AccessTokensApi } from "./access-tokens";
|
|
59
|
+
import { AgentsApi } from "./agents";
|
|
58
60
|
import { AppsApi } from "./apps";
|
|
59
61
|
import { AttributeApi, AttributeApiV2 } from "./attributes";
|
|
60
62
|
import { AuthenticationApi } from "./authentication";
|
|
@@ -123,5 +125,6 @@ applyMixins(NarrativeApi, [
|
|
|
123
125
|
WhoAmIApi,
|
|
124
126
|
WorkflowsApi,
|
|
125
127
|
ComputePoolsApi,
|
|
128
|
+
AgentsApi,
|
|
126
129
|
]);
|
|
127
130
|
export { NarrativeApi };
|
package/build/nql/types.d.ts
CHANGED
|
@@ -104,12 +104,12 @@ export declare const NqlFilterBinaryExpressionObj: z.ZodObject<{
|
|
|
104
104
|
}, z.core.$strip>;
|
|
105
105
|
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
106
106
|
operator: z.ZodEnum<{
|
|
107
|
-
"=": "=";
|
|
108
|
-
"!=": "!=";
|
|
109
107
|
">": ">";
|
|
110
108
|
"<": "<";
|
|
111
109
|
">=": ">=";
|
|
112
110
|
"<=": "<=";
|
|
111
|
+
"=": "=";
|
|
112
|
+
"!=": "!=";
|
|
113
113
|
IN: "IN";
|
|
114
114
|
"NOT IN": "NOT IN";
|
|
115
115
|
LIKE: "LIKE";
|
|
@@ -144,12 +144,12 @@ export declare const NqlFilterExpressionObj: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
144
144
|
}, z.core.$strip>;
|
|
145
145
|
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
146
146
|
operator: z.ZodEnum<{
|
|
147
|
-
"=": "=";
|
|
148
|
-
"!=": "!=";
|
|
149
147
|
">": ">";
|
|
150
148
|
"<": "<";
|
|
151
149
|
">=": ">=";
|
|
152
150
|
"<=": "<=";
|
|
151
|
+
"=": "=";
|
|
152
|
+
"!=": "!=";
|
|
153
153
|
IN: "IN";
|
|
154
154
|
"NOT IN": "NOT IN";
|
|
155
155
|
LIKE: "LIKE";
|
|
@@ -195,12 +195,12 @@ export declare const NqlWhereObj: z.ZodObject<{
|
|
|
195
195
|
}, z.core.$strip>;
|
|
196
196
|
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
197
197
|
operator: z.ZodEnum<{
|
|
198
|
-
"=": "=";
|
|
199
|
-
"!=": "!=";
|
|
200
198
|
">": ">";
|
|
201
199
|
"<": "<";
|
|
202
200
|
">=": ">=";
|
|
203
201
|
"<=": "<=";
|
|
202
|
+
"=": "=";
|
|
203
|
+
"!=": "!=";
|
|
204
204
|
IN: "IN";
|
|
205
205
|
"NOT IN": "NOT IN";
|
|
206
206
|
LIKE: "LIKE";
|
|
@@ -258,12 +258,12 @@ export declare const NqlObj: z.ZodObject<{
|
|
|
258
258
|
}, z.core.$strip>;
|
|
259
259
|
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
260
260
|
operator: z.ZodEnum<{
|
|
261
|
-
"=": "=";
|
|
262
|
-
"!=": "!=";
|
|
263
261
|
">": ">";
|
|
264
262
|
"<": "<";
|
|
265
263
|
">=": ">=";
|
|
266
264
|
"<=": "<=";
|
|
265
|
+
"=": "=";
|
|
266
|
+
"!=": "!=";
|
|
267
267
|
IN: "IN";
|
|
268
268
|
"NOT IN": "NOT IN";
|
|
269
269
|
LIKE: "LIKE";
|
|
@@ -287,11 +287,11 @@ export declare const NqlObj: z.ZodObject<{
|
|
|
287
287
|
CALENDAR_MONTH: "CALENDAR_MONTH";
|
|
288
288
|
}>;
|
|
289
289
|
}, z.core.$strip>;
|
|
290
|
-
sort: z.ZodUndefined
|
|
291
|
-
group: z.ZodUndefined
|
|
292
|
-
having: z.ZodUndefined
|
|
293
|
-
offset: z.ZodUndefined
|
|
294
|
-
join: z.ZodUndefined
|
|
290
|
+
sort: z.ZodOptional<z.ZodUndefined>;
|
|
291
|
+
group: z.ZodOptional<z.ZodUndefined>;
|
|
292
|
+
having: z.ZodOptional<z.ZodUndefined>;
|
|
293
|
+
offset: z.ZodOptional<z.ZodUndefined>;
|
|
294
|
+
join: z.ZodOptional<z.ZodUndefined>;
|
|
295
295
|
}, z.core.$strip>;
|
|
296
296
|
export type Nql = z.infer<typeof NqlObj>;
|
|
297
297
|
export interface RelatedJob {
|
package/build/nql/types.js
CHANGED
|
@@ -120,9 +120,24 @@ export const NqlObj = z.object({
|
|
|
120
120
|
from: NqlTableObject.array(),
|
|
121
121
|
where: NqlWhereObj,
|
|
122
122
|
limit: NqlBudgetObj,
|
|
123
|
-
sort: z
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
sort: z
|
|
124
|
+
.undefined()
|
|
125
|
+
.describe("Sort is not currently supported in NQL")
|
|
126
|
+
.optional(),
|
|
127
|
+
group: z
|
|
128
|
+
.undefined()
|
|
129
|
+
.describe("Group is not currently supported in NQL")
|
|
130
|
+
.optional(),
|
|
131
|
+
having: z
|
|
132
|
+
.undefined()
|
|
133
|
+
.describe("Having is not currently supported in NQL")
|
|
134
|
+
.optional(),
|
|
135
|
+
offset: z
|
|
136
|
+
.undefined()
|
|
137
|
+
.describe("Offset is not currently supported in NQL")
|
|
138
|
+
.optional(),
|
|
139
|
+
join: z
|
|
140
|
+
.undefined()
|
|
141
|
+
.describe("Join is not currently supported in NQL")
|
|
142
|
+
.optional(),
|
|
128
143
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.102.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -26,22 +26,21 @@
|
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "7.29.0",
|
|
29
|
-
"@babel/preset-env": "7.29.
|
|
29
|
+
"@babel/preset-env": "7.29.5",
|
|
30
30
|
"@babel/preset-typescript": "7.28.5",
|
|
31
|
-
"@biomejs/biome": "2.4.
|
|
32
|
-
"@commitlint/cli": "
|
|
33
|
-
"@commitlint/config-conventional": "
|
|
31
|
+
"@biomejs/biome": "2.4.15",
|
|
32
|
+
"@commitlint/cli": "21.0.1",
|
|
33
|
+
"@commitlint/config-conventional": "21.0.1",
|
|
34
34
|
"@types/jest": "30.0.0",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"jest": "30.3.0",
|
|
35
|
+
"babel-jest": "30.4.1",
|
|
36
|
+
"jest": "30.4.2",
|
|
38
37
|
"lefthook": "2.1.6",
|
|
39
38
|
"ts-jest": "29.4.9"
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
41
|
"mande": "2.0.9",
|
|
43
|
-
"zod": "4.3
|
|
44
|
-
"bignumber.js": "11.
|
|
42
|
+
"zod": "4.4.3",
|
|
43
|
+
"bignumber.js": "11.1.1"
|
|
45
44
|
},
|
|
46
45
|
"overrides": {
|
|
47
46
|
"semver@<7.5.2": "7.5.2"
|