You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For examples of this command see [Using reference objects](#using-reference-objects) or [Using other legacy examples](#using-other-legacy-examples)
37
37
38
-
####Test the loaded knowledge objects
39
-
Use http://localhost:3001/kos to get the list of knowledge objects and their status.
38
+
### Test the knowledge objects in the running app
39
+
Use http://localhost:3000/kos to get the list of knowledge objects and their status.
40
40
41
-
#### Test the loaded endpoints of knowledge objects
42
-
Use http://localhost:3001/endpoints to get the endpoints and their status. Each endpoint is accessible via an http POST request (e.g. using postman) to http://localhost:3001/endpoints/{ko id}/{endpoint id} with a Json body.
41
+
Use http://localhost:3000/endpoints to get the list of endpoints. Each endpoint is accessible via an http POST request (e.g. using postman) to http://localhost:3000/endpoints/{ko id}/{endpoint id} with a Json body.
43
42
44
43
For activated KOs that have a service specification, the JavaScript activator provides access to swagger and OpenAPI editor for each activated KO at {server address}/kos/{KO id}/doc.
45
44
46
-
As an example, once the BMI Calculator KO (in folder bmi-calc-ko with id BMICalculator) from the reference objects is activated, a post request could be sent to `POST http://localhost:3001/endpoints/BMICalculator/bmi` with the following body to use the bmi endpoint
45
+
As an example, once the BMI Calculator KO (in folder bmi-calc-ko with id BMICalculator) from the reference objects is activated, a post request could be sent to `POST http://localhost:3000/endpoints/BMICalculator/bmi` with the following body to use the bmi endpoint
47
46
```json
48
47
{
49
48
"height": 175,
50
49
"weight": 70,
51
50
"unit_system": "metric"
52
51
}
53
52
```
54
-
55
-
swagger editor link "documentation": "http://localhost:3001/kos/BMICalculator/doc" which is provided at http://localhost:3001/kos could also be used to test this KO's endpoint.
53
+
or swagger editor could be accessed at http://localhost:3000/kos/BMICalculator/doc for this KO to test its endpoint.
56
54
## Development
57
55
58
56
### Setting up the project
@@ -77,9 +75,11 @@ deno fmt
77
75
deno lint
78
76
deno test
79
77
```
80
-
78
+
- 'deno fmt' automatically formats and styles the code according to a predefined set of rules.
79
+
- 'deno lint' analyzes the code for potential errors, coding style violations, and other issues based on a specified set of linting rules.
80
+
- 'deno test' runs unit tests to ensure the correctness of the code
81
81
### Using reference objects
82
-
This activator supports [kgrid 2.0 Knowledge objects](). This collection has knowledge objects that have API services implemented for JavaScript activator. A [Local Manifest file](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) is provided in this repository to help loading these KOs from a cloned location. Clone this repository using
82
+
This activator supports [kgrid 2.0 Knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). [Reference Knowledge Objects Collection](https://github.com/kgrid/reference-objects) has knowledge objects that have API services implemented for JavaScript activator. A [Local Manifest file](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) is provided in this repository to help loading these KOs from a cloned location. Clone this repository using
The new activator does not support legacy knowledge objects. But examples of kgrid 1.0 knowledge objects that are upgraded to be activated by this version of activator are included in ./tests/fixtures/installfiles/ in this repository. A manifest file is also located in this folder for testing.
93
+
The new activator does not support legacy knowledge objects. But examples of kgrid 1.0 knowledge objects that are updated to be activated by this version of activator are included in ./tests/fixtures/installfiles/ in this repository. A manifest file is also located in this folder for testing.
94
94
95
95
Use the following command, from the root of this repository to deploy these knowledge objects to the JavaScript activator:
The JavaScript activator supports [kgrdi 2.0 knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). kgrid 1.0 knowledge objects, however require some minor update to work with JavaScript activator:
101
+
The JavaScript activator supports [kgrdi 2.0 knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). kgrid 1.0 knowledge objects, however require some minor updates to work with JavaScript activator:
102
102
1. The deployment files need to be restructured using the following example:
103
103
```
104
104
/{route name}:
@@ -138,7 +138,7 @@ JavaScript activator uses ORG_KGRID_JAVASCRIPT_ACTIVATOR_MANIFEST_PATH as the en
138
138
139
139
When using manifest file, this activator only accepts zipped knowledge objects. The local or remote (URL) paths to zip files should be listed on the input manifest. Relative local paths of zip files on the manifest file will be resolved towards the location of the manifest file.
140
140
141
-
The JavaScript activator creates an unzipped local copy of KOs and a local manifest file in the cache folder when it activates knowledge objects from a manifest. (See [local manifest file created for reference objects]() as an example of local manifest). To unzip remote zip files, this activator downloads them in the cache folder first.
141
+
The JavaScript activator creates an unzipped local copy of KOs and a local manifest file in the cache folder when it activates knowledge objects from a manifest. (See [local manifest file created for reference objects](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) as an example of local manifest). To unzip remote zip files, this activator downloads them in the cache folder first.
142
142
143
143
If no manifest path is provided, JAVASCRIPT activator can activate knowledge objects from a local cache that contains unzipped knowledge objects and the local manifest.
144
144
@@ -157,4 +157,12 @@ The JavaScript activator provides access to service specification file at {serve
157
157
158
158
If a KO has more than one service, this version of JavaScript activator will only activate the last service.
159
159
160
-
If a service has more than one endpoint with the same name, the JavaScript activator will keep and route to the last one.
160
+
If a service has more than one endpoint with the same name, the JavaScript activator will keep and route to the last one.
0 commit comments