@clairejs/server 3.16.16 → 3.16.18

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
@@ -1,7 +1,9 @@
1
1
  ## Change Log
2
2
 
3
- #### 3.16.16:
3
+ #### 3.16.18:
4
4
 
5
+ - allow file service to resolve empty uri to empty string
6
+ - fix job param type from any[] to any
5
7
  - fix CRUD order
6
8
  - fix Job repo
7
9
  - fix AbstractJob
@@ -37,12 +37,12 @@ export interface CustomJobInfo {
37
37
  id?: string;
38
38
  jobName: string;
39
39
  at: number;
40
- params?: any[];
40
+ params?: any;
41
41
  }
42
42
  export interface JobInfo {
43
43
  id?: string;
44
44
  jobName: string;
45
- params?: any[];
45
+ params?: any;
46
46
  at?: number;
47
47
  interval?: JobInterval;
48
48
  cron?: string;
package/dist/job/job.d.ts CHANGED
@@ -3,5 +3,5 @@ import { CustomJobInfo } from "./interfaces";
3
3
  export declare abstract class AbstractJob extends AbstractModel implements CustomJobInfo {
4
4
  jobName: string;
5
5
  at: number;
6
- params?: any[];
6
+ params?: any;
7
7
  }
package/dist/job/job.js CHANGED
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { AbstractModel, Column, DataType } from "@clairejs/core";
10
+ import { AbstractModel, Column } from "@clairejs/core";
11
11
  export class AbstractJob extends AbstractModel {
12
12
  jobName;
13
13
  at;
@@ -31,7 +31,6 @@ __decorate([
31
31
  __decorate([
32
32
  Column({
33
33
  description: "The associated params with this job",
34
- vectorProps: { elementDataType: DataType.OBJECT },
35
34
  }),
36
- __metadata("design:type", Array)
35
+ __metadata("design:type", Object)
37
36
  ], AbstractJob.prototype, "params", void 0);
@@ -2,7 +2,7 @@ import { FileOperation } from "../common/FileOperation";
2
2
  import { GetUploadUrlResponseBody } from "../controllers/dto/upload";
3
3
  export declare abstract class AbstractFileService {
4
4
  abstract getFileSize(objectKeys: string[]): Promise<number[]>;
5
- abstract getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
5
+ abstract getAccessUrls(uris: (string | undefined)[], isPublic: boolean): Promise<string[]>;
6
6
  abstract getPresignedUrl(operation: FileOperation, uris: string[]): Promise<string[]>;
7
7
  abstract moveObject(uris: {
8
8
  fromURI: string;
@@ -4,7 +4,7 @@ export declare class LocalFileService extends AbstractFileService {
4
4
  protected readonly fileServerUrl: string;
5
5
  constructor(fileServerUrl: string);
6
6
  getFileSize(objectKeys: string[]): Promise<number[]>;
7
- getAccessUrls(uris: string[], _isPublic: boolean): Promise<string[]>;
7
+ getAccessUrls(uris: (string | undefined)[], _isPublic: boolean): Promise<string[]>;
8
8
  getPresignedUrl(operation: FileOperation, uris: string[]): Promise<string[]>;
9
9
  moveObject(uris: {
10
10
  fromURI: string;
@@ -15,7 +15,7 @@ export class LocalFileService extends AbstractFileService {
15
15
  return fileInfo;
16
16
  }
17
17
  async getAccessUrls(uris, _isPublic) {
18
- return uris.map((key) => `${this.fileServerUrl}/${key}`);
18
+ return uris.map((key) => (key ? `${this.fileServerUrl}/${key}` : ""));
19
19
  }
20
20
  async getPresignedUrl(operation, uris) {
21
21
  if (operation === FileOperation.GET) {
@@ -16,7 +16,7 @@ export declare class S3FileService extends AbstractFileService {
16
16
  private readonly cloudfrontSigner;
17
17
  constructor(config: S3FileServiceConfig, logger: AbstractLogger);
18
18
  getFileSize(objectKeys: string[]): Promise<number[]>;
19
- getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
19
+ getAccessUrls(uris: (string | undefined)[], isPublic: boolean): Promise<string[]>;
20
20
  getPresignedUrl(operation: FileOperation, uris: string[]): Promise<string[]>;
21
21
  moveObject(uris: {
22
22
  fromURI: string;
@@ -30,7 +30,7 @@ let S3FileService = class S3FileService extends AbstractFileService {
30
30
  return await Promise.all(objectKeys.map((uri) => this.getSingleFileSize(uri)));
31
31
  }
32
32
  async getAccessUrls(uris, isPublic) {
33
- return uris.map((uri) => this.getSingleAccessUrl(uri, isPublic));
33
+ return uris.map((uri) => (uri ? this.getSingleAccessUrl(uri, isPublic) : ""));
34
34
  }
35
35
  async getPresignedUrl(operation, uris) {
36
36
  return uris.map((uri) => this.getSinglePresignedUrl(operation, uri));
@@ -54,7 +54,7 @@ let S3FileService = class S3FileService extends AbstractFileService {
54
54
  getSinglePresignedUrl(_operation, objectKey) {
55
55
  return this.cloudfrontSigner.getSignedUrl({
56
56
  url: `${this.config.CLOUD_FRONT_PUBLIC_DOMAIN}/${objectKey}`,
57
- expires: Date.now() + this.config.PRESIGNED_URL_EXPIRATION_S * 1000
57
+ expires: Date.now() + this.config.PRESIGNED_URL_EXPIRATION_S * 1000,
58
58
  });
59
59
  }
60
60
  async copySingleObject(fromObjectKey, toObjectKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/server",
3
- "version": "3.16.16",
3
+ "version": "3.16.18",
4
4
  "description": "Claire server NodeJs framework written in Typescript.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",