@twin.org/node-core 0.9.2-next.6 → 0.9.2-next.7

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.
@@ -0,0 +1,80 @@
1
+ import type { IEngineEnvironmentVariables } from "../../models/IEngineEnvironmentVariables.js";
2
+ /**
3
+ * Coerces an env var to a boolean, falling back to the supplied default when not set.
4
+ * @param envVars The environment variables object.
5
+ * @param key The property name of the env var to coerce.
6
+ * @param defaultValue The value to return when the env var is absent.
7
+ * @returns The boolean value or the default.
8
+ * @throws GeneralError if the value is set but cannot be coerced to a boolean.
9
+ */
10
+ export declare function envBoolean(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables, defaultValue: boolean): boolean;
11
+ /**
12
+ * Coerces an env var that is already in milliseconds to an integer.
13
+ * @param envVars The environment variables object.
14
+ * @param key The property name of the env var to coerce.
15
+ * @returns The millisecond value, or undefined when not set.
16
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
17
+ */
18
+ export declare function envMs(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
19
+ /**
20
+ * Coerces an env var that represents an integer count or size to an integer.
21
+ * @param envVars The environment variables object.
22
+ * @param key The property name of the env var to coerce.
23
+ * @returns The count, or undefined when not set.
24
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
25
+ */
26
+ export declare function envCount(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
27
+ /**
28
+ * Coerces an env var that represents an integer to an integer.
29
+ * @param envVars The environment variables object.
30
+ * @param key The property name of the env var to coerce.
31
+ * @returns The integer, or undefined when not set.
32
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
33
+ */
34
+ export declare function envInteger(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
35
+ /**
36
+ * Coerces an env var that is already in seconds to an integer.
37
+ * @param envVars The environment variables object.
38
+ * @param key The property name of the env var to coerce.
39
+ * @returns The second value, or undefined when not set.
40
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
41
+ */
42
+ export declare function envSeconds(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
43
+ /**
44
+ * Coerces an env var that is already in minutes to an integer.
45
+ * @param envVars The environment variables object.
46
+ * @param key The property name of the env var to coerce.
47
+ * @returns The minute value, or undefined when not set.
48
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
49
+ */
50
+ export declare function envMinutes(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
51
+ /**
52
+ * Coerces an env var that is a datetime string, throwing when the value is set but not a valid datetime.
53
+ * @param envVars The environment variables object.
54
+ * @param key The property name of the env var to coerce.
55
+ * @returns The datetime string, or undefined when not set.
56
+ * @throws GeneralError if the value is set but cannot be coerced to a datetime.
57
+ */
58
+ export declare function envDateTime(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): string | undefined;
59
+ /**
60
+ * Coerces an env var to an integer and converts from seconds to milliseconds.
61
+ * @param envVars The environment variables object.
62
+ * @param key The property name of the env var to coerce.
63
+ * @returns The value in milliseconds, or undefined when not set.
64
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
65
+ */
66
+ export declare function envSecToMs(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
67
+ /**
68
+ * Coerces an env var to an integer and converts from minutes to milliseconds.
69
+ * @param envVars The environment variables object.
70
+ * @param key The property name of the env var to coerce.
71
+ * @returns The value in milliseconds, or undefined when not set.
72
+ * @throws GeneralError if the value is set but cannot be coerced to an integer.
73
+ */
74
+ export declare function envMinToMs(envVars: IEngineEnvironmentVariables, key: keyof IEngineEnvironmentVariables): number | undefined;
75
+ /**
76
+ * Converts a comma separated list to an array.
77
+ * @param value The comma separated list.
78
+ * @returns The array.
79
+ */
80
+ export declare function commaSeparatedListToArray<T>(value: string | undefined): T[];
@@ -138,7 +138,7 @@ export interface IEngineEnvironmentVariables {
138
138
  /**
139
139
  * MySQL port.
140
140
  */
141
- mySqlPort?: number;
141
+ mySqlPort?: string;
142
142
  /**
143
143
  * MySQL username.
144
144
  */
@@ -158,7 +158,7 @@ export interface IEngineEnvironmentVariables {
158
158
  /**
159
159
  * MongoDB port.
160
160
  */
161
- mongoDbPort?: number;
161
+ mongoDbPort?: string;
162
162
  /**
163
163
  * MongoDB username.
164
164
  */
@@ -178,7 +178,7 @@ export interface IEngineEnvironmentVariables {
178
178
  /**
179
179
  * PostgreSQl port.
180
180
  */
181
- postgreSqlPort?: number;
181
+ postgreSqlPort?: string;
182
182
  /**
183
183
  * PostgreSQl username.
184
184
  */
@@ -564,18 +564,47 @@ export interface IEngineEnvironmentVariables {
564
564
  * The number of times to retry a proof task when it fails, 0 to disable retries.
565
565
  * @default 5
566
566
  */
567
- immutableProofTaskRetryCount?: number;
567
+ immutableProofTaskRetryCount?: string;
568
568
  /**
569
569
  * The interval in seconds to wait between proof task retries.
570
570
  * @default 5
571
571
  */
572
- immutableProofTaskRetryInterval?: number;
572
+ immutableProofTaskRetryInterval?: string;
573
573
  /**
574
574
  * The time in minutes to retain the record of a failed proof task.
575
575
  * Set to -1 to retain failures forever.
576
576
  * @default 10080
577
577
  */
578
- immutableProofTaskFailureRetainFor?: number;
578
+ immutableProofTaskFailureRetainFor?: string;
579
+ /**
580
+ * How often in minutes the immutable proof reconciliation sweep runs.
581
+ * @default 30
582
+ */
583
+ immutableProofSweepInterval?: string;
584
+ /**
585
+ * The minimum age in minutes before a proof with no notarization is considered stuck.
586
+ * @default 180
587
+ */
588
+ immutableProofSweepStaleThreshold?: string;
589
+ /**
590
+ * The number of sweep attempts made before a proof is parked.
591
+ * @default 5
592
+ */
593
+ immutableProofSweepMaxAttempts?: string;
594
+ /**
595
+ * The maximum number of proofs to re-enqueue per tenant per sweep cycle.
596
+ * @default 10
597
+ */
598
+ immutableProofSweepBatchLimit?: string;
599
+ /**
600
+ * The minimum time in minutes between sweep attempts for the same proof.
601
+ * @default 60
602
+ */
603
+ immutableProofSweepBackoff?: string;
604
+ /**
605
+ * ISO 8601 date-time used to treat older missing-task proofs as retryable.
606
+ */
607
+ immutableProofSweepAssumeRetryableBefore?: string;
579
608
  /**
580
609
  * The type of attestation connector: entity-storage, iota.
581
610
  */
@@ -739,6 +768,14 @@ export interface IEngineEnvironmentVariables {
739
768
  * @default 30
740
769
  */
741
770
  dataspaceStalledTransferTimeout?: string;
771
+ /**
772
+ * How long in seconds a provider transfer may stay idle before the idle policy marks it as stalled.
773
+ */
774
+ dataspaceProviderTransferIdleTimeout?: string;
775
+ /**
776
+ * How frequently in seconds the provider idle transfer policy sweep runs.
777
+ */
778
+ dataspaceProviderTransferPolicySweepInterval?: string;
742
779
  /**
743
780
  * Path under which the dataspace control plane is mounted (path only, not full URL).
744
781
  * This must match the control-plane REST mount, as it is combined with the public
@@ -793,13 +830,9 @@ export interface IEngineEnvironmentVariables {
793
830
  */
794
831
  loggingMutexTimeout?: string;
795
832
  /**
796
- * The mutex timeout in milliseconds for the memory entity storage connector.
797
- */
798
- entityStorageMemoryMutexTimeout?: string;
799
- /**
800
- * The mutex timeout in milliseconds for the file entity storage connector.
833
+ * The mutex timeout in milliseconds for the memory and file entity storage connectors.
801
834
  */
802
- entityStorageFileMutexTimeout?: string;
835
+ entityStorageMutexTimeout?: string;
803
836
  /**
804
837
  * The mutex timeout in milliseconds for the rights management component.
805
838
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.2-next.7](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.2-next.6...node-core-v0.9.2-next.7) (2026-08-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * additional env vars and validation ([#324](https://github.com/iotaledger/twin-node/issues/324)) ([6b01e8c](https://github.com/iotaledger/twin-node/commit/6b01e8c10f9aa7181f51f13534d8164db3e7322d))
9
+
3
10
  ## [0.9.2-next.6](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.2-next.5...node-core-v0.9.2-next.6) (2026-08-07)
4
11
 
5
12
 
@@ -268,7 +268,7 @@ MySQL host.
268
268
 
269
269
  ### mySqlPort? {#mysqlport}
270
270
 
271
- > `optional` **mySqlPort?**: `number`
271
+ > `optional` **mySqlPort?**: `string`
272
272
 
273
273
  MySQL port.
274
274
 
@@ -308,7 +308,7 @@ MongoDB host.
308
308
 
309
309
  ### mongoDbPort? {#mongodbport}
310
310
 
311
- > `optional` **mongoDbPort?**: `number`
311
+ > `optional` **mongoDbPort?**: `string`
312
312
 
313
313
  MongoDB port.
314
314
 
@@ -348,7 +348,7 @@ PostgreSQl host.
348
348
 
349
349
  ### postgreSqlPort? {#postgresqlport}
350
350
 
351
- > `optional` **postgreSqlPort?**: `number`
351
+ > `optional` **postgreSqlPort?**: `string`
352
352
 
353
353
  PostgreSQl port.
354
354
 
@@ -1129,7 +1129,7 @@ The identity verification method id to use with immutable proofs.
1129
1129
 
1130
1130
  ### immutableProofTaskRetryCount? {#immutableprooftaskretrycount}
1131
1131
 
1132
- > `optional` **immutableProofTaskRetryCount?**: `number`
1132
+ > `optional` **immutableProofTaskRetryCount?**: `string`
1133
1133
 
1134
1134
  The number of times to retry a proof task when it fails, 0 to disable retries.
1135
1135
 
@@ -1143,7 +1143,7 @@ The number of times to retry a proof task when it fails, 0 to disable retries.
1143
1143
 
1144
1144
  ### immutableProofTaskRetryInterval? {#immutableprooftaskretryinterval}
1145
1145
 
1146
- > `optional` **immutableProofTaskRetryInterval?**: `number`
1146
+ > `optional` **immutableProofTaskRetryInterval?**: `string`
1147
1147
 
1148
1148
  The interval in seconds to wait between proof task retries.
1149
1149
 
@@ -1157,7 +1157,7 @@ The interval in seconds to wait between proof task retries.
1157
1157
 
1158
1158
  ### immutableProofTaskFailureRetainFor? {#immutableprooftaskfailureretainfor}
1159
1159
 
1160
- > `optional` **immutableProofTaskFailureRetainFor?**: `number`
1160
+ > `optional` **immutableProofTaskFailureRetainFor?**: `string`
1161
1161
 
1162
1162
  The time in minutes to retain the record of a failed proof task.
1163
1163
  Set to -1 to retain failures forever.
@@ -1170,6 +1170,84 @@ Set to -1 to retain failures forever.
1170
1170
 
1171
1171
  ***
1172
1172
 
1173
+ ### immutableProofSweepInterval? {#immutableproofsweepinterval}
1174
+
1175
+ > `optional` **immutableProofSweepInterval?**: `string`
1176
+
1177
+ How often in minutes the immutable proof reconciliation sweep runs.
1178
+
1179
+ #### Default
1180
+
1181
+ ```ts
1182
+ 30
1183
+ ```
1184
+
1185
+ ***
1186
+
1187
+ ### immutableProofSweepStaleThreshold? {#immutableproofsweepstalethreshold}
1188
+
1189
+ > `optional` **immutableProofSweepStaleThreshold?**: `string`
1190
+
1191
+ The minimum age in minutes before a proof with no notarization is considered stuck.
1192
+
1193
+ #### Default
1194
+
1195
+ ```ts
1196
+ 180
1197
+ ```
1198
+
1199
+ ***
1200
+
1201
+ ### immutableProofSweepMaxAttempts? {#immutableproofsweepmaxattempts}
1202
+
1203
+ > `optional` **immutableProofSweepMaxAttempts?**: `string`
1204
+
1205
+ The number of sweep attempts made before a proof is parked.
1206
+
1207
+ #### Default
1208
+
1209
+ ```ts
1210
+ 5
1211
+ ```
1212
+
1213
+ ***
1214
+
1215
+ ### immutableProofSweepBatchLimit? {#immutableproofsweepbatchlimit}
1216
+
1217
+ > `optional` **immutableProofSweepBatchLimit?**: `string`
1218
+
1219
+ The maximum number of proofs to re-enqueue per tenant per sweep cycle.
1220
+
1221
+ #### Default
1222
+
1223
+ ```ts
1224
+ 10
1225
+ ```
1226
+
1227
+ ***
1228
+
1229
+ ### immutableProofSweepBackoff? {#immutableproofsweepbackoff}
1230
+
1231
+ > `optional` **immutableProofSweepBackoff?**: `string`
1232
+
1233
+ The minimum time in minutes between sweep attempts for the same proof.
1234
+
1235
+ #### Default
1236
+
1237
+ ```ts
1238
+ 60
1239
+ ```
1240
+
1241
+ ***
1242
+
1243
+ ### immutableProofSweepAssumeRetryableBefore? {#immutableproofsweepassumeretryablebefore}
1244
+
1245
+ > `optional` **immutableProofSweepAssumeRetryableBefore?**: `string`
1246
+
1247
+ ISO 8601 date-time used to treat older missing-task proofs as retryable.
1248
+
1249
+ ***
1250
+
1173
1251
  ### attestationConnector? {#attestationconnector}
1174
1252
 
1175
1253
  > `optional` **attestationConnector?**: `string`
@@ -1494,6 +1572,22 @@ progressing it before it is treated as timed out.
1494
1572
 
1495
1573
  ***
1496
1574
 
1575
+ ### dataspaceProviderTransferIdleTimeout? {#dataspaceprovidertransferidletimeout}
1576
+
1577
+ > `optional` **dataspaceProviderTransferIdleTimeout?**: `string`
1578
+
1579
+ How long in seconds a provider transfer may stay idle before the idle policy marks it as stalled.
1580
+
1581
+ ***
1582
+
1583
+ ### dataspaceProviderTransferPolicySweepInterval? {#dataspaceprovidertransferpolicysweepinterval}
1584
+
1585
+ > `optional` **dataspaceProviderTransferPolicySweepInterval?**: `string`
1586
+
1587
+ How frequently in seconds the provider idle transfer policy sweep runs.
1588
+
1589
+ ***
1590
+
1497
1591
  ### dataspaceCallbackPath? {#dataspacecallbackpath}
1498
1592
 
1499
1593
  > `optional` **dataspaceCallbackPath?**: `string`
@@ -1600,19 +1694,11 @@ The mutex timeout in milliseconds for the logging component.
1600
1694
 
1601
1695
  ***
1602
1696
 
1603
- ### entityStorageMemoryMutexTimeout? {#entitystoragememorymutextimeout}
1604
-
1605
- > `optional` **entityStorageMemoryMutexTimeout?**: `string`
1606
-
1607
- The mutex timeout in milliseconds for the memory entity storage connector.
1608
-
1609
- ***
1610
-
1611
- ### entityStorageFileMutexTimeout? {#entitystoragefilemutextimeout}
1697
+ ### entityStorageMutexTimeout? {#entitystoragemutextimeout}
1612
1698
 
1613
- > `optional` **entityStorageFileMutexTimeout?**: `string`
1699
+ > `optional` **entityStorageMutexTimeout?**: `string`
1614
1700
 
1615
- The mutex timeout in milliseconds for the file entity storage connector.
1701
+ The mutex timeout in milliseconds for the memory and file entity storage connectors.
1616
1702
 
1617
1703
  ***
1618
1704
 
package/locales/en.json CHANGED
@@ -14,6 +14,7 @@
14
14
  "cliCommandParamMissing": "Parameter \"{param}\" is required for command \"{command}\"",
15
15
  "cliCommandParamExtra": "Parameter(s) \"{params}\" are not recognised for command \"{command}\"",
16
16
  "cliEnvVarMissing": "Environment variable \"{envVar}\" does not exist",
17
+ "invalidEnvVarValue": "Environment variable \"{key}\" has an invalid value \"{value}\", expected {type} type",
17
18
  "unknownEnvVars": "Unknown environment variable properties [{keys}]. Check for typos in variable names, for custom variables use the {prefix}ENV_ALLOW_LIST."
18
19
  },
19
20
  "bootstrapDev": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node-core",
3
- "version": "0.9.2-next.6",
3
+ "version": "0.9.2-next.7",
4
4
  "description": "TWIN Node Core for serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",