@balena/pinejs 17.0.0-build-large-file-uploads-293e65ee371a69130834c50fef2f7f42cc18133f-1 → 17.0.0-build-17-x-74b0e8403edbd7922c684e3ce19bdb42ac41846b-1

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.
Files changed (66) hide show
  1. package/.pinejs-cache.json +1 -1
  2. package/.versionbot/CHANGELOG.yml +2295 -17
  3. package/CHANGELOG.md +860 -5
  4. package/out/bin/abstract-sql-compiler.js +1 -1
  5. package/out/bin/abstract-sql-compiler.js.map +1 -1
  6. package/out/bin/sbvr-compiler.js +1 -1
  7. package/out/bin/sbvr-compiler.js.map +1 -1
  8. package/out/database-layer/db.js +30 -19
  9. package/out/database-layer/db.js.map +1 -1
  10. package/out/http-transactions/transactions.js +2 -2
  11. package/out/http-transactions/transactions.js.map +1 -1
  12. package/out/migrator/async.js +8 -9
  13. package/out/migrator/async.js.map +1 -1
  14. package/out/migrator/sync.js +6 -6
  15. package/out/migrator/sync.js.map +1 -1
  16. package/out/pinejs-session-store/pinejs-session-store.js +103 -108
  17. package/out/pinejs-session-store/pinejs-session-store.js.map +1 -1
  18. package/out/sbvr-api/abstract-sql.js +1 -1
  19. package/out/sbvr-api/abstract-sql.js.map +1 -1
  20. package/out/sbvr-api/errors.js +3 -0
  21. package/out/sbvr-api/errors.js.map +1 -1
  22. package/out/sbvr-api/hooks.js +4 -5
  23. package/out/sbvr-api/hooks.js.map +1 -1
  24. package/out/sbvr-api/permissions.js +3 -3
  25. package/out/sbvr-api/permissions.js.map +1 -1
  26. package/out/sbvr-api/sbvr-utils.d.ts +5 -12
  27. package/out/sbvr-api/sbvr-utils.js +16 -15
  28. package/out/sbvr-api/sbvr-utils.js.map +1 -1
  29. package/out/sbvr-api/uri-parser.js +1 -1
  30. package/out/sbvr-api/uri-parser.js.map +1 -1
  31. package/out/server-glue/module.js +0 -2
  32. package/out/server-glue/module.js.map +1 -1
  33. package/out/webresource-handler/handlers/NoopHandler.d.ts +1 -3
  34. package/out/webresource-handler/handlers/NoopHandler.js +0 -6
  35. package/out/webresource-handler/handlers/NoopHandler.js.map +1 -1
  36. package/out/webresource-handler/handlers/S3Handler.d.ts +28 -0
  37. package/out/webresource-handler/handlers/S3Handler.js +104 -0
  38. package/out/webresource-handler/handlers/S3Handler.js.map +1 -0
  39. package/out/webresource-handler/handlers/index.d.ts +1 -0
  40. package/out/webresource-handler/handlers/index.js +1 -0
  41. package/out/webresource-handler/handlers/index.js.map +1 -1
  42. package/out/webresource-handler/index.d.ts +7 -31
  43. package/out/webresource-handler/index.js +22 -23
  44. package/out/webresource-handler/index.js.map +1 -1
  45. package/package.json +40 -39
  46. package/src/bin/abstract-sql-compiler.ts +1 -1
  47. package/src/bin/sbvr-compiler.ts +1 -1
  48. package/src/http-transactions/transactions.js +2 -2
  49. package/src/migrator/async.ts +10 -11
  50. package/src/migrator/sync.ts +6 -6
  51. package/src/sbvr-api/abstract-sql.ts +1 -1
  52. package/src/sbvr-api/permissions.ts +3 -3
  53. package/src/sbvr-api/sbvr-utils.ts +21 -30
  54. package/src/sbvr-api/uri-parser.ts +1 -1
  55. package/src/server-glue/module.ts +0 -2
  56. package/src/webresource-handler/handlers/NoopHandler.ts +1 -14
  57. package/src/webresource-handler/handlers/S3Handler.ts +143 -0
  58. package/src/webresource-handler/handlers/index.ts +1 -0
  59. package/src/webresource-handler/index.ts +22 -64
  60. package/tsconfig.json +1 -1
  61. package/out/webresource-handler/multipartUpload.d.ts +0 -16
  62. package/out/webresource-handler/multipartUpload.js +0 -182
  63. package/out/webresource-handler/multipartUpload.js.map +0 -1
  64. package/out/webresource-handler/webresource.sbvr +0 -63
  65. package/src/webresource-handler/multipartUpload.ts +0 -275
  66. package/src/webresource-handler/webresource.sbvr +0 -63
@@ -0,0 +1 @@
1
+ {"version":3,"file":"S3Handler.js","sourceRoot":"","sources":["../../../src/webresource-handler/handlers/S3Handler.ts"],"names":[],"mappings":";;;;;;AAAA,0BAOY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AC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,WAAwB;QACjD,IAAI,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACtD,WAAW,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,WAAW,CAAC;IACpB,CAAC;IAEO,SAAS,CAAC,OAAe;QAChC,MAAM,OAAO,GAAG,IAAI,4BAAgB,CAAC;YACpC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,OAAO;SACZ,CAAC,CAAC;QACH,OAAO,IAAA,mCAAY,EAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE;YACzC,SAAS,EAAE,IAAI,CAAC,0BAA0B;SAC1C,CAAC,CAAC;IACJ,CAAC;IAEO,QAAQ,CAAC,GAAW;QAC3B,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;IACxD,CAAC;IAEO,cAAc,CAAC,IAAY;QAClC,MAAM,iBAAiB,GAAG,IAAA,iBAAa,EAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC;CACD;AA7GD,8BA6GC"}
@@ -1 +1,2 @@
1
1
  export * from './NoopHandler';
2
+ export * from './S3Handler';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./NoopHandler"), exports);
18
+ __exportStar(require("./S3Handler"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webresource-handler/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webresource-handler/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B"}
@@ -1,10 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  import type * as Express from 'express';
3
3
  import type * as stream from 'node:stream';
4
- import * as uriParser from '../sbvr-api/uri-parser';
5
- import * as sbvrUtils from '../sbvr-api/sbvr-utils';
6
4
  import type { WebResourceType as WebResource } from '@balena/sbvr-types';
7
- import type { AnyObject } from 'pinejs-client-core';
5
+ import { TypedError } from 'typed-error';
8
6
  export * from './handlers';
9
7
  export interface IncomingFile {
10
8
  fieldname: string;
@@ -17,42 +15,20 @@ export interface UploadResponse {
17
15
  size: number;
18
16
  filename: string;
19
17
  }
20
- export interface BeginMultipartUploadPayload {
21
- filename: string;
22
- content_type: string;
23
- size: number;
24
- chunk_size: number;
25
- }
26
- export interface UploadPart {
27
- url: string;
28
- chunkSize: number;
29
- partNumber: number;
30
- }
31
- export interface BeginMultipartUploadHandlerResponse {
32
- uploadParts: UploadPart[];
33
- fileKey: string;
34
- uploadId: string;
35
- }
36
- export interface CommitMultipartUploadPayload {
37
- fileKey: string;
38
- uploadId: string;
39
- filename: string;
40
- providerCommitData?: AnyObject;
41
- }
42
18
  export interface WebResourceHandler {
43
19
  handleFile: (resource: IncomingFile) => Promise<UploadResponse>;
44
20
  removeFile: (fileReference: string) => Promise<void>;
45
21
  onPreRespond: (webResource: WebResource) => Promise<WebResource>;
46
- beginMultipartUpload: (fieldName: string, payload: BeginMultipartUploadPayload) => Promise<BeginMultipartUploadHandlerResponse>;
47
- commitMultipartUpload: (commitInfo: CommitMultipartUploadPayload) => Promise<WebResource>;
22
+ }
23
+ export declare class WebResourceError extends TypedError {
24
+ }
25
+ export declare class FileSizeExceededError extends WebResourceError {
26
+ name: string;
27
+ constructor(maxSize: number);
48
28
  }
49
29
  export declare const setupWebresourceHandler: (handler: WebResourceHandler) => void;
50
30
  export declare const getWebresourceHandler: () => WebResourceHandler | undefined;
51
31
  export declare const getUploaderMiddlware: (handler: WebResourceHandler) => Express.RequestHandler;
52
- export declare const getWebResourceFields: (request: uriParser.ODataRequest, useTranslations?: boolean) => string[];
53
32
  export declare const normalizeHref: (href: string) => string;
54
33
  export declare const getDefaultHandler: () => WebResourceHandler;
55
34
  export declare const setupUploadHooks: (handler: WebResourceHandler, apiRoot: string, resourceName: string) => void;
56
- export declare const config: {
57
- models: sbvrUtils.ExecutableModel[];
58
- };
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.config = exports.setupUploadHooks = exports.getDefaultHandler = exports.normalizeHref = exports.getWebResourceFields = exports.getUploaderMiddlware = exports.getWebresourceHandler = exports.setupWebresourceHandler = void 0;
32
+ exports.setupUploadHooks = exports.getDefaultHandler = exports.normalizeHref = exports.getUploaderMiddlware = exports.getWebresourceHandler = exports.setupWebresourceHandler = exports.FileSizeExceededError = exports.WebResourceError = void 0;
33
33
  const busboy_1 = __importDefault(require("busboy"));
34
34
  const uriParser = __importStar(require("../sbvr-api/uri-parser"));
35
35
  const sbvrUtils = __importStar(require("../sbvr-api/sbvr-utils"));
@@ -38,11 +38,21 @@ const permissions_1 = require("../sbvr-api/permissions");
38
38
  const NoopHandler_1 = require("./handlers/NoopHandler");
39
39
  const odata_to_abstract_sql_1 = require("@balena/odata-to-abstract-sql");
40
40
  const module_1 = require("../server-glue/module");
41
- const multipartUpload_1 = require("./multipartUpload");
41
+ const typed_error_1 = require("typed-error");
42
42
  __exportStar(require("./handlers"), exports);
43
+ class WebResourceError extends typed_error_1.TypedError {
44
+ }
45
+ exports.WebResourceError = WebResourceError;
46
+ class FileSizeExceededError extends WebResourceError {
47
+ name = 'FileSizeExceededError';
48
+ constructor(maxSize) {
49
+ super(`File size exceeded the limit of ${maxSize} bytes.`);
50
+ }
51
+ }
52
+ exports.FileSizeExceededError = FileSizeExceededError;
43
53
  const getLogger = (vocab) => {
44
54
  if (vocab) {
45
- return sbvrUtils.api[vocab]?.logger ?? console;
55
+ return sbvrUtils.logger[vocab] ?? console;
46
56
  }
47
57
  return console;
48
58
  };
@@ -151,8 +161,11 @@ const getUploaderMiddlware = (handler) => {
151
161
  }
152
162
  catch (err) {
153
163
  await clearFiles();
154
- getLogger((0, sbvr_utils_1.getApiRoot)(req)).warn('Error uploading file', err);
155
- return sbvrUtils.handleHttpErrors(req, res, new module_1.errors.BadRequestError(err));
164
+ if (err instanceof FileSizeExceededError) {
165
+ return sbvrUtils.handleHttpErrors(req, res, new module_1.errors.BadRequestError(err.message));
166
+ }
167
+ getLogger((0, sbvr_utils_1.getApiRoot)(req)).error('Error uploading file', err);
168
+ next(err);
156
169
  }
157
170
  });
158
171
  bb.on('error', async (err) => {
@@ -175,15 +188,12 @@ const getWebResourceFields = (request, useTranslations = true) => {
175
188
  .filter((f) => f.dataType === 'WebResource')
176
189
  .map((f) => (0, odata_to_abstract_sql_1.sqlNameToODataName)(f.fieldName));
177
190
  };
178
- exports.getWebResourceFields = getWebResourceFields;
179
191
  const deleteFiles = async (keysToDelete, webResourceHandler) => {
180
192
  const promises = keysToDelete.map((r) => webResourceHandler.removeFile(r));
181
193
  await Promise.all(promises);
182
194
  };
183
195
  const throwIfWebresourceNotInMultipart = (webResourceFields, { req, request }) => {
184
- if (request.custom.isAction !== 'beginUpload' &&
185
- request.custom.isAction !== 'commitUpload' &&
186
- !req.is?.('multipart') &&
196
+ if (!req.is?.('multipart') &&
187
197
  webResourceFields.some((field) => request.values[field] != null)) {
188
198
  throw new module_1.errors.BadRequestError('Use multipart requests to upload a file.');
189
199
  }
@@ -191,7 +201,7 @@ const throwIfWebresourceNotInMultipart = (webResourceFields, { req, request }) =
191
201
  const getCreateWebResourceHooks = (webResourceHandler) => {
192
202
  return {
193
203
  PRERUN: (hookArgs) => {
194
- const webResourceFields = (0, exports.getWebResourceFields)(hookArgs.request);
204
+ const webResourceFields = getWebResourceFields(hookArgs.request);
195
205
  throwIfWebresourceNotInMultipart(webResourceFields, hookArgs);
196
206
  },
197
207
  'POSTRUN-ERROR': async ({ tx, request }) => {
@@ -221,7 +231,7 @@ const getRemoveWebResourceHooks = (webResourceHandler) => {
221
231
  return {
222
232
  PRERUN: async (args) => {
223
233
  const { api, request, tx } = args;
224
- let webResourceFields = (0, exports.getWebResourceFields)(request);
234
+ let webResourceFields = getWebResourceFields(request);
225
235
  throwIfWebresourceNotInMultipart(webResourceFields, args);
226
236
  tx.on('rollback', () => {
227
237
  void deleteRollbackPendingFields(request, webResourceHandler);
@@ -269,7 +279,7 @@ const getRemoveWebResourceHooks = (webResourceHandler) => {
269
279
  };
270
280
  };
271
281
  const deleteRollbackPendingFields = async (request, webResourceHandler) => {
272
- const fields = (0, exports.getWebResourceFields)(request);
282
+ const fields = getWebResourceFields(request);
273
283
  if (fields.length === 0) {
274
284
  return;
275
285
  }
@@ -292,17 +302,6 @@ const setupUploadHooks = (handler, apiRoot, resourceName) => {
292
302
  sbvrUtils.addPureHook('DELETE', apiRoot, resourceName, getRemoveWebResourceHooks(handler));
293
303
  sbvrUtils.addPureHook('PATCH', apiRoot, resourceName, getRemoveWebResourceHooks(handler));
294
304
  sbvrUtils.addPureHook('POST', apiRoot, resourceName, getCreateWebResourceHooks(handler));
295
- sbvrUtils.addPureHook('POST', apiRoot, resourceName, (0, multipartUpload_1.multipartUploadHooks)(handler));
296
305
  };
297
306
  exports.setupUploadHooks = setupUploadHooks;
298
- const webresourceModel = require('./webresource.sbvr');
299
- exports.config = {
300
- models: [
301
- {
302
- apiRoot: 'webresource',
303
- modelText: webresourceModel,
304
- modelName: 'webresource',
305
- },
306
- ],
307
- };
308
307
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webresource-handler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA4B;AAE5B,kEAAoD;AACpD,kEAAoD;AAEpD,uDAA8D;AAC9D,yDAA2D;AAC3D,wDAAqD;AACrD,yEAGuC;AACvC,kDAA4D;AAG5D,uDAAyD;AAEzD,6CAA2B;AA2D3B,MAAM,SAAS,GAAG,CAAC,KAAc,EAAW,EAAE;IAC7C,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,OAAO,CAAC;IAChD,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,IAAI,4BAA4D,CAAC;AAC1D,MAAM,uBAAuB,GAAG,CAAC,OAA2B,EAAQ,EAAE;IAC5E,4BAA4B,GAAG,OAAO,CAAC;AACxC,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC;AACK,MAAM,qBAAqB,GAAG,GAAmC,EAAE;IACzE,OAAO,4BAA4B,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAC9B,SAAiB,EACjB,GAAoB,EACD,EAAE;IACrB,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,GAAG,CAAC,CAAC;IAChC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,IAAA,qBAAQ,EAAC,OAAO,CAAC,CAAC;IAChC,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CA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CACpB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,yBAAyB,CAAC,OAAO,CAAC,CAClC,CAAC;IAEF,SAAS,CAAC,WAAW,CACpB,OAAO,EACP,OAAO,EACP,YAAY,EAEZ,yBAAyB,CAAC,OAAO,CAAC,CAClC,CAAC;IAEF,SAAS,CAAC,WAAW,CACpB,MAAM,EACN,OAAO,EACP,YAAY,EACZ,yBAAyB,CAAC,OAAO,CAAC,CAClC,CAAC;AACH,CAAC,CAAC;AA1BW,QAAA,gBAAgB,oBA0B3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/pinejs",
3
- "version": "17.0.0-build-large-file-uploads-293e65ee371a69130834c50fef2f7f42cc18133f-1",
3
+ "version": "17.0.0-build-17-x-74b0e8403edbd7922c684e3ce19bdb42ac41846b-1",
4
4
  "main": "out/server-glue/module",
5
5
  "type": "commonjs",
6
6
  "repository": "git@github.com:balena-io/pinejs.git",
@@ -20,55 +20,53 @@
20
20
  "webpack-build": "npm run webpack-browser && npm run webpack-module && npm run webpack-server",
21
21
  "lint": "balena-lint -t tsconfig.dev.json -e js -e ts src build typings Gruntfile.ts && npx tsc --project tsconfig.dev.json --noEmit",
22
22
  "test": "npm run lint && npm run build && npm run webpack-build && npm run test:compose",
23
- "test:compose": "trap 'docker compose -f docker-compose.npm-test.yml down ; echo Stopped ; exit 0' SIGINT; docker compose -f docker-compose.npm-test.yml up -d && sleep 2 && DATABASE_URL=postgres://docker:docker@localhost:5431/postgres PINEJS_WEBRESOURCE_MAXFILESIZE=1000000000 S3_ENDPOINT=http://localhost:43680 S3_ACCESS_KEY=USERNAME S3_SECRET_KEY=PASSWORD S3_STORAGE_ADAPTER_BUCKET=balena-pine-web-resources S3_REGION=us-east-1 npm run mocha",
23
+ "test:compose": "trap 'docker compose -f docker-compose.npm-test.yml down ; echo Stopped ; exit 0' INT; docker compose -f docker-compose.npm-test.yml up -d && sleep 2 && DATABASE_URL=postgres://docker:docker@localhost:5431/postgres PINEJS_WEBRESOURCE_MAXFILESIZE=1000000000 S3_ENDPOINT=http://localhost:43680 S3_ACCESS_KEY=USERNAME S3_SECRET_KEY=PASSWORD S3_STORAGE_ADAPTER_BUCKET=balena-pine-web-resources S3_REGION=us-east-1 npm run mocha",
24
24
  "mocha": "TS_NODE_FILES=true mocha",
25
25
  "prettify": "balena-lint -t tsconfig.dev.json -e js -e ts --fix src test build typings Gruntfile.ts"
26
26
  },
27
27
  "dependencies": {
28
- "@balena/abstract-sql-compiler": "^9.1.0",
29
- "@balena/abstract-sql-to-typescript": "^2.1.3",
30
- "@balena/env-parsing": "^1.1.10",
31
- "@balena/lf-to-abstract-sql": "^5.0.1",
32
- "@balena/odata-parser": "^3.0.3",
33
- "@balena/odata-to-abstract-sql": "^6.2.3",
34
- "@balena/sbvr-parser": "^1.4.3",
35
- "@balena/sbvr-types": "^7.0.1",
28
+ "@balena/abstract-sql-compiler": "^9.1.4",
29
+ "@balena/abstract-sql-to-typescript": "^3.0.2",
30
+ "@balena/env-parsing": "^1.1.12",
31
+ "@balena/lf-to-abstract-sql": "^5.0.2",
32
+ "@balena/odata-parser": "^3.0.7",
33
+ "@balena/odata-to-abstract-sql": "^6.2.7",
34
+ "@balena/sbvr-parser": "^1.4.4",
35
+ "@balena/sbvr-types": "^7.1.0",
36
36
  "@types/body-parser": "^1.19.5",
37
37
  "@types/compression": "^1.7.5",
38
- "@types/cookie-parser": "^1.4.6",
38
+ "@types/cookie-parser": "^1.4.7",
39
39
  "@types/deep-freeze": "^0.1.5",
40
40
  "@types/express": "^4.17.21",
41
- "@types/express-session": "^1.17.10",
42
- "@types/lodash": "^4.14.202",
41
+ "@types/express-session": "^1.18.0",
42
+ "@types/lodash": "^4.17.1",
43
43
  "@types/memoizee": "^0.4.11",
44
44
  "@types/method-override": "^0.0.35",
45
45
  "@types/multer": "^1.4.11",
46
- "@types/mysql": "^2.15.25",
47
- "@types/node": "^20.11.2",
46
+ "@types/mysql": "^2.15.26",
47
+ "@types/node": "^20.12.10",
48
48
  "@types/passport": "^1.0.16",
49
49
  "@types/passport-local": "^1.0.38",
50
50
  "@types/passport-strategy": "^0.2.38",
51
- "@types/pg": "^8.10.9",
52
- "@types/randomstring": "^1.1.11",
51
+ "@types/pg": "^8.11.6",
52
+ "@types/randomstring": "^1.3.0",
53
53
  "@types/websql": "^0.0.30",
54
54
  "busboy": "^1.6.0",
55
55
  "commander": "^11.1.0",
56
56
  "deep-freeze": "^0.0.1",
57
57
  "eventemitter3": "^5.0.1",
58
- "express-session": "^1.17.3",
58
+ "express-session": "^1.18.0",
59
59
  "lodash": "^4.17.21",
60
60
  "memoizee": "^0.4.15",
61
- "pinejs-client-core": "^6.14.0",
61
+ "pinejs-client-core": "^6.14.4",
62
62
  "randomstring": "^1.3.0",
63
63
  "typed-error": "^3.2.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@aws-sdk/client-s3": "^3.556.0",
67
- "@balena/lint": "^8.0.0",
68
- "@balena/pinejs-webresource-s3": "^0.2.0",
69
- "@faker-js/faker": "^8.3.1",
70
- "@types/busboy": "^1.5.3",
71
- "@types/chai": "^4.3.11",
66
+ "@balena/lint": "^8.0.2",
67
+ "@faker-js/faker": "^8.4.1",
68
+ "@types/busboy": "^1.5.4",
69
+ "@types/chai": "^4.3.16",
72
70
  "@types/chai-as-promised": "^7.1.8",
73
71
  "@types/grunt": "^0.4.31",
74
72
  "@types/mocha": "^10.0.6",
@@ -90,40 +88,43 @@
90
88
  "grunt-text-replace": "^0.4.0",
91
89
  "grunt-ts": "^6.0.0-beta.22",
92
90
  "grunt-webpack": "^6.0.0",
93
- "husky": "^9.0.0",
94
- "lint-staged": "^15.2.0",
91
+ "husky": "^9.0.11",
92
+ "lint-staged": "^15.2.2",
95
93
  "load-grunt-tasks": "^5.1.0",
96
- "mocha": "^10.2.0",
94
+ "mocha": "^10.4.0",
97
95
  "on-finished": "^2.4.1",
98
- "pinejs-client-supertest": "^2.0.2",
96
+ "pinejs-client-supertest": "^2.0.3",
99
97
  "raw-loader": "^4.0.2",
100
98
  "request": "^2.88.2",
101
99
  "require-npm4-to-publish": "^1.0.0",
102
- "supertest": "^6.3.4",
100
+ "supertest": "^7.0.0",
103
101
  "terser-webpack-plugin": "^5.3.10",
104
102
  "ts-loader": "^9.5.1",
105
103
  "ts-node": "^10.9.2",
106
- "typescript": "^5.3.3",
107
- "webpack": "^5.89.0",
108
- "webpack-dev-server": "^4.15.1"
104
+ "typescript": "^5.4.5",
105
+ "webpack": "^5.91.0",
106
+ "webpack-dev-server": "^4.15.2"
109
107
  },
110
108
  "optionalDependencies": {
109
+ "@aws-sdk/client-s3": "^3.569.0",
110
+ "@aws-sdk/lib-storage": "^3.569.0",
111
+ "@aws-sdk/s3-request-presigner": "^3.569.0",
111
112
  "bcrypt": "^5.1.1",
112
113
  "body-parser": "^1.20.2",
113
114
  "compression": "^1.7.4",
114
115
  "cookie-parser": "^1.4.6",
115
- "express": "^4.18.2",
116
+ "express": "^4.19.2",
116
117
  "method-override": "^3.0.0",
117
118
  "mysql": "^2.18.1",
118
119
  "passport": "^0.7.0",
119
120
  "passport-local": "^1.0.0",
120
- "pg": "^8.11.3",
121
- "pg-connection-string": "^2.6.2",
121
+ "pg": "^8.11.5",
122
+ "pg-connection-string": "^2.6.4",
122
123
  "serve-static": "^1.15.0"
123
124
  },
124
125
  "engines": {
125
- "node": ">=18.18.0",
126
- "npm": ">=8.0.0"
126
+ "node": ">=20.14.0",
127
+ "npm": ">=10.7.0"
127
128
  },
128
129
  "lint-staged": {
129
130
  "*.js": [
@@ -143,6 +144,6 @@
143
144
  "recursive": true
144
145
  },
145
146
  "versionist": {
146
- "publishedAt": "2024-04-19T22:33:51.238Z"
147
+ "publishedAt": "2024-06-04T15:19:23.285Z"
147
148
  }
148
149
  }
@@ -17,7 +17,7 @@ const runCompile = async (inputFile: string, outputFile?: string) => {
17
17
 
18
18
  const generateTypes = async (inputFile: string, outputFile?: string) => {
19
19
  const { abstractSqlToTypescriptTypes } = await import(
20
- '@balena/abstract-sql-to-typescript'
20
+ '@balena/abstract-sql-to-typescript/generate'
21
21
  );
22
22
  const abstractSql = getAbstractSqlModelFromFile(inputFile);
23
23
  const types = abstractSqlToTypescriptTypes(abstractSql);
@@ -42,7 +42,7 @@ const generateTypes = async (inputFile: string, outputFile?: string) => {
42
42
  program.opts().engine,
43
43
  );
44
44
  const { abstractSqlToTypescriptTypes } = await import(
45
- '@balena/abstract-sql-to-typescript'
45
+ '@balena/abstract-sql-to-typescript/generate'
46
46
  );
47
47
  const types = abstractSqlToTypescriptTypes(models.abstractSql);
48
48
 
@@ -61,7 +61,7 @@ export function setup(app, sbvrUtils) {
61
61
  sbvrUtils.addPureHook('PUT', modelName, 'all', {
62
62
  async PRERUN({ tx, request }) {
63
63
  const vocab = request.vocabulary;
64
- const { logger } = sbvrUtils.api[vocab];
64
+ const log = sbvrUtils.logger[vocab];
65
65
  const id = sbvrUtils.getID(vocab, request);
66
66
  let result;
67
67
  try {
@@ -77,7 +77,7 @@ SELECT NOT EXISTS(
77
77
  [request.resourceName, id],
78
78
  );
79
79
  } catch (/** @type any */ err) {
80
- logger.error('Unable to check resource locks', err);
80
+ log.error('Unable to check resource locks', err);
81
81
  throw new Error('Unable to check resource locks');
82
82
  }
83
83
  if ([false, 0, '0'].includes(result.rows[0].result)) {
@@ -28,7 +28,7 @@ import {
28
28
  import { booleanToEnabledString } from '../config-loader/env';
29
29
 
30
30
  // log the startup condition of the async migration
31
- (sbvrUtils.api?.migrations?.logger.info ?? console.info)(
31
+ (sbvrUtils.logger?.migrations?.info ?? console.info)(
32
32
  `Async migration execution is ${booleanToEnabledString(
33
33
  migratorEnv.asyncMigrationIsEnabled,
34
34
  )}`,
@@ -153,7 +153,7 @@ const $run = async (
153
153
  (await tx.executeSql(asyncMigrationSqlStatement)).rowsAffected;
154
154
  } else {
155
155
  // don't break the async migration b/c of one migration fails
156
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
156
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
157
157
  `Invalid migration object: ${JSON.stringify(migration, null, 2)}`,
158
158
  );
159
159
  continue;
@@ -170,7 +170,7 @@ const $run = async (
170
170
  asyncRunnerMigratorFn = async (tx: Tx) =>
171
171
  (await tx.executeSql(migration)).rowsAffected;
172
172
  } else {
173
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
173
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
174
174
  `Invalid async migration object: ${JSON.stringify(migration, null, 2)}`,
175
175
  );
176
176
  continue;
@@ -210,7 +210,7 @@ const $run = async (
210
210
  if (!migrationState) {
211
211
  // migration status is unclear stop the migrator
212
212
  // or migration should stop
213
- (sbvrUtils.api.migrations?.logger.info ?? console.info)(
213
+ (sbvrUtils.logger.migrations?.info ?? console.info)(
214
214
  `stopping async migration due to missing migration status: ${key}`,
215
215
  );
216
216
  return false;
@@ -246,7 +246,7 @@ const $run = async (
246
246
  }
247
247
  } catch (err) {
248
248
  (
249
- sbvrUtils.api.migrations?.logger.error ??
249
+ sbvrUtils.logger.migrations?.error ??
250
250
  console.error
251
251
  )(
252
252
  `error rolling back pending async migration tx on mgmt tx end/rollback: ${key}: ${err}`,
@@ -280,14 +280,13 @@ const $run = async (
280
280
  initMigrationState.errorThreshold ===
281
281
  0
282
282
  ) {
283
- (
284
- sbvrUtils.api.migrations?.logger.error ??
285
- console.error
286
- )(`${key}: ${err.name} ${err.message}`);
283
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
284
+ `${key}: ${err.name} ${err.message}`,
285
+ );
287
286
  migrationState.is_backing_off = true;
288
287
  }
289
288
  } else {
290
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
289
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
291
290
  `async migration error unknown: ${key}: ${err}`,
292
291
  );
293
292
  }
@@ -312,7 +311,7 @@ const $run = async (
312
311
  setTimeout(asyncRunner, initMigrationState.delayMS);
313
312
  }
314
313
  } catch (err) {
315
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
314
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
316
315
  `error running async migration: ${key}: ${err}`,
317
316
  );
318
317
  setTimeout(asyncRunner, initMigrationState.backoffDelayMS);
@@ -29,7 +29,7 @@ export const postRun = async (tx: Tx, model: ApiRootModel): Promise<void> => {
29
29
  const modelName = model.apiRoot;
30
30
  const modelIsNew = await sbvrUtils.isModelNew(tx, modelName);
31
31
  if (modelIsNew) {
32
- (sbvrUtils.api.migrations?.logger.info ?? console.info)(
32
+ (sbvrUtils.logger.migrations?.info ?? console.info)(
33
33
  `First time executing '${modelName}', running init script`,
34
34
  );
35
35
 
@@ -37,7 +37,7 @@ export const postRun = async (tx: Tx, model: ApiRootModel): Promise<void> => {
37
37
  try {
38
38
  await tx.executeSql(initSql);
39
39
  } catch (err: any) {
40
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
40
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
41
41
  `initSql execution error ${err} `,
42
42
  );
43
43
  throw new MigrationError(err);
@@ -69,7 +69,7 @@ const $run = async (
69
69
  // to make changes that can't be automatically applied
70
70
  const modelIsNew = await sbvrUtils.isModelNew(tx, modelName);
71
71
  if (modelIsNew) {
72
- (sbvrUtils.api.migrations?.logger.info ?? console.info)(
72
+ (sbvrUtils.logger.migrations?.info ?? console.info)(
73
73
  `First time model '${modelName}' has executed, skipping migrations`,
74
74
  );
75
75
  return await setExecutedMigrations(tx, modelName, Object.keys(migrations));
@@ -94,7 +94,7 @@ const $run = async (
94
94
  ...newlyExecutedMigrations,
95
95
  ]);
96
96
  } catch (err: any) {
97
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
97
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
98
98
  `Failed to executed synchronous migrations from api root model ${err}`,
99
99
  );
100
100
  throw new MigrationError(err);
@@ -111,7 +111,7 @@ const executeMigrations = async (
111
111
  await executeMigration(tx, migration);
112
112
  }
113
113
  } catch (err: any) {
114
- (sbvrUtils.api.migrations?.logger.error ?? console.error)(
114
+ (sbvrUtils.logger.migrations?.error ?? console.error)(
115
115
  'Error while executing migrations, rolled back',
116
116
  );
117
117
  throw new MigrationError(err);
@@ -123,7 +123,7 @@ const executeMigration = async (
123
123
  tx: Tx,
124
124
  [key, migration]: MigrationTuple,
125
125
  ): Promise<void> => {
126
- (sbvrUtils.api.migrations?.logger.info ?? console.info)(
126
+ (sbvrUtils.logger.migrations?.info ?? console.info)(
127
127
  `Running migration ${JSON.stringify(key)}`,
128
128
  );
129
129
 
@@ -49,7 +49,7 @@ export const compileRequest = (request: ODataRequest) => {
49
49
  request.sqlQuery = sqlQuery;
50
50
  request.modifiedFields = modifiedFields;
51
51
  } catch (err: any) {
52
- sbvrUtils.api[request.vocabulary].logger.error(
52
+ sbvrUtils.logger[request.vocabulary].error(
53
53
  'Failed to compile abstract sql: ',
54
54
  request.abstractSqlQuery,
55
55
  err,
@@ -1268,7 +1268,7 @@ export const getUserPermissions = async (
1268
1268
  try {
1269
1269
  return await $getUserPermissions(userId, tx);
1270
1270
  } catch (err: any) {
1271
- sbvrUtils.api.Auth.logger.error('Error loading user permissions', err);
1271
+ sbvrUtils.logger.Auth.error('Error loading user permissions', err);
1272
1272
  throw err;
1273
1273
  }
1274
1274
  };
@@ -1396,7 +1396,7 @@ export const getApiKeyPermissions = async (
1396
1396
  try {
1397
1397
  return await $getApiKeyPermissions(apiKey, tx);
1398
1398
  } catch (err: any) {
1399
- sbvrUtils.api.Auth.logger.error('Error loading api key permissions', err);
1399
+ sbvrUtils.logger.Auth.error('Error loading api key permissions', err);
1400
1400
  throw err;
1401
1401
  }
1402
1402
  };
@@ -1577,7 +1577,7 @@ export const checkPermissionsMiddleware =
1577
1577
  );
1578
1578
  }
1579
1579
  } catch (err: any) {
1580
- sbvrUtils.api.Auth.logger.error('Error checking permissions', err);
1580
+ sbvrUtils.logger.Auth.error('Error checking permissions', err);
1581
1581
  res.status(503).end();
1582
1582
  }
1583
1583
  };