Skip to content

Commit

Permalink
Created some debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
macmv committed Feb 5, 2024
1 parent 0b59d71 commit a52b651
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export class Client {
format,
}: { secret?: string; typecheck?: boolean; format?: string } = {},
): Promise<Success<T>> {
console.log(`running a query against ${this.endpoint}`);
console.log(`secret: ${this.secret.slice(0, 10)}`);
console.log(`secret: ${this.secret.slice(10, 20)}`);
console.log(`secret: ${this.secret.slice(20, 30)}`);
console.log(`secret: ${this.secret.slice(30, 40)}`);

const url = new URL(this.endpoint);
url.pathname = "/query/1";
const res = await fetch(url, {
Expand Down
3 changes: 3 additions & 0 deletions src/test/suite/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const clientWithFreshDB = async (
name: string,
): Promise<[Client, string]> => {
const parentClient = getClient();
console.log("running query against parent client");
const secretQ = await parentClient.query<string>(`
if (Database.byName('${name}').exists()) {
Key.where(.database == '${name}').forEach(.delete())
Expand All @@ -57,6 +58,8 @@ export const clientWithFreshDB = async (
Key.create({ role: "admin", database: '${name}' }).secret
`);

console.log("created client with fresh db");

return [
new Client({
endpoint: parentClient.endpoint,
Expand Down

0 comments on commit a52b651

Please sign in to comment.