@cumulus/db 18.0.0 → 18.1.0

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.
@@ -0,0 +1,4 @@
1
+ import { Knex } from 'knex';
2
+ export declare const up: (knex: Knex) => Promise<void>;
3
+ export declare const down: (knex: Knex) => Promise<void>;
4
+ //# sourceMappingURL=20230915150154_add_max_download_time_providers.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.down = exports.up = void 0;
4
+ const up = async (knex) => await knex.schema.table('providers', (table) => {
5
+ table
6
+ .integer('max_download_time')
7
+ .comment('Maximum download time in seconds for all granule files on a sync granule task');
8
+ });
9
+ exports.up = up;
10
+ const down = async (knex) => {
11
+ if (await knex.schema.hasColumn('providers', 'max_download_time')) {
12
+ await knex.schema.table('providers', (table) => {
13
+ table.dropColumn('max_download_time');
14
+ });
15
+ }
16
+ };
17
+ exports.down = down;
18
+ //# sourceMappingURL=20230915150154_add_max_download_time_providers.js.map
package/dist/provider.js CHANGED
@@ -23,6 +23,7 @@ const nullifyUndefinedProviderValues = (data) => {
23
23
  'username',
24
24
  'password',
25
25
  'global_connection_limit',
26
+ 'max_download_time',
26
27
  'private_key',
27
28
  'cm_key_id',
28
29
  'certificate_uri',
@@ -9,7 +9,7 @@ export declare const translatePostgresCollectionToApiCollection: (collectionReco
9
9
  /**
10
10
  * Translates a NewCollectionRecord API collection object to a `PostgresCollectionRecord` object
11
11
  * @param {NewCollectionRecord} record - API collection record to translate
12
- * @returns {PostgresCollectionRecord} - Translated record
12
+ * @returns {PostgresCollection} - Translated record
13
13
  */
14
14
  export declare const translateApiCollectionToPostgresCollection: (record: NewCollectionRecord) => PostgresCollection;
15
15
  //# sourceMappingURL=collections.d.ts.map
@@ -28,7 +28,7 @@ exports.translatePostgresCollectionToApiCollection = translatePostgresCollection
28
28
  /**
29
29
  * Translates a NewCollectionRecord API collection object to a `PostgresCollectionRecord` object
30
30
  * @param {NewCollectionRecord} record - API collection record to translate
31
- * @returns {PostgresCollectionRecord} - Translated record
31
+ * @returns {PostgresCollection} - Translated record
32
32
  */
33
33
  const translateApiCollectionToPostgresCollection = (record) => {
34
34
  // Map old record to new schema.
@@ -16,6 +16,7 @@ const translatePostgresProviderToApiProvider = (record) => {
16
16
  certificateUri: record.certificate_uri,
17
17
  privateKey: record.private_key,
18
18
  globalConnectionLimit: record.global_connection_limit,
19
+ maxDownloadTime: record.max_download_time,
19
20
  port: record.port,
20
21
  host: record.host,
21
22
  protocol: record.protocol,
@@ -55,6 +56,7 @@ const translateApiProviderToPostgresProvider = async (record, encryptMethod = ex
55
56
  certificate_uri: record.certificateUri,
56
57
  private_key: record.privateKey,
57
58
  global_connection_limit: record.globalConnectionLimit,
59
+ max_download_time: record.maxDownloadTime,
58
60
  port: record.port,
59
61
  host: record.host,
60
62
  protocol: record.protocol,
@@ -30,7 +30,7 @@ const translatePostgresRuleToApiRule = async (pgRule, knex, collectionPgModel =
30
30
  payload: pgRule.payload,
31
31
  executionNamePrefix: pgRule.execution_name_prefix,
32
32
  queueUrl: pgRule.queue_url,
33
- tags: pgRule.tags ? JSON.parse(pgRule.tags) : undefined,
33
+ tags: pgRule.tags,
34
34
  createdAt: pgRule.created_at.getTime(),
35
35
  updatedAt: pgRule.updated_at.getTime(),
36
36
  };
@@ -11,6 +11,7 @@ export interface PostgresProvider {
11
11
  cumulus_id?: number | null;
12
12
  global_connection_limit?: number | null;
13
13
  host: string;
14
+ max_download_time?: number | null;
14
15
  name: string;
15
16
  password?: string;
16
17
  port?: number | null;
@@ -17,9 +17,10 @@ export interface PostgresRule {
17
17
  created_at: Date | undefined;
18
18
  updated_at: Date | undefined;
19
19
  }
20
- export interface PostgresRuleRecord extends PostgresRule {
20
+ export interface PostgresRuleRecord extends Omit<PostgresRule, 'tags'> {
21
21
  cumulus_id: number;
22
22
  created_at: Date;
23
23
  updated_at: Date;
24
+ tags: string[];
24
25
  }
25
26
  //# sourceMappingURL=rule.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cumulus/db",
3
- "version": "18.0.0",
3
+ "version": "18.1.0",
4
4
  "description": "Utilities for working with the Cumulus DB",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -30,12 +30,12 @@
30
30
  "node": ">=16.19.0"
31
31
  },
32
32
  "dependencies": {
33
- "@cumulus/aws-client": "18.0.0",
34
- "@cumulus/common": "18.0.0",
35
- "@cumulus/errors": "18.0.0",
36
- "@cumulus/logger": "18.0.0",
37
- "@cumulus/message": "18.0.0",
38
- "@cumulus/types": "18.0.0",
33
+ "@cumulus/aws-client": "18.1.0",
34
+ "@cumulus/common": "18.1.0",
35
+ "@cumulus/errors": "18.1.0",
36
+ "@cumulus/logger": "18.1.0",
37
+ "@cumulus/message": "18.1.0",
38
+ "@cumulus/types": "18.1.0",
39
39
  "crypto-random-string": "^3.2.0",
40
40
  "is-valid-hostname": "1.0.2",
41
41
  "knex": "2.4.1",
@@ -47,5 +47,5 @@
47
47
  "devDependencies": {
48
48
  "@types/uuid": "^8.0.0"
49
49
  },
50
- "gitHead": "43bcef7c0d979a05cd2dd559b811f4ac8f85a9b1"
50
+ "gitHead": "8428a02e0903d8d303c7dd36215aa6a24906e07b"
51
51
  }