@suss/extractor 0.5.10 → 0.5.11
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/index.cjs +13 -0
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +12 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
sharedGatingConditions: () => sharedGatingConditions,
|
|
42
42
|
terminalToOutput: () => terminalToOutput,
|
|
43
43
|
unreadableReading: () => unreadableReading,
|
|
44
|
+
unwrapJsonStringify: () => unwrapJsonStringify,
|
|
44
45
|
valueToReadFurtherFrom: () => valueToReadFurtherFrom,
|
|
45
46
|
writtenReading: () => writtenReading
|
|
46
47
|
});
|
|
@@ -153,6 +154,17 @@ function httpRouteDiscovery(opts) {
|
|
|
153
154
|
requiresImport: [opts.importModule]
|
|
154
155
|
}));
|
|
155
156
|
}
|
|
157
|
+
function unwrapJsonStringify(body) {
|
|
158
|
+
if (body === null || typeof body !== "object") {
|
|
159
|
+
return body;
|
|
160
|
+
}
|
|
161
|
+
const candidate = body;
|
|
162
|
+
if (candidate.kind !== "call" || candidate.callee !== "JSON.stringify") {
|
|
163
|
+
return body;
|
|
164
|
+
}
|
|
165
|
+
const inner = candidate.args?.[0];
|
|
166
|
+
return inner ?? body;
|
|
167
|
+
}
|
|
156
168
|
|
|
157
169
|
// src/paths/enumeratePaths.ts
|
|
158
170
|
var MAX_PATHS = 256;
|
|
@@ -1070,6 +1082,7 @@ function paramToInput(param) {
|
|
|
1070
1082
|
sharedGatingConditions,
|
|
1071
1083
|
terminalToOutput,
|
|
1072
1084
|
unreadableReading,
|
|
1085
|
+
unwrapJsonStringify,
|
|
1073
1086
|
valueToReadFurtherFrom,
|
|
1074
1087
|
writtenReading
|
|
1075
1088
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -942,6 +942,14 @@ interface ContractPattern {
|
|
|
942
942
|
/** The property on the contract object with the responses map on it */
|
|
943
943
|
property: string;
|
|
944
944
|
};
|
|
945
|
+
/**
|
|
946
|
+
* The properties an endpoint states its HTTP method and path under.
|
|
947
|
+
* Both ts-rest and zod-openapi happen to spell them `method` and
|
|
948
|
+
* `path`, but they are the library's words, so the pack says them
|
|
949
|
+
* and the adapter reads whatever it is told.
|
|
950
|
+
*/
|
|
951
|
+
methodProperty: string;
|
|
952
|
+
pathProperty: string;
|
|
945
953
|
paramsExtraction?: {
|
|
946
954
|
property: string;
|
|
947
955
|
};
|
|
@@ -1506,6 +1514,13 @@ declare function httpRouteDiscovery(opts: {
|
|
|
1506
1514
|
*/
|
|
1507
1515
|
mount?: DiscoveryPattern["mount"];
|
|
1508
1516
|
}): DiscoveryPattern[];
|
|
1517
|
+
/**
|
|
1518
|
+
* The payload behind a `JSON.stringify(...)` call, or the argument
|
|
1519
|
+
* unchanged when it is anything else. A producer serializes its message
|
|
1520
|
+
* before sending it, and the shape worth comparing across the boundary
|
|
1521
|
+
* is what went in, not the string that came out.
|
|
1522
|
+
*/
|
|
1523
|
+
declare function unwrapJsonStringify(body: EffectArg | null): EffectArg | null;
|
|
1509
1524
|
|
|
1510
1525
|
/**
|
|
1511
1526
|
* The path engine, written against `StructuredStatement` rather than any one
|
|
@@ -1897,4 +1912,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
|
|
|
1897
1912
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
1898
1913
|
declare function paramToInput(param: RawParameter): Input;
|
|
1899
1914
|
|
|
1900
|
-
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, valueToReadFurtherFrom, writtenReading };
|
|
1915
|
+
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
package/dist/index.d.ts
CHANGED
|
@@ -942,6 +942,14 @@ interface ContractPattern {
|
|
|
942
942
|
/** The property on the contract object with the responses map on it */
|
|
943
943
|
property: string;
|
|
944
944
|
};
|
|
945
|
+
/**
|
|
946
|
+
* The properties an endpoint states its HTTP method and path under.
|
|
947
|
+
* Both ts-rest and zod-openapi happen to spell them `method` and
|
|
948
|
+
* `path`, but they are the library's words, so the pack says them
|
|
949
|
+
* and the adapter reads whatever it is told.
|
|
950
|
+
*/
|
|
951
|
+
methodProperty: string;
|
|
952
|
+
pathProperty: string;
|
|
945
953
|
paramsExtraction?: {
|
|
946
954
|
property: string;
|
|
947
955
|
};
|
|
@@ -1506,6 +1514,13 @@ declare function httpRouteDiscovery(opts: {
|
|
|
1506
1514
|
*/
|
|
1507
1515
|
mount?: DiscoveryPattern["mount"];
|
|
1508
1516
|
}): DiscoveryPattern[];
|
|
1517
|
+
/**
|
|
1518
|
+
* The payload behind a `JSON.stringify(...)` call, or the argument
|
|
1519
|
+
* unchanged when it is anything else. A producer serializes its message
|
|
1520
|
+
* before sending it, and the shape worth comparing across the boundary
|
|
1521
|
+
* is what went in, not the string that came out.
|
|
1522
|
+
*/
|
|
1523
|
+
declare function unwrapJsonStringify(body: EffectArg | null): EffectArg | null;
|
|
1509
1524
|
|
|
1510
1525
|
/**
|
|
1511
1526
|
* The path engine, written against `StructuredStatement` rather than any one
|
|
@@ -1897,4 +1912,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
|
|
|
1897
1912
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
1898
1913
|
declare function paramToInput(param: RawParameter): Input;
|
|
1899
1914
|
|
|
1900
|
-
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, valueToReadFurtherFrom, writtenReading };
|
|
1915
|
+
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
package/dist/index.js
CHANGED
|
@@ -111,6 +111,17 @@ function httpRouteDiscovery(opts) {
|
|
|
111
111
|
requiresImport: [opts.importModule]
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
|
+
function unwrapJsonStringify(body) {
|
|
115
|
+
if (body === null || typeof body !== "object") {
|
|
116
|
+
return body;
|
|
117
|
+
}
|
|
118
|
+
const candidate = body;
|
|
119
|
+
if (candidate.kind !== "call" || candidate.callee !== "JSON.stringify") {
|
|
120
|
+
return body;
|
|
121
|
+
}
|
|
122
|
+
const inner = candidate.args?.[0];
|
|
123
|
+
return inner ?? body;
|
|
124
|
+
}
|
|
114
125
|
|
|
115
126
|
// src/paths/enumeratePaths.ts
|
|
116
127
|
var MAX_PATHS = 256;
|
|
@@ -1027,6 +1038,7 @@ export {
|
|
|
1027
1038
|
sharedGatingConditions,
|
|
1028
1039
|
terminalToOutput,
|
|
1029
1040
|
unreadableReading,
|
|
1041
|
+
unwrapJsonStringify,
|
|
1030
1042
|
valueToReadFurtherFrom,
|
|
1031
1043
|
writtenReading
|
|
1032
1044
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/extractor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Framework-agnostic extraction pipeline that turns raw extractions into suss behavioral summaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@suss/behavioral-ir": "0.5.
|
|
48
|
+
"@suss/behavioral-ir": "0.5.11"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup": "*",
|