postgresdk 0.19.5 → 0.19.6
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/cli.js +7 -1
- package/dist/index.js +7 -1
- package/package.json +4 -3
package/dist/cli.js
CHANGED
|
@@ -4495,7 +4495,13 @@ export abstract class BaseClient {
|
|
|
4495
4495
|
protected baseUrl: string,
|
|
4496
4496
|
protected fetchFn: typeof fetch = fetch,
|
|
4497
4497
|
protected auth?: AuthConfig
|
|
4498
|
-
) {
|
|
4498
|
+
) {
|
|
4499
|
+
// Rebind so \`this.fetchFn(...)\` calls don't pass the client as the receiver.
|
|
4500
|
+
// Browser \`fetch\` requires \`window\`/\`globalThis\` as \`this\` and throws
|
|
4501
|
+
// "Illegal invocation" otherwise. Covers both the default and any caller-supplied fetch.
|
|
4502
|
+
const f = this.fetchFn;
|
|
4503
|
+
this.fetchFn = ((...args: Parameters<typeof fetch>) => f(...args)) as typeof fetch;
|
|
4504
|
+
}
|
|
4499
4505
|
|
|
4500
4506
|
protected async authHeaders(): Promise<HeaderMap> {
|
|
4501
4507
|
if (!this.auth) return {};
|
package/dist/index.js
CHANGED
|
@@ -3497,7 +3497,13 @@ export abstract class BaseClient {
|
|
|
3497
3497
|
protected baseUrl: string,
|
|
3498
3498
|
protected fetchFn: typeof fetch = fetch,
|
|
3499
3499
|
protected auth?: AuthConfig
|
|
3500
|
-
) {
|
|
3500
|
+
) {
|
|
3501
|
+
// Rebind so \`this.fetchFn(...)\` calls don't pass the client as the receiver.
|
|
3502
|
+
// Browser \`fetch\` requires \`window\`/\`globalThis\` as \`this\` and throws
|
|
3503
|
+
// "Illegal invocation" otherwise. Covers both the default and any caller-supplied fetch.
|
|
3504
|
+
const f = this.fetchFn;
|
|
3505
|
+
this.fetchFn = ((...args: Parameters<typeof fetch>) => f(...args)) as typeof fetch;
|
|
3506
|
+
}
|
|
3501
3507
|
|
|
3502
3508
|
protected async authHeaders(): Promise<HeaderMap> {
|
|
3503
3509
|
if (!this.auth) return {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postgresdk",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "bun build src/cli.ts src/index.ts --outdir dist --target node --format esm --external=pg --external=zod --external=hono --external=prompts --external=node:* && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
26
|
-
"test": "bun test:write-files && bun test:init && bun test:gen && bun test test/test-where-clause.test.ts && bun test test/test-where-or-and.test.ts && bun test test/test-nested-include-options.test.ts && bun test test/test-include-methods-with-options.test.ts && bun test:gen-with-tests && bun test:pull && bun test:enums && bun test:typecheck && bun test:drizzle-e2e && bun test test/test-numeric-mode-integration.test.ts && bun test test/test-jsonb-array-serialization.test.ts && bun test test/test-trigram-search.test.ts && bun test test/test-soft-delete-config.test.ts && bun test test/test-soft-delete-include-loader.test.ts && bun test test/test-soft-delete-nested-include.test.ts && bun test test/test-transaction.test.ts && bun test test/test-nullable-belongs-to.test.ts && bun test test/test-no-default-limit.test.ts",
|
|
26
|
+
"test": "bun test:write-files && bun test:init && bun test:gen && bun test test/test-where-clause.test.ts && bun test test/test-where-or-and.test.ts && bun test test/test-nested-include-options.test.ts && bun test test/test-include-methods-with-options.test.ts && bun test:gen-with-tests && bun test:pull && bun test:enums && bun test:typecheck && bun test:drizzle-e2e && bun test test/test-numeric-mode-integration.test.ts && bun test test/test-jsonb-array-serialization.test.ts && bun test test/test-trigram-search.test.ts && bun test test/test-soft-delete-config.test.ts && bun test test/test-soft-delete-include-loader.test.ts && bun test test/test-soft-delete-nested-include.test.ts && bun test test/test-transaction.test.ts && bun test test/test-nullable-belongs-to.test.ts && bun test test/test-no-default-limit.test.ts && bun test test/test-base-client-fetch-receiver.test.ts",
|
|
27
27
|
"test:write-files": "bun test/test-write-files-if-changed.ts",
|
|
28
28
|
"test:init": "bun test/test-init.ts",
|
|
29
29
|
"test:gen": "bun test/test-gen.ts",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"drizzle-kit": "^0.31.4",
|
|
55
55
|
"drizzle-orm": "^0.44.4",
|
|
56
56
|
"jose": "^6.0.12",
|
|
57
|
-
"typescript": "^5.5.0"
|
|
57
|
+
"typescript": "^5.5.0",
|
|
58
|
+
"vitest": "^4.1.6"
|
|
58
59
|
},
|
|
59
60
|
"author": "Ben Honda <ben@theadpharm.com>",
|
|
60
61
|
"license": "MIT",
|