@neondatabase/neon-js 0.1.0-beta.19 → 0.1.0-beta.20
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.mjs +21 -3
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createInternalNeonAuth } from "@neondatabase/auth";
|
|
2
2
|
import { BetterAuthVanillaAdapter, SupabaseAuthAdapter } from "@neondatabase/auth/vanilla/adapters";
|
|
3
3
|
import "@neondatabase/auth/react/adapters";
|
|
4
|
-
import { AuthRequiredError, NeonPostgrestClient, fetchWithToken, fetchWithToken as fetchWithToken$1 } from "@neondatabase/postgrest-js";
|
|
4
|
+
import { AuthRequiredError, NeonPostgrestClient, X_NEON_CLIENT_INFO_HEADER, fetchWithToken, fetchWithToken as fetchWithToken$1, getClientInfo } from "@neondatabase/postgrest-js";
|
|
5
5
|
|
|
6
6
|
//#region src/client/neon-client.ts
|
|
7
7
|
/**
|
|
@@ -21,13 +21,27 @@ var NeonClient = class extends NeonPostgrestClient {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region package.json
|
|
26
|
+
var name = "@neondatabase/neon-js";
|
|
27
|
+
var version = "0.1.0-beta.19";
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/utils/client-info.ts
|
|
31
|
+
function buildNeonJsClientInfo() {
|
|
32
|
+
const info = getClientInfo(name, version);
|
|
33
|
+
return JSON.stringify(info);
|
|
34
|
+
}
|
|
35
|
+
|
|
24
36
|
//#endregion
|
|
25
37
|
//#region src/client/client-factory.ts
|
|
26
38
|
function createClient(config) {
|
|
27
39
|
const { auth: authConfig, dataApi: dataApiConfig } = config;
|
|
40
|
+
const clientInfoHeader = buildNeonJsClientInfo();
|
|
28
41
|
const auth = createInternalNeonAuth(authConfig.url, {
|
|
29
42
|
adapter: authConfig.adapter,
|
|
30
|
-
allowAnonymous: authConfig.allowAnonymous ?? false
|
|
43
|
+
allowAnonymous: authConfig.allowAnonymous ?? false,
|
|
44
|
+
fetchOptions: { headers: { [X_NEON_CLIENT_INFO_HEADER]: clientInfoHeader } }
|
|
31
45
|
});
|
|
32
46
|
const getAccessToken = async () => {
|
|
33
47
|
return auth.getJWTToken();
|
|
@@ -40,7 +54,11 @@ function createClient(config) {
|
|
|
40
54
|
...dataApiConfig.options,
|
|
41
55
|
global: {
|
|
42
56
|
...dataApiConfig.options?.global,
|
|
43
|
-
fetch: authFetch
|
|
57
|
+
fetch: authFetch,
|
|
58
|
+
headers: {
|
|
59
|
+
...dataApiConfig.options?.global?.headers,
|
|
60
|
+
[X_NEON_CLIENT_INFO_HEADER]: clientInfoHeader
|
|
61
|
+
}
|
|
44
62
|
}
|
|
45
63
|
}
|
|
46
64
|
});
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neondatabase/neon-js",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.19",
|
|
4
4
|
"description": "TypeScript SDK for Neon Auth and Data API - authentication and PostgreSQL querying",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"msw": "2.6.8"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@neondatabase/postgrest-js": "^0.1.0-alpha.1",
|
|
122
121
|
"@neondatabase/auth": "^0.1.0-beta.19",
|
|
122
|
+
"@neondatabase/postgrest-js": "^0.1.0-alpha.2",
|
|
123
123
|
"@supabase/postgres-meta": "0.93.1",
|
|
124
124
|
"meow": "14.0.0",
|
|
125
125
|
"zod": "4.1.12"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neondatabase/neon-js",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.20",
|
|
4
4
|
"description": "TypeScript SDK for Neon Auth and Data API - authentication and PostgreSQL querying",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"msw": "2.6.8"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@neondatabase/postgrest-js": "0.1.0-alpha.1",
|
|
122
121
|
"@neondatabase/auth": "0.1.0-beta.19",
|
|
122
|
+
"@neondatabase/postgrest-js": "0.1.0-alpha.2",
|
|
123
123
|
"@supabase/postgres-meta": "0.93.1",
|
|
124
124
|
"meow": "14.0.0",
|
|
125
125
|
"zod": "4.1.12"
|