@suss/adapter-python 0.22.2 → 0.22.4

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
@@ -247,6 +247,20 @@ interface StoragePattern {
247
247
  queryTypes: string[];
248
248
  /** Chain-ending methods that change what is stored. Anything else reads. */
249
249
  writes: string[];
250
+ /**
251
+ * Methods on a query type that touch no rows of their own: one that runs
252
+ * a statement built elsewhere, `session.execute(stmt)`, whose own chain
253
+ * already records the work, and one that manages the session, `close`.
254
+ * A call to one of these records nothing.
255
+ */
256
+ recordsNothing?: string[];
257
+ /**
258
+ * Methods whose keywords supply column values rather than pick rows,
259
+ * `values` in `update(User).where(id=1).values(name="x")`. Their
260
+ * keywords are reported as fields; every other call's keywords are the
261
+ * selector.
262
+ */
263
+ valueMethods?: string[];
250
264
  /**
251
265
  * Functions the library exports that start a query on their own, for the
252
266
  * case where a call site imports one rather than reaching it through a
@@ -301,9 +315,32 @@ interface RouteConventions {
301
315
  * that sets its own status would be reported at the default.
302
316
  */
303
317
  statusFromReturnedTuple?: boolean;
318
+ /**
319
+ * The library's own callables that end the request with a status, such
320
+ * as FastAPI's `HTTPException` and Flask's `abort`. Declaring them is
321
+ * also what makes a `raise` in a route body an outcome of its own: a
322
+ * raise the list does not cover comes out as a throw with no status,
323
+ * and one it does cover comes out as the response the library sends.
324
+ */
325
+ responseStatusCalls?: PyStatusCall[];
304
326
  /** Unset means the library has no router mounting, and a route's decorator path stands as written. */
305
327
  routerComposition?: RouterComposition;
306
328
  }
329
+ /**
330
+ * One callable that ends the request, and where it takes the status.
331
+ * A call may take it either way, so a pattern may state both, and the
332
+ * keyword wins where an argument is written both ways.
333
+ */
334
+ interface PyStatusCall {
335
+ /** The callee as the file imports it, module and name together, `fastapi.HTTPException`. */
336
+ callee: string;
337
+ /** The keyword whose value gives the status, FastAPI's `status_code`. */
338
+ statusKeyword?: string;
339
+ /** The index of the positional argument giving the status, 0 for `abort(404)`. */
340
+ statusArgument?: number;
341
+ /** What the library sends when the call states no status of its own. */
342
+ defaultStatusCode?: number;
343
+ }
307
344
  /**
308
345
  * A class has a decorator whose first string-literal argument is the route path,
309
346
  * and each method in its body named after an HTTP verb becomes its own unit,
@@ -749,4 +786,4 @@ declare function pythonImportEvidence(options: PythonImportEvidenceOptions): Pro
749
786
  */
750
787
  declare const ADAPTER_VERSION = "0.1.0";
751
788
 
752
- export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, findPythonFiles, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
789
+ export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, findPythonFiles, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
package/dist/index.d.ts CHANGED
@@ -247,6 +247,20 @@ interface StoragePattern {
247
247
  queryTypes: string[];
248
248
  /** Chain-ending methods that change what is stored. Anything else reads. */
249
249
  writes: string[];
250
+ /**
251
+ * Methods on a query type that touch no rows of their own: one that runs
252
+ * a statement built elsewhere, `session.execute(stmt)`, whose own chain
253
+ * already records the work, and one that manages the session, `close`.
254
+ * A call to one of these records nothing.
255
+ */
256
+ recordsNothing?: string[];
257
+ /**
258
+ * Methods whose keywords supply column values rather than pick rows,
259
+ * `values` in `update(User).where(id=1).values(name="x")`. Their
260
+ * keywords are reported as fields; every other call's keywords are the
261
+ * selector.
262
+ */
263
+ valueMethods?: string[];
250
264
  /**
251
265
  * Functions the library exports that start a query on their own, for the
252
266
  * case where a call site imports one rather than reaching it through a
@@ -301,9 +315,32 @@ interface RouteConventions {
301
315
  * that sets its own status would be reported at the default.
302
316
  */
303
317
  statusFromReturnedTuple?: boolean;
318
+ /**
319
+ * The library's own callables that end the request with a status, such
320
+ * as FastAPI's `HTTPException` and Flask's `abort`. Declaring them is
321
+ * also what makes a `raise` in a route body an outcome of its own: a
322
+ * raise the list does not cover comes out as a throw with no status,
323
+ * and one it does cover comes out as the response the library sends.
324
+ */
325
+ responseStatusCalls?: PyStatusCall[];
304
326
  /** Unset means the library has no router mounting, and a route's decorator path stands as written. */
305
327
  routerComposition?: RouterComposition;
306
328
  }
329
+ /**
330
+ * One callable that ends the request, and where it takes the status.
331
+ * A call may take it either way, so a pattern may state both, and the
332
+ * keyword wins where an argument is written both ways.
333
+ */
334
+ interface PyStatusCall {
335
+ /** The callee as the file imports it, module and name together, `fastapi.HTTPException`. */
336
+ callee: string;
337
+ /** The keyword whose value gives the status, FastAPI's `status_code`. */
338
+ statusKeyword?: string;
339
+ /** The index of the positional argument giving the status, 0 for `abort(404)`. */
340
+ statusArgument?: number;
341
+ /** What the library sends when the call states no status of its own. */
342
+ defaultStatusCode?: number;
343
+ }
307
344
  /**
308
345
  * A class has a decorator whose first string-literal argument is the route path,
309
346
  * and each method in its body named after an HTTP verb becomes its own unit,
@@ -749,4 +786,4 @@ declare function pythonImportEvidence(options: PythonImportEvidenceOptions): Pro
749
786
  */
750
787
  declare const ADAPTER_VERSION = "0.1.0";
751
788
 
752
- export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, findPythonFiles, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
789
+ export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, findPythonFiles, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };