From 91336c27eaa1a755ee139dfd1a84eeca5a4c4b32 Mon Sep 17 00:00:00 2001 From: dnwpark Date: Thu, 28 Nov 2024 21:18:25 -0500 Subject: [PATCH] test --- deno.lock | 129 +++++++++++++++------------ packages/driver/src/baseClient.ts | 3 + packages/driver/src/browserClient.ts | 3 + packages/driver/src/conUtils.ts | 39 +++++++- packages/driver/src/httpScram.ts | 2 + packages/driver/src/nodeClient.ts | 4 + 6 files changed, 120 insertions(+), 60 deletions(-) diff --git a/deno.lock b/deno.lock index 2a72433f9..adb865cb4 100644 --- a/deno.lock +++ b/deno.lock @@ -1,30 +1,25 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@types/node": "npm:@types/node@18.16.19", - "npm:fast-check": "npm:fast-check@3.20.0", - "npm:typescript": "npm:typescript@5.5.4" + "version": "4", + "specifiers": { + "npm:@types/node@*": "18.16.19", + "npm:fast-check@*": "3.20.0", + "npm:typescript@*": "5.5.4" + }, + "npm": { + "@types/node@18.16.19": { + "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==" }, - "npm": { - "@types/node@18.16.19": { - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", - "dependencies": {} - }, - "fast-check@3.20.0": { - "integrity": "sha512-pZIjqLpOZgdSLecec4GKC3Zq5702MZ34upMKxojnNVSWA0K64V3pXOBT1Wdsrc3AphLtzRBbsi8bRWF4TUGmUg==", - "dependencies": { - "pure-rand": "pure-rand@6.1.0" - } - }, - "pure-rand@6.1.0": { - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", - "dependencies": {} - }, - "typescript@5.5.4": { - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dependencies": {} - } + "fast-check@3.20.0": { + "integrity": "sha512-pZIjqLpOZgdSLecec4GKC3Zq5702MZ34upMKxojnNVSWA0K64V3pXOBT1Wdsrc3AphLtzRBbsi8bRWF4TUGmUg==", + "dependencies": [ + "pure-rand" + ] + }, + "pure-rand@6.1.0": { + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==" + }, + "typescript@5.5.4": { + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==" } }, "redirects": { @@ -315,12 +310,12 @@ "integration-tests/legacy": { "packageJson": { "dependencies": [ - "npm:@edgedb/generate", + "npm:@edgedb/generate@*", "npm:@tsconfig/node-lts@^20.1.3", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", "npm:conditional-type-checks@^1.0.6", - "npm:edgedb", + "npm:edgedb@*", "npm:jest@^29.7.0", "npm:ts-jest@^29.1.4", "npm:typescript@^5.5.2" @@ -330,13 +325,13 @@ "integration-tests/lts": { "packageJson": { "dependencies": [ - "npm:@arktype/attest@^0.7.8", - "npm:@edgedb/generate", + "npm:@arktype/attest@~0.7.8", + "npm:@edgedb/generate@*", "npm:@tsconfig/node-lts@^20.1.3", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", "npm:conditional-type-checks@^1.0.6", - "npm:edgedb", + "npm:edgedb@*", "npm:fast-check@^3.19.0", "npm:jest@^29.7.0", "npm:superjson@1.13.3", @@ -348,12 +343,12 @@ "integration-tests/nightly": { "packageJson": { "dependencies": [ - "npm:@edgedb/generate", + "npm:@edgedb/generate@*", "npm:@tsconfig/node-lts@^20.1.3", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", "npm:conditional-type-checks@^1.0.6", - "npm:edgedb", + "npm:edgedb@*", "npm:jest@^29.7.0", "npm:ts-jest@^29.1.4", "npm:typescript@^5.5.2" @@ -363,12 +358,12 @@ "integration-tests/stable": { "packageJson": { "dependencies": [ - "npm:@edgedb/generate", + "npm:@edgedb/generate@*", "npm:@tsconfig/node-lts@^20.1.3", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", "npm:conditional-type-checks@^1.0.6", - "npm:edgedb", + "npm:edgedb@*", "npm:jest@^29.7.0", "npm:ts-jest@^29.1.4", "npm:typescript@^5.5.2" @@ -378,10 +373,10 @@ "packages/ai": { "packageJson": { "dependencies": [ - "npm:@repo/tsconfig", + "npm:@repo/tsconfig@*", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", - "npm:edgedb", + "npm:edgedb@*", "npm:eventsource-parser@^1.1.2", "npm:jest@29.7.0", "npm:ts-jest@29.1.4", @@ -392,12 +387,12 @@ "packages/auth-core": { "packageJson": { "dependencies": [ - "npm:@repo/tsconfig", + "npm:@repo/tsconfig@*", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", - "npm:edgedb", + "npm:edgedb@*", "npm:jest@29.7.0", - "npm:jwt-decode@^4.0.0", + "npm:jwt-decode@4", "npm:ts-jest@29.1.4", "npm:typescript@^5.5.2" ] @@ -406,11 +401,11 @@ "packages/auth-express": { "packageJson": { "dependencies": [ - "npm:@edgedb/auth-core@^0.2.1", - "npm:@repo/tsconfig", + "npm:@edgedb/auth-core@~0.2.1", + "npm:@repo/tsconfig@*", "npm:@types/express@^4.17.21", "npm:@types/node@^20.12.13", - "npm:edgedb", + "npm:edgedb@*", "npm:express@^4.19.2", "npm:typescript@^5.5.2" ] @@ -420,10 +415,10 @@ "packageJson": { "dependencies": [ "npm:@edgedb/auth-core@0.2.1", - "npm:@repo/tsconfig", + "npm:@repo/tsconfig@*", "npm:@types/node@^20.12.13", "npm:@types/react@^18.3.3", - "npm:edgedb", + "npm:edgedb@*", "npm:next@14.2.3", "npm:react@^18.3.1", "npm:typescript@^5.5.2" @@ -433,12 +428,12 @@ "packages/auth-remix": { "packageJson": { "dependencies": [ - "npm:@edgedb/auth-core@^0.2.1", + "npm:@edgedb/auth-core@~0.2.1", "npm:@remix-run/server-runtime@^2.9.2", - "npm:@repo/tsconfig", + "npm:@repo/tsconfig@*", "npm:@types/node@^20.12.13", - "npm:cookie@^0.6.0", - "npm:edgedb", + "npm:cookie@0.6", + "npm:edgedb@*", "npm:typescript@^5.5.2" ] } @@ -446,11 +441,11 @@ "packages/auth-sveltekit": { "packageJson": { "dependencies": [ - "npm:@edgedb/auth-core@^0.2.1", - "npm:@repo/tsconfig", + "npm:@edgedb/auth-core@~0.2.1", + "npm:@repo/tsconfig@*", "npm:@sveltejs/kit@^2.5.10", "npm:@types/node@^20.12.13", - "npm:edgedb", + "npm:edgedb@*", "npm:svelte@^4.2.17", "npm:typescript@^5.5.2", "npm:vite@^5.2.12" @@ -460,7 +455,7 @@ "packages/create": { "packageJson": { "dependencies": [ - "npm:@clack/prompts@^0.7.0", + "npm:@clack/prompts@0.7", "npm:@types/debug@^4.1.12", "npm:@types/node@^20.12.13", "npm:debug@^4.3.4", @@ -476,15 +471,17 @@ "packageJson": { "dependencies": [ "npm:@js-temporal/polyfill@0.4.3", - "npm:@repo/tsconfig", + "npm:@petamoriken/float16@^3.8.7", + "npm:@repo/tsconfig@*", "npm:@types/jest@^29.5.12", + "npm:@types/node@^22.7.5", "npm:@types/semver@^7.5.8", "npm:@types/shell-quote@^1.7.5", "npm:@types/which@^3.0.3", "npm:debug@^4.3.4", - "npm:env-paths@^3.0.0", + "npm:env-paths@3", "npm:fast-check@^3.19.0", - "npm:get-stdin@^9.0.0", + "npm:get-stdin@9", "npm:globby@^14.0.1", "npm:jest-environment-jsdom@^29.7.0", "npm:jest@29.7.0", @@ -493,7 +490,7 @@ "npm:ts-jest@29.1.4", "npm:tsx@^4.11.0", "npm:typescript@^5.5.2", - "npm:which@^4.0.0" + "npm:which@4" ] } }, @@ -501,19 +498,33 @@ "packageJson": { "dependencies": [ "npm:@iarna/toml@^2.2.5", - "npm:@repo/tsconfig", + "npm:@repo/tsconfig@*", "npm:@types/jest@^29.5.12", "npm:@types/node@^20.12.13", "npm:conditional-type-checks@^1.0.6", "npm:debug@^4.3.4", - "npm:edgedb", - "npm:esbuild@^0.21.4", + "npm:edgedb@*", + "npm:esbuild@~0.21.4", "npm:globby@^14.0.1", "npm:jest@^29.7.0", "npm:ts-jest@^29.1.4", "npm:typescript@^5.5.2" ] } + }, + "packages/vercel-ai-provider": { + "packageJson": { + "dependencies": [ + "npm:@ai-sdk/provider-utils@2", + "npm:@ai-sdk/provider@1", + "npm:@repo/tsconfig@*", + "npm:@types/node@18", + "npm:edgedb@*", + "npm:tsup@8", + "npm:typescript@5.5.4", + "npm:zod@3.23.8" + ] + } } } } diff --git a/packages/driver/src/baseClient.ts b/packages/driver/src/baseClient.ts index b25ae7e91..a9e8a5866 100644 --- a/packages/driver/src/baseClient.ts +++ b/packages/driver/src/baseClient.ts @@ -431,7 +431,10 @@ export abstract class BaseClientPool { throw new errors.InterfaceError("The client is closed"); } + console.log('! getNewConnection') + console.log(this.__normalizedConnectConfig) const config = await this._getNormalizedConnectConfig(); + console.log(config.connectionParams) const connection = await retryingConnect( this._connectWithTimeout, config, diff --git a/packages/driver/src/browserClient.ts b/packages/driver/src/browserClient.ts index 901fd7014..a0551907f 100644 --- a/packages/driver/src/browserClient.ts +++ b/packages/driver/src/browserClient.ts @@ -24,6 +24,9 @@ export function createClient(): Client { export function createHttpClient( options?: string | ConnectOptions | null, ): Client { + console.log('! createHttpClient') + console.log('. options') + console.log(options) return new Client( new FetchClientPool( parseConnectArguments, diff --git a/packages/driver/src/conUtils.ts b/packages/driver/src/conUtils.ts index 79fae0d4f..a7979e2e6 100644 --- a/packages/driver/src/conUtils.ts +++ b/packages/driver/src/conUtils.ts @@ -534,6 +534,13 @@ async function parseConnectDsnAndArgs( config: ConnectConfig, serverUtils: ServerUtils | null, ): Promise { + console.log('! parseConnectDsnAndArgs'); + console.log('. config.tlsCA'); + console.log(config.tlsCA); + console.log('. config.tlsCAFile'); + console.log(config.tlsCAFile); + console.log(getEnv("EDGEDB_TLS_CA_FILE")); + const resolvedConfig = new ResolvedConnectConfig(); let fromEnv = false; let fromProject = false; @@ -805,6 +812,9 @@ async function resolveConfigOptions< } } + console.warn('! resolveConfigOptions') + console.log('. resolvedConfig._tlsCAData') + console.log(resolvedConfig._tlsCAData) anyOptionsUsed = resolvedConfig.setUser(config.user ?? null, sources.user!) || anyOptionsUsed; @@ -819,15 +829,32 @@ async function resolveConfigOptions< config.cloudProfile ?? null, sources.cloudProfile!, ) || anyOptionsUsed; + console.log(': 1') + console.log('. resolvedConfig._tlsCAData') + console.log(resolvedConfig._tlsCAData) + console.log('. config.tlsCAFile') + console.log(config.tlsCA) + console.log('. sources.tlsCA') + console.log(sources.tlsCA) anyOptionsUsed = resolvedConfig.setTlsCAData(config.tlsCA ?? null, sources.tlsCA!) || anyOptionsUsed; + console.log(': 2') + console.log('. resolvedConfig._tlsCAData') + console.log(resolvedConfig._tlsCAData) + console.log('. config.tlsCAFile') + console.log(config.tlsCAFile) + console.log('. sources.tlsCAFile') + console.log(sources.tlsCAFile) anyOptionsUsed = (await resolvedConfig.setTlsCAFile( config.tlsCAFile ?? null, sources.tlsCAFile!, readFile, )) || anyOptionsUsed; + console.log(': 3') + console.log('. resolvedConfig._tlsCAData') + console.log(resolvedConfig._tlsCAData) anyOptionsUsed = resolvedConfig.setTlsServerName( config.tlsServerName ?? null, @@ -869,8 +896,11 @@ async function resolveConfigOptions< resolvedConfig.setPort(config.port, sources.port!); } const host = config.host != null ? validateHost(config.host) : ""; - dsn = `edgedb://${host.includes(":") ? `[${encodeURI(host)}]` : host}`; + dsn = `gel://${host.includes(":") ? `[${encodeURI(host)}]` : host}`; } + console.log(': 4') + console.log('. resolvedConfig._tlsCAData') + console.log(resolvedConfig._tlsCAData) await parseDSNIntoConfig( dsn, resolvedConfig, @@ -972,6 +1002,11 @@ async function parseDSNIntoConfig( ); } + console.log('!!! parseDSNIntoConfig') + console.log('. dsnString') + console.log(dsnString) + console.log('. _tlsCAData') + console.log(config._tlsCAData) let parsed: URL; try { parsed = new URL(dsnString); @@ -1125,6 +1160,8 @@ async function parseDSNIntoConfig( config.setSecretKey, ); + console.log('. _tlsCAData') + console.log(config._tlsCAData) await handleDSNPart("tls_ca", null, config._tlsCAData, config.setTlsCAData); await handleDSNPart( "tls_ca_file", diff --git a/packages/driver/src/httpScram.ts b/packages/driver/src/httpScram.ts index ef87f4f29..d72f2b064 100644 --- a/packages/driver/src/httpScram.ts +++ b/packages/driver/src/httpScram.ts @@ -88,6 +88,8 @@ export function getHTTPSCRAMAuth(cryptoUtils: CryptoUtils): HttpSCRAMAuth { serverNonce, ); + console.log('!!! getHTTPSCRAMAuth') + console.log(authUrl) const serverFinalRes = await fetch(authUrl, { headers: { Authorization: `SCRAM-SHA-256 sid=${sid}, data=${utf8ToB64( diff --git a/packages/driver/src/nodeClient.ts b/packages/driver/src/nodeClient.ts index 74a0be3a4..fa3ea6065 100644 --- a/packages/driver/src/nodeClient.ts +++ b/packages/driver/src/nodeClient.ts @@ -12,6 +12,9 @@ class ClientPool extends BaseClientPool { } export function createClient(options?: string | ConnectOptions | null): Client { + console.log('! createClient') + console.log('. options') + console.log(options) return new Client( new ClientPool( parseConnectArguments, @@ -31,6 +34,7 @@ class FetchClientPool extends BaseClientPool { export function createHttpClient( options?: string | ConnectOptions | null, ): Client { + console.log('! createHttpClient') return new Client( new FetchClientPool( parseConnectArguments,