@balena/pinejs 15.6.0 → 15.6.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 (39) hide show
  1. package/.pinejs-cache.json +1 -1
  2. package/.versionbot/CHANGELOG.yml +13 -1
  3. package/CHANGELOG.md +5 -0
  4. package/VERSION +1 -1
  5. package/out/config-loader/config-loader.d.ts +3 -3
  6. package/out/migrator/sync.d.ts +1 -1
  7. package/out/odata-metadata/odata-metadata-generator.js.map +1 -1
  8. package/out/passport-pinejs/mount-login-router.d.ts +1 -1
  9. package/out/sbvr-api/abstract-sql.d.ts +2 -2
  10. package/out/sbvr-api/common-types.d.ts +1 -1
  11. package/out/sbvr-api/hooks.d.ts +1 -1
  12. package/out/sbvr-api/odata-response.d.ts +1 -1
  13. package/out/sbvr-api/odata-response.js.map +1 -1
  14. package/out/sbvr-api/permissions.d.ts +2 -2
  15. package/out/sbvr-api/permissions.js.map +1 -1
  16. package/out/sbvr-api/sbvr-utils.d.ts +5 -5
  17. package/out/sbvr-api/sbvr-utils.js.map +1 -1
  18. package/out/sbvr-api/translations.d.ts +2 -2
  19. package/out/server-glue/module.d.ts +1 -1
  20. package/out/webresource-handler/handlers/NoopHandler.d.ts +1 -1
  21. package/out/webresource-handler/handlers/S3Handler.d.ts +1 -1
  22. package/out/webresource-handler/index.d.ts +1 -1
  23. package/package.json +2 -2
  24. package/src/config-loader/config-loader.ts +4 -4
  25. package/src/migrator/async.ts +4 -4
  26. package/src/migrator/sync.ts +3 -3
  27. package/src/odata-metadata/odata-metadata-generator.ts +1 -1
  28. package/src/passport-pinejs/mount-login-router.ts +1 -1
  29. package/src/sbvr-api/abstract-sql.ts +2 -2
  30. package/src/sbvr-api/common-types.ts +1 -1
  31. package/src/sbvr-api/hooks.ts +4 -4
  32. package/src/sbvr-api/odata-response.ts +1 -1
  33. package/src/sbvr-api/permissions.ts +3 -3
  34. package/src/sbvr-api/sbvr-utils.ts +13 -13
  35. package/src/sbvr-api/translations.ts +2 -2
  36. package/src/server-glue/module.ts +1 -1
  37. package/src/webresource-handler/handlers/NoopHandler.ts +1 -1
  38. package/src/webresource-handler/handlers/S3Handler.ts +5 -5
  39. package/src/webresource-handler/index.ts +1 -1
@@ -1,5 +1,5 @@
1
- import { AbstractSqlModel, ReferencedFieldNode, Definition, SelectQueryNode, NumberTypeNodes, BooleanTypeNodes, UnknownTypeNodes, NullNode } from '@balena/abstract-sql-compiler';
2
- import { Dictionary } from './common-types';
1
+ import type { AbstractSqlModel, ReferencedFieldNode, Definition, SelectQueryNode, NumberTypeNodes, BooleanTypeNodes, UnknownTypeNodes, NullNode } from '@balena/abstract-sql-compiler';
2
+ import type { Dictionary } from './common-types';
3
3
  export type AliasValidNodeType = ReferencedFieldNode | SelectQueryNode | NumberTypeNodes | BooleanTypeNodes | UnknownTypeNodes | NullNode;
4
4
  export declare const translateAbstractSqlModel: (fromAbstractSqlModel: AbstractSqlModel, toAbstractSqlModel: AbstractSqlModel, fromVersion: string, toVersion: string, translationDefinitions?: Dictionary<(Definition & {
5
5
  $toResource?: string;
@@ -3,7 +3,7 @@ import type * as Express from 'express';
3
3
  import './sbvr-loader';
4
4
  import * as dbModule from '../database-layer/db';
5
5
  import * as configLoader from '../config-loader/config-loader';
6
- import * as migratorUtils from '../migrator/utils';
6
+ import type * as migratorUtils from '../migrator/utils';
7
7
  export * as dbModule from '../database-layer/db';
8
8
  export { PinejsSessionStore } from '../pinejs-session-store/pinejs-session-store';
9
9
  export { mountLoginRouter } from '../passport-pinejs/mount-login-router';
@@ -1,5 +1,5 @@
1
1
  import type { WebResourceType as WebResource } from '@balena/sbvr-types';
2
- import { IncomingFile, UploadResponse, WebResourceHandler } from '..';
2
+ import type { IncomingFile, UploadResponse, WebResourceHandler } from '..';
3
3
  export declare class NoopHandler implements WebResourceHandler {
4
4
  handleFile(resource: IncomingFile): Promise<UploadResponse>;
5
5
  removeFile(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { IncomingFile, UploadResponse, WebResourceHandler } from '..';
1
+ import { type IncomingFile, type UploadResponse, type WebResourceHandler } from '..';
2
2
  import type { WebResourceType as WebResource } from '@balena/sbvr-types';
3
3
  export interface S3HandlerProps {
4
4
  region: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type * as Express from 'express';
3
- import * as stream from 'stream';
3
+ import type * as stream from 'node:stream';
4
4
  import type { WebResourceType as WebResource } from '@balena/sbvr-types';
5
5
  import { TypedError } from 'typed-error';
6
6
  export * from './handlers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/pinejs",
3
- "version": "15.6.0",
3
+ "version": "15.6.1",
4
4
  "main": "out/server-glue/module",
5
5
  "type": "commonjs",
6
6
  "repository": "git@github.com:balena-io/pinejs.git",
@@ -144,6 +144,6 @@
144
144
  "recursive": true
145
145
  },
146
146
  "versionist": {
147
- "publishedAt": "2024-01-24T10:46:39.628Z"
147
+ "publishedAt": "2024-02-04T02:21:37.152Z"
148
148
  }
149
149
  }
@@ -12,8 +12,8 @@ import type {
12
12
  } from '../sbvr-api/common-types';
13
13
 
14
14
  import {
15
- Migration,
16
- Migrations,
15
+ type Migration,
16
+ type Migrations,
17
17
  defaultMigrationCategory,
18
18
  MigrationCategories,
19
19
  isSyncMigration,
@@ -30,11 +30,11 @@ import * as permissions from '../sbvr-api/permissions';
30
30
  import {
31
31
  getDefaultHandler,
32
32
  getUploaderMiddlware,
33
- WebResourceHandler,
33
+ type WebResourceHandler,
34
34
  setupUploadHooks,
35
35
  setupWebresourceHandler,
36
36
  } from '../webresource-handler';
37
- import { AliasValidNodeType } from '../sbvr-api/translations';
37
+ import type { AliasValidNodeType } from '../sbvr-api/translations';
38
38
 
39
39
  export type SetupFunction = (
40
40
  app: Express.Application,
@@ -12,18 +12,18 @@ type InitialMigrationStatus = MigrationStatus &
12
12
  >;
13
13
 
14
14
  import {
15
- MigrationTuple,
15
+ type MigrationTuple,
16
16
  getExecutedMigrations,
17
17
  migratorEnv,
18
18
  lockMigrations,
19
19
  initMigrationStatus,
20
20
  readMigrationStatus,
21
21
  updateMigrationStatus,
22
- RunnableAsyncMigrations,
22
+ type RunnableAsyncMigrations,
23
23
  getRunnableAsyncMigrations,
24
24
  filterAndSortPendingMigrations,
25
- MigrationStatus,
26
- BaseAsyncMigration,
25
+ type MigrationStatus,
26
+ type BaseAsyncMigration,
27
27
  } from './utils';
28
28
  import { booleanToEnabledString } from '../config-loader/env';
29
29
 
@@ -1,11 +1,11 @@
1
1
  import {
2
- MigrationTuple,
2
+ type MigrationTuple,
3
3
  MigrationError,
4
- MigrationExecutionResult,
4
+ type MigrationExecutionResult,
5
5
  setExecutedMigrations,
6
6
  getExecutedMigrations,
7
7
  lockMigrations,
8
- RunnableMigrations,
8
+ type RunnableMigrations,
9
9
  filterAndSortPendingMigrations,
10
10
  getRunnableSyncMigrations,
11
11
  } from './utils';
@@ -3,7 +3,7 @@ import type {
3
3
  AbstractSqlTable,
4
4
  } from '@balena/abstract-sql-compiler';
5
5
 
6
- import sbvrTypes, { SbvrType } from '@balena/sbvr-types';
6
+ import sbvrTypes, { type SbvrType } from '@balena/sbvr-types';
7
7
 
8
8
  // eslint-disable-next-line @typescript-eslint/no-var-requires
9
9
  const { version }: { version: string } = require('../../package.json');
@@ -1,7 +1,7 @@
1
1
  import * as passportPinejs from './passport-pinejs';
2
2
  import type { Express } from 'express';
3
3
  import { PinejsSessionStore } from '../pinejs-session-store/pinejs-session-store';
4
- import { setup } from '../config-loader/config-loader';
4
+ import type { setup } from '../config-loader/config-loader';
5
5
 
6
6
  export const mountLoginRouter = async (
7
7
  configLoader: ReturnType<typeof setup>,
@@ -3,7 +3,7 @@ import _ from 'lodash';
3
3
  import * as AbstractSQLCompiler from '@balena/abstract-sql-compiler';
4
4
  import type { BindKey } from '@balena/odata-parser';
5
5
  import {
6
- ODataBinds,
6
+ type ODataBinds,
7
7
  odataNameToSqlName,
8
8
  isBindReference,
9
9
  } from '@balena/odata-to-abstract-sql';
@@ -12,7 +12,7 @@ import memoize from 'memoizee';
12
12
  import * as env from '../config-loader/env';
13
13
  import { BadRequestError, SqlCompilationError } from './errors';
14
14
  import * as sbvrUtils from './sbvr-utils';
15
- import { ODataRequest } from './uri-parser';
15
+ import type { ODataRequest } from './uri-parser';
16
16
 
17
17
  const getMemoizedCompileRule = memoize(
18
18
  (engine: AbstractSQLCompiler.Engines) =>
@@ -1,4 +1,4 @@
1
- export { AnyObject, Dictionary } from 'pinejs-client-core';
1
+ export type { AnyObject, Dictionary } from 'pinejs-client-core';
2
2
 
3
3
  type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
4
4
  export type RequiredField<T, F extends keyof T> = Overwrite<
@@ -9,13 +9,13 @@ import _ from 'lodash';
9
9
  import { settleMapSeries } from './control-flow';
10
10
  import memoize from 'memoizee';
11
11
  import {
12
- PinejsClient,
13
- User,
14
- ApiKey,
12
+ type PinejsClient,
13
+ type User,
14
+ type ApiKey,
15
15
  resolveSynonym,
16
16
  getAbstractSqlModel,
17
17
  api,
18
- Response,
18
+ type Response,
19
19
  } from './sbvr-utils';
20
20
 
21
21
  export interface HookReq {
@@ -21,7 +21,7 @@ declare module '@balena/abstract-sql-compiler' {
21
21
  import type { Result, Row } from '../database-layer/db';
22
22
 
23
23
  import { sqlNameToODataName } from '@balena/odata-to-abstract-sql';
24
- import sbvrTypes, { SbvrType } from '@balena/sbvr-types';
24
+ import sbvrTypes, { type SbvrType } from '@balena/sbvr-types';
25
25
  import _ from 'lodash';
26
26
  import { resolveNavigationResource, resolveSynonym } from './sbvr-utils';
27
27
  import { getWebresourceHandler } from '../webresource-handler';
@@ -28,7 +28,7 @@ import {
28
28
  isBindReference,
29
29
  type OData2AbstractSQL,
30
30
  odataNameToSqlName,
31
- ResourceFunction,
31
+ type ResourceFunction,
32
32
  sqlNameToODataName,
33
33
  } from '@balena/odata-to-abstract-sql';
34
34
  import * as ODataParser from '@balena/odata-parser';
@@ -38,7 +38,7 @@ import memoize from 'memoizee';
38
38
  import * as randomstring from 'randomstring';
39
39
  import * as env from '../config-loader/env';
40
40
  import * as sbvrUtils from '../sbvr-api/sbvr-utils';
41
- import { HookReq, addPureHook, addHook } from './hooks';
41
+ import { type HookReq, addPureHook, addHook } from './hooks';
42
42
  import {
43
43
  BadRequestError,
44
44
  PermissionError,
@@ -48,7 +48,7 @@ import {
48
48
  memoizedGetOData2AbstractSQL,
49
49
  memoizedParseOdata,
50
50
  metadataEndpoints,
51
- ODataRequest,
51
+ type ODataRequest,
52
52
  } from './uri-parser';
53
53
  import memoizeWeak = require('memoizee/weak');
54
54
 
@@ -16,7 +16,7 @@ declare global {
16
16
 
17
17
  import _ from 'lodash';
18
18
 
19
- import { TypedError } from 'typed-error';
19
+ import type { TypedError } from 'typed-error';
20
20
  import { cachedCompile } from './cached-compile';
21
21
 
22
22
  type LFModel = any[];
@@ -25,14 +25,14 @@ import { version as AbstractSQLCompilerVersion } from '@balena/abstract-sql-comp
25
25
  import * as LF2AbstractSQL from '@balena/lf-to-abstract-sql';
26
26
 
27
27
  import {
28
- ODataBinds,
28
+ type ODataBinds,
29
29
  odataNameToSqlName,
30
30
  sqlNameToODataName,
31
- SupportedMethod,
31
+ type SupportedMethod,
32
32
  } from '@balena/odata-to-abstract-sql';
33
33
  import sbvrTypes from '@balena/sbvr-types';
34
34
  import deepFreeze = require('deep-freeze');
35
- import { PinejsClientCore, PromiseResultTypes } from 'pinejs-client-core';
35
+ import { PinejsClientCore, type PromiseResultTypes } from 'pinejs-client-core';
36
36
 
37
37
  import { ExtendedSBVRParser } from '../extended-sbvr-parser/extended-sbvr-parser';
38
38
 
@@ -60,20 +60,20 @@ import {
60
60
  UnauthorizedError,
61
61
  } from './errors';
62
62
  import * as uriParser from './uri-parser';
63
- export { ODataRequest } from './uri-parser';
63
+ export type { ODataRequest } from './uri-parser';
64
64
  import {
65
- HookReq,
66
- HookArgs,
65
+ type HookReq,
66
+ type HookArgs,
67
67
  rollbackRequestHooks,
68
68
  getHooks,
69
69
  runHooks,
70
- InstantiatedHooks,
70
+ type InstantiatedHooks,
71
71
  } from './hooks';
72
72
  export {
73
- HookReq,
74
- HookArgs,
75
- HookResponse,
76
- Hooks,
73
+ type HookReq,
74
+ type HookArgs,
75
+ type HookResponse,
76
+ type Hooks,
77
77
  addPureHook,
78
78
  addSideEffectHook,
79
79
  } from './hooks';
@@ -97,7 +97,7 @@ import * as odataResponse from './odata-response';
97
97
  import { env } from '../server-glue/module';
98
98
  import { translateAbstractSqlModel } from './translations';
99
99
  import {
100
- MigrationExecutionResult,
100
+ type MigrationExecutionResult,
101
101
  setExecutedMigrations,
102
102
  } from '../migrator/utils';
103
103
 
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import {
2
+ import type {
3
3
  AbstractSqlModel,
4
4
  Relationship,
5
5
  ReferencedFieldNode,
@@ -14,7 +14,7 @@ import {
14
14
  UnknownTypeNodes,
15
15
  NullNode,
16
16
  } from '@balena/abstract-sql-compiler';
17
- import { Dictionary } from './common-types';
17
+ import type { Dictionary } from './common-types';
18
18
 
19
19
  export type AliasValidNodeType =
20
20
  | ReferencedFieldNode
@@ -5,7 +5,7 @@ import './sbvr-loader';
5
5
  import * as dbModule from '../database-layer/db';
6
6
  import * as configLoader from '../config-loader/config-loader';
7
7
  import * as migrator from '../migrator/sync';
8
- import * as migratorUtils from '../migrator/utils';
8
+ import type * as migratorUtils from '../migrator/utils';
9
9
 
10
10
  import * as sbvrUtils from '../sbvr-api/sbvr-utils';
11
11
  import { PINEJS_ADVISORY_LOCK } from '../config-loader/env';
@@ -1,5 +1,5 @@
1
1
  import type { WebResourceType as WebResource } from '@balena/sbvr-types';
2
- import { IncomingFile, UploadResponse, WebResourceHandler } from '..';
2
+ import type { IncomingFile, UploadResponse, WebResourceHandler } from '..';
3
3
 
4
4
  export class NoopHandler implements WebResourceHandler {
5
5
  public async handleFile(resource: IncomingFile): Promise<UploadResponse> {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  FileSizeExceededError,
3
- IncomingFile,
3
+ type IncomingFile,
4
4
  normalizeHref,
5
- UploadResponse,
5
+ type UploadResponse,
6
6
  WebResourceError,
7
- WebResourceHandler,
7
+ type WebResourceHandler,
8
8
  } from '..';
9
9
  import {
10
10
  S3Client,
11
- S3ClientConfig,
11
+ type S3ClientConfig,
12
12
  DeleteObjectCommand,
13
- PutObjectCommandInput,
13
+ type PutObjectCommandInput,
14
14
  GetObjectCommand,
15
15
  } from '@aws-sdk/client-s3';
16
16
  import { Upload } from '@aws-sdk/lib-storage';
@@ -1,6 +1,6 @@
1
1
  import type * as Express from 'express';
2
2
  import busboy from 'busboy';
3
- import * as stream from 'stream';
3
+ import type * as stream from 'node:stream';
4
4
  import * as uriParser from '../sbvr-api/uri-parser';
5
5
  import * as sbvrUtils from '../sbvr-api/sbvr-utils';
6
6
  import type { HookArgs } from '../sbvr-api/hooks';