@suss/adapter-python 0.23.0 → 0.24.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/index.d.cts CHANGED
@@ -229,6 +229,8 @@ interface PythonPack {
229
229
  * and never says why (#188).
230
230
  */
231
231
  projectModules?: string[];
232
+ /** The callables the library gives a project for making a request. */
233
+ clients?: PyClientCall[];
232
234
  /** What the library's own database queries look like. The README says how one is matched. */
233
235
  storage?: StoragePattern[];
234
236
  /** How the library lets a project hand the database SQL it wrote itself. */
@@ -285,6 +287,49 @@ interface RawSqlPattern {
285
287
  storageSystem: "postgresql" | "mysql" | "sqlite";
286
288
  }
287
289
  type PythonDiscoveryPattern = DecoratedClassRoute | DecoratedFunctionRoute;
290
+ /**
291
+ * The callables a library gives a project for making a request. A
292
+ * function that calls one of them is a client of the boundary that call
293
+ * states, and gets a unit bound to its method and path.
294
+ */
295
+ interface PyClientCall {
296
+ type: "clientCall";
297
+ /** The module the callables come from, `requests`. */
298
+ importModule: string[];
299
+ /** Attribute names that state the method themselves: `get` means GET. */
300
+ verbAttributeNames: Record<string, string>;
301
+ /** Where a call whose name states the method states its URL. */
302
+ url: {
303
+ position: number;
304
+ keyword: string;
305
+ };
306
+ /** A call that takes the method as an argument instead, `request("GET", url)`. */
307
+ methodCall?: {
308
+ attribute: string;
309
+ methodPosition: number;
310
+ methodKeyword?: string;
311
+ urlPosition: number;
312
+ };
313
+ /** Constructors whose instances take the same calls, `Session`. */
314
+ receiverConstructors?: string[];
315
+ /** What the response object gives a caller, so a guard on it reads as a guard on a status. */
316
+ response?: PyClientResponse;
317
+ }
318
+ /**
319
+ * The members a library's response object gives a caller. A caller that
320
+ * tests one of them is saying which statuses it handles, and the
321
+ * checker compares that against what the other side produces.
322
+ */
323
+ interface PyClientResponse {
324
+ /** Members whose value is the status code: `status_code`. */
325
+ statusCode?: string[];
326
+ /** Members that say the request succeeded, meaning a status in 200 to 299: `ok`. */
327
+ success?: string[];
328
+ /** Members that give the body: `json`, `text`, `content`. */
329
+ body?: string[];
330
+ /** Whether a refused request comes back as a response or raises where it was made. */
331
+ failureDelivery?: "response" | "exception";
332
+ }
288
333
  /** Conventions both kinds of route share. Each one describes what the library does, never a project's choice. */
289
334
  interface RouteConventions {
290
335
  /** How the library spells a path parameter. The README lists the syntaxes we know how to read. */
package/dist/index.d.ts CHANGED
@@ -229,6 +229,8 @@ interface PythonPack {
229
229
  * and never says why (#188).
230
230
  */
231
231
  projectModules?: string[];
232
+ /** The callables the library gives a project for making a request. */
233
+ clients?: PyClientCall[];
232
234
  /** What the library's own database queries look like. The README says how one is matched. */
233
235
  storage?: StoragePattern[];
234
236
  /** How the library lets a project hand the database SQL it wrote itself. */
@@ -285,6 +287,49 @@ interface RawSqlPattern {
285
287
  storageSystem: "postgresql" | "mysql" | "sqlite";
286
288
  }
287
289
  type PythonDiscoveryPattern = DecoratedClassRoute | DecoratedFunctionRoute;
290
+ /**
291
+ * The callables a library gives a project for making a request. A
292
+ * function that calls one of them is a client of the boundary that call
293
+ * states, and gets a unit bound to its method and path.
294
+ */
295
+ interface PyClientCall {
296
+ type: "clientCall";
297
+ /** The module the callables come from, `requests`. */
298
+ importModule: string[];
299
+ /** Attribute names that state the method themselves: `get` means GET. */
300
+ verbAttributeNames: Record<string, string>;
301
+ /** Where a call whose name states the method states its URL. */
302
+ url: {
303
+ position: number;
304
+ keyword: string;
305
+ };
306
+ /** A call that takes the method as an argument instead, `request("GET", url)`. */
307
+ methodCall?: {
308
+ attribute: string;
309
+ methodPosition: number;
310
+ methodKeyword?: string;
311
+ urlPosition: number;
312
+ };
313
+ /** Constructors whose instances take the same calls, `Session`. */
314
+ receiverConstructors?: string[];
315
+ /** What the response object gives a caller, so a guard on it reads as a guard on a status. */
316
+ response?: PyClientResponse;
317
+ }
318
+ /**
319
+ * The members a library's response object gives a caller. A caller that
320
+ * tests one of them is saying which statuses it handles, and the
321
+ * checker compares that against what the other side produces.
322
+ */
323
+ interface PyClientResponse {
324
+ /** Members whose value is the status code: `status_code`. */
325
+ statusCode?: string[];
326
+ /** Members that say the request succeeded, meaning a status in 200 to 299: `ok`. */
327
+ success?: string[];
328
+ /** Members that give the body: `json`, `text`, `content`. */
329
+ body?: string[];
330
+ /** Whether a refused request comes back as a response or raises where it was made. */
331
+ failureDelivery?: "response" | "exception";
332
+ }
288
333
  /** Conventions both kinds of route share. Each one describes what the library does, never a project's choice. */
289
334
  interface RouteConventions {
290
335
  /** How the library spells a path parameter. The README lists the syntaxes we know how to read. */