@cumulus/errors 20.3.1 → 21.0.0-echo10-alpha

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/dist/index.d.ts CHANGED
@@ -348,13 +348,5 @@ export declare const UnmetRequirementsError: {
348
348
  stack?: string | undefined;
349
349
  };
350
350
  };
351
- /**
352
- * Safely serializes an error-like object to JSON, removing circular references
353
- * and including only own properties.
354
- *
355
- * @param err - The error or object to serialize
356
- * @returns A JSON string representation of the object
357
- */
358
- export declare const errorify: (err: any) => string;
359
351
  export {};
360
352
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
- /* eslint-disable max-classes-per-file */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.errorify = exports.UnmetRequirementsError = exports.IndexExistsError = exports.PostgresUpdateFailed = exports.PostgresValidationError = exports.ValidationError = exports.UnparsableFileLocationError = exports.UnmatchedRegexError = exports.UnexpectedFileSize = exports.RecordDoesNotExist = exports.RecordAlreadyMigrated = exports.ProviderNotFound = exports.PDRParsingError = exports.MissingS3FileError = exports.MissingRequiredEnvVarError = exports.MissingRequiredEnvVar = exports.MissingRequiredArgument = exports.MismatchPdrCollection = exports.InvalidRegexError = exports.InvalidChecksum = exports.InvalidArgument = exports.HostNotFound = exports.GranuleFileWriteError = exports.GranuleNotPublished = exports.FTPError = exports.FileNotFound = exports.EcsStartTaskError = exports.DuplicateFile = exports.DeletePublishedGranule = exports.CumulusMessageError = exports.ConnectionTimeout = exports.ApiCollisionError = exports.MissingBucketMap = exports.CMRInternalError = exports.CMRMetaFileNotFound = exports.XmlMetaFileNotFound = exports.RemoteResourceError = exports.ResourcesLockedError = exports.IncompleteError = exports.NotNeededError = exports.WorkflowError = exports.isConditionalCheckException = exports.isWorkflowError = exports.isThrottlingException = exports.ThrottlingException = exports.createErrorType = void 0;
5
- const isObject = require('lodash/isObject');
6
- const pick = require('lodash/pick');
3
+ exports.UnmetRequirementsError = exports.IndexExistsError = exports.PostgresUpdateFailed = exports.PostgresValidationError = exports.ValidationError = exports.UnparsableFileLocationError = exports.UnmatchedRegexError = exports.UnexpectedFileSize = exports.RecordDoesNotExist = exports.RecordAlreadyMigrated = exports.ProviderNotFound = exports.PDRParsingError = exports.MissingS3FileError = exports.MissingRequiredEnvVarError = exports.MissingRequiredEnvVar = exports.MissingRequiredArgument = exports.MismatchPdrCollection = exports.InvalidRegexError = exports.InvalidChecksum = exports.InvalidArgument = exports.HostNotFound = exports.GranuleFileWriteError = exports.GranuleNotPublished = exports.FTPError = exports.FileNotFound = exports.EcsStartTaskError = exports.DuplicateFile = exports.DeletePublishedGranule = exports.CumulusMessageError = exports.ConnectionTimeout = exports.ApiCollisionError = exports.MissingBucketMap = exports.CMRInternalError = exports.CMRMetaFileNotFound = exports.XmlMetaFileNotFound = exports.RemoteResourceError = exports.ResourcesLockedError = exports.IncompleteError = exports.NotNeededError = exports.WorkflowError = exports.isConditionalCheckException = exports.isWorkflowError = exports.isThrottlingException = exports.ThrottlingException = exports.createErrorType = void 0;
7
4
  /**
8
5
  * Creates a new error type with the given name and parent class. Sets up
9
6
  * boilerplate necessary to successfully subclass Error and preserve stack trace
@@ -125,35 +122,4 @@ exports.PostgresValidationError = PostgresValidationError;
125
122
  exports.PostgresUpdateFailed = (0, exports.createErrorType)('PostgresUpdateFailed');
126
123
  exports.IndexExistsError = (0, exports.createErrorType)('IndexExistsError');
127
124
  exports.UnmetRequirementsError = (0, exports.createErrorType)('UnmetRequirementsError');
128
- /**
129
- * Creates a JSON replacer function that removes circular references and
130
- * ensures only an object's own properties (not inherited ones) are serialized.
131
- *
132
- * @returns A JSON replacer function
133
- */
134
- const replacerFactory = () => {
135
- const seen = new WeakSet();
136
- const replacer = (_key, value) => {
137
- if (isObject(value) && value !== null) {
138
- if (seen.has(value)) {
139
- return undefined; // Remove circular reference
140
- }
141
- seen.add(value);
142
- }
143
- if (!Array.isArray(value) && isObject(value)) {
144
- return pick(value, Object.getOwnPropertyNames(value));
145
- }
146
- return value;
147
- };
148
- return replacer;
149
- };
150
- /**
151
- * Safely serializes an error-like object to JSON, removing circular references
152
- * and including only own properties.
153
- *
154
- * @param err - The error or object to serialize
155
- * @returns A JSON string representation of the object
156
- */
157
- const errorify = (err) => JSON.stringify(err, replacerFactory());
158
- exports.errorify = errorify;
159
125
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cumulus/errors",
3
- "version": "20.3.1",
3
+ "version": "21.0.0-echo10-alpha",
4
4
  "description": "Provides error classes for Cumulus",
5
5
  "keywords": [
6
6
  "GIBS",
@@ -26,18 +26,11 @@
26
26
  },
27
27
  "scripts": {
28
28
  "clean": "git clean -d -x -e node_modules -f",
29
- "test": "../../node_modules/.bin/ava",
30
- "test:ci": "../../scripts/run_package_ci_unit.sh",
31
- "test:coverage": "../../node_modules/.bin/nyc npm test",
32
29
  "prepare": "npm run tsc",
33
30
  "tsc": "../../node_modules/.bin/tsc",
34
- "tsc:listEmittedFiles": "../../node_modules/.bin/tsc --listEmittedFiles",
35
- "coverage": "python ../../scripts/coverage_handler/coverage.py"
31
+ "tsc:listEmittedFiles": "../../node_modules/.bin/tsc --listEmittedFiles"
36
32
  },
37
33
  "author": "Cumulus Authors",
38
34
  "license": "Apache-2.0",
39
- "dependencies": {
40
- "lodash": "~4.17.21"
41
- },
42
- "gitHead": "711d958cf08f4e69f4f8059b32b4a109698556ce"
35
+ "gitHead": "71e9edd4833f5f8579179f17d6bc48d12a0587e7"
43
36
  }