@suss/ir-core 0.5.11 → 0.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.
- package/README.md +1 -1
- package/dist/{chunk-WKR5SU4N.js → chunk-TEXSN75M.js} +32 -18
- package/dist/index.cjs +103 -25
- package/dist/index.d.cts +59 -11
- package/dist/index.d.ts +59 -11
- package/dist/index.js +67 -8
- package/dist/{schemas-N9GyG0Sn.d.cts → schemas-D6hKT-zV.d.cts} +15 -24
- package/dist/{schemas-N9GyG0Sn.d.ts → schemas-D6hKT-zV.d.ts} +15 -24
- package/dist/schemas.cjs +33 -19
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Primitives shared across suss's intermediate representations: the pieces every I
|
|
|
7
7
|
The types that any suss IR is built from:
|
|
8
8
|
|
|
9
9
|
- `TypeShape`: the structure of a value, for body / payload / field comparison.
|
|
10
|
-
- `BoundaryBinding` + the `Semantics` variants (rest, function-call, graphql-resolver, graphql-operation, runtime-config, storage
|
|
10
|
+
- `BoundaryBinding` + the `Semantics` variants (rest, function-call, graphql-resolver, graphql-operation, runtime-config, storage, message-bus), plus the eight blessed binding constructors (`restBinding`, `functionCallBinding`, …).
|
|
11
11
|
- `SourceLocation` and `Confidence` (`source` + `level`).
|
|
12
12
|
|
|
13
13
|
```ts
|
|
@@ -414,29 +414,43 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
416
|
|
|
417
|
-
// src/semantics/
|
|
417
|
+
// src/semantics/storage.ts
|
|
418
418
|
import { z as z8 } from "zod";
|
|
419
|
-
var
|
|
420
|
-
name: z8.literal("storage
|
|
421
|
-
storageSystem: z8.enum(["postgres", "mysql", "sqlite"]),
|
|
419
|
+
var StorageSemanticsSchema = z8.object({
|
|
420
|
+
name: z8.literal("storage"),
|
|
422
421
|
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
422
|
+
* Which store this is: postgres, mysql, sqlite, dynamodb. Two
|
|
423
|
+
* products' containers can share a name, so this keeps them apart,
|
|
424
|
+
* and it is what a finding message calls the store.
|
|
425
|
+
*/
|
|
426
|
+
storageSystem: z8.string(),
|
|
427
|
+
/**
|
|
428
|
+
* The ORM, schema, or deployment scope. A single-database setup uses
|
|
429
|
+
* `"default"`, and a monorepo with several schemas gives each one its
|
|
430
|
+
* own value.
|
|
425
431
|
*/
|
|
426
432
|
scope: z8.string(),
|
|
427
433
|
/**
|
|
428
|
-
* The table or
|
|
429
|
-
* the source states one this reader could not
|
|
430
|
-
* pairs with nothing, rather than with
|
|
431
|
-
* happens to spell.
|
|
434
|
+
* The table, bucket, collection, or index, as the source declares
|
|
435
|
+
* it, or null when the source states one this reader could not
|
|
436
|
+
* settle. A null container pairs with nothing, rather than with
|
|
437
|
+
* whatever its source text happens to spell.
|
|
438
|
+
*/
|
|
439
|
+
container: z8.string().nullable(),
|
|
440
|
+
/**
|
|
441
|
+
* A secondary way into the container, a DynamoDB global secondary
|
|
442
|
+
* index or an Elasticsearch alias, each with its own key fields.
|
|
443
|
+
* Null means the container's own primary way in. A query through an
|
|
444
|
+
* index and a query through the table are different accesses, so
|
|
445
|
+
* they pair separately.
|
|
432
446
|
*/
|
|
433
|
-
|
|
447
|
+
accessPath: z8.string().nullable()
|
|
434
448
|
});
|
|
435
|
-
var
|
|
436
|
-
name: "storage
|
|
437
|
-
schema:
|
|
449
|
+
var storageSemantics = defineBoundarySemantics({
|
|
450
|
+
name: "storage",
|
|
451
|
+
schema: StorageSemanticsSchema,
|
|
438
452
|
behavior: {
|
|
439
|
-
/** A query returns rows, not a status and a body. */
|
|
453
|
+
/** A query returns rows or items, not a status and a body. */
|
|
440
454
|
exchangesHttpResponses: false,
|
|
441
455
|
reportsUnpairedItself: false,
|
|
442
456
|
identityKey: () => null
|
|
@@ -450,7 +464,7 @@ var SemanticsSchema = z9.discriminatedUnion("name", [
|
|
|
450
464
|
graphqlResolverSemantics.schema,
|
|
451
465
|
graphqlOperationSemantics.schema,
|
|
452
466
|
runtimeConfigSemantics.schema,
|
|
453
|
-
|
|
467
|
+
storageSemantics.schema,
|
|
454
468
|
messageBusSemantics.schema
|
|
455
469
|
]);
|
|
456
470
|
var DEFINITIONS = [
|
|
@@ -459,7 +473,7 @@ var DEFINITIONS = [
|
|
|
459
473
|
graphqlResolverSemantics,
|
|
460
474
|
graphqlOperationSemantics,
|
|
461
475
|
runtimeConfigSemantics,
|
|
462
|
-
|
|
476
|
+
storageSemantics,
|
|
463
477
|
messageBusSemantics
|
|
464
478
|
];
|
|
465
479
|
var BY_NAME = new Map(
|
|
@@ -614,7 +628,7 @@ export {
|
|
|
614
628
|
DeployableUnitSchema,
|
|
615
629
|
ecsContainerInstanceName,
|
|
616
630
|
RuntimeConfigSemanticsSchema,
|
|
617
|
-
|
|
631
|
+
StorageSemanticsSchema,
|
|
618
632
|
SemanticsSchema,
|
|
619
633
|
behaviorOf,
|
|
620
634
|
allBehaviors,
|
package/dist/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
RuntimeConfigSemanticsSchema: () => RuntimeConfigSemanticsSchema,
|
|
35
35
|
SemanticsSchema: () => SemanticsSchema,
|
|
36
36
|
SourceLocationSchema: () => SourceLocationSchema,
|
|
37
|
-
|
|
37
|
+
StorageSemanticsSchema: () => StorageSemanticsSchema,
|
|
38
38
|
SuppressionFileSchema: () => SuppressionFileSchema,
|
|
39
39
|
SuppressionRuleSchema: () => SuppressionRuleSchema,
|
|
40
40
|
TypeShapeSchema: () => TypeShapeSchema,
|
|
@@ -59,9 +59,14 @@ __export(index_exports, {
|
|
|
59
59
|
gqlIdentityKey: () => gqlIdentityKey,
|
|
60
60
|
graphqlOperationBinding: () => graphqlOperationBinding,
|
|
61
61
|
graphqlResolverBinding: () => graphqlResolverBinding,
|
|
62
|
+
hasNameHole: () => hasNameHole,
|
|
62
63
|
isGraphqlOperationBinding: () => isGraphqlOperationBinding,
|
|
63
64
|
messageBusBinding: () => messageBusBinding,
|
|
64
65
|
methodsAgree: () => methodsAgree,
|
|
66
|
+
namePatternFromSub: () => namePatternFromSub,
|
|
67
|
+
namePatternKey: () => namePatternKey,
|
|
68
|
+
namesAgree: () => namesAgree,
|
|
69
|
+
namesNothing: () => namesNothing,
|
|
65
70
|
normalizePath: () => normalizePath,
|
|
66
71
|
normalizeRuleBoundary: () => normalizeRuleBoundary,
|
|
67
72
|
packageExportBinding: () => packageExportBinding,
|
|
@@ -74,7 +79,7 @@ __export(index_exports, {
|
|
|
74
79
|
runtimeConfigBinding: () => runtimeConfigBinding,
|
|
75
80
|
semanticsAgree: () => semanticsAgree,
|
|
76
81
|
servesRequest: () => servesRequest,
|
|
77
|
-
|
|
82
|
+
storageBinding: () => storageBinding,
|
|
78
83
|
typeDefinitionKey: () => typeDefinitionKey,
|
|
79
84
|
validateRule: () => validateRule,
|
|
80
85
|
withDefinitionsInlined: () => withDefinitionsInlined
|
|
@@ -497,29 +502,43 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
497
502
|
}
|
|
498
503
|
});
|
|
499
504
|
|
|
500
|
-
// src/semantics/
|
|
505
|
+
// src/semantics/storage.ts
|
|
501
506
|
var import_zod8 = require("zod");
|
|
502
|
-
var
|
|
503
|
-
name: import_zod8.z.literal("storage
|
|
504
|
-
storageSystem: import_zod8.z.enum(["postgres", "mysql", "sqlite"]),
|
|
507
|
+
var StorageSemanticsSchema = import_zod8.z.object({
|
|
508
|
+
name: import_zod8.z.literal("storage"),
|
|
505
509
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
510
|
+
* Which store this is: postgres, mysql, sqlite, dynamodb. Two
|
|
511
|
+
* products' containers can share a name, so this keeps them apart,
|
|
512
|
+
* and it is what a finding message calls the store.
|
|
513
|
+
*/
|
|
514
|
+
storageSystem: import_zod8.z.string(),
|
|
515
|
+
/**
|
|
516
|
+
* The ORM, schema, or deployment scope. A single-database setup uses
|
|
517
|
+
* `"default"`, and a monorepo with several schemas gives each one its
|
|
518
|
+
* own value.
|
|
508
519
|
*/
|
|
509
520
|
scope: import_zod8.z.string(),
|
|
510
521
|
/**
|
|
511
|
-
* The table or
|
|
512
|
-
* the source states one this reader could not
|
|
513
|
-
* pairs with nothing, rather than with
|
|
514
|
-
* happens to spell.
|
|
522
|
+
* The table, bucket, collection, or index, as the source declares
|
|
523
|
+
* it, or null when the source states one this reader could not
|
|
524
|
+
* settle. A null container pairs with nothing, rather than with
|
|
525
|
+
* whatever its source text happens to spell.
|
|
526
|
+
*/
|
|
527
|
+
container: import_zod8.z.string().nullable(),
|
|
528
|
+
/**
|
|
529
|
+
* A secondary way into the container, a DynamoDB global secondary
|
|
530
|
+
* index or an Elasticsearch alias, each with its own key fields.
|
|
531
|
+
* Null means the container's own primary way in. A query through an
|
|
532
|
+
* index and a query through the table are different accesses, so
|
|
533
|
+
* they pair separately.
|
|
515
534
|
*/
|
|
516
|
-
|
|
535
|
+
accessPath: import_zod8.z.string().nullable()
|
|
517
536
|
});
|
|
518
|
-
var
|
|
519
|
-
name: "storage
|
|
520
|
-
schema:
|
|
537
|
+
var storageSemantics = defineBoundarySemantics({
|
|
538
|
+
name: "storage",
|
|
539
|
+
schema: StorageSemanticsSchema,
|
|
521
540
|
behavior: {
|
|
522
|
-
/** A query returns rows, not a status and a body. */
|
|
541
|
+
/** A query returns rows or items, not a status and a body. */
|
|
523
542
|
exchangesHttpResponses: false,
|
|
524
543
|
reportsUnpairedItself: false,
|
|
525
544
|
identityKey: () => null
|
|
@@ -533,7 +552,7 @@ var SemanticsSchema = import_zod9.z.discriminatedUnion("name", [
|
|
|
533
552
|
graphqlResolverSemantics.schema,
|
|
534
553
|
graphqlOperationSemantics.schema,
|
|
535
554
|
runtimeConfigSemantics.schema,
|
|
536
|
-
|
|
555
|
+
storageSemantics.schema,
|
|
537
556
|
messageBusSemantics.schema
|
|
538
557
|
]);
|
|
539
558
|
var DEFINITIONS = [
|
|
@@ -542,7 +561,7 @@ var DEFINITIONS = [
|
|
|
542
561
|
graphqlResolverSemantics,
|
|
543
562
|
graphqlOperationSemantics,
|
|
544
563
|
runtimeConfigSemantics,
|
|
545
|
-
|
|
564
|
+
storageSemantics,
|
|
546
565
|
messageBusSemantics
|
|
547
566
|
];
|
|
548
567
|
var BY_NAME = new Map(
|
|
@@ -749,6 +768,59 @@ function dispatchByType(table, value) {
|
|
|
749
768
|
return handler(value);
|
|
750
769
|
}
|
|
751
770
|
|
|
771
|
+
// src/namePattern.ts
|
|
772
|
+
var HOLE = /\{[^}]*\}/g;
|
|
773
|
+
var SUB_TOKEN = /\$\{([^}]*)\}/g;
|
|
774
|
+
var SUB_ESCAPE = /\$\{!/;
|
|
775
|
+
function namePatternFromSub(value) {
|
|
776
|
+
if (Array.isArray(value)) {
|
|
777
|
+
return typeof value[0] === "string" ? namePatternFromSub(value[0]) : null;
|
|
778
|
+
}
|
|
779
|
+
if (typeof value !== "string") {
|
|
780
|
+
return null;
|
|
781
|
+
}
|
|
782
|
+
if (SUB_ESCAPE.test(value)) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
return value.replace(SUB_TOKEN, (_whole, inner) => `{${inner}}`);
|
|
786
|
+
}
|
|
787
|
+
function namesNothing(name) {
|
|
788
|
+
return /^\{[^}]*\}$/.test(name);
|
|
789
|
+
}
|
|
790
|
+
function hasNameHole(name) {
|
|
791
|
+
HOLE.lastIndex = 0;
|
|
792
|
+
return HOLE.test(name);
|
|
793
|
+
}
|
|
794
|
+
function namePatternKey(name) {
|
|
795
|
+
return name.replace(HOLE, "{}");
|
|
796
|
+
}
|
|
797
|
+
function admits(pattern, name) {
|
|
798
|
+
const source = pattern.split(/(\{[^}]*\})/).map(
|
|
799
|
+
(part) => part.startsWith("{") && part.endsWith("}") ? ".+" : part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
|
|
800
|
+
).join("");
|
|
801
|
+
return new RegExp(`^${source}$`).test(name);
|
|
802
|
+
}
|
|
803
|
+
function namesAgree(a, b) {
|
|
804
|
+
if (namesNothing(a) || namesNothing(b)) {
|
|
805
|
+
return false;
|
|
806
|
+
}
|
|
807
|
+
if (a === b) {
|
|
808
|
+
return true;
|
|
809
|
+
}
|
|
810
|
+
const aHasHole = hasNameHole(a);
|
|
811
|
+
const bHasHole = hasNameHole(b);
|
|
812
|
+
if (aHasHole && bHasHole) {
|
|
813
|
+
return namePatternKey(a) === namePatternKey(b);
|
|
814
|
+
}
|
|
815
|
+
if (aHasHole) {
|
|
816
|
+
return admits(a, b);
|
|
817
|
+
}
|
|
818
|
+
if (bHasHole) {
|
|
819
|
+
return admits(b, a);
|
|
820
|
+
}
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
|
|
752
824
|
// src/suppressions.ts
|
|
753
825
|
var import_zod11 = require("zod");
|
|
754
826
|
var SuppressionSideSchema = import_zod11.z.object({
|
|
@@ -1089,14 +1161,15 @@ function runtimeConfigBinding(opts) {
|
|
|
1089
1161
|
recognition: opts.recognition
|
|
1090
1162
|
};
|
|
1091
1163
|
}
|
|
1092
|
-
function
|
|
1164
|
+
function storageBinding(opts) {
|
|
1093
1165
|
return {
|
|
1094
|
-
transport: opts.storageSystem,
|
|
1166
|
+
transport: opts.transport ?? opts.storageSystem,
|
|
1095
1167
|
semantics: {
|
|
1096
|
-
name: "storage
|
|
1168
|
+
name: "storage",
|
|
1097
1169
|
storageSystem: opts.storageSystem,
|
|
1098
1170
|
scope: opts.scope,
|
|
1099
|
-
|
|
1171
|
+
container: namedOrNull(opts.container, "storage container"),
|
|
1172
|
+
accessPath: opts.accessPath ?? null
|
|
1100
1173
|
},
|
|
1101
1174
|
recognition: opts.recognition
|
|
1102
1175
|
};
|
|
@@ -1128,7 +1201,7 @@ function messageBusBinding(opts) {
|
|
|
1128
1201
|
RuntimeConfigSemanticsSchema,
|
|
1129
1202
|
SemanticsSchema,
|
|
1130
1203
|
SourceLocationSchema,
|
|
1131
|
-
|
|
1204
|
+
StorageSemanticsSchema,
|
|
1132
1205
|
SuppressionFileSchema,
|
|
1133
1206
|
SuppressionRuleSchema,
|
|
1134
1207
|
TypeShapeSchema,
|
|
@@ -1153,9 +1226,14 @@ function messageBusBinding(opts) {
|
|
|
1153
1226
|
gqlIdentityKey,
|
|
1154
1227
|
graphqlOperationBinding,
|
|
1155
1228
|
graphqlResolverBinding,
|
|
1229
|
+
hasNameHole,
|
|
1156
1230
|
isGraphqlOperationBinding,
|
|
1157
1231
|
messageBusBinding,
|
|
1158
1232
|
methodsAgree,
|
|
1233
|
+
namePatternFromSub,
|
|
1234
|
+
namePatternKey,
|
|
1235
|
+
namesAgree,
|
|
1236
|
+
namesNothing,
|
|
1159
1237
|
normalizePath,
|
|
1160
1238
|
normalizeRuleBoundary,
|
|
1161
1239
|
packageExportBinding,
|
|
@@ -1168,7 +1246,7 @@ function messageBusBinding(opts) {
|
|
|
1168
1246
|
runtimeConfigBinding,
|
|
1169
1247
|
semanticsAgree,
|
|
1170
1248
|
servesRequest,
|
|
1171
|
-
|
|
1249
|
+
storageBinding,
|
|
1172
1250
|
typeDefinitionKey,
|
|
1173
1251
|
validateRule,
|
|
1174
1252
|
withDefinitionsInlined
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-
|
|
3
|
-
export { D as DeployableUnit, f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-D6hKT-zV.cjs';
|
|
3
|
+
export { D as DeployableUnit, f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as routePathAdmits, w as typeDefinitionKey, x as withDefinitionsInlined } from './schemas-D6hKT-zV.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Comparing two TypeShapes structurally.
|
|
@@ -262,6 +262,50 @@ declare function dispatchByType<T extends {
|
|
|
262
262
|
type: string;
|
|
263
263
|
}, R>(table: DispatchTable<T, R>, value: T): R;
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* A name two sides state with a hole in it.
|
|
267
|
+
*
|
|
268
|
+
* A deployed resource is often called something built at deploy time:
|
|
269
|
+
* a template writes `!Sub "${StageName}-orders-v1"` and the code writes
|
|
270
|
+
* `` `${stage}-orders-v1` ``. Neither side states a string, both agree
|
|
271
|
+
* about the fixed text, and each spells the parameter its own way. So a
|
|
272
|
+
* name is written here as fixed text with `{}` holes, the way a REST
|
|
273
|
+
* path is written with `{id}`, and two names agree when their fixed
|
|
274
|
+
* parts line up.
|
|
275
|
+
*
|
|
276
|
+
* A hole covers a whole parameter rather than one path segment,
|
|
277
|
+
* because a name has no separator that every project agrees on.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* The name a CloudFormation `Fn::Sub` value states. The array form
|
|
281
|
+
* takes its template from the first element, and the variable map only
|
|
282
|
+
* says where a substitution comes from, which does not change the name.
|
|
283
|
+
*/
|
|
284
|
+
declare function namePatternFromSub(value: unknown): string | null;
|
|
285
|
+
/**
|
|
286
|
+
* Whether a name says only that somebody else knows it. A wrapper that
|
|
287
|
+
* takes its bucket as an argument states `{location.bucket}` and
|
|
288
|
+
* nothing more, which says which parameter to ask rather than which
|
|
289
|
+
* bucket. A name like that agrees with nothing until something grounds
|
|
290
|
+
* it, since otherwise it would agree with every name there is.
|
|
291
|
+
*/
|
|
292
|
+
declare function namesNothing(name: string): boolean;
|
|
293
|
+
/** Whether a name has anything a source left for deploy time to fill. */
|
|
294
|
+
declare function hasNameHole(name: string): boolean;
|
|
295
|
+
/**
|
|
296
|
+
* The form two patterns are compared in: every hole reduced to the same
|
|
297
|
+
* token, since the two sides pick their own name for the parameter.
|
|
298
|
+
*/
|
|
299
|
+
declare function namePatternKey(name: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Whether two names are the same name. Two patterns agree when their
|
|
302
|
+
* fixed parts line up, since a hole on one side meets a hole on the
|
|
303
|
+
* other. A pattern and a concrete name agree when the fixed parts are
|
|
304
|
+
* where the pattern says they are, which is what happens when one side
|
|
305
|
+
* hardcoded what the other parameterized.
|
|
306
|
+
*/
|
|
307
|
+
declare function namesAgree(a: string, b: string): boolean;
|
|
308
|
+
|
|
265
309
|
/**
|
|
266
310
|
* The suppression pipeline, over the smallest finding both checkers share.
|
|
267
311
|
*
|
|
@@ -475,17 +519,21 @@ declare function runtimeConfigBinding(opts: {
|
|
|
475
519
|
instanceName: string;
|
|
476
520
|
}): BoundaryBinding;
|
|
477
521
|
/**
|
|
478
|
-
* Build a storage
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
522
|
+
* Build a storage binding, the side of a store that both a schema
|
|
523
|
+
* reader and a call site can spell. `transport` defaults to the store's
|
|
524
|
+
* own name, which is right for a database whose product and wire
|
|
525
|
+
* protocol are the same word, and a store reached over an SDK passes
|
|
526
|
+
* its wire instead.
|
|
482
527
|
*/
|
|
483
|
-
declare function
|
|
528
|
+
declare function storageBinding(opts: {
|
|
484
529
|
recognition: string;
|
|
485
|
-
storageSystem:
|
|
530
|
+
storageSystem: string;
|
|
531
|
+
transport?: string;
|
|
486
532
|
scope: string;
|
|
487
|
-
/** Null when the source
|
|
488
|
-
|
|
533
|
+
/** Null when the source gives a container this reader could not settle. */
|
|
534
|
+
container: string | null;
|
|
535
|
+
/** A secondary index or alias, or null for the container's own primary key. */
|
|
536
|
+
accessPath?: string | null;
|
|
489
537
|
}): BoundaryBinding;
|
|
490
538
|
/**
|
|
491
539
|
* Build a message-bus binding, the boundary between a producer that
|
|
@@ -498,4 +546,4 @@ declare function messageBusBinding(opts: {
|
|
|
498
546
|
channel: string | null;
|
|
499
547
|
}): BoundaryBinding;
|
|
500
548
|
|
|
501
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, isGraphqlOperationBinding, messageBusBinding, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest,
|
|
549
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-
|
|
3
|
-
export { D as DeployableUnit, f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-D6hKT-zV.js';
|
|
3
|
+
export { D as DeployableUnit, f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as routePathAdmits, w as typeDefinitionKey, x as withDefinitionsInlined } from './schemas-D6hKT-zV.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Comparing two TypeShapes structurally.
|
|
@@ -262,6 +262,50 @@ declare function dispatchByType<T extends {
|
|
|
262
262
|
type: string;
|
|
263
263
|
}, R>(table: DispatchTable<T, R>, value: T): R;
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* A name two sides state with a hole in it.
|
|
267
|
+
*
|
|
268
|
+
* A deployed resource is often called something built at deploy time:
|
|
269
|
+
* a template writes `!Sub "${StageName}-orders-v1"` and the code writes
|
|
270
|
+
* `` `${stage}-orders-v1` ``. Neither side states a string, both agree
|
|
271
|
+
* about the fixed text, and each spells the parameter its own way. So a
|
|
272
|
+
* name is written here as fixed text with `{}` holes, the way a REST
|
|
273
|
+
* path is written with `{id}`, and two names agree when their fixed
|
|
274
|
+
* parts line up.
|
|
275
|
+
*
|
|
276
|
+
* A hole covers a whole parameter rather than one path segment,
|
|
277
|
+
* because a name has no separator that every project agrees on.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* The name a CloudFormation `Fn::Sub` value states. The array form
|
|
281
|
+
* takes its template from the first element, and the variable map only
|
|
282
|
+
* says where a substitution comes from, which does not change the name.
|
|
283
|
+
*/
|
|
284
|
+
declare function namePatternFromSub(value: unknown): string | null;
|
|
285
|
+
/**
|
|
286
|
+
* Whether a name says only that somebody else knows it. A wrapper that
|
|
287
|
+
* takes its bucket as an argument states `{location.bucket}` and
|
|
288
|
+
* nothing more, which says which parameter to ask rather than which
|
|
289
|
+
* bucket. A name like that agrees with nothing until something grounds
|
|
290
|
+
* it, since otherwise it would agree with every name there is.
|
|
291
|
+
*/
|
|
292
|
+
declare function namesNothing(name: string): boolean;
|
|
293
|
+
/** Whether a name has anything a source left for deploy time to fill. */
|
|
294
|
+
declare function hasNameHole(name: string): boolean;
|
|
295
|
+
/**
|
|
296
|
+
* The form two patterns are compared in: every hole reduced to the same
|
|
297
|
+
* token, since the two sides pick their own name for the parameter.
|
|
298
|
+
*/
|
|
299
|
+
declare function namePatternKey(name: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Whether two names are the same name. Two patterns agree when their
|
|
302
|
+
* fixed parts line up, since a hole on one side meets a hole on the
|
|
303
|
+
* other. A pattern and a concrete name agree when the fixed parts are
|
|
304
|
+
* where the pattern says they are, which is what happens when one side
|
|
305
|
+
* hardcoded what the other parameterized.
|
|
306
|
+
*/
|
|
307
|
+
declare function namesAgree(a: string, b: string): boolean;
|
|
308
|
+
|
|
265
309
|
/**
|
|
266
310
|
* The suppression pipeline, over the smallest finding both checkers share.
|
|
267
311
|
*
|
|
@@ -475,17 +519,21 @@ declare function runtimeConfigBinding(opts: {
|
|
|
475
519
|
instanceName: string;
|
|
476
520
|
}): BoundaryBinding;
|
|
477
521
|
/**
|
|
478
|
-
* Build a storage
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
522
|
+
* Build a storage binding, the side of a store that both a schema
|
|
523
|
+
* reader and a call site can spell. `transport` defaults to the store's
|
|
524
|
+
* own name, which is right for a database whose product and wire
|
|
525
|
+
* protocol are the same word, and a store reached over an SDK passes
|
|
526
|
+
* its wire instead.
|
|
482
527
|
*/
|
|
483
|
-
declare function
|
|
528
|
+
declare function storageBinding(opts: {
|
|
484
529
|
recognition: string;
|
|
485
|
-
storageSystem:
|
|
530
|
+
storageSystem: string;
|
|
531
|
+
transport?: string;
|
|
486
532
|
scope: string;
|
|
487
|
-
/** Null when the source
|
|
488
|
-
|
|
533
|
+
/** Null when the source gives a container this reader could not settle. */
|
|
534
|
+
container: string | null;
|
|
535
|
+
/** A secondary index or alias, or null for the container's own primary key. */
|
|
536
|
+
accessPath?: string | null;
|
|
489
537
|
}): BoundaryBinding;
|
|
490
538
|
/**
|
|
491
539
|
* Build a message-bus binding, the boundary between a producer that
|
|
@@ -498,4 +546,4 @@ declare function messageBusBinding(opts: {
|
|
|
498
546
|
channel: string | null;
|
|
499
547
|
}): BoundaryBinding;
|
|
500
548
|
|
|
501
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, isGraphqlOperationBinding, messageBusBinding, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest,
|
|
549
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RuntimeConfigSemanticsSchema,
|
|
14
14
|
SemanticsSchema,
|
|
15
15
|
SourceLocationSchema,
|
|
16
|
-
|
|
16
|
+
StorageSemanticsSchema,
|
|
17
17
|
TypeShapeSchema,
|
|
18
18
|
allBehaviors,
|
|
19
19
|
behaviorOf,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
routePathAdmits,
|
|
31
31
|
typeDefinitionKey,
|
|
32
32
|
withDefinitionsInlined
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TEXSN75M.js";
|
|
34
34
|
|
|
35
35
|
// src/boundaryKey.ts
|
|
36
36
|
function boundaryKey(binding) {
|
|
@@ -103,6 +103,59 @@ function dispatchByType(table, value) {
|
|
|
103
103
|
return handler(value);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// src/namePattern.ts
|
|
107
|
+
var HOLE = /\{[^}]*\}/g;
|
|
108
|
+
var SUB_TOKEN = /\$\{([^}]*)\}/g;
|
|
109
|
+
var SUB_ESCAPE = /\$\{!/;
|
|
110
|
+
function namePatternFromSub(value) {
|
|
111
|
+
if (Array.isArray(value)) {
|
|
112
|
+
return typeof value[0] === "string" ? namePatternFromSub(value[0]) : null;
|
|
113
|
+
}
|
|
114
|
+
if (typeof value !== "string") {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (SUB_ESCAPE.test(value)) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return value.replace(SUB_TOKEN, (_whole, inner) => `{${inner}}`);
|
|
121
|
+
}
|
|
122
|
+
function namesNothing(name) {
|
|
123
|
+
return /^\{[^}]*\}$/.test(name);
|
|
124
|
+
}
|
|
125
|
+
function hasNameHole(name) {
|
|
126
|
+
HOLE.lastIndex = 0;
|
|
127
|
+
return HOLE.test(name);
|
|
128
|
+
}
|
|
129
|
+
function namePatternKey(name) {
|
|
130
|
+
return name.replace(HOLE, "{}");
|
|
131
|
+
}
|
|
132
|
+
function admits(pattern, name) {
|
|
133
|
+
const source = pattern.split(/(\{[^}]*\})/).map(
|
|
134
|
+
(part) => part.startsWith("{") && part.endsWith("}") ? ".+" : part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
|
|
135
|
+
).join("");
|
|
136
|
+
return new RegExp(`^${source}$`).test(name);
|
|
137
|
+
}
|
|
138
|
+
function namesAgree(a, b) {
|
|
139
|
+
if (namesNothing(a) || namesNothing(b)) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (a === b) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
const aHasHole = hasNameHole(a);
|
|
146
|
+
const bHasHole = hasNameHole(b);
|
|
147
|
+
if (aHasHole && bHasHole) {
|
|
148
|
+
return namePatternKey(a) === namePatternKey(b);
|
|
149
|
+
}
|
|
150
|
+
if (aHasHole) {
|
|
151
|
+
return admits(a, b);
|
|
152
|
+
}
|
|
153
|
+
if (bHasHole) {
|
|
154
|
+
return admits(b, a);
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
|
|
106
159
|
// src/suppressions.ts
|
|
107
160
|
import { z } from "zod";
|
|
108
161
|
var SuppressionSideSchema = z.object({
|
|
@@ -443,14 +496,15 @@ function runtimeConfigBinding(opts) {
|
|
|
443
496
|
recognition: opts.recognition
|
|
444
497
|
};
|
|
445
498
|
}
|
|
446
|
-
function
|
|
499
|
+
function storageBinding(opts) {
|
|
447
500
|
return {
|
|
448
|
-
transport: opts.storageSystem,
|
|
501
|
+
transport: opts.transport ?? opts.storageSystem,
|
|
449
502
|
semantics: {
|
|
450
|
-
name: "storage
|
|
503
|
+
name: "storage",
|
|
451
504
|
storageSystem: opts.storageSystem,
|
|
452
505
|
scope: opts.scope,
|
|
453
|
-
|
|
506
|
+
container: namedOrNull(opts.container, "storage container"),
|
|
507
|
+
accessPath: opts.accessPath ?? null
|
|
454
508
|
},
|
|
455
509
|
recognition: opts.recognition
|
|
456
510
|
};
|
|
@@ -481,7 +535,7 @@ export {
|
|
|
481
535
|
RuntimeConfigSemanticsSchema,
|
|
482
536
|
SemanticsSchema,
|
|
483
537
|
SourceLocationSchema,
|
|
484
|
-
|
|
538
|
+
StorageSemanticsSchema,
|
|
485
539
|
SuppressionFileSchema,
|
|
486
540
|
SuppressionRuleSchema,
|
|
487
541
|
TypeShapeSchema,
|
|
@@ -506,9 +560,14 @@ export {
|
|
|
506
560
|
gqlIdentityKey,
|
|
507
561
|
graphqlOperationBinding,
|
|
508
562
|
graphqlResolverBinding,
|
|
563
|
+
hasNameHole,
|
|
509
564
|
isGraphqlOperationBinding,
|
|
510
565
|
messageBusBinding,
|
|
511
566
|
methodsAgree,
|
|
567
|
+
namePatternFromSub,
|
|
568
|
+
namePatternKey,
|
|
569
|
+
namesAgree,
|
|
570
|
+
namesNothing,
|
|
512
571
|
normalizePath,
|
|
513
572
|
normalizeRuleBoundary,
|
|
514
573
|
packageExportBinding,
|
|
@@ -521,7 +580,7 @@ export {
|
|
|
521
580
|
runtimeConfigBinding,
|
|
522
581
|
semanticsAgree,
|
|
523
582
|
servesRequest,
|
|
524
|
-
|
|
583
|
+
storageBinding,
|
|
525
584
|
typeDefinitionKey,
|
|
526
585
|
validateRule,
|
|
527
586
|
withDefinitionsInlined
|
|
@@ -124,14 +124,11 @@ declare const SemanticsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
124
124
|
instanceName: z.ZodString;
|
|
125
125
|
name: z.ZodLiteral<"runtime-config">;
|
|
126
126
|
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
-
name: z.ZodLiteral<"storage
|
|
128
|
-
storageSystem: z.
|
|
129
|
-
postgres: "postgres";
|
|
130
|
-
mysql: "mysql";
|
|
131
|
-
sqlite: "sqlite";
|
|
132
|
-
}>;
|
|
127
|
+
name: z.ZodLiteral<"storage">;
|
|
128
|
+
storageSystem: z.ZodString;
|
|
133
129
|
scope: z.ZodString;
|
|
134
|
-
|
|
130
|
+
container: z.ZodNullable<z.ZodString>;
|
|
131
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
135
132
|
}, z.core.$strip>, z.ZodObject<{
|
|
136
133
|
name: z.ZodLiteral<"message-bus">;
|
|
137
134
|
messageBus: z.ZodEnum<{
|
|
@@ -192,17 +189,14 @@ declare const RuntimeConfigSemanticsSchema: z.ZodObject<{
|
|
|
192
189
|
}, z.core.$strip>;
|
|
193
190
|
type RuntimeConfigSemantics = z.infer<typeof RuntimeConfigSemanticsSchema>;
|
|
194
191
|
|
|
195
|
-
declare const
|
|
196
|
-
name: z.ZodLiteral<"storage
|
|
197
|
-
storageSystem: z.
|
|
198
|
-
postgres: "postgres";
|
|
199
|
-
mysql: "mysql";
|
|
200
|
-
sqlite: "sqlite";
|
|
201
|
-
}>;
|
|
192
|
+
declare const StorageSemanticsSchema: z.ZodObject<{
|
|
193
|
+
name: z.ZodLiteral<"storage">;
|
|
194
|
+
storageSystem: z.ZodString;
|
|
202
195
|
scope: z.ZodString;
|
|
203
|
-
|
|
196
|
+
container: z.ZodNullable<z.ZodString>;
|
|
197
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
204
198
|
}, z.core.$strip>;
|
|
205
|
-
type
|
|
199
|
+
type StorageSemantics = z.infer<typeof StorageSemanticsSchema>;
|
|
206
200
|
|
|
207
201
|
/**
|
|
208
202
|
* @suss/ir-core schemas: primitives shared by every suss IR.
|
|
@@ -320,14 +314,11 @@ declare const BoundaryBindingSchema: z.ZodObject<{
|
|
|
320
314
|
instanceName: z.ZodString;
|
|
321
315
|
name: z.ZodLiteral<"runtime-config">;
|
|
322
316
|
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
-
name: z.ZodLiteral<"storage
|
|
324
|
-
storageSystem: z.
|
|
325
|
-
postgres: "postgres";
|
|
326
|
-
mysql: "mysql";
|
|
327
|
-
sqlite: "sqlite";
|
|
328
|
-
}>;
|
|
317
|
+
name: z.ZodLiteral<"storage">;
|
|
318
|
+
storageSystem: z.ZodString;
|
|
329
319
|
scope: z.ZodString;
|
|
330
|
-
|
|
320
|
+
container: z.ZodNullable<z.ZodString>;
|
|
321
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
331
322
|
}, z.core.$strip>, z.ZodObject<{
|
|
332
323
|
name: z.ZodLiteral<"message-bus">;
|
|
333
324
|
messageBus: z.ZodEnum<{
|
|
@@ -429,4 +420,4 @@ declare const TypeShapeSchema: z.ZodType<TypeShape>;
|
|
|
429
420
|
*/
|
|
430
421
|
declare function withDefinitionsInlined(shape: TypeShape, definitions: Record<string, TypeShape> | undefined, depth?: number, inProgress?: ReadonlySet<string>): TypeShape;
|
|
431
422
|
|
|
432
|
-
export { BoundaryBindingSchema as B, ConfidenceInfoSchema as C, type DeployableUnit as D, type FunctionCallSemantics as F, type GraphqlOperationSemantics as G, type MessageBusSemantics as M, type RestSemantics as R, type Semantics as S, type TypeShape as T, ConfidenceLevelSchema as a, ConfidenceSourceSchema as b, CorroborationSchema as c, SourceLocationSchema as d, type MessageBusTechnology as e, DeployableUnitSchema as f, FunctionCallSemanticsSchema as g, GraphqlOperationSemanticsSchema as h, type GraphqlResolverSemantics as i, GraphqlResolverSemanticsSchema as j, MessageBusSemanticsSchema as k, RestSemanticsSchema as l, type RuntimeConfigSemantics as m, RuntimeConfigSemanticsSchema as n, SemanticsSchema as o, type
|
|
423
|
+
export { BoundaryBindingSchema as B, ConfidenceInfoSchema as C, type DeployableUnit as D, type FunctionCallSemantics as F, type GraphqlOperationSemantics as G, type MessageBusSemantics as M, type RestSemantics as R, type Semantics as S, type TypeShape as T, ConfidenceLevelSchema as a, ConfidenceSourceSchema as b, CorroborationSchema as c, SourceLocationSchema as d, type MessageBusTechnology as e, DeployableUnitSchema as f, FunctionCallSemanticsSchema as g, GraphqlOperationSemanticsSchema as h, type GraphqlResolverSemantics as i, GraphqlResolverSemanticsSchema as j, MessageBusSemanticsSchema as k, RestSemanticsSchema as l, type RuntimeConfigSemantics as m, RuntimeConfigSemanticsSchema as n, SemanticsSchema as o, type StorageSemantics as p, StorageSemanticsSchema as q, TypeShapeSchema as r, ecsContainerInstanceName as s, methodsAgree as t, normalizePath as u, routePathAdmits as v, typeDefinitionKey as w, withDefinitionsInlined as x };
|
|
@@ -124,14 +124,11 @@ declare const SemanticsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
124
124
|
instanceName: z.ZodString;
|
|
125
125
|
name: z.ZodLiteral<"runtime-config">;
|
|
126
126
|
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
-
name: z.ZodLiteral<"storage
|
|
128
|
-
storageSystem: z.
|
|
129
|
-
postgres: "postgres";
|
|
130
|
-
mysql: "mysql";
|
|
131
|
-
sqlite: "sqlite";
|
|
132
|
-
}>;
|
|
127
|
+
name: z.ZodLiteral<"storage">;
|
|
128
|
+
storageSystem: z.ZodString;
|
|
133
129
|
scope: z.ZodString;
|
|
134
|
-
|
|
130
|
+
container: z.ZodNullable<z.ZodString>;
|
|
131
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
135
132
|
}, z.core.$strip>, z.ZodObject<{
|
|
136
133
|
name: z.ZodLiteral<"message-bus">;
|
|
137
134
|
messageBus: z.ZodEnum<{
|
|
@@ -192,17 +189,14 @@ declare const RuntimeConfigSemanticsSchema: z.ZodObject<{
|
|
|
192
189
|
}, z.core.$strip>;
|
|
193
190
|
type RuntimeConfigSemantics = z.infer<typeof RuntimeConfigSemanticsSchema>;
|
|
194
191
|
|
|
195
|
-
declare const
|
|
196
|
-
name: z.ZodLiteral<"storage
|
|
197
|
-
storageSystem: z.
|
|
198
|
-
postgres: "postgres";
|
|
199
|
-
mysql: "mysql";
|
|
200
|
-
sqlite: "sqlite";
|
|
201
|
-
}>;
|
|
192
|
+
declare const StorageSemanticsSchema: z.ZodObject<{
|
|
193
|
+
name: z.ZodLiteral<"storage">;
|
|
194
|
+
storageSystem: z.ZodString;
|
|
202
195
|
scope: z.ZodString;
|
|
203
|
-
|
|
196
|
+
container: z.ZodNullable<z.ZodString>;
|
|
197
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
204
198
|
}, z.core.$strip>;
|
|
205
|
-
type
|
|
199
|
+
type StorageSemantics = z.infer<typeof StorageSemanticsSchema>;
|
|
206
200
|
|
|
207
201
|
/**
|
|
208
202
|
* @suss/ir-core schemas: primitives shared by every suss IR.
|
|
@@ -320,14 +314,11 @@ declare const BoundaryBindingSchema: z.ZodObject<{
|
|
|
320
314
|
instanceName: z.ZodString;
|
|
321
315
|
name: z.ZodLiteral<"runtime-config">;
|
|
322
316
|
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
-
name: z.ZodLiteral<"storage
|
|
324
|
-
storageSystem: z.
|
|
325
|
-
postgres: "postgres";
|
|
326
|
-
mysql: "mysql";
|
|
327
|
-
sqlite: "sqlite";
|
|
328
|
-
}>;
|
|
317
|
+
name: z.ZodLiteral<"storage">;
|
|
318
|
+
storageSystem: z.ZodString;
|
|
329
319
|
scope: z.ZodString;
|
|
330
|
-
|
|
320
|
+
container: z.ZodNullable<z.ZodString>;
|
|
321
|
+
accessPath: z.ZodNullable<z.ZodString>;
|
|
331
322
|
}, z.core.$strip>, z.ZodObject<{
|
|
332
323
|
name: z.ZodLiteral<"message-bus">;
|
|
333
324
|
messageBus: z.ZodEnum<{
|
|
@@ -429,4 +420,4 @@ declare const TypeShapeSchema: z.ZodType<TypeShape>;
|
|
|
429
420
|
*/
|
|
430
421
|
declare function withDefinitionsInlined(shape: TypeShape, definitions: Record<string, TypeShape> | undefined, depth?: number, inProgress?: ReadonlySet<string>): TypeShape;
|
|
431
422
|
|
|
432
|
-
export { BoundaryBindingSchema as B, ConfidenceInfoSchema as C, type DeployableUnit as D, type FunctionCallSemantics as F, type GraphqlOperationSemantics as G, type MessageBusSemantics as M, type RestSemantics as R, type Semantics as S, type TypeShape as T, ConfidenceLevelSchema as a, ConfidenceSourceSchema as b, CorroborationSchema as c, SourceLocationSchema as d, type MessageBusTechnology as e, DeployableUnitSchema as f, FunctionCallSemanticsSchema as g, GraphqlOperationSemanticsSchema as h, type GraphqlResolverSemantics as i, GraphqlResolverSemanticsSchema as j, MessageBusSemanticsSchema as k, RestSemanticsSchema as l, type RuntimeConfigSemantics as m, RuntimeConfigSemanticsSchema as n, SemanticsSchema as o, type
|
|
423
|
+
export { BoundaryBindingSchema as B, ConfidenceInfoSchema as C, type DeployableUnit as D, type FunctionCallSemantics as F, type GraphqlOperationSemantics as G, type MessageBusSemantics as M, type RestSemantics as R, type Semantics as S, type TypeShape as T, ConfidenceLevelSchema as a, ConfidenceSourceSchema as b, CorroborationSchema as c, SourceLocationSchema as d, type MessageBusTechnology as e, DeployableUnitSchema as f, FunctionCallSemanticsSchema as g, GraphqlOperationSemanticsSchema as h, type GraphqlResolverSemantics as i, GraphqlResolverSemanticsSchema as j, MessageBusSemanticsSchema as k, RestSemanticsSchema as l, type RuntimeConfigSemantics as m, RuntimeConfigSemanticsSchema as n, SemanticsSchema as o, type StorageSemantics as p, StorageSemanticsSchema as q, TypeShapeSchema as r, ecsContainerInstanceName as s, methodsAgree as t, normalizePath as u, routePathAdmits as v, typeDefinitionKey as w, withDefinitionsInlined as x };
|
package/dist/schemas.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(schemas_exports, {
|
|
|
34
34
|
RuntimeConfigSemanticsSchema: () => RuntimeConfigSemanticsSchema,
|
|
35
35
|
SemanticsSchema: () => SemanticsSchema,
|
|
36
36
|
SourceLocationSchema: () => SourceLocationSchema,
|
|
37
|
-
|
|
37
|
+
StorageSemanticsSchema: () => StorageSemanticsSchema,
|
|
38
38
|
TypeShapeSchema: () => TypeShapeSchema,
|
|
39
39
|
typeDefinitionKey: () => typeDefinitionKey,
|
|
40
40
|
withDefinitionsInlined: () => withDefinitionsInlined
|
|
@@ -446,29 +446,43 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
|
|
449
|
-
// src/semantics/
|
|
449
|
+
// src/semantics/storage.ts
|
|
450
450
|
var import_zod8 = require("zod");
|
|
451
|
-
var
|
|
452
|
-
name: import_zod8.z.literal("storage
|
|
453
|
-
storageSystem: import_zod8.z.enum(["postgres", "mysql", "sqlite"]),
|
|
451
|
+
var StorageSemanticsSchema = import_zod8.z.object({
|
|
452
|
+
name: import_zod8.z.literal("storage"),
|
|
454
453
|
/**
|
|
455
|
-
*
|
|
456
|
-
*
|
|
454
|
+
* Which store this is: postgres, mysql, sqlite, dynamodb. Two
|
|
455
|
+
* products' containers can share a name, so this keeps them apart,
|
|
456
|
+
* and it is what a finding message calls the store.
|
|
457
|
+
*/
|
|
458
|
+
storageSystem: import_zod8.z.string(),
|
|
459
|
+
/**
|
|
460
|
+
* The ORM, schema, or deployment scope. A single-database setup uses
|
|
461
|
+
* `"default"`, and a monorepo with several schemas gives each one its
|
|
462
|
+
* own value.
|
|
457
463
|
*/
|
|
458
464
|
scope: import_zod8.z.string(),
|
|
459
465
|
/**
|
|
460
|
-
* The table or
|
|
461
|
-
* the source states one this reader could not
|
|
462
|
-
* pairs with nothing, rather than with
|
|
463
|
-
* happens to spell.
|
|
466
|
+
* The table, bucket, collection, or index, as the source declares
|
|
467
|
+
* it, or null when the source states one this reader could not
|
|
468
|
+
* settle. A null container pairs with nothing, rather than with
|
|
469
|
+
* whatever its source text happens to spell.
|
|
470
|
+
*/
|
|
471
|
+
container: import_zod8.z.string().nullable(),
|
|
472
|
+
/**
|
|
473
|
+
* A secondary way into the container, a DynamoDB global secondary
|
|
474
|
+
* index or an Elasticsearch alias, each with its own key fields.
|
|
475
|
+
* Null means the container's own primary way in. A query through an
|
|
476
|
+
* index and a query through the table are different accesses, so
|
|
477
|
+
* they pair separately.
|
|
464
478
|
*/
|
|
465
|
-
|
|
479
|
+
accessPath: import_zod8.z.string().nullable()
|
|
466
480
|
});
|
|
467
|
-
var
|
|
468
|
-
name: "storage
|
|
469
|
-
schema:
|
|
481
|
+
var storageSemantics = defineBoundarySemantics({
|
|
482
|
+
name: "storage",
|
|
483
|
+
schema: StorageSemanticsSchema,
|
|
470
484
|
behavior: {
|
|
471
|
-
/** A query returns rows, not a status and a body. */
|
|
485
|
+
/** A query returns rows or items, not a status and a body. */
|
|
472
486
|
exchangesHttpResponses: false,
|
|
473
487
|
reportsUnpairedItself: false,
|
|
474
488
|
identityKey: () => null
|
|
@@ -482,7 +496,7 @@ var SemanticsSchema = import_zod9.z.discriminatedUnion("name", [
|
|
|
482
496
|
graphqlResolverSemantics.schema,
|
|
483
497
|
graphqlOperationSemantics.schema,
|
|
484
498
|
runtimeConfigSemantics.schema,
|
|
485
|
-
|
|
499
|
+
storageSemantics.schema,
|
|
486
500
|
messageBusSemantics.schema
|
|
487
501
|
]);
|
|
488
502
|
var DEFINITIONS = [
|
|
@@ -491,7 +505,7 @@ var DEFINITIONS = [
|
|
|
491
505
|
graphqlResolverSemantics,
|
|
492
506
|
graphqlOperationSemantics,
|
|
493
507
|
runtimeConfigSemantics,
|
|
494
|
-
|
|
508
|
+
storageSemantics,
|
|
495
509
|
messageBusSemantics
|
|
496
510
|
];
|
|
497
511
|
var BY_NAME = new Map(
|
|
@@ -632,7 +646,7 @@ function withDefinitionsInlined(shape, definitions, depth = 0, inProgress = /* @
|
|
|
632
646
|
RuntimeConfigSemanticsSchema,
|
|
633
647
|
SemanticsSchema,
|
|
634
648
|
SourceLocationSchema,
|
|
635
|
-
|
|
649
|
+
StorageSemanticsSchema,
|
|
636
650
|
TypeShapeSchema,
|
|
637
651
|
typeDefinitionKey,
|
|
638
652
|
withDefinitionsInlined
|
package/dist/schemas.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as
|
|
2
|
+
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, w as typeDefinitionKey, x as withDefinitionsInlined } from './schemas-D6hKT-zV.cjs';
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as
|
|
2
|
+
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, w as typeDefinitionKey, x as withDefinitionsInlined } from './schemas-D6hKT-zV.js';
|
package/dist/schemas.js
CHANGED
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
RuntimeConfigSemanticsSchema,
|
|
14
14
|
SemanticsSchema,
|
|
15
15
|
SourceLocationSchema,
|
|
16
|
-
|
|
16
|
+
StorageSemanticsSchema,
|
|
17
17
|
TypeShapeSchema,
|
|
18
18
|
typeDefinitionKey,
|
|
19
19
|
withDefinitionsInlined
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TEXSN75M.js";
|
|
21
21
|
export {
|
|
22
22
|
BoundaryBindingSchema,
|
|
23
23
|
ConfidenceInfoSchema,
|
|
@@ -33,7 +33,7 @@ export {
|
|
|
33
33
|
RuntimeConfigSemanticsSchema,
|
|
34
34
|
SemanticsSchema,
|
|
35
35
|
SourceLocationSchema,
|
|
36
|
-
|
|
36
|
+
StorageSemanticsSchema,
|
|
37
37
|
TypeShapeSchema,
|
|
38
38
|
typeDefinitionKey,
|
|
39
39
|
withDefinitionsInlined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/ir-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared IR primitives for suss — type shapes, boundary bindings, source locations, and confidence. Imported by both @suss/behavioral-ir and @suss/intent-ir so neither depends on the other.",
|
|
6
6
|
"keywords": [
|