@twin.org/node-core 0.0.2-next.15 → 0.0.2-next.17

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 (42) hide show
  1. package/dist/cjs/index.cjs +360 -160
  2. package/dist/esm/index.mjs +351 -164
  3. package/dist/types/builders/engineEnvBuilder.d.ts +1 -1
  4. package/dist/types/builders/engineServerEnvBuilder.d.ts +2 -2
  5. package/dist/types/builders/extensionsBuilder.d.ts +31 -0
  6. package/dist/types/defaults.d.ts +6 -0
  7. package/dist/types/index.d.ts +4 -0
  8. package/dist/types/models/IEngineEnvironmentVariables.d.ts +60 -18
  9. package/dist/types/models/INodeEngineConfig.d.ts +6 -0
  10. package/dist/types/models/INodeOptions.d.ts +2 -1
  11. package/dist/types/models/nodeExtensionMethods.d.ts +22 -0
  12. package/dist/types/node.d.ts +2 -2
  13. package/dist/types/server.d.ts +4 -2
  14. package/dist/types/utils.d.ts +18 -0
  15. package/docs/changelog.md +15 -0
  16. package/docs/reference/functions/buildConfiguration.md +2 -2
  17. package/docs/reference/functions/buildEngineConfiguration.md +2 -2
  18. package/docs/reference/functions/buildEngineServerConfiguration.md +3 -3
  19. package/docs/reference/functions/directoryExists.md +19 -0
  20. package/docs/reference/functions/extensionsConfiguration.md +25 -0
  21. package/docs/reference/functions/extensionsInitialiseEngine.md +25 -0
  22. package/docs/reference/functions/extensionsInitialiseEngineServer.md +31 -0
  23. package/docs/reference/functions/getFiles.md +19 -0
  24. package/docs/reference/functions/getSubFolders.md +19 -0
  25. package/docs/reference/functions/shutdownExtensions.md +19 -0
  26. package/docs/reference/functions/start.md +4 -4
  27. package/docs/reference/index.md +17 -0
  28. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +118 -26
  29. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +166 -34
  30. package/docs/reference/interfaces/INodeEngineConfig.md +7 -0
  31. package/docs/reference/interfaces/INodeEnvironmentVariables.md +166 -34
  32. package/docs/reference/interfaces/INodeOptions.md +6 -2
  33. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +18 -0
  34. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +24 -0
  35. package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +23 -0
  36. package/docs/reference/variables/ATTESTATION_VERIFICATION_METHOD_ID.md +3 -0
  37. package/docs/reference/variables/AUTH_SIGNING_KEY_ID.md +3 -0
  38. package/docs/reference/variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
  39. package/docs/reference/variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +3 -0
  40. package/docs/reference/variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
  41. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +3 -0
  42. package/package.json +13 -2
@@ -81,6 +81,18 @@ A prefix for all the table in entity-storage, can be empty.
81
81
 
82
82
  ***
83
83
 
84
+ ### awsDynamodbAuthMode?
85
+
86
+ > `optional` **awsDynamodbAuthMode**: `string`
87
+
88
+ AWS DynamoDB auth mode, either credentials or pod.
89
+
90
+ #### Inherited from
91
+
92
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsDynamodbAuthMode`](IEngineServerEnvironmentVariables.md#awsdynamodbauthmode)
93
+
94
+ ***
95
+
84
96
  ### awsDynamodbAccessKeyId?
85
97
 
86
98
  > `optional` **awsDynamodbAccessKeyId**: `string`
@@ -575,15 +587,15 @@ A prefix for all the blobs in blob-storage, can be empty.
575
587
 
576
588
  ***
577
589
 
578
- ### awsS3AccessKeyId?
590
+ ### awsS3Region?
579
591
 
580
- > `optional` **awsS3AccessKeyId**: `string`
592
+ > `optional` **awsS3Region**: `string`
581
593
 
582
- AWS S3 access key id.
594
+ AWS S3 region.
583
595
 
584
596
  #### Inherited from
585
597
 
586
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3AccessKeyId`](IEngineServerEnvironmentVariables.md#awss3accesskeyid)
598
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3Region`](IEngineServerEnvironmentVariables.md#awss3region)
587
599
 
588
600
  ***
589
601
 
@@ -599,27 +611,27 @@ AWS S3 bucket name.
599
611
 
600
612
  ***
601
613
 
602
- ### awsS3Endpoint?
614
+ ### awsS3AuthMode?
603
615
 
604
- > `optional` **awsS3Endpoint**: `string`
616
+ > `optional` **awsS3AuthMode**: `string`
605
617
 
606
- AWS S3 endpoint.
618
+ AWS S3 auth mode, either credentials or pod, defaults to credentials.
607
619
 
608
620
  #### Inherited from
609
621
 
610
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3Endpoint`](IEngineServerEnvironmentVariables.md#awss3endpoint)
622
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3AuthMode`](IEngineServerEnvironmentVariables.md#awss3authmode)
611
623
 
612
624
  ***
613
625
 
614
- ### awsS3Region?
626
+ ### awsS3AccessKeyId?
615
627
 
616
- > `optional` **awsS3Region**: `string`
628
+ > `optional` **awsS3AccessKeyId**: `string`
617
629
 
618
- AWS S3 region.
630
+ AWS S3 access key id.
619
631
 
620
632
  #### Inherited from
621
633
 
622
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3Region`](IEngineServerEnvironmentVariables.md#awss3region)
634
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3AccessKeyId`](IEngineServerEnvironmentVariables.md#awss3accesskeyid)
623
635
 
624
636
  ***
625
637
 
@@ -635,6 +647,18 @@ AWS S3 secret access key.
635
647
 
636
648
  ***
637
649
 
650
+ ### awsS3Endpoint?
651
+
652
+ > `optional` **awsS3Endpoint**: `string`
653
+
654
+ AWS S3 endpoint.
655
+
656
+ #### Inherited from
657
+
658
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsS3Endpoint`](IEngineServerEnvironmentVariables.md#awss3endpoint)
659
+
660
+ ***
661
+
638
662
  ### azureStorageAccountKey?
639
663
 
640
664
  > `optional` **azureStorageAccountKey**: `string`
@@ -815,39 +839,88 @@ The type of event bus component: service.
815
839
 
816
840
  ***
817
841
 
818
- ### messagingEmailConnector?
842
+ ### messagingEnabled?
819
843
 
820
- > `optional` **messagingEmailConnector**: `string`
844
+ > `optional` **messagingEnabled**: `string`
821
845
 
822
- The type of messaging email connector: entity-storage, aws.
846
+ Are the messaging components enabled, defaults to false.
823
847
 
824
848
  #### Inherited from
825
849
 
826
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingEmailConnector`](IEngineServerEnvironmentVariables.md#messagingemailconnector)
850
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingEnabled`](IEngineServerEnvironmentVariables.md#messagingenabled)
827
851
 
828
852
  ***
829
853
 
830
- ### messagingSmsConnector?
854
+ ### messagingTemplates?
831
855
 
832
- > `optional` **messagingSmsConnector**: `string`
856
+ > `optional` **messagingTemplates**: `string`
833
857
 
834
- The type of messaging sms connector: entity-storage, aws.
858
+ An initial set of templates for the messages.
859
+ Use the @json: prefix to specify the path to the JSON file.
835
860
 
836
861
  #### Inherited from
837
862
 
838
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingSmsConnector`](IEngineServerEnvironmentVariables.md#messagingsmsconnector)
863
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingTemplates`](IEngineServerEnvironmentVariables.md#messagingtemplates)
839
864
 
840
865
  ***
841
866
 
842
- ### messagingPushNotificationConnector?
867
+ ### awsSesRegion?
843
868
 
844
- > `optional` **messagingPushNotificationConnector**: `string`
869
+ > `optional` **awsSesRegion**: `string`
845
870
 
846
- The type of messaging push notification connector: entity-storage, aws.
871
+ AWS SES region.
847
872
 
848
873
  #### Inherited from
849
874
 
850
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingPushNotificationConnector`](IEngineServerEnvironmentVariables.md#messagingpushnotificationconnector)
875
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsSesRegion`](IEngineServerEnvironmentVariables.md#awssesregion)
876
+
877
+ ***
878
+
879
+ ### awsSesAuthMode?
880
+
881
+ > `optional` **awsSesAuthMode**: `string`
882
+
883
+ AWS SES auth mode, either credentials or pod, defaults to credentials.
884
+
885
+ #### Inherited from
886
+
887
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsSesAuthMode`](IEngineServerEnvironmentVariables.md#awssesauthmode)
888
+
889
+ ***
890
+
891
+ ### awsSesSecretAccessKey?
892
+
893
+ > `optional` **awsSesSecretAccessKey**: `string`
894
+
895
+ AWS SES secret access key.
896
+
897
+ #### Inherited from
898
+
899
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsSesSecretAccessKey`](IEngineServerEnvironmentVariables.md#awssessecretaccesskey)
900
+
901
+ ***
902
+
903
+ ### awsSesAccessKeyId?
904
+
905
+ > `optional` **awsSesAccessKeyId**: `string`
906
+
907
+ AWS SES access key id.
908
+
909
+ #### Inherited from
910
+
911
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsSesAccessKeyId`](IEngineServerEnvironmentVariables.md#awssesaccesskeyid)
912
+
913
+ ***
914
+
915
+ ### awsSesEndpoint?
916
+
917
+ > `optional` **awsSesEndpoint**: `string`
918
+
919
+ AWS SES endpoint.
920
+
921
+ #### Inherited from
922
+
923
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`awsSesEndpoint`](IEngineServerEnvironmentVariables.md#awssesendpoint)
851
924
 
852
925
  ***
853
926
 
@@ -863,15 +936,39 @@ The applications for the push notifications JSON stringified array of IAwsApplic
863
936
 
864
937
  ***
865
938
 
866
- ### messagingComponent?
939
+ ### messagingEmailConnector?
940
+
941
+ > `optional` **messagingEmailConnector**: `string`
942
+
943
+ The type of messaging email connector: entity-storage, aws.
944
+
945
+ #### Inherited from
946
+
947
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingEmailConnector`](IEngineServerEnvironmentVariables.md#messagingemailconnector)
948
+
949
+ ***
950
+
951
+ ### messagingSmsConnector?
952
+
953
+ > `optional` **messagingSmsConnector**: `string`
954
+
955
+ The type of messaging sms connector: entity-storage, aws.
956
+
957
+ #### Inherited from
958
+
959
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingSmsConnector`](IEngineServerEnvironmentVariables.md#messagingsmsconnector)
960
+
961
+ ***
962
+
963
+ ### messagingPushNotificationConnector?
867
964
 
868
- > `optional` **messagingComponent**: `string`
965
+ > `optional` **messagingPushNotificationConnector**: `string`
869
966
 
870
- The type of messaging component: service.
967
+ The type of messaging push notification connector: entity-storage, aws.
871
968
 
872
969
  #### Inherited from
873
970
 
874
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingComponent`](IEngineServerEnvironmentVariables.md#messagingcomponent)
971
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`messagingPushNotificationConnector`](IEngineServerEnvironmentVariables.md#messagingpushnotificationconnector)
875
972
 
876
973
  ***
877
974
 
@@ -1204,7 +1301,7 @@ Url which points to the api for a trusted synchronised storage node, not require
1204
1301
  > `optional` **synchronisedStorageVerifiableStorageKeyId**: `string`
1205
1302
 
1206
1303
  The key for the smart contract which contains the verifiable storage pointer store for synchronised storage.
1207
- This only required if using a custom verifiable storage item, otherwise it will default the the network name.
1304
+ This only required if using a custom verifiable storage item, otherwise it will default to the network name.
1208
1305
 
1209
1306
  #### Inherited from
1210
1307
 
@@ -1486,16 +1583,39 @@ Is the data space connector enabled, defaults to false.
1486
1583
 
1487
1584
  ***
1488
1585
 
1489
- ### dataSpaceConnectorApps?
1586
+ ### dataSpaceConnectorRetainActivityLogsFor?
1490
1587
 
1491
- > `optional` **dataSpaceConnectorApps**: `string`
1588
+ > `optional` **dataSpaceConnectorRetainActivityLogsFor**: `string`
1492
1589
 
1493
- The application configuration for the data space connector.
1494
- Use the @json: prefix to specify the path to the JSON configuration file.
1590
+ The length of time to retain the activity logs for in minutes, set to -1 to keep forever.
1591
+
1592
+ #### Default
1593
+
1594
+ ```ts
1595
+ 10
1596
+ ```
1495
1597
 
1496
1598
  #### Inherited from
1497
1599
 
1498
- [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`dataSpaceConnectorApps`](IEngineServerEnvironmentVariables.md#dataspaceconnectorapps)
1600
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`dataSpaceConnectorRetainActivityLogsFor`](IEngineServerEnvironmentVariables.md#dataspaceconnectorretainactivitylogsfor)
1601
+
1602
+ ***
1603
+
1604
+ ### dataSpaceConnectorActivityLogsCleanUpInterval?
1605
+
1606
+ > `optional` **dataSpaceConnectorActivityLogsCleanUpInterval**: `string`
1607
+
1608
+ The interval for cleaning up the activity logs.
1609
+
1610
+ #### Default
1611
+
1612
+ ```ts
1613
+ 60
1614
+ ```
1615
+
1616
+ #### Inherited from
1617
+
1618
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`dataSpaceConnectorActivityLogsCleanUpInterval`](IEngineServerEnvironmentVariables.md#dataspaceconnectoractivitylogscleanupinterval)
1499
1619
 
1500
1620
  ***
1501
1621
 
@@ -1524,6 +1644,18 @@ Defaults to node-authentication-assertion.
1524
1644
 
1525
1645
  ***
1526
1646
 
1647
+ ### extensions?
1648
+
1649
+ > `optional` **extensions**: `string`
1650
+
1651
+ A comma separated list of additional node extensions to load, the initialiseExtension method will be called for each extension.
1652
+
1653
+ #### Inherited from
1654
+
1655
+ [`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`extensions`](IEngineServerEnvironmentVariables.md#extensions)
1656
+
1657
+ ***
1658
+
1527
1659
  ### port?
1528
1660
 
1529
1661
  > `optional` **port**: `string`
@@ -113,15 +113,19 @@ Method to extend the engine environment variables with any additional custom con
113
113
 
114
114
  ### extendConfig()?
115
115
 
116
- > `optional` **extendConfig**: (`config`) => `Promise`\<`void`\>
116
+ > `optional` **extendConfig**: (`envVars`, `config`) => `Promise`\<`void`\>
117
117
 
118
118
  Method to extend the engine configuration with any additional custom configuration.
119
119
 
120
120
  #### Parameters
121
121
 
122
+ ##### envVars
123
+
124
+ [`INodeEnvironmentVariables`](INodeEnvironmentVariables.md)
125
+
122
126
  ##### config
123
127
 
124
- `IEngineConfig`
128
+ [`INodeEngineConfig`](INodeEngineConfig.md)
125
129
 
126
130
  #### Returns
127
131
 
@@ -0,0 +1,18 @@
1
+ # Type Alias: NodeExtensionInitialiseEngineMethod()
2
+
3
+ > **NodeExtensionInitialiseEngineMethod** = (`engineCore`) => `Promise`\<`void`\>
4
+
5
+ The type for the initialise engine method of an extension module.
6
+ This is called when the engine has been constructed but not yet started.
7
+
8
+ ## Parameters
9
+
10
+ ### engineCore
11
+
12
+ `IEngineCore`
13
+
14
+ The engine core instance.
15
+
16
+ ## Returns
17
+
18
+ `Promise`\<`void`\>
@@ -0,0 +1,24 @@
1
+ # Type Alias: NodeExtensionInitialiseEngineServerMethod()
2
+
3
+ > **NodeExtensionInitialiseEngineServerMethod** = (`engineCore`, `engineServer`) => `Promise`\<`void`\>
4
+
5
+ The type for the initialise engine server method of an extension module.
6
+ This is called when the engine server has been constructed but not yet started.
7
+
8
+ ## Parameters
9
+
10
+ ### engineCore
11
+
12
+ `IEngineCore`
13
+
14
+ The engine core instance.
15
+
16
+ ### engineServer
17
+
18
+ `IEngineServer`
19
+
20
+ The engine server instance.
21
+
22
+ ## Returns
23
+
24
+ `Promise`\<`void`\>
@@ -0,0 +1,23 @@
1
+ # Type Alias: NodeExtensionInitialiseMethod()
2
+
3
+ > **NodeExtensionInitialiseMethod** = (`envVars`, `nodeEngineConfig`) => `Promise`\<`void`\>
4
+
5
+ The type for the initialise method of an extension module.
6
+
7
+ ## Parameters
8
+
9
+ ### envVars
10
+
11
+ [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
12
+
13
+ The environment variables for the node.
14
+
15
+ ### nodeEngineConfig
16
+
17
+ [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md)
18
+
19
+ The node engine config.
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`void`\>
@@ -0,0 +1,3 @@
1
+ # Variable: ATTESTATION\_VERIFICATION\_METHOD\_ID
2
+
3
+ > `const` **ATTESTATION\_VERIFICATION\_METHOD\_ID**: `"attestation-assertion"` = `"attestation-assertion"`
@@ -0,0 +1,3 @@
1
+ # Variable: AUTH\_SIGNING\_KEY\_ID
2
+
3
+ > `const` **AUTH\_SIGNING\_KEY\_ID**: `"auth-signing"` = `"auth-signing"`
@@ -0,0 +1,3 @@
1
+ # Variable: BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID
2
+
3
+ > `const` **BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID**: `"blob-encryption"` = `"blob-encryption"`
@@ -0,0 +1,3 @@
1
+ # Variable: IMMUTABLE\_PROOF\_VERIFICATION\_METHOD\_ID
2
+
3
+ > `const` **IMMUTABLE\_PROOF\_VERIFICATION\_METHOD\_ID**: `"immutable-proof-assertion"` = `"immutable-proof-assertion"`
@@ -0,0 +1,3 @@
1
+ # Variable: SYNCHRONISED\_STORAGE\_BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID
2
+
3
+ > `const` **SYNCHRONISED\_STORAGE\_BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID**: `"synchronised-storage-blob-encryption"` = `"synchronised-storage-blob-encryption"`
@@ -0,0 +1,3 @@
1
+ # Variable: VC\_AUTHENTICATION\_VERIFICATION\_METHOD\_ID
2
+
3
+ > `const` **VC\_AUTHENTICATION\_VERIFICATION\_METHOD\_ID**: `"node-authentication-assertion"` = `"node-authentication-assertion"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node-core",
3
- "version": "0.0.2-next.15",
3
+ "version": "0.0.2-next.17",
4
4
  "description": "TWIN Node Core for serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "@twin.org/standards-w3c-odrl": "next",
33
33
  "@twin.org/vault-models": "next",
34
34
  "@twin.org/wallet-models": "next",
35
- "dotenv": "17.2.1",
35
+ "dotenv": "17.2.2",
36
36
  "schema-dts": "1.1.5"
37
37
  },
38
38
  "main": "./dist/cjs/index.cjs",
@@ -52,5 +52,16 @@
52
52
  "dist/types",
53
53
  "locales",
54
54
  "docs"
55
+ ],
56
+ "keywords": [
57
+ "twin",
58
+ "trade",
59
+ "iota",
60
+ "framework",
61
+ "blockchain",
62
+ "node",
63
+ "core",
64
+ "foundation",
65
+ "utilities"
55
66
  ]
56
67
  }