diff --git a/package.json b/package.json index 4b59e27..82fb403 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "antelope-transactions-api", "description": "Transactions information from the Antelope blockchains", - "version": "0.3.2", + "version": "0.3.3", "homepage": "https://github.com/pinax-network/antelope-transactions-api", "license": "MIT", "authors": [ diff --git a/src/logger.ts b/src/logger.ts index effcdaf..3ce24ae 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -10,6 +10,7 @@ class TsLogger extends Logger { public enable(type: "pretty" | "json" = "json") { this.settings.type = type; + this.settings.hideLogPositionForProduction = true; this.settings.minLevel = 0; this.info("Enabled logger"); } diff --git a/src/typespec/openapi3.tsp b/src/typespec/openapi3.tsp index f057f3f..2f8173d 100644 --- a/src/typespec/openapi3.tsp +++ b/src/typespec/openapi3.tsp @@ -14,7 +14,7 @@ using TypeSpec.OpenAPI; name: "MIT", url: "https://github.com/pinax-network/antelope-transactions-api/blob/75db1c61477ac7ea5e56f775cefe54875af953d4/LICENSE", }, - version: "0.3.2", + version: "0.3.3", }) // From @typespec/openapi //@server("https://eos.api.pinax.network/v1", "EOS V1 Api Endpoint") namespace AntelopeTransactionsApi; @@ -50,10 +50,10 @@ model UsageResponse { }; rows: safeint; rows_before_limit_at_least: safeint; - meta: { - name: string; - type: string; - }[]; + // meta: { + // name: string; + // type: string; + // }[]; } // Alias will *not* be present in the OpenAPI components. diff --git a/src/usage.ts b/src/usage.ts index ddcca14..b6c5056 100644 --- a/src/usage.ts +++ b/src/usage.ts @@ -27,7 +27,8 @@ export async function makeUsageQuery(ctx: Context, endpoint: UsageEndpoints, use if (["limit", "offset", "order_by", "order_direction", "skip", "first"].includes(key)) continue; // skip pagination params const value = (query_params as any)[key]; let isNumber = !isNaN(Number(value)); - where.push(`"${key}" = {${key}: ${isNumber ? "int" : "String"}}`); + // where.push(`${key} = {${key}: ${isNumber ? "int" : "String"}}`); + where.push(`${key}='${value}'`); } if (where.length) query.push(`WHERE ${where.join(" AND ")}`); @@ -45,7 +46,10 @@ export async function makeUsageQuery(ctx: Context, endpoint: UsageEndpoints, use if (query_params.offset) query.push("OFFSET {offset: int}"); try { - return ctx.json(await makeQuery(query.join(" "), { ...query_params })); + const result = await makeQuery(query.join(" "), { ...query_params }); + // Remove the `meta` key from the response + if (result.meta) delete result.meta; + return ctx.json(result); } catch (err) { return APIErrorResponse(ctx, 500, "bad_database_response", err); }