@jskit-ai/json-rest-api-core 0.1.5 → 0.1.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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/json-rest-api-core",
4
- version: "0.1.5",
4
+ version: "0.1.6",
5
5
  kind: "runtime",
6
6
  description: "Shared internal json-rest-api host runtime for JSKIT server packages.",
7
7
  dependsOn: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/json-rest-api-core",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -11,6 +11,6 @@
11
11
  "dependencies": {
12
12
  "hooked-api": "1.x.x",
13
13
  "json-rest-api": "1.x.x",
14
- "@jskit-ai/kernel": "0.1.60"
14
+ "@jskit-ai/kernel": "0.1.61"
15
15
  }
16
16
  }
@@ -370,7 +370,9 @@ async function createJsonRestApiHost({ knex }) {
370
370
 
371
371
  const api = new Api({
372
372
  name: "jskit-internal-json-rest-api",
373
- logLevel: "error"
373
+ logging: {
374
+ level: "error"
375
+ }
374
376
  });
375
377
 
376
378
  await api.use(RestApiPlugin, {
@@ -133,6 +133,30 @@ test("createJsonRestApiHost installs normalizeRecordId as the default resource i
133
133
  assert.equal(api.vars.normalizeId(7.5), null);
134
134
  });
135
135
 
136
+ test("createJsonRestApiHost configures the internal json-rest logger at error level", async () => {
137
+ const fakeKnex = Object.assign(() => {}, {
138
+ client: {
139
+ config: {
140
+ client: "sqlite3"
141
+ }
142
+ },
143
+ async raw() {
144
+ return [
145
+ {
146
+ version: "3.35.5"
147
+ }
148
+ ];
149
+ },
150
+ transaction() {}
151
+ });
152
+
153
+ const api = await createJsonRestApiHost({
154
+ knex: fakeKnex
155
+ });
156
+
157
+ assert.equal(api.options.logging.level, "error");
158
+ });
159
+
136
160
  test("shared query/document helpers build json-rest-api request shapes", () => {
137
161
  assert.deepEqual(
138
162
  buildJsonRestQueryParams("contacts", {