@suss/packs 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/requests.js CHANGED
@@ -1,42 +1,51 @@
1
1
  // ../client/requests/dist/index.js
2
- var VERB_FUNCTIONS = {
2
+ var VERB_FUNCTIONS_THAT_FOLLOW = {
3
3
  get: "GET",
4
4
  post: "POST",
5
5
  put: "PUT",
6
6
  patch: "PATCH",
7
7
  delete: "DELETE",
8
- head: "HEAD",
9
8
  options: "OPTIONS"
10
9
  };
10
+ function verbCalls(verbs, redirectDelivery) {
11
+ return {
12
+ type: "clientCall",
13
+ importModule: ["requests"],
14
+ verbAttributeNames: verbs,
15
+ url: { position: 0, keyword: "url" },
16
+ receiverConstructors: ["Session"],
17
+ // A caller's condition on one of these members shows which
18
+ // statuses it handles.
19
+ response: {
20
+ statusCode: ["status_code"],
21
+ success: ["ok"],
22
+ body: ["json", "text", "content"],
23
+ failureDelivery: "response",
24
+ redirectDelivery,
25
+ redirectOption: { name: "allow_redirects", handsBack: [false] }
26
+ }
27
+ };
28
+ }
11
29
  function requestsClient() {
12
30
  return {
13
31
  name: "requests",
14
32
  protocol: "http",
15
33
  discovery: [],
34
+ // `head` defaults `allow_redirects` to False, and every other call,
35
+ // `request("HEAD", url)` included, defaults it to True.
16
36
  clients: [
17
37
  {
18
- type: "clientCall",
19
- importModule: ["requests"],
20
- verbAttributeNames: VERB_FUNCTIONS,
38
+ ...verbCalls(VERB_FUNCTIONS_THAT_FOLLOW, "followed"),
21
39
  // The verb functions take the URL first and `request` takes it
22
40
  // second. All of them accept it as `url=`.
23
- url: { position: 0, keyword: "url" },
24
41
  methodCall: {
25
42
  attribute: "request",
26
43
  methodPosition: 0,
27
44
  methodKeyword: "method",
28
45
  urlPosition: 1
29
- },
30
- receiverConstructors: ["Session"],
31
- // A caller's condition on one of these members shows which
32
- // statuses it handles.
33
- response: {
34
- statusCode: ["status_code"],
35
- success: ["ok"],
36
- body: ["json", "text", "content"],
37
- failureDelivery: "response"
38
46
  }
39
- }
47
+ },
48
+ verbCalls({ head: "HEAD" }, "response")
40
49
  ],
41
50
  // `Session.__enter__` returns the session, so `with
42
51
  // requests.Session() as s` puts the constructed session in s.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/packs",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "description": "Every pack suss ships in one install, so it can read Express, Hono, NestJS, FastAPI, Rails, Prisma, OpenAPI and the rest.",
6
6
  "keywords": [
@@ -267,15 +267,15 @@
267
267
  },
268
268
  "dependencies": {
269
269
  "@mrleebo/prisma-ast": "^0.15.0",
270
- "@suss/adapter-python": "0.34.0",
271
- "@suss/adapter-ruby": "0.34.0",
272
- "@suss/adapter-typescript": "0.34.0",
273
- "@suss/behavioral-ir": "0.34.0",
274
- "@suss/contract-graphql": "0.34.0",
275
- "@suss/extractor": "0.34.0",
276
- "@suss/manifest-aws": "0.34.0",
277
- "@suss/recognize": "0.34.0",
278
- "@suss/sql": "0.34.0",
270
+ "@suss/adapter-python": "0.34.1",
271
+ "@suss/adapter-ruby": "0.34.1",
272
+ "@suss/adapter-typescript": "0.34.1",
273
+ "@suss/behavioral-ir": "0.34.1",
274
+ "@suss/contract-graphql": "0.34.1",
275
+ "@suss/extractor": "0.34.1",
276
+ "@suss/manifest-aws": "0.34.1",
277
+ "@suss/recognize": "0.34.1",
278
+ "@suss/sql": "0.34.1",
279
279
  "zod": "^4.0.0"
280
280
  },
281
281
  "devDependencies": {