@digipair/skill-process 0.113.0 → 0.114.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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # skill-test
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build skill-process` to build the library.
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  /**
6
4
  * Convert array of 16 byte values to UUID string format of the form:
7
5
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@@ -16,7 +14,7 @@ function unsafeStringify(arr) {
16
14
  //
17
15
  // Note to future-self: No, you can't remove the `toLowerCase()` call.
18
16
  // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
19
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
17
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
20
18
  }
21
19
 
22
20
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
@@ -28,21 +26,21 @@ function rng() {
28
26
  // lazy load so that environments that need to polyfill have a chance to do so
29
27
  if (!getRandomValues) {
30
28
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
31
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
29
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
32
30
  if (!getRandomValues) {
33
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
31
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
34
32
  }
35
33
  }
36
34
  return getRandomValues(rnds8);
37
35
  }
38
36
 
39
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
37
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
40
38
  var native = {
41
39
  randomUUID: randomUUID
42
40
  };
43
41
 
44
42
  function v4(options, buf, offset) {
45
- if (native.randomUUID && !buf && !options) {
43
+ if (native.randomUUID && true && !options) {
46
44
  return native.randomUUID();
47
45
  }
48
46
  options = options || {};
@@ -50,14 +48,6 @@ function v4(options, buf, offset) {
50
48
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
51
49
  rnds[6] = rnds[6] & 0x0f | 0x40;
52
50
  rnds[8] = rnds[8] & 0x3f | 0x80;
53
- // Copy bytes to buffer, if provided
54
- if (buf) {
55
- offset = offset || 0;
56
- for(var i = 0; i < 16; ++i){
57
- buf[offset + i] = rnds[i];
58
- }
59
- return buf;
60
- }
61
51
  return unsafeStringify(rnds);
62
52
  }
63
53
 
@@ -81,18 +71,17 @@ let ProcessService = class ProcessService {
81
71
  }
82
72
  remove(id) {
83
73
  const process = this.processList.find((p)=>p.id === id);
84
- process == null ? void 0 : process.abortController.abort();
74
+ process?.abortController.abort();
85
75
  this.processList = this.processList.filter((p)=>p.id !== id);
86
76
  }
87
77
  async stop(params, _pinsSettingsList, _context) {
88
- var _process_res;
89
78
  const { id } = params;
90
79
  const process = this.processList.find((p)=>p.id === id);
91
80
  if (!process) {
92
81
  return false;
93
82
  }
94
83
  process.abortController.abort();
95
- (_process_res = process.res) == null ? void 0 : _process_res.status(503).send({
84
+ process.res?.status(503).send({
96
85
  status: 'stopped'
97
86
  });
98
87
  this.processList = this.processList.filter((p)=>p.id !== id);
@@ -12,7 +12,7 @@ function unsafeStringify(arr) {
12
12
  //
13
13
  // Note to future-self: No, you can't remove the `toLowerCase()` call.
14
14
  // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
15
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
15
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
16
16
  }
17
17
 
18
18
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
@@ -24,21 +24,21 @@ function rng() {
24
24
  // lazy load so that environments that need to polyfill have a chance to do so
25
25
  if (!getRandomValues) {
26
26
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
27
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
27
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
28
28
  if (!getRandomValues) {
29
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
29
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
30
30
  }
31
31
  }
32
32
  return getRandomValues(rnds8);
33
33
  }
34
34
 
35
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
35
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
36
36
  var native = {
37
37
  randomUUID: randomUUID
38
38
  };
39
39
 
40
40
  function v4(options, buf, offset) {
41
- if (native.randomUUID && !buf && !options) {
41
+ if (native.randomUUID && true && !options) {
42
42
  return native.randomUUID();
43
43
  }
44
44
  options = options || {};
@@ -46,14 +46,6 @@ function v4(options, buf, offset) {
46
46
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
47
47
  rnds[6] = rnds[6] & 0x0f | 0x40;
48
48
  rnds[8] = rnds[8] & 0x3f | 0x80;
49
- // Copy bytes to buffer, if provided
50
- if (buf) {
51
- offset = offset || 0;
52
- for(var i = 0; i < 16; ++i){
53
- buf[offset + i] = rnds[i];
54
- }
55
- return buf;
56
- }
57
49
  return unsafeStringify(rnds);
58
50
  }
59
51
 
@@ -77,18 +69,17 @@ let ProcessService = class ProcessService {
77
69
  }
78
70
  remove(id) {
79
71
  const process = this.processList.find((p)=>p.id === id);
80
- process == null ? void 0 : process.abortController.abort();
72
+ process?.abortController.abort();
81
73
  this.processList = this.processList.filter((p)=>p.id !== id);
82
74
  }
83
75
  async stop(params, _pinsSettingsList, _context) {
84
- var _process_res;
85
76
  const { id } = params;
86
77
  const process = this.processList.find((p)=>p.id === id);
87
78
  if (!process) {
88
79
  return false;
89
80
  }
90
81
  process.abortController.abort();
91
- (_process_res = process.res) == null ? void 0 : _process_res.status(503).send({
82
+ process.res?.status(503).send({
92
83
  status: 'stopped'
93
84
  });
94
85
  this.processList = this.processList.filter((p)=>p.id !== id);
@@ -1 +1,2 @@
1
1
  export * from './lib/skill-process';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -12,3 +12,4 @@ export declare const list: (params: any, pinsSettingsList: PinsSettings[], conte
12
12
  reasoning: string;
13
13
  time: number;
14
14
  }[]>;
15
+ //# sourceMappingURL=skill-process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-process.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwDnC,eAAO,MAAM,GAAG,GAAI,UAAU,MAAM,EAAE,WAAW,MAAM,EAAE,KAAK,QAAQ;;;CAC9B,CAAC;AAEzC,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,SAAwB,CAAC;AAE1D,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,qBAC9B,CAAC;AAEnD,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG;;;;;IAC9B,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,33 @@
1
1
  {
2
2
  "name": "@digipair/skill-process",
3
- "version": "0.113.0",
3
+ "version": "0.114.1",
4
+ "main": "./dist/index.cjs.js",
5
+ "module": "./dist/index.esm.js",
6
+ "types": "./dist/index.d.ts",
4
7
  "keywords": [
5
8
  "digipair",
6
9
  "service",
7
10
  "util"
8
11
  ],
9
- "dependencies": {},
10
- "main": "./index.cjs.js",
11
- "module": "./index.esm.js"
12
- }
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.esm.js",
16
+ "default": "./dist/index.cjs.js"
17
+ },
18
+ "./index.esm.js": "./dist/index.esm.js",
19
+ "./index.cjs.js": "./dist/index.cjs.js",
20
+ "./package.json": "./package.json",
21
+ "./schema.json": "./dist/schema.json",
22
+ "./schema.fr.json": "./dist/schema.fr.json"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "package.json"
28
+ ],
29
+ "nx": {
30
+ "name": "skill-process"
31
+ },
32
+ "dependencies": {}
33
+ }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './libs/skill-process/src/index';
File without changes
File without changes
File without changes