@colabo-flow/s-go 0.2.4 → 0.2.5

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.
Files changed (118) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{src/lib/go.amqp.host_status.d.ts → demo/create-client.d.ts} +0 -0
  3. package/dist/cjs/{src/lib/go.amqp.service.d.ts → demo/create-host.d.ts} +0 -0
  4. package/dist/{esm/src/lib/go.amqp.host_status.d.ts → cjs/demo/send.d.ts} +0 -0
  5. package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/{src/lib → lib}/config.d.ts +0 -0
  8. package/dist/cjs/{src/lib → lib}/go.amqp.client.d.ts +0 -0
  9. package/dist/cjs/{src/lib → lib}/go.amqp.host.d.ts +0 -0
  10. package/dist/{esm/src/lib/go.amqp.service.d.ts → cjs/lib/go.amqp.host_status.d.ts} +0 -0
  11. package/dist/cjs/lib/go.amqp.service.d.ts +1 -0
  12. package/dist/cjs/{src/lib → lib}/operators.d.ts +0 -0
  13. package/dist/cjs/{src/lib → lib}/params.d.ts +0 -0
  14. package/dist/cjs/{src/lib → lib}/vos.d.ts +0 -0
  15. package/dist/cjs/test_ts.d.ts +1 -0
  16. package/dist/esm/demo/create-client.d.ts +1 -0
  17. package/dist/esm/demo/create-host.d.ts +1 -0
  18. package/dist/esm/demo/send.d.ts +1 -0
  19. package/dist/esm/{src/index.d.ts → index.d.ts} +0 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/{src/lib → lib}/config.d.ts +0 -0
  22. package/dist/esm/{src/lib → lib}/go.amqp.client.d.ts +0 -0
  23. package/dist/esm/{src/lib → lib}/go.amqp.host.d.ts +0 -0
  24. package/dist/esm/lib/go.amqp.host_status.d.ts +1 -0
  25. package/dist/esm/lib/go.amqp.service.d.ts +1 -0
  26. package/dist/esm/{src/lib → lib}/operators.d.ts +0 -0
  27. package/dist/esm/{src/lib → lib}/params.d.ts +0 -0
  28. package/dist/esm/{src/lib → lib}/vos.d.ts +0 -0
  29. package/dist/esm/test_ts.d.ts +1 -0
  30. package/package.json +14 -9
  31. package/dist/colabo/src/services/puzzles/flow/go/index.js +0 -7
  32. package/dist/colabo/src/services/puzzles/flow/go/index.js.map +0 -1
  33. package/dist/colabo/src/services/puzzles/flow/go/lib/config.js +0 -21
  34. package/dist/colabo/src/services/puzzles/flow/go/lib/config.js.map +0 -1
  35. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.client.js +0 -80
  36. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.client.js.map +0 -1
  37. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.host.js +0 -237
  38. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.host.js.map +0 -1
  39. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.host_status.js +0 -67
  40. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.host_status.js.map +0 -1
  41. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.service.js +0 -244
  42. package/dist/colabo/src/services/puzzles/flow/go/lib/go.amqp.service.js.map +0 -1
  43. package/dist/colabo/src/services/puzzles/flow/go/lib/operators.js +0 -15
  44. package/dist/colabo/src/services/puzzles/flow/go/lib/operators.js.map +0 -1
  45. package/dist/colabo/src/services/puzzles/flow/go/lib/params.js +0 -2
  46. package/dist/colabo/src/services/puzzles/flow/go/lib/params.js.map +0 -1
  47. package/dist/colabo/src/services/puzzles/flow/go/lib/vos.js +0 -23
  48. package/dist/colabo/src/services/puzzles/flow/go/lib/vos.js.map +0 -1
  49. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/index.js +0 -22
  50. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/index.js.map +0 -1
  51. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-semaphore.js +0 -203
  52. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-semaphore.js.map +0 -1
  53. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-semaphore.vos.js +0 -2
  54. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-semaphore.vos.js.map +0 -1
  55. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-vos.js +0 -45
  56. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution-vos.js.map +0 -1
  57. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution.operators.js +0 -42
  58. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/execution.operators.js.map +0 -1
  59. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/flow-execution.service.js +0 -334
  60. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/execution/flow-execution.service.js.map +0 -1
  61. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/executors/executors-store.js +0 -2
  62. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/executors/executors-store.js.map +0 -1
  63. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/executors/executors-vos.js +0 -30
  64. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/executors/executors-vos.js.map +0 -1
  65. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine-updates-vos.js +0 -10
  66. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine-updates-vos.js.map +0 -1
  67. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine-vos.js +0 -106
  68. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine-vos.js.map +0 -1
  69. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine.js +0 -1513
  70. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/flow-instance-engine.js.map +0 -1
  71. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/index.js +0 -5
  72. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-instance-engine/index.js.map +0 -1
  73. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-type-utils.js +0 -189
  74. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-type-utils.js.map +0 -1
  75. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-condensed.operators.js +0 -335
  76. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-condensed.operators.js.map +0 -1
  77. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-condensed.vos.js +0 -8
  78. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-condensed.vos.js.map +0 -1
  79. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form-condensed.operators.js +0 -38
  80. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form-condensed.operators.js.map +0 -1
  81. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form-condensed.vos.js +0 -10
  82. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form-condensed.vos.js.map +0 -1
  83. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form.vos.js +0 -2
  84. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-form.vos.js.map +0 -1
  85. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-translators.vos.js +0 -5
  86. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-translators.vos.js.map +0 -1
  87. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-visual.vos.js +0 -16
  88. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-visual.vos.js.map +0 -1
  89. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-vos.js +0 -103
  90. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types-vos.js.map +0 -1
  91. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types.operators.js +0 -121
  92. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/lib/flow-types/flow-types.operators.js.map +0 -1
  93. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/vos.js +0 -25
  94. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/vos.js.map +0 -1
  95. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/index.js +0 -3
  96. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/index.js.map +0 -1
  97. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/lib/assertion.js +0 -20
  98. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/lib/assertion.js.map +0 -1
  99. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/lib/params.js +0 -2
  100. package/dist/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify/lib/params.js.map +0 -1
  101. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/index.js +0 -7
  102. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/index.js.map +0 -1
  103. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/datatalks-cache.service.js +0 -33
  104. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/datatalks-cache.service.js.map +0 -1
  105. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/datatalks-cache.vos.js +0 -2
  106. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/datatalks-cache.vos.js.map +0 -1
  107. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/params.js +0 -2
  108. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/lib/params.js.map +0 -1
  109. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/vos.js +0 -2
  110. package/dist/colabo-vue3/src/isomorphic/puzzles/datatalks/cache/vos.js.map +0 -1
  111. package/dist/colabo-vue3/src/isomorphic/puzzles/headless/core-backend/chalk/index.js +0 -3
  112. package/dist/colabo-vue3/src/isomorphic/puzzles/headless/core-backend/chalk/index.js.map +0 -1
  113. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/index.js +0 -6
  114. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/index.js.map +0 -1
  115. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/lib/transform.js +0 -582
  116. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/lib/transform.js.map +0 -1
  117. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/lib/vos/transform.vos.js +0 -33
  118. package/dist/colabo-vue3/src/isomorphic/puzzles/transform/json/lib/vos/transform.vos.js.map +0 -1
@@ -1,582 +0,0 @@
1
- import { ETransformOperation, EPathDirection, EPathsTransformationContextState } from "./vos/transform.vos";
2
- const PATH_SEPARATOR = "/";
3
- const ITERATIVE_PATH_PART = "[*]";
4
- const FLAGS_SEPARATOR = ";";
5
- const FLAG_VALUE_SEPARATOR = ":";
6
- import { chalk } from "@colabo-headless/i-core/chalk";
7
- import { assert, assertIsDefined } from "@colabo-utils/i-verify";
8
- const showLogs = false;
9
- const console_log = (msg) => {
10
- if (showLogs)
11
- console.log(msg);
12
- };
13
- const console_warn = (msg) => {
14
- if (showLogs)
15
- console.warn(msg);
16
- };
17
- /** Used to clone the set of IPathTransformationContext to be possible to use them separately in recursive call of transformation algorithms */
18
- const clonePathTransformationContexts = (pathsContext) => {
19
- const clonedPathsContext = {
20
- ...pathsContext,
21
- paths: {},
22
- };
23
- for (const pathName in pathsContext.paths) {
24
- const path = pathsContext.paths[pathName];
25
- const clonedPath = {
26
- ...path,
27
- };
28
- clonedPathsContext.paths[pathName] = clonedPath;
29
- }
30
- if (pathsContext.mainIterablePathContext)
31
- clonedPathsContext.mainIterablePathContext = clonedPathsContext.paths[pathsContext.mainIterablePathContext.id];
32
- if (pathsContext.sourcePathContext)
33
- clonedPathsContext.sourcePathContext = clonedPathsContext.paths[pathsContext.sourcePathContext.id];
34
- return clonedPathsContext;
35
- };
36
- const reportOperation = (transform, path) => {
37
- const reportOperation = `${chalk.green("*** ")}${chalk.white("OPERATION: ")}${chalk.blue.bold((transform.operation || ETransformOperation.MOVE).toString())}: " for path: ${chalk.blue.bold(path.id)}"`;
38
- console_log(reportOperation);
39
- };
40
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
41
- const chalkJSONstringify = (obj) => chalk.rgb(128, 128, 128)(JSON.stringify(obj));
42
- /**
43
- * Applies the final step of transform against the `dataObj` or rather `dataObjTransformed` (accessed through `sourceDataSubObject` and `destinationDataSubObject`)
44
- *
45
- * @param transform transform that should be applied
46
- * @param sourceDataSubObject object that contains (hosts) the last part (with a property of a name contained in `sourceLastPathPart`) of the source path
47
- * @param sourceLastPathPart the last part of the source path. It contains the name of a property inside of the `sourceDataSubObject` object that should be used (deleted if moved)
48
- * @param sourceLastValue the value of the property (with the name contained in `sourceLastPathPart`) in the `sourceDataSubObject` object
49
- * @param destinationDataSubObject object that contains (hosts) the last part (with a property of a name contained in `destinationLastPathPart`) of the destination path
50
- * @param destinationLastPathPart the last part of the destination path. It contains the name of a property inside of the `destinationDataSubObject` object that should be transformed
51
- * @param isSourcePathThePartOfTheDestinationPath tells is the source path part of the destination path. If it is, then the `sourceDataSubObject[sourceLastPathPart]` should not be deleted in the case of MOVE
52
- */
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- const asyncApplyTransformOnDataSubObject = async (transform, dataObjTransformed, pathsContext) => {
55
- console_warn(`[transform:applyTransformOnDataSubObject] transform: ${chalkJSONstringify(transform)}`);
56
- if (pathsContext.sourcePathContext) {
57
- console_warn(`[applyTransformOnDataSubObject] sourcePathContext.dataSubObject: ${chalkJSONstringify(pathsContext.sourcePathContext.currentDataSubObject)}, sourcePathContext.currentPathPart: ${chalkJSONstringify(pathsContext.sourcePathContext.currentPathPart)}, sourcePathContext.lastValue: ${chalkJSONstringify(pathsContext.sourcePathContext.lastValue)}`);
58
- }
59
- let someDestinationPathContainsSourcePath = false;
60
- // transforming for each path
61
- for (const pathName in pathsContext.paths) {
62
- const path = pathsContext.paths[pathName];
63
- // TODO: see if this is acceptable
64
- if (path.avoidWalkThroughPath)
65
- continue;
66
- if (transform.operation === ETransformOperation.DELETE) {
67
- reportOperation(transform, path);
68
- if (path.direction !== EPathDirection.SOURCE)
69
- continue;
70
- delete path.currentDataSubObject[path.currentPathPart.selector];
71
- }
72
- else if (transform.operation === ETransformOperation.CODE) {
73
- if (path.direction !== EPathDirection.DESTINATION)
74
- continue;
75
- reportOperation(transform, path);
76
- assert(transform.reference, `[asyncApplyTransformOnDataSubObject] transform.reference is not defined for ETransformOperation.CODE: transform: ${JSON.stringify(transform)}`);
77
- // TODO: we might need to provide different dataObj as dataSubObjectSource is probably deeper variant
78
- // TODO: add destinationDataSubObject as well
79
- // eslint-disable-next-line @typescript-eslint/ban-types
80
- assertIsDefined(pathsContext.sourcePathContext);
81
- await transform.reference(pathsContext.sourcePathContext, path, transform);
82
- }
83
- else if (transform.operation === ETransformOperation.ADD) {
84
- if (path.direction !== EPathDirection.DESTINATION)
85
- continue;
86
- reportOperation(transform, path);
87
- // set the dataSubObject's value
88
- path.currentDataSubObject[path.currentPathPart.selector] = transform.value;
89
- console_log(`[applyTransformOnDataSubObject] path.dataSubObject: ${chalkJSONstringify(path.currentDataSubObject)}`);
90
- }
91
- else {
92
- if (path.direction !== EPathDirection.DESTINATION)
93
- continue;
94
- // ETransformOperation.MOVE or ETransformOperation.DUPLICATE
95
- reportOperation(transform, path);
96
- if (!pathsContext.sourcePathContext) {
97
- throw new Error(`sourcePathContext is missing for the ETransformOperation.MOVE transformation`);
98
- }
99
- console_warn(`[applyTransformOnDataSubObject] path.dataSubObject: ${chalkJSONstringify(path.currentDataSubObject)}`);
100
- const isRootElementUsed = typeof transform.dest === "string" && transform.dest.trim() === "";
101
- if (isRootElementUsed) {
102
- dataObjTransformed = path.currentDataSubObject = pathsContext.sourcePathContext.lastValue;
103
- }
104
- else {
105
- path.currentDataSubObject[path.currentPathPart.selector] = pathsContext.sourcePathContext.lastValue;
106
- }
107
- someDestinationPathContainsSourcePath = someDestinationPathContainsSourcePath || path.containsSourcePath;
108
- }
109
- }
110
- // ETransformOperation.MOVE (which is also a default): remove the original `source` element if not overlapping with the destination
111
- if ((transform.operation === ETransformOperation.MOVE || !transform.operation) && !someDestinationPathContainsSourcePath) {
112
- // console_log(`... removing the "source" ('${sourcePathContext.currentPathPart.selector}') element`);
113
- // eslint-disable-next-line @typescript-eslint/ban-types
114
- assertIsDefined(pathsContext.sourcePathContext);
115
- delete pathsContext.sourcePathContext.currentDataSubObject[pathsContext.sourcePathContext.currentPathPart.selector];
116
- }
117
- return dataObjTransformed;
118
- };
119
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
120
- export const asyncProcessTransformIterability = async (transform, dataObjTransformed, pathsContext) => {
121
- if (!pathsContext?.mainIterablePathContext?.currentDataSubObject) {
122
- console_log(`pathsContext.mainIterablePathContext.currentDataSubObject doesn't exist. Leaving spanned iteration`);
123
- return dataObjTransformed;
124
- }
125
- if (typeof pathsContext.mainIterablePathContext.currentDataSubObject !== "object") {
126
- console_log(`pathsContext.mainIterablePathContext.currentDataSubObject is not object/array (not iterable). Leaving spanned iteration`);
127
- return dataObjTransformed;
128
- }
129
- const iteratingProps = Object.keys(pathsContext.mainIterablePathContext.currentDataSubObject);
130
- // ITERATING through iterable path part
131
- console_warn(`[transform:asyncProcessTransformIterability] Iterating for transform ${chalkJSONstringify(transform)} through iterable elements (length: ${iteratingProps.length}) of the \`mainIterablePathContext.dataSubObject\`: ${chalkJSONstringify(pathsContext.mainIterablePathContext.currentDataSubObject)} for pathsContext.mainIterablePathContext.currentPathPart: ${chalkJSONstringify(pathsContext.mainIterablePathContext.currentPathPart)}`);
132
- for (const iteratingProp of iteratingProps) {
133
- const iteratingPathsContext = clonePathTransformationContexts(pathsContext);
134
- // setting dataSubObject-s for each path
135
- for (const pathName in pathsContext.paths) {
136
- const path = pathsContext.paths[pathName];
137
- // TODO: see if this is acceptable
138
- if (path.avoidWalkThroughPath)
139
- continue;
140
- // this should be done for all paths as we are concurrently iterating over all paths
141
- iteratingPathsContext.paths[pathName].currentDataSubObject = path.currentDataSubObject[iteratingProp];
142
- console_warn(`[transform:asyncProcessTransformIterability] ${chalk.bold.green('path.id: "' + path.id + '": [key: ' + iteratingProp + "]")}: \`iteratingPathsContext.paths[pathName].currentDataSubObject\`: ${chalkJSONstringify(iteratingPathsContext.paths[pathName].currentDataSubObject)}`);
143
- // if (path.id === pathsContext.mainIterablePathContext.id) continue;
144
- }
145
- console_warn(`[transform:asyncProcessTransformIterability] ${chalk.bold.green("Calling for sub-element [index/key: " + iteratingProp + "]")}: \`pathsContext.mainIterablePathContext.dataSubObject\`: ${chalkJSONstringify(pathsContext.mainIterablePathContext.currentDataSubObject)} for the current path part for \`pathsContext.mainIterablePathContext\`: ${chalkJSONstringify(pathsContext.mainIterablePathContext.pathPartsAspects[pathsContext.mainIterablePathContext.currentPathPartIndex])}`);
146
- dataObjTransformed = await asyncExecuteTransformOnDataObjExpandedPaths(transform, dataObjTransformed, iteratingPathsContext);
147
- }
148
- return dataObjTransformed;
149
- };
150
- /**
151
- * Gets sub-object from the provided `dataEntry` pointed with the `pathStr` pointer
152
- * @param dataEntity data entry which we should extract from
153
- * @param pathStr path to the sub-object
154
- * @returns retrieved sub-object
155
- */
156
- export const getSubObjectForPath = (dataEntity, pathStr, pathParts) => {
157
- let subDataEntity = dataEntity;
158
- assert(pathStr || pathParts, "Either `pathStr` or `pathParts` should be defined");
159
- if (!pathParts) {
160
- // pathStr is defined due to the assert and if
161
- pathParts = extractPathAspects(pathStr);
162
- }
163
- for (const pathPart of pathParts) {
164
- if (subDataEntity)
165
- subDataEntity = subDataEntity[pathPart.selector];
166
- }
167
- return subDataEntity;
168
- };
169
- /**
170
- * Sets (updates) sub-object of the provided `dataEntry` pointed with the `pathStr` pointer
171
- * If a subobject described by path is missing it will be generated as an empty object (`{}`)
172
- * @param dataEntity data entry which we should update
173
- * @param pathStr path to the sub-object
174
- * @param subDataEntity reference to the sub-object that we should place at the `pathStr` place
175
- */
176
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
177
- export const setSubObjectForPath = (dataEntity, pathStr, subDataEntity) => {
178
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
- let parentSubDataEntity = dataEntity;
180
- const pathParts = extractPathAspects(pathStr);
181
- for (let pathPartIndex = 0; pathPartIndex < pathParts.length - 1; pathPartIndex++) {
182
- const pathPart = pathParts[pathPartIndex];
183
- if (!parentSubDataEntity[pathPart.selector])
184
- parentSubDataEntity[pathPart.selector] = {};
185
- parentSubDataEntity = parentSubDataEntity[pathPart.selector];
186
- }
187
- parentSubDataEntity[pathParts[pathParts.length - 1].selector] = subDataEntity;
188
- };
189
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
190
- export const asyncWalkDownTransformPaths = async (transform, dataObjTransformed, pathsContext) => {
191
- console_log(`[transform:asyncWalkDownTransformPaths] transform: ${chalkJSONstringify(transform)}, pathsContext: ${chalkJSONstringify(pathsContext)}`);
192
- let firstDestinationPathContext;
193
- /** It is true if all paths reached iterable part as algorithm (and current (?) logic) accept only scenario where all source(s) and all destinations paths match iterable path part */
194
- let areAllPathsAtIterablePathPart = true;
195
- /** It is true if all paths reached non-iterable part as algorithm (and current (?) logic) accept only scenario where all source(s) and all destinations paths match the state of "iterability" for the current paths parts (positions, indices) */
196
- let areAllPathsAtNonIterablePathPart = true;
197
- /** It is true if all paths have reached (walked down) their ends */
198
- let areEndsReachedByAllPaths = true;
199
- for (const pathName in pathsContext.paths) {
200
- const path = pathsContext.paths[pathName];
201
- // TODO: see if this is acceptable
202
- if (path.avoidWalkThroughPath)
203
- continue;
204
- // TODO: see if this is acceptable
205
- if (path.reachedEndOfThePath)
206
- continue;
207
- // setting preferable contexts, used for choosing path which we will use for iteration over, etc
208
- if (path.direction == EPathDirection.SOURCE) {
209
- if (pathsContext.sourcePathContext && pathsContext.sourcePathContext.id !== path.id) {
210
- throw new Error(`Source is already identified for path.id: "${pathsContext.sourcePathContext.id}", when another path with \`EPathDirection.SOURCE\` is identified: path.id: "${path.id}"`);
211
- }
212
- else {
213
- pathsContext.sourcePathContext = path;
214
- }
215
- }
216
- else {
217
- if (!firstDestinationPathContext)
218
- firstDestinationPathContext = path;
219
- }
220
- let isLastPathPart;
221
- // WALK down the `dataObjTransformed`
222
- // stop before the last sub-dataObj, as we need to keep the context of hosting dataObj
223
- // + (mostly when we want to update the sub-dataObj inside the hosting dataObj)
224
- // or stop at the iteration selector
225
- // while (path.currentPathPartIndex < path.pathPartsAspects.length) {
226
- while (!path.reachedEndOfThePath) {
227
- path.currentPathPart = path.pathPartsAspects[path.currentPathPartIndex];
228
- // update
229
- if (path.avoidWalkThroughPath || pathsContext.sourcePathContext?.avoidWalkThroughPath || path.currentPathPart.selector !== pathsContext.sourcePathContext?.currentPathPart?.selector)
230
- path.containsSourcePath = false;
231
- isLastPathPart = path.currentPathPartIndex >= path.pathPartsAspects.length - 1;
232
- console_warn(`path.id: "${path.id}", isLastPathPart: ${isLastPathPart}`);
233
- // create destination object if it is missing and integrate it in the original dataObj hierarchy
234
- if (path.direction === EPathDirection.DESTINATION) {
235
- if (!isLastPathPart && typeof path.currentDataSubObject[path.currentPathPart.selector] !== "object") {
236
- // TODO: support creating arrays. This would require to understand what is the correct type, which can be done either by format in the transform that will distinguish array and object, both in navigating down the path (should be straightforward) and array-addressing (for example all of them `[*]`) which is hard as it is same for both array and object, and therefore it would require processing source path(s) first to learn their types, but that is also painful and unclear, as it is most-likely not at the same parsing path, though we care mostly for leaves and iterable points which should (?) be aligned
237
- path.currentDataSubObject[path.currentPathPart.selector] = {};
238
- // console_log(`[transform:executeTransformOnDataObjExpandedPaths] ...transforming "path.dataSubObject[path.currentPathPart.selector]" (${path.dataSubObject[path.currentPathPart.selector]}) to object`);
239
- }
240
- }
241
- // Error if path.currentDataSubObject is lost
242
- if (path.direction === EPathDirection.SOURCE) {
243
- if (!isLastPathPart && !path.currentDataSubObject) {
244
- console_log(`[transform:executeTransformOnDataObjExpandedPaths] path.dataSubObject: ${chalkJSONstringify(path.currentDataSubObject)}`);
245
- const errMsg = `[transform:executeTransformOnDataObjExpandedPaths] \`path.dataSubObject\` became undefined while walking down [${chalkJSONstringify(path.pathPartsAspects)}] at position: ${path.currentPathPartIndex} for lastPathPart.selector: ${path.currentPathPart.selector}`;
246
- console_log(errMsg);
247
- throw new Error(errMsg);
248
- // return;
249
- }
250
- }
251
- // upgrade pointers and flags
252
- if (!isLastPathPart) {
253
- path.currentPathPartIndex++;
254
- }
255
- else {
256
- path.reachedEndOfThePath = true;
257
- }
258
- // iterability
259
- if (path.currentPathPart.isIterable) {
260
- // we move on only on the array (hence only `path.currentPathPart.selector`) and not on any specific element of the array
261
- // (which will be done in `asyncProcessTransformIterability`)
262
- path.currentDataSubObject = path.currentDataSubObject[path.currentPathPart.selector];
263
- console_warn(`[transform:asyncWalkDownTransformPaths] path.id: ${path.id}, path.currentPathPart.isIterable: ${path.currentPathPart.isIterable}, transform: ${chalkJSONstringify(transform)}, path.currentDataSubObject: ${chalkJSONstringify(path.currentDataSubObject)}`);
264
- // we exit walking down the path and wait for other paths to align (reach) next iterable path part
265
- break;
266
- }
267
- else {
268
- // walk into a sub-object only if not the last for other paths
269
- if (!isLastPathPart)
270
- path.currentDataSubObject = path.currentDataSubObject[path.currentPathPart.selector];
271
- // get last value for setting it to destination sub-objects
272
- if (path.direction == EPathDirection.SOURCE) {
273
- if (isLastPathPart) {
274
- // this ensures that for non-existing (empty) `lastSourcePathPart` we will get the root object
275
- // TODO: unclear why we need that? is it for some path like `src: "transforms/"` with missing path after the `/` separator? If yes, unclear why we need this scenario. Probably, make more robust tests, go through current transformations and reduce it to `const lastSourceValue = dataSubObject?.[lastPathPart]`
276
- path.lastValue = path.currentPathPart.selector ? path.currentDataSubObject?.[path.currentPathPart.selector] : path.currentDataSubObject;
277
- // console_log(`[transform:executeTransformOnDataObjExpandedPaths] pathParts: ${chalkJSONstringify(pathParts)}, path.currentPathPart: ${path.currentPathPart}, lastValue: ${lastValue}, dataSubObject: ${chalkJSONstringify(dataSubObject, null, 4)}`);
278
- }
279
- }
280
- }
281
- }
282
- // upgrade flags
283
- if (!isLastPathPart) {
284
- areEndsReachedByAllPaths = false;
285
- }
286
- // iterability
287
- if (path.currentPathPart.isIterable) {
288
- areAllPathsAtNonIterablePathPart = false;
289
- }
290
- else {
291
- areAllPathsAtIterablePathPart = false;
292
- }
293
- console_warn(`[transform:executeTransformOnDataObjExpandedPaths] stopped "while" for path.id="${path.id}" path.dataSubObject: ${chalkJSONstringify(path.currentDataSubObject)}, path.currentPathPart: ${chalkJSONstringify(path.currentPathPart)}, path.lastValue: ${chalkJSONstringify(path.lastValue)}`);
294
- // console_log(`[transform:executeTransformOnDataObjExpandedPaths] [2] pathParts: ${chalkJSONstringify(pathParts)}, lastPathPart: ${lastPathPart}, dataSubObject: ${chalkJSONstringify(dataSubObject, null, 4)}`);
295
- }
296
- pathsContext.mainIterablePathContext = pathsContext.sourcePathContext ?? firstDestinationPathContext;
297
- // check overall paths states
298
- if (areEndsReachedByAllPaths) {
299
- pathsContext.allPathsReachedEnds = true;
300
- console_warn(`[transform:executeTransformOnDataObjExpandedPaths] ${chalk.bold.blue("pathsContext.allPathsReachedEnds = true")}`);
301
- }
302
- if (areAllPathsAtIterablePathPart) {
303
- pathsContext.state = EPathsTransformationContextState.ALL_PATHS_AT_ITERABLE_PART;
304
- console_warn(`[transform:executeTransformOnDataObjExpandedPaths] pathsContext.state = EPathsTransformationContextState.ALL_PATHS_AT_ITERABLE_PART`);
305
- }
306
- if (areAllPathsAtNonIterablePathPart) {
307
- pathsContext.state = EPathsTransformationContextState.ALL_PATHS_AT_NON_ITERABLE_PART;
308
- console_warn(`[transform:executeTransformOnDataObjExpandedPaths] pathsContext.state = EPathsTransformationContextState.ALL_PATHS_AT_NON_ITERABLE_PART`);
309
- }
310
- // problem if not all paths are in the same state if "iterability"
311
- if (!areAllPathsAtNonIterablePathPart && !areAllPathsAtIterablePathPart) {
312
- pathsContext.state = EPathsTransformationContextState.NOT_ALL_PATHS_AT_ITERABLE_PART;
313
- console_warn(`[transform:executeTransformOnDataObjExpandedPaths] pathsContext.state = EPathsTransformationContextState.NOT_ALL_PATHS_AT_ITERABLE_PART`);
314
- throw new Error("Paths didn't reach consensus on either all being iterable or all being non-iterable");
315
- }
316
- return dataObjTransformed;
317
- };
318
- /**
319
- * Transforms data entity through a single transform
320
- * @param transform single transform(ation) operation that should be applied against the `entity` entity. Currently (?) `src` and `dest` properties of it are pre-parsed and provided separately as `_sourceElements` and `_destinationPathParts` elements
321
- * @param entity entity that should be transformed by the single transform(ation) operation `transform`. **NOTE** The entity itself will be transformed, without being cloned and returned!
322
- * @param sourcePathParts path of the source of the transformation operation reduced (in the case of an array) and split into sub-pointers
323
- * @param destinationPathParts path of the destination of the transformation operation reduced (in the case of an array) and split into sub-pointers
324
- * @returns
325
- */
326
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
327
- export const asyncExecuteTransformOnDataObjExpandedPaths = async (transform, dataObjTransformed, pathsContext) => {
328
- console_log(`[transform:executeTransformOnDataObjExpandedPaths] transform: ${chalkJSONstringify(transform)}`);
329
- // report on paths
330
- for (const pathName in pathsContext.paths) {
331
- const path = pathsContext.paths[pathName];
332
- // TODO: see if this is acceptable
333
- if (path.avoidWalkThroughPath) {
334
- console_log(`[transform:executeTransformOnDataObjExpandedPaths] avoidWalkThroughPath path.id: ${path.id}`);
335
- }
336
- console_log(`[transform:executeTransformOnDataObjExpandedPaths] path.id: ${chalkJSONstringify(path.id)}, path.direction: ${chalkJSONstringify(path.direction)}, path.pathPartsAspects: ${chalkJSONstringify(path.pathPartsAspects)}, path.currentPathPartIndex: ${path.currentPathPartIndex}`);
337
- }
338
- if (pathsContext.allPathsReachedEnds) {
339
- console_warn(`[transform:asyncExecuteTransformOnDataObjExpandedPaths] ${chalkJSONstringify("pathsContext.allPathsReachedEnds")}: ${pathsContext.allPathsReachedEnds}`);
340
- dataObjTransformed = await asyncApplyTransformOnDataSubObject(transform, dataObjTransformed, pathsContext);
341
- }
342
- else {
343
- // WALK-DOWN the paths
344
- dataObjTransformed = await asyncWalkDownTransformPaths(transform, dataObjTransformed, pathsContext);
345
- if (pathsContext.state === EPathsTransformationContextState.ALL_PATHS_AT_ITERABLE_PART) {
346
- dataObjTransformed = await asyncProcessTransformIterability(transform, dataObjTransformed, pathsContext);
347
- }
348
- else {
349
- dataObjTransformed = await asyncApplyTransformOnDataSubObject(transform, dataObjTransformed, pathsContext);
350
- }
351
- }
352
- console_log(`[transform:executeTransformOnDataObjExpandedPaths] transformed (partially) entry: ${chalkJSONstringify(dataObjTransformed)}`);
353
- return dataObjTransformed;
354
- };
355
- /**
356
- * Converts JSON path (pointer, extension of the JSON Pointer [RFC6901](https://datatracker.ietf.org/doc/html/rfc6901) standard)
357
- */
358
- export const pathToPathParts = (path) => {
359
- if (!path || path.trim() === "")
360
- return [];
361
- return path?.split(PATH_SEPARATOR) ?? [];
362
- };
363
- export const extractPathAspects = (path) => {
364
- const pathParts = [];
365
- if (typeof path === "undefined" || path === null)
366
- return [];
367
- if (path.trim() === "") {
368
- console_log(`Root selector, injecting empty pathPart`);
369
- const pathPart = {
370
- text: "",
371
- selector: "",
372
- isIterable: false,
373
- iterableSelector: "",
374
- index: 0,
375
- originalObjectUsed: false,
376
- flags: {},
377
- };
378
- return [pathPart];
379
- }
380
- const pathPartsStr = path?.split(PATH_SEPARATOR) ?? [];
381
- for (let index = 0; index < pathPartsStr.length; index++) {
382
- const pathPartStr = pathPartsStr[index];
383
- let selector = pathPartStr;
384
- let flagsStr;
385
- let iterableSelector;
386
- let isIterable = false;
387
- let originalObjectUsed = false;
388
- // `originalObjectUsed` is optional
389
- // `selector` cannot contain iterator characters: `[` and `]`
390
- // `iterator` is optional
391
- const pathPartRegExp = new RegExp("^(\\<(?<flags>.+)\\>)?(?<originalObjectUsed>\\^)?(?<selector>[^[\\[\\]]+)(\\[(?<iterator>.+)\\])?$");
392
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match#using_match
393
- const pathPartMatches = pathPartStr.match(pathPartRegExp);
394
- if (pathPartMatches) {
395
- if (pathPartMatches.groups) {
396
- iterableSelector = pathPartMatches.groups.iterator;
397
- isIterable = !!iterableSelector;
398
- selector = pathPartMatches.groups.selector;
399
- flagsStr = pathPartMatches.groups.flags;
400
- originalObjectUsed = !!pathPartMatches.groups.originalObjectUsed;
401
- }
402
- }
403
- const flags = {};
404
- if (flagsStr) {
405
- const flagStrArray = flagsStr.split(FLAGS_SEPARATOR);
406
- for (const flagStr of flagStrArray) {
407
- const [flagName, flagValue] = flagStr.split(FLAG_VALUE_SEPARATOR, 2);
408
- flags[flagName] = flagValue;
409
- }
410
- }
411
- const pathPart = {
412
- text: pathPartStr,
413
- selector,
414
- isIterable,
415
- iterableSelector,
416
- index,
417
- originalObjectUsed,
418
- flags,
419
- };
420
- pathParts.push(pathPart);
421
- }
422
- return pathParts;
423
- };
424
- /**
425
- *
426
- * @param dataObjTransformed
427
- * @param transform
428
- * @returns
429
- */
430
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
431
- export const asyncExecuteTransformOnDataObj = async (dataObjToTransform, transform, dataObjOriginal) => {
432
- // console_log(`[transform] transform: ${chalkJSONstringify(transform, null, 4)}`);
433
- const sourcePathPartsAspects = extractPathAspects(transform.src);
434
- const destinationPathPartsAspects = extractPathAspects(transform.dest);
435
- console_log(`[transform:executeTransformOnDataObj] transform.src: ${transform.src}, sourcePathPartsAspects: ${chalkJSONstringify(sourcePathPartsAspects)}`);
436
- console_log(`transform.dest: ${transform.dest}, destinationPathPartsAspects: ${chalkJSONstringify(destinationPathPartsAspects)}`);
437
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
438
- let dataObjTransformed;
439
- /** If we are moving the whole root element then we have to make a now root dataObj that will host it */
440
- const isRootElementUsed = (typeof transform.src === "string" && transform.src.trim() === "") || (typeof transform.dest === "string" && transform.dest.trim() === "");
441
- if (isRootElementUsed && transform.operation === ETransformOperation.MOVE) {
442
- // console_warn(`transform.src: ${transform.src}, isRootElementUsed: ${isRootElementUsed}`);
443
- // TODO: support new dataObj of array
444
- dataObjTransformed = {};
445
- }
446
- else {
447
- dataObjTransformed = dataObjToTransform;
448
- }
449
- const avoidWalkThroughTheSourcePath = [ETransformOperation.ADD].indexOf(transform.operation || ETransformOperation.MOVE) >= 0;
450
- const avoidWalkThroughTheDestinationPath = [ETransformOperation.DELETE].indexOf(transform.operation || ETransformOperation.MOVE) >= 0;
451
- // console_log(`[transform:executeTransformOnDataObj] (transform.operation: ${transform.operation}) avoidWalkThroughTheDestinationPath : ${avoidWalkThroughTheDestinationPath}, avoidWalkThroughTheSourcePath: ${avoidWalkThroughTheSourcePath}`);
452
- if ((typeof transform.src === "undefined" || transform.src === null) && !avoidWalkThroughTheSourcePath) {
453
- throw new Error(`No \`src\` provided in transform but needed for transform: ${chalkJSONstringify(transform)}`);
454
- }
455
- if ((typeof transform.dest === "undefined" || transform.dest === null) && !avoidWalkThroughTheDestinationPath) {
456
- throw new Error(`No \`dest\` provided in transform but needed for transform: ${chalkJSONstringify(transform)}`);
457
- }
458
- const paths = {
459
- source: {
460
- id: "source",
461
- direction: EPathDirection.SOURCE,
462
- avoidWalkThroughPath: avoidWalkThroughTheSourcePath,
463
- pathPartsAspects: sourcePathPartsAspects,
464
- containsSourcePath: true,
465
- currentPathPartIndex: 0,
466
- currentPathPart: sourcePathPartsAspects?.[0],
467
- // if transformation uses original object it should be provided, otherwise the dataObjTransformed will be used
468
- currentDataSubObject: dataObjOriginal ?? dataObjToTransform,
469
- },
470
- destination: {
471
- id: "destination",
472
- direction: EPathDirection.DESTINATION,
473
- avoidWalkThroughPath: avoidWalkThroughTheDestinationPath,
474
- pathPartsAspects: destinationPathPartsAspects,
475
- containsSourcePath: !avoidWalkThroughTheSourcePath && !avoidWalkThroughTheDestinationPath && sourcePathPartsAspects?.[0]?.selector === destinationPathPartsAspects?.[0]?.selector,
476
- currentPathPartIndex: 0,
477
- currentPathPart: destinationPathPartsAspects?.[0],
478
- currentDataSubObject: dataObjTransformed,
479
- },
480
- };
481
- const pathsContext = {
482
- paths,
483
- state: EPathsTransformationContextState.ALL_PATHS_AT_NON_ITERABLE_PART,
484
- };
485
- dataObjTransformed = await asyncExecuteTransformOnDataObjExpandedPaths(transform, dataObjTransformed, pathsContext);
486
- return dataObjTransformed;
487
- };
488
- /** Checks if any of transforms in transformation needs (uses) original object
489
- * @param transformation the transformation we checks for
490
- * @returns true if any of transforms in transformation needs (uses) original object
491
- */
492
- export const isOriginalObjectReferredInTransformation = (transformation) => {
493
- for (const transform of transformation.transforms) {
494
- if (transform?.src?.startsWith("^"))
495
- return true;
496
- }
497
- return false;
498
- };
499
- /** Checks if the transform needs (uses) original object
500
- * @param transform the transform we checks for
501
- * @returns true if the transforms needs (uses) original object
502
- */
503
- export const isOriginalObjectReferredInTransform = (transform) => {
504
- if (transform?.src?.startsWith("^"))
505
- return true;
506
- return false;
507
- };
508
- /**
509
- * Transforms object with the set of transforms described in `transformation.transforms`
510
- * @param dataObjOriginal object to be transformed (**NOTE**: It will transform the object itself, without cloning it and returning)
511
- * @param transformation transformation that should be applied
512
- */
513
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
514
- export const asyncExecuteTransformationOnDataObj = async (dataObjTransformed, transformation, dataObjOriginal) => {
515
- /** tells if the original object is used in any of the `transformation.transforms` */
516
- const originalObjectReferredInTransformation = isOriginalObjectReferredInTransformation(transformation);
517
- // we CLONE the dataObj ONLY if it is necessary, if any of the transformations need original non-transformed object
518
- // (which is usually the case if any transformation before the mentioned destroys value that is needed)
519
- if (originalObjectReferredInTransformation) {
520
- console_log(`[asyncExecuteTransformationOnDataObj] originalObjectUsedInTransformation: ${originalObjectReferredInTransformation}`);
521
- // TODO:OPTIMIZATION Would be great to avoid it if possible with smart approach to transformations
522
- dataObjOriginal = dataObjOriginal ?? JSON.parse(JSON.stringify(dataObjTransformed));
523
- }
524
- // iterate through all transforms in the transformation object
525
- for (const transform of transformation.transforms) {
526
- const reportTransform = `\n${chalk.green("***** ")}${chalk.white("Applying transform [")}${chalk.blue.bold(transform.name || transform.description || "")}]:\n"${chalk.blue(JSON.stringify(transform))}\n${chalk.green.bold("******************************************************************************")}"`;
527
- console_log(reportTransform);
528
- // if the original object is used in the current transform provide it to be used as a source instead of `dataObjTransformed`
529
- if (originalObjectReferredInTransformation && isOriginalObjectReferredInTransform(transform)) {
530
- dataObjTransformed = await asyncExecuteTransformOnDataObj(dataObjTransformed, transform, dataObjOriginal);
531
- }
532
- else {
533
- dataObjTransformed = await asyncExecuteTransformOnDataObj(dataObjTransformed, transform);
534
- }
535
- }
536
- return dataObjTransformed;
537
- };
538
- /**
539
- * Transforms an array of objects with the set of transforms described in `transformation.transforms`
540
- *
541
- * The reason of using this method instead of `asyncExecuteTransformationOnDataObj` is for the sake of the future potential optimization
542
- * **NOTE**: It will transform the `dataObjArray` objects themselves, **without** cloning them and returning copies
543
- *
544
- * @param dataObjArray an array object to be transformed (**NOTE**: It will transform the objects themselves)
545
- * @param transformation transformation that should be applied
546
- * @param dataObjOriginalArray the array of original objects before they are transform. They should not be affected by changes applied on `dataObjArray`
547
- *
548
- * @returns **the very same array** of data objects that it received but just transformed
549
- */
550
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
551
- export const asyncExecuteTransformationOnDataObjArray = async (dataObjArray, transformation, dataObjOriginalArray) => {
552
- for (let dataObjIndex = 0; dataObjIndex < dataObjArray.length; dataObjIndex++) {
553
- const dataObj = dataObjArray[dataObjIndex];
554
- const dataObjOriginal = dataObjOriginalArray?.[dataObjIndex];
555
- const dataObjTransformed = await asyncExecuteTransformationOnDataObj(dataObj, transformation, dataObjOriginal);
556
- dataObjArray[dataObjIndex] = dataObjTransformed;
557
- }
558
- return dataObjArray;
559
- };
560
- /**
561
- * Transforms an array of objects with the set of transforms described in `transformation.transforms`
562
- *
563
- * It can do transformation on a single array of objects (`dataObjArray`) or it can have additional input arrays of objects (packed into input tuple, meaning each element of the `dataObjSourcesArray` array
564
- *
565
- * The reason of using this method instead of `asyncExecuteTransformationOnDataObj` is for the sake of the future potential optimization
566
- *
567
- * TODO:NOT_IMPLEMENTED
568
- * @param dataObjArray an array object to be transformed (**NOTE**: It will transform the objects themselves, **without** cloning them and returning copies)
569
- * @param transformation transformation that should be applied
570
- * @param dataObjSourcesArray the list all input data objects
571
- * @returns the very same array of data objects that it received but just transformed
572
- */
573
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
574
- export const asyncExecuteTransformationOnDataEntryElementArray = async (dataEntryElements, transformation) => {
575
- for (let dataEntryElementIndex = 0; dataEntryElementIndex < dataEntryElements.length; dataEntryElementIndex++) {
576
- const dataEntryElement = dataEntryElements[dataEntryElementIndex];
577
- const dataEntriesTransformed = await asyncExecuteTransformationOnDataObj(dataEntryElement, transformation);
578
- dataEntryElements[dataEntryElementIndex] = dataEntriesTransformed;
579
- }
580
- return dataEntryElements;
581
- };
582
- //# sourceMappingURL=transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../../../../../../../../../../../../colabo-vue3/src/isomorphic/puzzles/transform/json/lib/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,mBAAmB,EAAyC,cAAc,EAA+B,gCAAgC,EAAyC,MAAM,qBAAqB,CAAC;AAEpP,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,QAAQ,GAAY,KAAK,CAAC;AAChC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,IAAI,QAAQ;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,IAAI,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,+IAA+I;AAC/I,MAAM,+BAA+B,GAAG,CAAC,YAAyC,EAA+B,EAAE;IAClH,MAAM,kBAAkB,GAAgC;QACvD,GAAG,YAAY;QACf,KAAK,EAAE,EAAE;KACT,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,KAAK,EAAE;QAC1C,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC1C,MAAM,UAAU,GAA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