@hestia-earth/pipeline-utils 0.7.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.7.1](https://gitlab.com/hestia-earth/hestia-pipeline-utils/compare/v0.7.0...v0.7.1) (2022-09-07)
6
+
7
+
8
+ ### Features
9
+
10
+ * **api:** add method to format `originalId` ([f1edce5](https://gitlab.com/hestia-earth/hestia-pipeline-utils/commit/f1edce5f20076406076e697661a98ad326ec3056))
11
+
5
12
  ## [0.7.0](https://gitlab.com/hestia-earth/hestia-pipeline-utils/compare/v0.6.0...v0.7.0) (2022-08-30)
6
13
 
7
14
 
package/dist/api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { NodeType } from '@hestia-earth/schema';
2
2
  export declare const isEnabled: () => boolean;
3
3
  export declare const getNode: (id: string, type: NodeType) => Promise<unknown>;
4
+ export declare const formatOriginalId: (id: string) => string;
package/dist/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNode = exports.isEnabled = void 0;
3
+ exports.formatOriginalId = exports.getNode = exports.isEnabled = void 0;
4
4
  const requests_1 = require("./requests");
5
5
  const apiUrl = () => process.env.API_URL;
6
6
  const apiAccessToken = () => process.env.API_ACCESS_TOKEN;
@@ -17,4 +17,6 @@ const getNode = async (id, type) => {
17
17
  }
18
18
  };
19
19
  exports.getNode = getNode;
20
+ const formatOriginalId = (id) => id.toLowerCase().replace(/[^\w]+/g, '');
21
+ exports.formatOriginalId = formatOriginalId;
20
22
  //# sourceMappingURL=api.js.map
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],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I;QACF,MAAM,GAAG,GAAG,GAAG,MAAM,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,IAAA,cAAG,EAAC,GAAG,EAAE,SAAS,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAC9E;IACD,OAAO,IAAI,EAAE;QACX,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AATW,QAAA,OAAO,WASlB;AAKK,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAA3E,QAAA,gBAAgB,oBAA2D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/pipeline-utils",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Utilities for running pipelines",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/api.ts CHANGED
@@ -25,3 +25,8 @@ export const getNode = async (id: string, type: NodeType) => {
25
25
  return null;
26
26
  }
27
27
  };
28
+
29
+ /**
30
+ * Formats the id used when loading exsting `@id`.
31
+ */
32
+ export const formatOriginalId = (id: string) => id.toLowerCase().replace(/[^\w]+/g, '');