@suss/extractor 0.5.8 → 0.5.10

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.d.cts CHANGED
@@ -945,6 +945,19 @@ interface ContractPattern {
945
945
  paramsExtraction?: {
946
946
  property: string;
947
947
  };
948
+ /**
949
+ * Where the reader finds one endpoint's contract object. Left out,
950
+ * the ts-rest shape applies: one contract object contains every
951
+ * endpoint keyed by handler name, and the reader walks up from the
952
+ * handler to the enclosing router call. With `registrationArgument`,
953
+ * the zod-openapi shape applies instead: `app.openapi(route, handler)`
954
+ * passes the endpoint's own contract as the handler's sibling
955
+ * argument.
956
+ */
957
+ endpoint?: {
958
+ from: "registrationArgument";
959
+ position: number;
960
+ };
948
961
  }
949
962
  type InputMappingPattern = {
950
963
  /** Single object parameter, e.g. React Router LoaderFunctionArgs */
@@ -1234,6 +1247,24 @@ interface PatternPack {
1234
1247
  * available without importing anything).
1235
1248
  */
1236
1249
  requiresImport?: string[];
1250
+ /**
1251
+ * Environment variables the pack's library reads from inside
1252
+ * node_modules, where no walk ever looks. Declaring them keeps the
1253
+ * checker from telling a template that a variable is unused when the
1254
+ * library reads it on every invocation. The adapter emits one marker
1255
+ * summary per entry whose `module` some project file imports, and
1256
+ * the runtime-config pairing consults the markers before it accuses.
1257
+ * The module match is a specifier prefix, so one entry covers a
1258
+ * scoped family like `@aws-lambda-powertools/`.
1259
+ */
1260
+ libraryEnvVars?: Array<{
1261
+ /** Module-specifier prefix the library's imports start with. */
1262
+ module: string;
1263
+ /** Env-var name prefixes the library reads, e.g. "POWERTOOLS_". */
1264
+ prefixes?: string[];
1265
+ /** Exact env-var names the library reads. */
1266
+ names?: string[];
1267
+ }>;
1237
1268
  /**
1238
1269
  * Library wrappers that return the function they wrapped. The adapter
1239
1270
  * works this out on its own for a factory inside the project by reading
@@ -1245,6 +1276,40 @@ interface PatternPack {
1245
1276
  * `"Sentry.wrapHandler"`.
1246
1277
  */
1247
1278
  transparentWrappers?: TransparentWrapper[];
1279
+ /**
1280
+ * How this library's client object is constructed, so an operation
1281
+ * summary can say which endpoint its calls go to. Each entry is a
1282
+ * constructor or factory imported from `importModule`, with
1283
+ * `uriProperty` the option key whose value is the endpoint. The
1284
+ * adapter reads every construction in the project and stamps the
1285
+ * client on each operation summary when exactly one distinct client
1286
+ * exists; two or more distinct clients abstain, since a hook call
1287
+ * does not say which one it goes through.
1288
+ */
1289
+ graphqlClients?: Array<{
1290
+ importModule: string;
1291
+ importName: string;
1292
+ uriProperty: string;
1293
+ }>;
1294
+ /**
1295
+ * Which service a client talks to, keyed by the endpoint the
1296
+ * construction was read with: the uri literal, or the written
1297
+ * expression when the value is computed. The value is the provider
1298
+ * workspace name. This is deployment knowledge, so it comes from the
1299
+ * pack's own per-project config rather than from the library.
1300
+ */
1301
+ graphqlClientBindings?: Record<string, string>;
1302
+ /**
1303
+ * Which service the operations in a set of files talk to, for a
1304
+ * project whose one frontend uses two clients. A hook call does not
1305
+ * say which client it goes through, so when the sole-client rule
1306
+ * cannot decide, these globs do: an operation whose file matches
1307
+ * gets the entry's workspace. First matching entry wins.
1308
+ */
1309
+ graphqlOperationScopes?: Array<{
1310
+ files: string[];
1311
+ workspace: string;
1312
+ }>;
1248
1313
  /**
1249
1314
  * Per-property-access recognizers, the counterpart to
1250
1315
  * `invocationRecognizers`, firing on `PropertyAccessExpression`
@@ -1356,7 +1421,8 @@ interface DiscoveredCustomUnit {
1356
1421
  */
1357
1422
  channelInfo?: {
1358
1423
  messageBus: MessageBusSemantics["messageBus"];
1359
- channel: string;
1424
+ /** Null when the pack knows the wire but not the channel on it. */
1425
+ channel: string | null;
1360
1426
  };
1361
1427
  /** The thing that gets deployed and runs this unit, when known. */
1362
1428
  deployableUnit?: DeployableUnit;
package/dist/index.d.ts CHANGED
@@ -945,6 +945,19 @@ interface ContractPattern {
945
945
  paramsExtraction?: {
946
946
  property: string;
947
947
  };
948
+ /**
949
+ * Where the reader finds one endpoint's contract object. Left out,
950
+ * the ts-rest shape applies: one contract object contains every
951
+ * endpoint keyed by handler name, and the reader walks up from the
952
+ * handler to the enclosing router call. With `registrationArgument`,
953
+ * the zod-openapi shape applies instead: `app.openapi(route, handler)`
954
+ * passes the endpoint's own contract as the handler's sibling
955
+ * argument.
956
+ */
957
+ endpoint?: {
958
+ from: "registrationArgument";
959
+ position: number;
960
+ };
948
961
  }
949
962
  type InputMappingPattern = {
950
963
  /** Single object parameter, e.g. React Router LoaderFunctionArgs */
@@ -1234,6 +1247,24 @@ interface PatternPack {
1234
1247
  * available without importing anything).
1235
1248
  */
1236
1249
  requiresImport?: string[];
1250
+ /**
1251
+ * Environment variables the pack's library reads from inside
1252
+ * node_modules, where no walk ever looks. Declaring them keeps the
1253
+ * checker from telling a template that a variable is unused when the
1254
+ * library reads it on every invocation. The adapter emits one marker
1255
+ * summary per entry whose `module` some project file imports, and
1256
+ * the runtime-config pairing consults the markers before it accuses.
1257
+ * The module match is a specifier prefix, so one entry covers a
1258
+ * scoped family like `@aws-lambda-powertools/`.
1259
+ */
1260
+ libraryEnvVars?: Array<{
1261
+ /** Module-specifier prefix the library's imports start with. */
1262
+ module: string;
1263
+ /** Env-var name prefixes the library reads, e.g. "POWERTOOLS_". */
1264
+ prefixes?: string[];
1265
+ /** Exact env-var names the library reads. */
1266
+ names?: string[];
1267
+ }>;
1237
1268
  /**
1238
1269
  * Library wrappers that return the function they wrapped. The adapter
1239
1270
  * works this out on its own for a factory inside the project by reading
@@ -1245,6 +1276,40 @@ interface PatternPack {
1245
1276
  * `"Sentry.wrapHandler"`.
1246
1277
  */
1247
1278
  transparentWrappers?: TransparentWrapper[];
1279
+ /**
1280
+ * How this library's client object is constructed, so an operation
1281
+ * summary can say which endpoint its calls go to. Each entry is a
1282
+ * constructor or factory imported from `importModule`, with
1283
+ * `uriProperty` the option key whose value is the endpoint. The
1284
+ * adapter reads every construction in the project and stamps the
1285
+ * client on each operation summary when exactly one distinct client
1286
+ * exists; two or more distinct clients abstain, since a hook call
1287
+ * does not say which one it goes through.
1288
+ */
1289
+ graphqlClients?: Array<{
1290
+ importModule: string;
1291
+ importName: string;
1292
+ uriProperty: string;
1293
+ }>;
1294
+ /**
1295
+ * Which service a client talks to, keyed by the endpoint the
1296
+ * construction was read with: the uri literal, or the written
1297
+ * expression when the value is computed. The value is the provider
1298
+ * workspace name. This is deployment knowledge, so it comes from the
1299
+ * pack's own per-project config rather than from the library.
1300
+ */
1301
+ graphqlClientBindings?: Record<string, string>;
1302
+ /**
1303
+ * Which service the operations in a set of files talk to, for a
1304
+ * project whose one frontend uses two clients. A hook call does not
1305
+ * say which client it goes through, so when the sole-client rule
1306
+ * cannot decide, these globs do: an operation whose file matches
1307
+ * gets the entry's workspace. First matching entry wins.
1308
+ */
1309
+ graphqlOperationScopes?: Array<{
1310
+ files: string[];
1311
+ workspace: string;
1312
+ }>;
1248
1313
  /**
1249
1314
  * Per-property-access recognizers, the counterpart to
1250
1315
  * `invocationRecognizers`, firing on `PropertyAccessExpression`
@@ -1356,7 +1421,8 @@ interface DiscoveredCustomUnit {
1356
1421
  */
1357
1422
  channelInfo?: {
1358
1423
  messageBus: MessageBusSemantics["messageBus"];
1359
- channel: string;
1424
+ /** Null when the pack knows the wire but not the channel on it. */
1425
+ channel: string | null;
1360
1426
  };
1361
1427
  /** The thing that gets deployed and runs this unit, when known. */
1362
1428
  deployableUnit?: DeployableUnit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/extractor",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
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.8"
48
+ "@suss/behavioral-ir": "0.5.10"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "*",