@dataplan/json 0.0.1-beta.14 → 0.0.1-beta.16
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 +64 -0
- package/README.md +1 -0
- package/dist/steps/jsonParse.d.ts +2 -2
- package/dist/steps/jsonParse.d.ts.map +1 -1
- package/dist/steps/jsonParse.js +8 -11
- package/dist/steps/jsonParse.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @dataplan/json
|
|
2
2
|
|
|
3
|
+
## 0.0.1-beta.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1980](https://github.com/graphile/crystal/pull/1980)
|
|
8
|
+
[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - The signature of
|
|
10
|
+
`ExecutableStep.execute` has changed; please make the following change to each
|
|
11
|
+
of your custom step classes' `execute` methods:
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
- async execute(count: number, values: any[][], extra: ExecutionExtra) {
|
|
15
|
+
+ async execute({ count, values: newValues, extra }: ExecutionDetails) {
|
|
16
|
+
+ const values = newValues.map((dep) =>
|
|
17
|
+
+ dep.isBatch ? dep.entries : new Array(count).fill(dep.value)
|
|
18
|
+
+ );
|
|
19
|
+
// REST OF YOUR FUNCTION HERE
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For more details, see: https://err.red/gev2
|
|
24
|
+
|
|
25
|
+
- [#1973](https://github.com/graphile/crystal/pull/1973)
|
|
26
|
+
[`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8)
|
|
27
|
+
Thanks [@benjie](https://github.com/benjie)! - Add 'unary steps' concept to
|
|
28
|
+
codebase and refactor to using new executeV2 execution method which leverages
|
|
29
|
+
them. Backwards compatibility maintained, but users should move to executeV2.
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
[[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430),
|
|
32
|
+
[`3551725e7`](https://github.com/graphile/crystal/commit/3551725e71c3ed876554e19e5ab2c1dcb0fb1143),
|
|
33
|
+
[`80836471e`](https://github.com/graphile/crystal/commit/80836471e5cedb29dee63bc5002550c4f1713cfd),
|
|
34
|
+
[`a5c20fefb`](https://github.com/graphile/crystal/commit/a5c20fefb571dea6d1187515dc48dd547e9e6204),
|
|
35
|
+
[`1ce08980e`](https://github.com/graphile/crystal/commit/1ce08980e2a52ed9bc81564d248c19648ecd3616),
|
|
36
|
+
[`dff4f2535`](https://github.com/graphile/crystal/commit/dff4f2535ac6ce893089b312fcd5fffcd98573a5),
|
|
37
|
+
[`a287a57c2`](https://github.com/graphile/crystal/commit/a287a57c2765da0fb6a132ea0953f64453210ceb),
|
|
38
|
+
[`2fe56f9a6`](https://github.com/graphile/crystal/commit/2fe56f9a6dac03484ace45c29c2223a65f9ca1db),
|
|
39
|
+
[`fed603d71`](https://github.com/graphile/crystal/commit/fed603d719c02f33e12190f925c9e3b06c581fac),
|
|
40
|
+
[`ed6e0d278`](https://github.com/graphile/crystal/commit/ed6e0d2788217a1c419634837f4208013eaf2923),
|
|
41
|
+
[`e82e4911e`](https://github.com/graphile/crystal/commit/e82e4911e32138df1b90ec0fde555ea963018d21),
|
|
42
|
+
[`42ece5aa6`](https://github.com/graphile/crystal/commit/42ece5aa6ca05345ebc17fb5c7d55df3b79b7612),
|
|
43
|
+
[`e0d69e518`](https://github.com/graphile/crystal/commit/e0d69e518a98c70f9b90f59d243ce33978c1b5a1),
|
|
44
|
+
[`6699388ec`](https://github.com/graphile/crystal/commit/6699388ec167d35c71220ce5d9113cac578da6cb),
|
|
45
|
+
[`966203504`](https://github.com/graphile/crystal/commit/96620350467ab8c65b56adf2f055e19450f8e772),
|
|
46
|
+
[`c1645b249`](https://github.com/graphile/crystal/commit/c1645b249aae949a548cd916e536ccfb63e5ab35),
|
|
47
|
+
[`ed8bbaa3c`](https://github.com/graphile/crystal/commit/ed8bbaa3cd1563a7601ca8c6b0412633b0ea4ce9),
|
|
48
|
+
[`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8),
|
|
49
|
+
[`14e2412ee`](https://github.com/graphile/crystal/commit/14e2412ee368e8d53abf6774c7f0069f32d4e8a3),
|
|
50
|
+
[`57ab0e1e7`](https://github.com/graphile/crystal/commit/57ab0e1e72c01213b21d3efc539cd655d83d993a),
|
|
51
|
+
[`8442242e4`](https://github.com/graphile/crystal/commit/8442242e43cac7d89ca0c413cf42c9fabf6f247f),
|
|
52
|
+
[`64ce7b765`](https://github.com/graphile/crystal/commit/64ce7b7650530251aec38a51089da66f914c19b4),
|
|
53
|
+
[`cba842357`](https://github.com/graphile/crystal/commit/cba84235786acbd77ade53bae7a3fba4a9be1eb7),
|
|
54
|
+
[`2fa77d0f2`](https://github.com/graphile/crystal/commit/2fa77d0f237cdb98d3dafb6b5e4083a2c6c38673)]:
|
|
55
|
+
- grafast@0.1.1-beta.7
|
|
56
|
+
|
|
57
|
+
## 0.0.1-beta.15
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies
|
|
62
|
+
[[`9f85c614d`](https://github.com/graphile/crystal/commit/9f85c614d48dc745c5fed15333dbb75af7fddc88),
|
|
63
|
+
[`6c6be29f1`](https://github.com/graphile/crystal/commit/6c6be29f12b24782c926b2bc62ed2ede09ac05de),
|
|
64
|
+
[`8315e8d01`](https://github.com/graphile/crystal/commit/8315e8d01c118cebc4ebbc53a2f264b958b252ad)]:
|
|
65
|
+
- grafast@0.1.1-beta.6
|
|
66
|
+
|
|
3
67
|
## 0.0.1-beta.14
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ And please give some love to our featured sponsors 🤩:
|
|
|
28
28
|
<td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
|
|
29
29
|
</tr><tr>
|
|
30
30
|
<td align="center"><a href="https://gosteelhead.com/"><img src="https://graphile.org/images/sponsors/steelhead.svg" width="90" height="90" alt="Steelhead" /><br />Steelhead</a> *</td>
|
|
31
|
+
<td align="center"><a href="https://www.sylvera.com/"><img src="https://graphile.org/images/sponsors/sylvera.svg" width="90" height="90" alt="Sylvera" /><br />Sylvera</a> *</td>
|
|
31
32
|
</tr></table>
|
|
32
33
|
|
|
33
34
|
<em>\* Sponsors the entire Graphile suite</em>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessStep,
|
|
1
|
+
import type { AccessStep, ExecutionDetails, GrafastResultsList } from "grafast";
|
|
2
2
|
import { ExecutableStep } from "grafast";
|
|
3
3
|
export type JSONValue = string | number | boolean | null | {
|
|
4
4
|
[key: string]: JSONValue;
|
|
@@ -19,7 +19,7 @@ export declare class JSONParseStep<TJSON extends JSONValue> extends ExecutableSt
|
|
|
19
19
|
[key: string]: unknown;
|
|
20
20
|
} ? TJSON[TKey] : never>;
|
|
21
21
|
at<TIndex extends keyof TJSON & number>(index: TIndex): AccessStep<TJSON[TIndex]>;
|
|
22
|
-
execute(
|
|
22
|
+
execute({ indexMap, values: [stringDep], }: ExecutionDetails<[string]>): GrafastResultsList<TJSON>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* This plan accepts as JSON string as its only input and will result in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"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ends grafast_1.ExecutableStep {
|
|
|
29
29
|
at(index) {
|
|
30
30
|
return (0, grafast_1.access)(this, [index]);
|
|
31
31
|
}
|
|
32
|
-
execute(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (let i = 0; i < count; i++) {
|
|
36
|
-
const v = list[i];
|
|
32
|
+
execute({ indexMap, values: [stringDep], }) {
|
|
33
|
+
return indexMap((i) => {
|
|
34
|
+
const v = stringDep.at(i);
|
|
37
35
|
if (typeof v === "string") {
|
|
38
36
|
try {
|
|
39
|
-
|
|
37
|
+
return JSON.parse(v);
|
|
40
38
|
}
|
|
41
39
|
catch (e) {
|
|
42
|
-
|
|
40
|
+
return Promise.reject(e);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
else if (v == null) {
|
|
46
|
-
|
|
44
|
+
return null;
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
|
-
|
|
47
|
+
return Promise.reject(new Error(`JSONParseStep: expected string to parse, but received ${Array.isArray(v) ? "array" : typeof v}`));
|
|
50
48
|
}
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
49
|
+
});
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
exports.JSONParseStep = JSONParseStep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParse.js","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAO1B,qCAA2D;AAU3D;;;GAGG;AACH,MAAa,aAEX,SAAQ,wBAAqB;aACtB,aAAQ,GAAG;QAChB,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,eAAe;KAC5B,AAHc,CAGb;IAKF,YAAY,WAA0C;QACpD,KAAK,EAAE,CAAC;QALV,wEAAwE;QACxE,WAAW;QACX,kBAAa,GAAG,KAAK,CAAC;QAIpB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED,YAAY;QACV,OAAO,eAAK,CAAC,IAAI,C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E;YAC5C,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBACzB,IAAI;oBACF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBACtB;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC1B;aACF;iBAAM,IAAI,CAAC,IAAI,IAAI,EAAE;gBACpB,OAAO,IAAW,CAAC;aACpB;iBAAM;gBACL,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,yDACE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACtC,EAAE,CACH,CACF,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AA1DH,sCA2DC;AAED;;;GAGG;AACH,SAAgB,SAAS,CACvB,OAAsC;IAEtC,OAAO,IAAI,aAAa,CAAQ,OAAO,CAAC,CAAC;AAC3C,CAAC;AAJD,8BAIC;AAED,IAAA,kBAAQ,EAAC,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataplan/json",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.16",
|
|
4
4
|
"description": "JSON step classes for Grafast",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=14.17"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"grafast": "^0.1.1-beta.
|
|
36
|
+
"grafast": "^0.1.1-beta.7"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|