@xeplr/base-apis 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -9,8 +9,8 @@ The service layer for a xeplr app: `createApp` wires an Express service, and
9
9
  1. Install `@xeplr/base-apis` (add `@xeplr/db`, `@xeplr/auth`, `dotenv`).
10
10
  2. Create a file env.required.js
11
11
  3. For anything
12
- 3. Each API is by default guarded through Auth System. But you will need following variables in your env file for AUTH: AUTH_DB_NAME, AUTH_DB_CONNECTION_INFO_ENCRYPTED, AUTH_EXT_MIGRATIONS_DIR, AUTH_PORT.
13
- 4. The AUTH_EXT_MIGRATIONS_DIR is y
12
+ 3. Each API is by default guarded through Auth System. But you will need following variables in your env file for AUTH: AUTH_DB_NAME, AUTH_DB_CONNECTION_INFO_ENCRYPTED, XEPLR_AUTH_MIGRATIONS, AUTH_PORT.
13
+ 4. The XEPLR_AUTH_MIGRATIONS is y
14
14
 
15
15
  Example:
16
16
 
@@ -66,7 +66,7 @@ function sendError(req, res, err) {
66
66
  */
67
67
  async function save(req, res, hierarchy) {
68
68
  var changeSet = req.body;
69
-
69
+ console.log('bruh: ', 1);
70
70
  if (!Array.isArray(changeSet) || changeSet.length === 0) {
71
71
  return respond(res, HTTP.BAD_REQUEST, STATUS.BAD_REQUEST, 'bad_request', {
72
72
  message: 'Expected a non-empty changeset array'
@@ -102,6 +102,7 @@ async function save(req, res, hierarchy) {
102
102
  var ids = await processEntry(changeSet[i], rootDef, trx, null, queryContext);
103
103
  updatedIds = updatedIds.concat(ids);
104
104
  }
105
+ console.log('bruh: ', 2);
105
106
 
106
107
  await trx.commit();
107
108
 
@@ -113,6 +114,7 @@ async function save(req, res, hierarchy) {
113
114
  else console.error('[genericController] afterCommit callback failed:', err.message);
114
115
  }
115
116
  }
117
+ console.log('bruh: ', 3);
116
118
 
117
119
  respond(res, HTTP.OK, STATUS.UPDATED, 'updated', { updatedIds: updatedIds });
118
120
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/base-apis",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Base API bootstrapper — Express and plain HTTP server factories with middleware injection",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -46,5 +46,8 @@
46
46
  "multer": {
47
47
  "optional": true
48
48
  }
49
+ },
50
+ "scripts": {
51
+ "test": "node --test test/*.test.js"
49
52
  }
50
53
  }