@steerprotocol/data-connector-loader 5.0.0-next.3 → 5.0.0-next.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.
- package/README.md +14 -0
- package/lib/bundle/bundleBase.js +12 -4
- package/lib/esm/bundle/bundleBase.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,6 +31,20 @@ change must be marked as such for the first prerelease of a new major version.
|
|
|
31
31
|
The npm package must authorize `next-publish.yml` as a trusted publisher before
|
|
32
32
|
that workflow can publish.
|
|
33
33
|
|
|
34
|
+
## CI checks
|
|
35
|
+
|
|
36
|
+
The shared `next-ci.yml` matrix verifies Node 22 and Node 24. Each job runs
|
|
37
|
+
`npm ci` (which builds CommonJS and ESM through `prepare`), tests, Biome,
|
|
38
|
+
and packed-consumer checks. Node 24 collects coverage during its test run;
|
|
39
|
+
coverage comments are posted on same-repository pull requests with write access.
|
|
40
|
+
Fork and Dependabot pull requests still run coverage without posting comments.
|
|
41
|
+
|
|
42
|
+
Pull requests and non-release branch pushes run the shared CI directly.
|
|
43
|
+
Pushes to `next` or `main` run it once through their release workflow, and
|
|
44
|
+
publishing waits for both Node jobs. The release workflow filenames remain
|
|
45
|
+
unchanged for npm trusted publishing. The packed-consumer check installs into
|
|
46
|
+
a fresh temporary directory while reusing npm's download cache.
|
|
47
|
+
|
|
34
48
|
## Block-pinned strategy execution (recommended)
|
|
35
49
|
|
|
36
50
|
Supply a resolved `SmartPoolExecutionContext` to `ExecutionApp.executeWithContext`.
|
package/lib/bundle/bundleBase.js
CHANGED
|
@@ -136,7 +136,8 @@ class BundleBase {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
setExecutionContextStrategyExecution(executionContext, forceDeposit) {
|
|
139
|
-
|
|
139
|
+
if (!this.module)
|
|
140
|
+
throw new Error("Module not initialized");
|
|
140
141
|
// Determine the timestamp for epoch
|
|
141
142
|
const timestamp = this.subtractDate(executionContext.executionTimestamp, Number(executionContext.epochLength)).getTime();
|
|
142
143
|
// Divide milliseconds data to seconds for transformation bundle
|
|
@@ -146,20 +147,27 @@ class BundleBase {
|
|
|
146
147
|
if (completeConfig.triggerStyle && forceDeposit === true) {
|
|
147
148
|
completeConfig.triggerStyle = "None";
|
|
148
149
|
}
|
|
149
|
-
(
|
|
150
|
+
if (this.module.initialize(JSON.stringify(completeConfig, bigIntReplacer)) ===
|
|
151
|
+
false) {
|
|
152
|
+
throw new Error("Strategy initialization failed");
|
|
153
|
+
}
|
|
150
154
|
}
|
|
151
155
|
/**
|
|
152
156
|
* Initializes a strategy from an already resolved SDK context. Unlike the
|
|
153
157
|
* legacy setter this deliberately does not derive a timestamp or block.
|
|
154
158
|
*/
|
|
155
159
|
initializeStrategyWithContext(executionContext, forceDeposit) {
|
|
156
|
-
|
|
160
|
+
if (!this.module)
|
|
161
|
+
throw new Error("Module not initialized");
|
|
157
162
|
this.executionContext = executionContext;
|
|
158
163
|
const completeConfig = Object.assign(Object.assign({}, JSON.parse(this.config)), executionContext);
|
|
159
164
|
if (completeConfig.triggerStyle && forceDeposit === true) {
|
|
160
165
|
completeConfig.triggerStyle = "None";
|
|
161
166
|
}
|
|
162
|
-
(
|
|
167
|
+
if (this.module.initialize(JSON.stringify(completeConfig, bigIntReplacer)) ===
|
|
168
|
+
false) {
|
|
169
|
+
throw new Error("Strategy initialization failed");
|
|
170
|
+
}
|
|
163
171
|
}
|
|
164
172
|
setExecutionContextDataConnector(executionContext) {
|
|
165
173
|
var _a;
|
|
@@ -114,6 +114,8 @@ export class BundleBase {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
setExecutionContextStrategyExecution(executionContext, forceDeposit) {
|
|
117
|
+
if (!this.module)
|
|
118
|
+
throw new Error("Module not initialized");
|
|
117
119
|
// Determine the timestamp for epoch
|
|
118
120
|
const timestamp = this.subtractDate(executionContext.executionTimestamp, Number(executionContext.epochLength)).getTime();
|
|
119
121
|
// Divide milliseconds data to seconds for transformation bundle
|
|
@@ -129,13 +131,18 @@ export class BundleBase {
|
|
|
129
131
|
if (completeConfig.triggerStyle && forceDeposit === true) {
|
|
130
132
|
completeConfig.triggerStyle = "None";
|
|
131
133
|
}
|
|
132
|
-
this.module
|
|
134
|
+
if (this.module.initialize(JSON.stringify(completeConfig, bigIntReplacer)) ===
|
|
135
|
+
false) {
|
|
136
|
+
throw new Error("Strategy initialization failed");
|
|
137
|
+
}
|
|
133
138
|
}
|
|
134
139
|
/**
|
|
135
140
|
* Initializes a strategy from an already resolved SDK context. Unlike the
|
|
136
141
|
* legacy setter this deliberately does not derive a timestamp or block.
|
|
137
142
|
*/
|
|
138
143
|
initializeStrategyWithContext(executionContext, forceDeposit) {
|
|
144
|
+
if (!this.module)
|
|
145
|
+
throw new Error("Module not initialized");
|
|
139
146
|
this.executionContext = executionContext;
|
|
140
147
|
const completeConfig = {
|
|
141
148
|
...JSON.parse(this.config),
|
|
@@ -144,7 +151,10 @@ export class BundleBase {
|
|
|
144
151
|
if (completeConfig.triggerStyle && forceDeposit === true) {
|
|
145
152
|
completeConfig.triggerStyle = "None";
|
|
146
153
|
}
|
|
147
|
-
this.module
|
|
154
|
+
if (this.module.initialize(JSON.stringify(completeConfig, bigIntReplacer)) ===
|
|
155
|
+
false) {
|
|
156
|
+
throw new Error("Strategy initialization failed");
|
|
157
|
+
}
|
|
148
158
|
}
|
|
149
159
|
setExecutionContextDataConnector(executionContext) {
|
|
150
160
|
// Determine the timestamp for epoch
|