@narrative.io/data-collaboration-sdk-ts 2.98.1-beta.0 → 2.100.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/collaboration-policy/types/collaboration-policy.d.ts +20 -20
- package/build/model-inference/types.d.ts +1 -1
- package/package.json +5 -5
- 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 -260
- 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>]>>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Model identifiers supported by the Narrative model inference API.
|
|
3
3
|
* Maps to Scala ModelInferenceRunJobInput.Model
|
|
4
4
|
*/
|
|
5
|
-
export type InferenceModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-opus-4.5" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini";
|
|
5
|
+
export type InferenceModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini";
|
|
6
6
|
/**
|
|
7
7
|
* Message role for inference requests.
|
|
8
8
|
* Maps to Scala ModelInferenceRunJobInput.Role
|
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.100.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"@babel/core": "7.29.0",
|
|
29
29
|
"@babel/preset-env": "7.29.2",
|
|
30
30
|
"@babel/preset-typescript": "7.28.5",
|
|
31
|
-
"@biomejs/biome": "2.4.
|
|
32
|
-
"@commitlint/cli": "20.5.
|
|
31
|
+
"@biomejs/biome": "2.4.13",
|
|
32
|
+
"@commitlint/cli": "20.5.2",
|
|
33
33
|
"@commitlint/config-conventional": "20.5.0",
|
|
34
34
|
"@types/jest": "30.0.0",
|
|
35
35
|
"babel-jest": "30.3.0",
|
|
36
36
|
"jest": "30.3.0",
|
|
37
|
-
"lefthook": "2.1.
|
|
37
|
+
"lefthook": "2.1.6",
|
|
38
38
|
"ts-jest": "29.4.9"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"mande": "2.0.9",
|
|
42
42
|
"zod": "4.3.6",
|
|
43
|
-
"bignumber.js": "
|
|
43
|
+
"bignumber.js": "11.0.0"
|
|
44
44
|
},
|
|
45
45
|
"overrides": {
|
|
46
46
|
"semver@<7.5.2": "7.5.2"
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { JSONSchema7 } from "json-schema";
|
|
2
|
-
/**
|
|
3
|
-
* Base JSON Schema type used for connector policies.
|
|
4
|
-
*
|
|
5
|
-
* Uses JSONSchema7 as a structural base. The real API schemas declare
|
|
6
|
-
* `$schema: "https://json-schema.org/draft/2020-12/schema"` and are
|
|
7
|
-
* validated with AJV 2020-12.
|
|
8
|
-
*/
|
|
9
|
-
export type JsonSchema = JSONSchema7;
|
|
10
|
-
/**
|
|
11
|
-
* Shape of a JSON-Schema-based connector policy as returned by the backend API.
|
|
12
|
-
*
|
|
13
|
-
* The `policy` field is a JSON Schema document that must be satisfied
|
|
14
|
-
* by `dataset.schema`. Refresh schedule lives in `metadata.refresh_schedule.max`.
|
|
15
|
-
*
|
|
16
|
-
* Filters live on property definitions inside the schema (as `filters` arrays
|
|
17
|
-
* on individual attribute entries), not on anyOf branches.
|
|
18
|
-
*/
|
|
19
|
-
export interface JsonSchemaConnectorPolicy {
|
|
20
|
-
/** Stable identifier (e.g., "audience_first_party_new"). */
|
|
21
|
-
name: string;
|
|
22
|
-
/** Policy ID, typically matches name. */
|
|
23
|
-
id: string;
|
|
24
|
-
/** The app this policy belongs to. */
|
|
25
|
-
app_id: number;
|
|
26
|
-
/** Metadata including tags and refresh schedule. */
|
|
27
|
-
metadata: {
|
|
28
|
-
tags?: string[];
|
|
29
|
-
refresh_schedule?: {
|
|
30
|
-
min: string | null;
|
|
31
|
-
max: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The JSON Schema that must be satisfied by dataset.schema.
|
|
36
|
-
* Contains `properties`, `required`, `anyOf`/`allOf` for branch structure.
|
|
37
|
-
* Filters are on property definitions (sibling `properties` next to `anyOf`).
|
|
38
|
-
* May declare `$schema: "https://json-schema.org/draft/2020-12/schema"`.
|
|
39
|
-
*/
|
|
40
|
-
policy: JsonSchema;
|
|
41
|
-
/** UI form schema — not used by the SDK. */
|
|
42
|
-
schema?: unknown;
|
|
43
|
-
/** UI schema — not used by the SDK. */
|
|
44
|
-
uischema?: unknown;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { PolicyFilter } from "../types";
|
|
2
|
-
import type { JsonSchemaConnectorPolicy } from "./json-schema-types";
|
|
3
|
-
/**
|
|
4
|
-
* A single logical branch within a JSON-Schema policy that matched the dataset.
|
|
5
|
-
* Typically corresponds to one entry in schema.properties.properties.anyOf[*],
|
|
6
|
-
* or an allOf group inside one of those entries.
|
|
7
|
-
*/
|
|
8
|
-
export interface PolicyBranchMatch {
|
|
9
|
-
/**
|
|
10
|
-
* Index into the top-level anyOf array under the policy's
|
|
11
|
-
* `policy.properties.properties.anyOf`.
|
|
12
|
-
*/
|
|
13
|
-
branchIndex: number;
|
|
14
|
-
/**
|
|
15
|
-
* Required attribute names for this branch. These correspond to Schema.properties keys
|
|
16
|
-
* like "sha256_hashed_email", "postal_code", etc.
|
|
17
|
-
*/
|
|
18
|
-
requiredAttributes: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Filters collected from the property definitions for this branch's required attributes.
|
|
21
|
-
* Filters live on the property definitions (sibling `properties` to `anyOf`), not on branches.
|
|
22
|
-
* These follow the existing PolicyFilter structure and can be fed directly into filterToSql.
|
|
23
|
-
*/
|
|
24
|
-
filters: PolicyFilter[];
|
|
25
|
-
/**
|
|
26
|
-
* Additional required subfield paths per attribute, used to generate IS NOT NULL WHERE clauses.
|
|
27
|
-
* Derived from `$ref` resolution against `$defs` in the JSON Schema.
|
|
28
|
-
*
|
|
29
|
-
* Example: for `sha256_hashed_phone_number` referencing an object-type `$def`,
|
|
30
|
-
* this produces `(company_data."ds"."_rosetta_stone"."sha256_hashed_phone_number"."type" IS NOT NULL)`.
|
|
31
|
-
*/
|
|
32
|
-
additionalRequiredProperties: Array<{
|
|
33
|
-
attributeName: string;
|
|
34
|
-
paths: string[];
|
|
35
|
-
}>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Evaluation result for a single JSON-Schema-based policy.
|
|
39
|
-
*/
|
|
40
|
-
export interface PolicyEvaluation {
|
|
41
|
-
/** The policy that was evaluated. */
|
|
42
|
-
policy: JsonSchemaConnectorPolicy;
|
|
43
|
-
/** Whether dataset.schema is compatible with the policy's JSON Schema. */
|
|
44
|
-
isValid: boolean;
|
|
45
|
-
/** Branches within the policy that are satisfied for this dataset. */
|
|
46
|
-
matches: PolicyBranchMatch[];
|
|
47
|
-
/** Human-readable validation issues if isValid === false. */
|
|
48
|
-
errors: string[];
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Attribute } from "../../../attributes/types";
|
|
2
|
-
import type { Dataset } from "../../../datasets/types";
|
|
3
|
-
import type { JsonSchemaConnectorPolicy } from "./json-schema-types";
|
|
4
|
-
import type { PolicyEvaluation } from "./policy-branches";
|
|
5
|
-
/**
|
|
6
|
-
* Evaluate an array of JSON-Schema-based connector policies against a dataset.
|
|
7
|
-
*
|
|
8
|
-
* Eligibility is determined by checking whether the dataset's Rosetta Stone
|
|
9
|
-
* attributes satisfy at least one anyOf branch in the policy schema. This uses
|
|
10
|
-
* the `attributes` array (resolved from dataset mappings) as the source of truth,
|
|
11
|
-
* NOT the raw dataset.schema — the raw schema contains storage-level column names
|
|
12
|
-
* and flat types that don't match the policy's Rosetta Stone attribute names.
|
|
13
|
-
*
|
|
14
|
-
* A policy is considered valid (compatible) if `findMatchingBranches` finds at
|
|
15
|
-
* least one satisfied branch.
|
|
16
|
-
*
|
|
17
|
-
* @param _dataset - The dataset (currently unused; attributes carry the relevant info).
|
|
18
|
-
* @param attributes - Rosetta Stone attributes associated with the dataset.
|
|
19
|
-
* @param policies - JSON-Schema-based connector policies to evaluate.
|
|
20
|
-
* @returns An array of PolicyEvaluation results, one per policy.
|
|
21
|
-
*/
|
|
22
|
-
export declare function evaluateJsonSchemaPolicies(_dataset: Dataset, attributes: Attribute[], policies: JsonSchemaConnectorPolicy[]): PolicyEvaluation[];
|