@suss/ir-core 0.34.0 → 0.34.1
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/dist/{chunk-WOXA5GBL.js → chunk-A46EUIKC.js} +301 -35
- package/dist/index.cjs +330 -42
- package/dist/index.d.cts +59 -11
- package/dist/index.d.ts +59 -11
- package/dist/index.js +27 -6
- package/dist/{schemas-CghZNwSE.d.cts → schemas-lfg8kvak.d.cts} +6 -0
- package/dist/{schemas-CghZNwSE.d.ts → schemas-lfg8kvak.d.ts} +6 -0
- package/dist/schemas.cjs +299 -37
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, 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 { f as DeployableUnitSchema, E as EVERY_FIELD, 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 isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, 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-lfg8kvak.cjs';
|
|
3
|
+
export { f as DeployableUnitSchema, E as EVERY_FIELD, 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 isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The boundary-name syntax, parsed and printed in one place.
|
|
@@ -231,6 +231,13 @@ interface BoundaryBehavior<S extends {
|
|
|
231
231
|
* protocol does not define it, every pair in a bucket agrees.
|
|
232
232
|
*/
|
|
233
233
|
sidesAgree?(a: S, b: S): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* The key two providers of one operation share, such as a handler and
|
|
236
|
+
* the spec that documents it. Defaults to `identityKey`. Leave out
|
|
237
|
+
* what two sources can spell differently without serving different
|
|
238
|
+
* requests: REST drops parameter names, so `{id}` meets `:pk`.
|
|
239
|
+
*/
|
|
240
|
+
operationKey?(semantics: S): string | null;
|
|
234
241
|
/**
|
|
235
242
|
* Whether this boundary's bucket can meet buckets with other keys. A
|
|
236
243
|
* REST path with a hole that spans some number of segments has a key
|
|
@@ -243,12 +250,13 @@ interface BoundaryBehavior<S extends {
|
|
|
243
250
|
/** Whether two buckets describe at least one boundary in common. */
|
|
244
251
|
bucketsMeet?(a: S, b: S): boolean;
|
|
245
252
|
/**
|
|
246
|
-
* How
|
|
247
|
-
* lexicographically. When a consumer meets more than one
|
|
248
|
-
* reaches the one ranked highest, and a tie is reported
|
|
249
|
-
* paired.
|
|
253
|
+
* How well a provider fits what a consumer states, compared
|
|
254
|
+
* lexicographically. When a consumer meets more than one provider
|
|
255
|
+
* bucket, it reaches the one ranked highest, and a tie is reported
|
|
256
|
+
* instead of paired. Null when the two meet only by a guess the
|
|
257
|
+
* consumer gives no ground for, so they do not pair.
|
|
250
258
|
*/
|
|
251
|
-
|
|
259
|
+
pairRank?(provider: S, consumer: S): readonly number[] | null;
|
|
252
260
|
/** The label a reader sees for this boundary. Defaults to `identityKey`. */
|
|
253
261
|
displayLabel?(semantics: S): string | null;
|
|
254
262
|
/**
|
|
@@ -308,6 +316,12 @@ interface BoundaryBehavior<S extends {
|
|
|
308
316
|
* `groundName` looks up the same reference.
|
|
309
317
|
*/
|
|
310
318
|
nameReference?(semantics: S): Reference | null;
|
|
319
|
+
/**
|
|
320
|
+
* The semantics with a host the project says it serves left out of
|
|
321
|
+
* the name, or null when the name has none of them. A protocol whose
|
|
322
|
+
* names never carry a host leaves this undefined.
|
|
323
|
+
*/
|
|
324
|
+
withoutOwnHost?(semantics: S, ownHosts: ReadonlySet<string>): S | null;
|
|
311
325
|
/**
|
|
312
326
|
* Whether a provider produces a status and a body that a consumer
|
|
313
327
|
* reads back. It is required, so a new protocol cannot end up in the
|
|
@@ -505,6 +519,13 @@ interface PackDeclaration {
|
|
|
505
519
|
* Every project in that language is a candidate.
|
|
506
520
|
*/
|
|
507
521
|
shippedWith?: "typescript" | "python" | "ruby";
|
|
522
|
+
/**
|
|
523
|
+
* Text in a source file that shows the project calls a library the
|
|
524
|
+
* language ships. No manifest can say that a project uses fetch, so
|
|
525
|
+
* `suss init` looks for a call before it sets up a project on the
|
|
526
|
+
* strength of this pack alone.
|
|
527
|
+
*/
|
|
528
|
+
sourcePattern?: RegExp;
|
|
508
529
|
/** The line the packages page shows, one sentence, what it reads. */
|
|
509
530
|
reads: string;
|
|
510
531
|
/** Set when the pack needs a value from the project to run at all. */
|
|
@@ -541,6 +562,11 @@ declare function boundaryKey(binding: BoundaryBinding): string | null;
|
|
|
541
562
|
* whose protocol has no paths comes back unchanged.
|
|
542
563
|
*/
|
|
543
564
|
declare function withRewrittenPaths(binding: BoundaryBinding, rewrite: (path: string) => string): BoundaryBinding;
|
|
565
|
+
/**
|
|
566
|
+
* The binding with a host the project serves left out, so a call to
|
|
567
|
+
* the project's public host pairs with its routes.
|
|
568
|
+
*/
|
|
569
|
+
declare function withoutOwnHost(binding: BoundaryBinding, ownHosts: ReadonlySet<string>): BoundaryBinding;
|
|
544
570
|
/**
|
|
545
571
|
* The pairing key after the deployment's values are filled into the
|
|
546
572
|
* boundary's name.
|
|
@@ -567,13 +593,23 @@ declare function groundBinding(binding: BoundaryBinding, deployment: Deployment)
|
|
|
567
593
|
*/
|
|
568
594
|
declare function nameReference(binding: BoundaryBinding): Reference | null;
|
|
569
595
|
declare function pairingKey(binding: BoundaryBinding): string | null;
|
|
596
|
+
/**
|
|
597
|
+
* The key a handler and a document describing the same operation share.
|
|
598
|
+
* The contract checks match providers to each other on it, since two
|
|
599
|
+
* providers never go through pairing.
|
|
600
|
+
*/
|
|
601
|
+
declare function operationKey(binding: BoundaryBinding): string | null;
|
|
570
602
|
declare function semanticsAgree(a: Semantics, b: Semantics): boolean;
|
|
571
603
|
/** Whether the binding's bucket can meet buckets with other keys. */
|
|
572
604
|
declare function spansBuckets(binding: BoundaryBinding): boolean;
|
|
573
605
|
/** Whether two bindings' buckets describe a boundary in common. */
|
|
574
606
|
declare function bucketsMeet(a: BoundaryBinding, b: BoundaryBinding): boolean;
|
|
575
|
-
/**
|
|
576
|
-
|
|
607
|
+
/**
|
|
608
|
+
* How well a provider fits what a consumer states, or null when they do
|
|
609
|
+
* not pair; see `compareRanks`. A protocol that does not rank gives
|
|
610
|
+
* every provider the same rank.
|
|
611
|
+
*/
|
|
612
|
+
declare function pairRank(provider: BoundaryBinding, consumer: BoundaryBinding): readonly number[] | null;
|
|
577
613
|
declare function boundaryLabel(binding: BoundaryBinding): string | null;
|
|
578
614
|
declare function displayLabel(binding: BoundaryBinding): string;
|
|
579
615
|
/**
|
|
@@ -817,7 +853,8 @@ type EffectRelation = z.infer<typeof EffectRelationSchema>;
|
|
|
817
853
|
* `{rest*}` is zero or more, the modifiers Express puts on `:name`. A
|
|
818
854
|
* bare `*` segment is zero or more segments, Express 4's reading of a
|
|
819
855
|
* star. A set piece is written `(v1|v2)` and matches any one of its
|
|
820
|
-
* options, and an option can contain a slash.
|
|
856
|
+
* options, and an option can contain a slash. A hole before the first
|
|
857
|
+
* slash is a base URL the client left open, and it matches the origin.
|
|
821
858
|
*
|
|
822
859
|
* `pathsMeet` expands the sets into alternatives, splits each one into
|
|
823
860
|
* segments, and walks the two segment lists with a reachability table
|
|
@@ -990,6 +1027,13 @@ declare function testUnitName(titles: readonly string[]): string;
|
|
|
990
1027
|
declare function pathAfterOrigin(text: string): string;
|
|
991
1028
|
/** Whether the text starts with an origin (a scheme and host, or `//host`). */
|
|
992
1029
|
declare function statesAnOrigin(text: string): boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether a host a client wrote out can belong to the project itself: a
|
|
1032
|
+
* loopback or private address, a name with no dot such as a container's
|
|
1033
|
+
* service name, or a name under a suffix kept for private networks or
|
|
1034
|
+
* examples. Any other name is a public host the project does not serve.
|
|
1035
|
+
*/
|
|
1036
|
+
declare function hostCanBeOwn(host: string): boolean;
|
|
993
1037
|
|
|
994
1038
|
/**
|
|
995
1039
|
* @suss/ir-core: primitives shared across suss IRs.
|
|
@@ -1021,6 +1065,10 @@ declare function restBinding(opts: {
|
|
|
1021
1065
|
path: string | null;
|
|
1022
1066
|
recognition: string;
|
|
1023
1067
|
declaredResponses?: number[];
|
|
1068
|
+
/** The host of an absolute URL a client calls; see `RestSemantics`. */
|
|
1069
|
+
host?: string | undefined;
|
|
1070
|
+
/** True for a route also served with `.{format}` after its path. */
|
|
1071
|
+
optionalFormat?: boolean;
|
|
1024
1072
|
}): BoundaryBinding;
|
|
1025
1073
|
/**
|
|
1026
1074
|
* Build a function-call-semantics binding, for an in-process boundary
|
|
@@ -1159,4 +1207,4 @@ declare function ioBinding(opts: {
|
|
|
1159
1207
|
target: string | null;
|
|
1160
1208
|
}): BoundaryBinding;
|
|
1161
1209
|
|
|
1162
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type IoIdentityKey, type IoSemantics, IoSemanticsSchema, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, PLATFORM_INJECTED_ENV_VARS, type PackConfiguration, type PackDeclaration, type ParsedChannel, type ParsedHandler, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TEST_TITLE_SEPARATOR, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString,
|
|
1210
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type IoIdentityKey, type IoSemantics, IoSemanticsSchema, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, PLATFORM_INJECTED_ENV_VARS, type PackConfiguration, type PackDeclaration, type ParsedChannel, type ParsedHandler, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TEST_TITLE_SEPARATOR, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, hostCanBeOwn, ioBinding, ioIdentityKey, isGraphqlOperationBinding, labelWithDetail, leavesTheProcess, messageBusBinding, metricBinding, metricIdentityKey, moduleExportBinding, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, operationKey, packageExportBinding, pairRank, pairingKey, parseBoundaryName, parseChannel, parseHandler, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, testUnitName, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope, withoutOwnHost };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, 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 { f as DeployableUnitSchema, E as EVERY_FIELD, 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 isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, 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-lfg8kvak.js';
|
|
3
|
+
export { f as DeployableUnitSchema, E as EVERY_FIELD, 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 isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The boundary-name syntax, parsed and printed in one place.
|
|
@@ -231,6 +231,13 @@ interface BoundaryBehavior<S extends {
|
|
|
231
231
|
* protocol does not define it, every pair in a bucket agrees.
|
|
232
232
|
*/
|
|
233
233
|
sidesAgree?(a: S, b: S): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* The key two providers of one operation share, such as a handler and
|
|
236
|
+
* the spec that documents it. Defaults to `identityKey`. Leave out
|
|
237
|
+
* what two sources can spell differently without serving different
|
|
238
|
+
* requests: REST drops parameter names, so `{id}` meets `:pk`.
|
|
239
|
+
*/
|
|
240
|
+
operationKey?(semantics: S): string | null;
|
|
234
241
|
/**
|
|
235
242
|
* Whether this boundary's bucket can meet buckets with other keys. A
|
|
236
243
|
* REST path with a hole that spans some number of segments has a key
|
|
@@ -243,12 +250,13 @@ interface BoundaryBehavior<S extends {
|
|
|
243
250
|
/** Whether two buckets describe at least one boundary in common. */
|
|
244
251
|
bucketsMeet?(a: S, b: S): boolean;
|
|
245
252
|
/**
|
|
246
|
-
* How
|
|
247
|
-
* lexicographically. When a consumer meets more than one
|
|
248
|
-
* reaches the one ranked highest, and a tie is reported
|
|
249
|
-
* paired.
|
|
253
|
+
* How well a provider fits what a consumer states, compared
|
|
254
|
+
* lexicographically. When a consumer meets more than one provider
|
|
255
|
+
* bucket, it reaches the one ranked highest, and a tie is reported
|
|
256
|
+
* instead of paired. Null when the two meet only by a guess the
|
|
257
|
+
* consumer gives no ground for, so they do not pair.
|
|
250
258
|
*/
|
|
251
|
-
|
|
259
|
+
pairRank?(provider: S, consumer: S): readonly number[] | null;
|
|
252
260
|
/** The label a reader sees for this boundary. Defaults to `identityKey`. */
|
|
253
261
|
displayLabel?(semantics: S): string | null;
|
|
254
262
|
/**
|
|
@@ -308,6 +316,12 @@ interface BoundaryBehavior<S extends {
|
|
|
308
316
|
* `groundName` looks up the same reference.
|
|
309
317
|
*/
|
|
310
318
|
nameReference?(semantics: S): Reference | null;
|
|
319
|
+
/**
|
|
320
|
+
* The semantics with a host the project says it serves left out of
|
|
321
|
+
* the name, or null when the name has none of them. A protocol whose
|
|
322
|
+
* names never carry a host leaves this undefined.
|
|
323
|
+
*/
|
|
324
|
+
withoutOwnHost?(semantics: S, ownHosts: ReadonlySet<string>): S | null;
|
|
311
325
|
/**
|
|
312
326
|
* Whether a provider produces a status and a body that a consumer
|
|
313
327
|
* reads back. It is required, so a new protocol cannot end up in the
|
|
@@ -505,6 +519,13 @@ interface PackDeclaration {
|
|
|
505
519
|
* Every project in that language is a candidate.
|
|
506
520
|
*/
|
|
507
521
|
shippedWith?: "typescript" | "python" | "ruby";
|
|
522
|
+
/**
|
|
523
|
+
* Text in a source file that shows the project calls a library the
|
|
524
|
+
* language ships. No manifest can say that a project uses fetch, so
|
|
525
|
+
* `suss init` looks for a call before it sets up a project on the
|
|
526
|
+
* strength of this pack alone.
|
|
527
|
+
*/
|
|
528
|
+
sourcePattern?: RegExp;
|
|
508
529
|
/** The line the packages page shows, one sentence, what it reads. */
|
|
509
530
|
reads: string;
|
|
510
531
|
/** Set when the pack needs a value from the project to run at all. */
|
|
@@ -541,6 +562,11 @@ declare function boundaryKey(binding: BoundaryBinding): string | null;
|
|
|
541
562
|
* whose protocol has no paths comes back unchanged.
|
|
542
563
|
*/
|
|
543
564
|
declare function withRewrittenPaths(binding: BoundaryBinding, rewrite: (path: string) => string): BoundaryBinding;
|
|
565
|
+
/**
|
|
566
|
+
* The binding with a host the project serves left out, so a call to
|
|
567
|
+
* the project's public host pairs with its routes.
|
|
568
|
+
*/
|
|
569
|
+
declare function withoutOwnHost(binding: BoundaryBinding, ownHosts: ReadonlySet<string>): BoundaryBinding;
|
|
544
570
|
/**
|
|
545
571
|
* The pairing key after the deployment's values are filled into the
|
|
546
572
|
* boundary's name.
|
|
@@ -567,13 +593,23 @@ declare function groundBinding(binding: BoundaryBinding, deployment: Deployment)
|
|
|
567
593
|
*/
|
|
568
594
|
declare function nameReference(binding: BoundaryBinding): Reference | null;
|
|
569
595
|
declare function pairingKey(binding: BoundaryBinding): string | null;
|
|
596
|
+
/**
|
|
597
|
+
* The key a handler and a document describing the same operation share.
|
|
598
|
+
* The contract checks match providers to each other on it, since two
|
|
599
|
+
* providers never go through pairing.
|
|
600
|
+
*/
|
|
601
|
+
declare function operationKey(binding: BoundaryBinding): string | null;
|
|
570
602
|
declare function semanticsAgree(a: Semantics, b: Semantics): boolean;
|
|
571
603
|
/** Whether the binding's bucket can meet buckets with other keys. */
|
|
572
604
|
declare function spansBuckets(binding: BoundaryBinding): boolean;
|
|
573
605
|
/** Whether two bindings' buckets describe a boundary in common. */
|
|
574
606
|
declare function bucketsMeet(a: BoundaryBinding, b: BoundaryBinding): boolean;
|
|
575
|
-
/**
|
|
576
|
-
|
|
607
|
+
/**
|
|
608
|
+
* How well a provider fits what a consumer states, or null when they do
|
|
609
|
+
* not pair; see `compareRanks`. A protocol that does not rank gives
|
|
610
|
+
* every provider the same rank.
|
|
611
|
+
*/
|
|
612
|
+
declare function pairRank(provider: BoundaryBinding, consumer: BoundaryBinding): readonly number[] | null;
|
|
577
613
|
declare function boundaryLabel(binding: BoundaryBinding): string | null;
|
|
578
614
|
declare function displayLabel(binding: BoundaryBinding): string;
|
|
579
615
|
/**
|
|
@@ -817,7 +853,8 @@ type EffectRelation = z.infer<typeof EffectRelationSchema>;
|
|
|
817
853
|
* `{rest*}` is zero or more, the modifiers Express puts on `:name`. A
|
|
818
854
|
* bare `*` segment is zero or more segments, Express 4's reading of a
|
|
819
855
|
* star. A set piece is written `(v1|v2)` and matches any one of its
|
|
820
|
-
* options, and an option can contain a slash.
|
|
856
|
+
* options, and an option can contain a slash. A hole before the first
|
|
857
|
+
* slash is a base URL the client left open, and it matches the origin.
|
|
821
858
|
*
|
|
822
859
|
* `pathsMeet` expands the sets into alternatives, splits each one into
|
|
823
860
|
* segments, and walks the two segment lists with a reachability table
|
|
@@ -990,6 +1027,13 @@ declare function testUnitName(titles: readonly string[]): string;
|
|
|
990
1027
|
declare function pathAfterOrigin(text: string): string;
|
|
991
1028
|
/** Whether the text starts with an origin (a scheme and host, or `//host`). */
|
|
992
1029
|
declare function statesAnOrigin(text: string): boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether a host a client wrote out can belong to the project itself: a
|
|
1032
|
+
* loopback or private address, a name with no dot such as a container's
|
|
1033
|
+
* service name, or a name under a suffix kept for private networks or
|
|
1034
|
+
* examples. Any other name is a public host the project does not serve.
|
|
1035
|
+
*/
|
|
1036
|
+
declare function hostCanBeOwn(host: string): boolean;
|
|
993
1037
|
|
|
994
1038
|
/**
|
|
995
1039
|
* @suss/ir-core: primitives shared across suss IRs.
|
|
@@ -1021,6 +1065,10 @@ declare function restBinding(opts: {
|
|
|
1021
1065
|
path: string | null;
|
|
1022
1066
|
recognition: string;
|
|
1023
1067
|
declaredResponses?: number[];
|
|
1068
|
+
/** The host of an absolute URL a client calls; see `RestSemantics`. */
|
|
1069
|
+
host?: string | undefined;
|
|
1070
|
+
/** True for a route also served with `.{format}` after its path. */
|
|
1071
|
+
optionalFormat?: boolean;
|
|
1024
1072
|
}): BoundaryBinding;
|
|
1025
1073
|
/**
|
|
1026
1074
|
* Build a function-call-semantics binding, for an in-process boundary
|
|
@@ -1159,4 +1207,4 @@ declare function ioBinding(opts: {
|
|
|
1159
1207
|
target: string | null;
|
|
1160
1208
|
}): BoundaryBinding;
|
|
1161
1209
|
|
|
1162
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type IoIdentityKey, type IoSemantics, IoSemanticsSchema, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, PLATFORM_INJECTED_ENV_VARS, type PackConfiguration, type PackDeclaration, type ParsedChannel, type ParsedHandler, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TEST_TITLE_SEPARATOR, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString,
|
|
1210
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type IoIdentityKey, type IoSemantics, IoSemanticsSchema, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, PLATFORM_INJECTED_ENV_VARS, type PackConfiguration, type PackDeclaration, type ParsedChannel, type ParsedHandler, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TEST_TITLE_SEPARATOR, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, hostCanBeOwn, ioBinding, ioIdentityKey, isGraphqlOperationBinding, labelWithDetail, leavesTheProcess, messageBusBinding, metricBinding, metricIdentityKey, moduleExportBinding, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, operationKey, packageExportBinding, pairRank, pairingKey, parseBoundaryName, parseChannel, parseHandler, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, testUnitName, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope, withoutOwnHost };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
formatChannel,
|
|
34
34
|
gqlIdentityKey,
|
|
35
35
|
hasNameHole,
|
|
36
|
+
hostCanBeOwn,
|
|
36
37
|
ioIdentityKey,
|
|
37
38
|
isModuleName,
|
|
38
39
|
methodsAgree,
|
|
@@ -62,7 +63,7 @@ import {
|
|
|
62
63
|
typeDefinitionKey,
|
|
63
64
|
unitIdentityKey,
|
|
64
65
|
withDefinitionsInlined
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-A46EUIKC.js";
|
|
66
67
|
|
|
67
68
|
// src/semconv.ts
|
|
68
69
|
function semconvAttributes(binding) {
|
|
@@ -100,6 +101,13 @@ function withRewrittenPaths(binding, rewrite) {
|
|
|
100
101
|
semantics: behavior.rewritePaths(binding.semantics, rewrite)
|
|
101
102
|
};
|
|
102
103
|
}
|
|
104
|
+
function withoutOwnHost(binding, ownHosts) {
|
|
105
|
+
const semantics = behaviorOf(binding.semantics).withoutOwnHost?.(
|
|
106
|
+
binding.semantics,
|
|
107
|
+
ownHosts
|
|
108
|
+
);
|
|
109
|
+
return semantics === void 0 || semantics === null ? binding : { ...binding, semantics };
|
|
110
|
+
}
|
|
103
111
|
function groundedPairingKey(binding, deployment) {
|
|
104
112
|
return pairingKey(groundBinding(binding, deployment));
|
|
105
113
|
}
|
|
@@ -115,6 +123,10 @@ function pairingKey(binding) {
|
|
|
115
123
|
const behavior = behaviorOf(binding.semantics);
|
|
116
124
|
return (behavior.pairingKey ?? behavior.identityKey)(binding.semantics);
|
|
117
125
|
}
|
|
126
|
+
function operationKey(binding) {
|
|
127
|
+
const behavior = behaviorOf(binding.semantics);
|
|
128
|
+
return (behavior.operationKey ?? behavior.identityKey)(binding.semantics);
|
|
129
|
+
}
|
|
118
130
|
function semanticsAgree(a, b) {
|
|
119
131
|
if (a.name !== b.name) {
|
|
120
132
|
return false;
|
|
@@ -132,8 +144,12 @@ function bucketsMeet(a, b) {
|
|
|
132
144
|
const meet = behaviorOf(a.semantics).bucketsMeet;
|
|
133
145
|
return meet !== void 0 && meet(a.semantics, b.semantics);
|
|
134
146
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
147
|
+
function pairRank(provider, consumer) {
|
|
148
|
+
if (provider.semantics.name !== consumer.semantics.name) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const rank = behaviorOf(provider.semantics).pairRank;
|
|
152
|
+
return rank === void 0 ? [] : rank(provider.semantics, consumer.semantics);
|
|
137
153
|
}
|
|
138
154
|
function boundaryLabel(binding) {
|
|
139
155
|
const behavior = behaviorOf(binding.semantics);
|
|
@@ -608,7 +624,9 @@ function restBinding(opts) {
|
|
|
608
624
|
name: "rest",
|
|
609
625
|
method: method === null ? null : method.toUpperCase(),
|
|
610
626
|
path: namedOrNull(opts.path, "rest path"),
|
|
611
|
-
...opts.declaredResponses !== void 0 ? { declaredResponses: opts.declaredResponses } : {}
|
|
627
|
+
...opts.declaredResponses !== void 0 ? { declaredResponses: opts.declaredResponses } : {},
|
|
628
|
+
...opts.host !== void 0 && opts.host !== "" ? { host: opts.host } : {},
|
|
629
|
+
...opts.optionalFormat === true ? { optionalFormat: true } : {}
|
|
612
630
|
},
|
|
613
631
|
recognition: opts.recognition
|
|
614
632
|
};
|
|
@@ -766,7 +784,6 @@ export {
|
|
|
766
784
|
boundaryKey,
|
|
767
785
|
boundaryLabel,
|
|
768
786
|
boundaryNameString,
|
|
769
|
-
bucketRank,
|
|
770
787
|
bucketsMeet,
|
|
771
788
|
busIdentityKey,
|
|
772
789
|
busesAgree,
|
|
@@ -790,6 +807,7 @@ export {
|
|
|
790
807
|
groundBinding,
|
|
791
808
|
groundedPairingKey,
|
|
792
809
|
hasNameHole,
|
|
810
|
+
hostCanBeOwn,
|
|
793
811
|
ioBinding,
|
|
794
812
|
ioIdentityKey,
|
|
795
813
|
isGraphqlOperationBinding,
|
|
@@ -810,7 +828,9 @@ export {
|
|
|
810
828
|
namesNothing,
|
|
811
829
|
normalizePath,
|
|
812
830
|
normalizeRuleBoundary,
|
|
831
|
+
operationKey,
|
|
813
832
|
packageExportBinding,
|
|
833
|
+
pairRank,
|
|
814
834
|
pairingKey,
|
|
815
835
|
parseBoundaryName,
|
|
816
836
|
parseChannel,
|
|
@@ -847,5 +867,6 @@ export {
|
|
|
847
867
|
validateRule,
|
|
848
868
|
withDefinitionsInlined,
|
|
849
869
|
withRewrittenPaths,
|
|
850
|
-
withinScope
|
|
870
|
+
withinScope,
|
|
871
|
+
withoutOwnHost
|
|
851
872
|
};
|
|
@@ -110,6 +110,8 @@ declare const SemanticsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
110
110
|
method: z.ZodNullable<z.ZodString>;
|
|
111
111
|
path: z.ZodNullable<z.ZodString>;
|
|
112
112
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
113
|
+
host: z.ZodOptional<z.ZodString>;
|
|
114
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
113
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
114
116
|
name: z.ZodLiteral<"function-call">;
|
|
115
117
|
module: z.ZodOptional<z.ZodString>;
|
|
@@ -187,6 +189,8 @@ declare const RestSemanticsSchema: z.ZodObject<{
|
|
|
187
189
|
method: z.ZodNullable<z.ZodString>;
|
|
188
190
|
path: z.ZodNullable<z.ZodString>;
|
|
189
191
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
192
|
+
host: z.ZodOptional<z.ZodString>;
|
|
193
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
190
194
|
}, z.core.$strip>;
|
|
191
195
|
type RestSemantics = z.infer<typeof RestSemanticsSchema>;
|
|
192
196
|
/**
|
|
@@ -369,6 +373,8 @@ declare const BoundaryBindingSchema: z.ZodObject<{
|
|
|
369
373
|
method: z.ZodNullable<z.ZodString>;
|
|
370
374
|
path: z.ZodNullable<z.ZodString>;
|
|
371
375
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
376
|
+
host: z.ZodOptional<z.ZodString>;
|
|
377
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
372
378
|
}, z.core.$strip>, z.ZodObject<{
|
|
373
379
|
name: z.ZodLiteral<"function-call">;
|
|
374
380
|
module: z.ZodOptional<z.ZodString>;
|
|
@@ -110,6 +110,8 @@ declare const SemanticsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
110
110
|
method: z.ZodNullable<z.ZodString>;
|
|
111
111
|
path: z.ZodNullable<z.ZodString>;
|
|
112
112
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
113
|
+
host: z.ZodOptional<z.ZodString>;
|
|
114
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
113
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
114
116
|
name: z.ZodLiteral<"function-call">;
|
|
115
117
|
module: z.ZodOptional<z.ZodString>;
|
|
@@ -187,6 +189,8 @@ declare const RestSemanticsSchema: z.ZodObject<{
|
|
|
187
189
|
method: z.ZodNullable<z.ZodString>;
|
|
188
190
|
path: z.ZodNullable<z.ZodString>;
|
|
189
191
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
192
|
+
host: z.ZodOptional<z.ZodString>;
|
|
193
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
190
194
|
}, z.core.$strip>;
|
|
191
195
|
type RestSemantics = z.infer<typeof RestSemanticsSchema>;
|
|
192
196
|
/**
|
|
@@ -369,6 +373,8 @@ declare const BoundaryBindingSchema: z.ZodObject<{
|
|
|
369
373
|
method: z.ZodNullable<z.ZodString>;
|
|
370
374
|
path: z.ZodNullable<z.ZodString>;
|
|
371
375
|
declaredResponses: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
376
|
+
host: z.ZodOptional<z.ZodString>;
|
|
377
|
+
optionalFormat: z.ZodOptional<z.ZodBoolean>;
|
|
372
378
|
}, z.core.$strip>, z.ZodObject<{
|
|
373
379
|
name: z.ZodLiteral<"function-call">;
|
|
374
380
|
module: z.ZodOptional<z.ZodString>;
|