From c3c7fecd1df22534cddc2e56893876520807a515 Mon Sep 17 00:00:00 2001 From: Peter van Vliet Date: Fri, 21 Apr 2023 17:31:43 +0200 Subject: [PATCH 01/14] #235: Updated the first four examples --- examples/1-basic/1-hello-world/README.md | 24 +++++++--- examples/1-basic/1-hello-world/package.json | 2 +- examples/1-basic/1-hello-world/requests.http | 6 +-- .../{ => segments}/default.segment.json | 2 +- .../{jitar.json => services/standalone.json} | 0 .../1-hello-world/src/{start.ts => jitar.ts} | 0 .../src/{greetings => }/sayHello.ts | 0 examples/1-basic/2-segmentation/README.md | 36 ++++++++++++--- examples/1-basic/2-segmentation/package.json | 9 ++-- examples/1-basic/2-segmentation/requests.http | 17 ++++--- .../{hello.segment.json => data.segment.json} | 2 +- .../{hi.segment.json => process.segment.json} | 4 +- .../{conf => services}/gateway.json | 0 .../{conf => services}/node1.json | 2 +- .../{conf => services}/node2.json | 2 +- .../repo.json => services/repository.json} | 0 .../services/standalone.json} | 0 .../2-segmentation/src/greetings/sayBoth.ts | 23 ---------- .../2-segmentation/src/greetings/sayHello.ts | 5 -- .../2-segmentation/src/greetings/sayHi.ts | 5 -- .../2-segmentation/src/{start.ts => jitar.ts} | 0 .../src/reporting/createReport.ts | 16 +++++++ .../src/reporting/createStatistics.ts | 10 ++++ .../2-segmentation/src/reporting/getData.ts | 5 ++ examples/1-basic/3-load-balancing/README.md | 33 +++++++++++-- .../1-basic/3-load-balancing/package.json | 9 ++-- .../1-basic/3-load-balancing/requests.http | 46 ++++++++++++++++++- .../segments/calculator.segment.json | 22 +++++++++ .../segments/default.segment.json | 8 ---- .../{conf => services}/gateway.json | 0 .../{conf => services}/node1.json | 2 +- .../{conf => services}/node2.json | 2 +- .../repo.json => services/repository.json} | 0 .../3-load-balancing/services/standalone.json | 8 ++++ .../3-load-balancing/src/calculator/add.ts | 5 ++ .../3-load-balancing/src/calculator/divide.ts | 5 ++ .../src/calculator/multiply.ts | 5 ++ .../src/calculator/subtract.ts | 5 ++ .../src/greetings/sayHello.ts | 5 -- .../src/{start.ts => jitar.ts} | 0 .../1-basic/4-access-protection/README.md | 21 +++++++-- .../1-basic/4-access-protection/package.json | 2 +- .../1-basic/4-access-protection/requests.http | 4 +- .../game.segment.json} | 4 +- .../services/standalone.json | 8 ++++ .../src/game/checkSecret.ts | 7 +++ .../4-access-protection/src/game/getSecret.ts | 9 ++++ .../src/greetings/sayHello.ts | 14 ------ .../src/greetings/sayHelloPublic.ts | 7 --- .../src/{start.ts => jitar.ts} | 0 package-lock.json | 4 +- 51 files changed, 280 insertions(+), 125 deletions(-) rename examples/1-basic/1-hello-world/{ => segments}/default.segment.json (77%) rename examples/1-basic/1-hello-world/{jitar.json => services/standalone.json} (100%) rename examples/1-basic/1-hello-world/src/{start.ts => jitar.ts} (100%) rename examples/1-basic/1-hello-world/src/{greetings => }/sayHello.ts (100%) rename examples/1-basic/2-segmentation/segments/{hello.segment.json => data.segment.json} (70%) rename examples/1-basic/2-segmentation/segments/{hi.segment.json => process.segment.json} (66%) rename examples/1-basic/2-segmentation/{conf => services}/gateway.json (100%) rename examples/1-basic/2-segmentation/{conf => services}/node1.json (83%) rename examples/1-basic/2-segmentation/{conf => services}/node2.json (81%) rename examples/1-basic/2-segmentation/{conf/repo.json => services/repository.json} (100%) rename examples/1-basic/{4-access-protection/jitar.json => 2-segmentation/services/standalone.json} (100%) delete mode 100644 examples/1-basic/2-segmentation/src/greetings/sayBoth.ts delete mode 100644 examples/1-basic/2-segmentation/src/greetings/sayHello.ts delete mode 100644 examples/1-basic/2-segmentation/src/greetings/sayHi.ts rename examples/1-basic/2-segmentation/src/{start.ts => jitar.ts} (100%) create mode 100644 examples/1-basic/2-segmentation/src/reporting/createReport.ts create mode 100644 examples/1-basic/2-segmentation/src/reporting/createStatistics.ts create mode 100644 examples/1-basic/2-segmentation/src/reporting/getData.ts create mode 100644 examples/1-basic/3-load-balancing/segments/calculator.segment.json delete mode 100644 examples/1-basic/3-load-balancing/segments/default.segment.json rename examples/1-basic/3-load-balancing/{conf => services}/gateway.json (100%) rename examples/1-basic/3-load-balancing/{conf => services}/node1.json (80%) rename examples/1-basic/3-load-balancing/{conf => services}/node2.json (80%) rename examples/1-basic/3-load-balancing/{conf/repo.json => services/repository.json} (100%) create mode 100644 examples/1-basic/3-load-balancing/services/standalone.json create mode 100644 examples/1-basic/3-load-balancing/src/calculator/add.ts create mode 100644 examples/1-basic/3-load-balancing/src/calculator/divide.ts create mode 100644 examples/1-basic/3-load-balancing/src/calculator/multiply.ts create mode 100644 examples/1-basic/3-load-balancing/src/calculator/subtract.ts delete mode 100644 examples/1-basic/3-load-balancing/src/greetings/sayHello.ts rename examples/1-basic/3-load-balancing/src/{start.ts => jitar.ts} (100%) rename examples/1-basic/4-access-protection/{default.segment.json => segments/game.segment.json} (68%) create mode 100644 examples/1-basic/4-access-protection/services/standalone.json create mode 100644 examples/1-basic/4-access-protection/src/game/checkSecret.ts create mode 100644 examples/1-basic/4-access-protection/src/game/getSecret.ts delete mode 100644 examples/1-basic/4-access-protection/src/greetings/sayHello.ts delete mode 100644 examples/1-basic/4-access-protection/src/greetings/sayHelloPublic.ts rename examples/1-basic/4-access-protection/src/{start.ts => jitar.ts} (100%) diff --git a/examples/1-basic/1-hello-world/README.md b/examples/1-basic/1-hello-world/README.md index 095f6449..effe273a 100644 --- a/examples/1-basic/1-hello-world/README.md +++ b/examples/1-basic/1-hello-world/README.md @@ -1,13 +1,23 @@ # Jitar | Hello World example -This example demonstrates how to create a simple procedure and call it using the RPC API. +This example demonstrates the simplest Jitar application possible. +It contains a single backend procedure and does not have a frontend. +Therefore the procedure needs to be called using the RPC API. -The application contains a simple "Hello World" procedure that returns a string. -It can be found in the ``src/greetings`` directory. Also the application contains -the ``src/default.segment.json`` segment file. +## Project setup -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. +**Procedures** + +* sayHello (`src/sayHello.ts`) + +**Segments** + +* Default - contains the *sayHello* procedure (`segments/default.segment.json`) + +**Services** + +* Standalone (`services/standalone.json`) ## Running the example @@ -26,7 +36,7 @@ npm run build Then start Jitar with the following command from the same directory. ``` -npm run start +npm run standalone ``` -The ``requests.http`` file contains example requests to call the procedure. +The ``requests.http`` file contains example requests to call the procedure with the GET and POST method. diff --git a/examples/1-basic/1-hello-world/package.json b/examples/1-basic/1-hello-world/package.json index 72380d63..cf2cf517 100644 --- a/examples/1-basic/1-hello-world/package.json +++ b/examples/1-basic/1-hello-world/package.json @@ -4,7 +4,7 @@ "type": "module", "scripts": { "build": "tsc", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/1-basic/1-hello-world/requests.http b/examples/1-basic/1-hello-world/requests.http index e2f89d21..323ffaba 100644 --- a/examples/1-basic/1-hello-world/requests.http +++ b/examples/1-basic/1-hello-world/requests.http @@ -1,19 +1,19 @@ // Say hello without the name parameter -GET http://localhost:3000/rpc/greetings/sayHello HTTP/1.1 +GET http://localhost:3000/rpc/sayHello HTTP/1.1 ### // Say hello with the name parameter using a GET request -GET http://localhost:3000/rpc/greetings/sayHello?name=John HTTP/1.1 +GET http://localhost:3000/rpc/sayHello?name=John HTTP/1.1 ### // Say hello with the name parameter using a POST request -POST http://localhost:3000/rpc/greetings/sayHello HTTP/1.1 +POST http://localhost:3000/rpc/sayHello HTTP/1.1 content-type: application/json { diff --git a/examples/1-basic/1-hello-world/default.segment.json b/examples/1-basic/1-hello-world/segments/default.segment.json similarity index 77% rename from examples/1-basic/1-hello-world/default.segment.json rename to examples/1-basic/1-hello-world/segments/default.segment.json index c40b9fbd..301e93fc 100644 --- a/examples/1-basic/1-hello-world/default.segment.json +++ b/examples/1-basic/1-hello-world/segments/default.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./sayHello": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/1-basic/1-hello-world/jitar.json b/examples/1-basic/1-hello-world/services/standalone.json similarity index 100% rename from examples/1-basic/1-hello-world/jitar.json rename to examples/1-basic/1-hello-world/services/standalone.json diff --git a/examples/1-basic/1-hello-world/src/start.ts b/examples/1-basic/1-hello-world/src/jitar.ts similarity index 100% rename from examples/1-basic/1-hello-world/src/start.ts rename to examples/1-basic/1-hello-world/src/jitar.ts diff --git a/examples/1-basic/1-hello-world/src/greetings/sayHello.ts b/examples/1-basic/1-hello-world/src/sayHello.ts similarity index 100% rename from examples/1-basic/1-hello-world/src/greetings/sayHello.ts rename to examples/1-basic/1-hello-world/src/sayHello.ts diff --git a/examples/1-basic/2-segmentation/README.md b/examples/1-basic/2-segmentation/README.md index dc6de1d4..b044a895 100644 --- a/examples/1-basic/2-segmentation/README.md +++ b/examples/1-basic/2-segmentation/README.md @@ -1,15 +1,37 @@ # Jitar | Segmentation example -This example demonstrates how to split an application into multiple segments and -run them distributed using the repository, gateway and nodes. +This example demonstrates how to distribute an application in production. -The application consists of three simple procedures and two segments. All procedures are placed in the -``src/greetings`` directory. +The application is a simple report creation that separates the data from the processing. -Because this example has multiple segment files all the segment files ``(*.segment.json)`` are placed in the ``segments`` directory. The same is done for the configurations, as there are multiple configurations used. +## Project setup -## Running the example +**Procedures** + +* getData (`src/reporting/getData.ts`) +* createStatistics (`src/reporting/createStatistics.ts`) +* createReport (`src/reporting/createReport.ts`) + +**Segments** + +* Data - contains the *multiply* procedure (`segments/data.segment.json`) +* Process - contains the *createReport* and *process* procedures (`segments/process.segment.json`) + +**Services** + +Development + +* Standalone - loads both segments (`services/standalone.json`) + +Production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Node 1 - loads the *data* segment (`services/node1.json`) +* Node 2 - loads the *process* segment (`services/node2.json`) + +## Running the example (production) Install Jitar by running the following command from the root directory of the example. @@ -23,7 +45,7 @@ Next build the application by running the following command. npm run build ``` -To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. +To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importance. **Repository** (terminal 1) ``` diff --git a/examples/1-basic/2-segmentation/package.json b/examples/1-basic/2-segmentation/package.json index 08b84b67..7c4ff6f5 100644 --- a/examples/1-basic/2-segmentation/package.json +++ b/examples/1-basic/2-segmentation/package.json @@ -4,10 +4,11 @@ "private": true, "scripts": { "build": "tsc", - "repo": "node --experimental-network-imports dist/start.js --config=conf/repo.json", - "gateway": "node --experimental-network-imports dist/start.js --config=conf/gateway.json", - "node1": "node --experimental-network-imports dist/start.js --config=conf/node1.json", - "node2": "node --experimental-network-imports dist/start.js --config=conf/node2.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", + "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", + "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", + "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/1-basic/2-segmentation/requests.http b/examples/1-basic/2-segmentation/requests.http index 22a609d4..7a2a2069 100644 --- a/examples/1-basic/2-segmentation/requests.http +++ b/examples/1-basic/2-segmentation/requests.http @@ -1,16 +1,21 @@ -// Say hi (from the hi segment) +// Get the data (from the data segment) -GET http://localhost:3000/rpc/greetings/sayHi?firstName=John HTTP/1.1 +GET http://localhost:3000/rpc/reporting/getData HTTP/1.1 ### -// Say hello (from the hello segment) +// Create the statistics (from the process segment) -GET http://localhost:3000/rpc/greetings/sayHello?firstName=Jane&lastName=Doe HTTP/1.1 +POST http://localhost:3000/rpc/reporting/createStatistics HTTP/1.1 +content-type: application/json + +{ + "data": [1, 2, 3, 4, 5] +} ### -// Say hi and hello (from both segments) +// Create the report (from both segments) -GET http://localhost:3000/rpc/greetings/sayBoth?firstName=Jim&lastName=Doe HTTP/1.1 \ No newline at end of file +GET http://localhost:3000/rpc/reporting/createReport HTTP/1.1 diff --git a/examples/1-basic/2-segmentation/segments/hello.segment.json b/examples/1-basic/2-segmentation/segments/data.segment.json similarity index 70% rename from examples/1-basic/2-segmentation/segments/hello.segment.json rename to examples/1-basic/2-segmentation/segments/data.segment.json index 689c994f..c4f6f762 100644 --- a/examples/1-basic/2-segmentation/segments/hello.segment.json +++ b/examples/1-basic/2-segmentation/segments/data.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./reporting/getData": { "default": { "access": "public" } diff --git a/examples/1-basic/2-segmentation/segments/hi.segment.json b/examples/1-basic/2-segmentation/segments/process.segment.json similarity index 66% rename from examples/1-basic/2-segmentation/segments/hi.segment.json rename to examples/1-basic/2-segmentation/segments/process.segment.json index 088a9cc9..fca988b8 100644 --- a/examples/1-basic/2-segmentation/segments/hi.segment.json +++ b/examples/1-basic/2-segmentation/segments/process.segment.json @@ -1,10 +1,10 @@ { - "./greetings/sayHi": { + "./reporting/createStatistics": { "default": { "access": "public" } }, - "./greetings/sayBoth": { + "./reporting/createReport": { "default": { "access": "public" } diff --git a/examples/1-basic/2-segmentation/conf/gateway.json b/examples/1-basic/2-segmentation/services/gateway.json similarity index 100% rename from examples/1-basic/2-segmentation/conf/gateway.json rename to examples/1-basic/2-segmentation/services/gateway.json diff --git a/examples/1-basic/2-segmentation/conf/node1.json b/examples/1-basic/2-segmentation/services/node1.json similarity index 83% rename from examples/1-basic/2-segmentation/conf/node1.json rename to examples/1-basic/2-segmentation/services/node1.json index 9bebcb9f..cd5b90ba 100644 --- a/examples/1-basic/2-segmentation/conf/node1.json +++ b/examples/1-basic/2-segmentation/services/node1.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hi" ] + "segments": [ "data" ] } } \ No newline at end of file diff --git a/examples/1-basic/2-segmentation/conf/node2.json b/examples/1-basic/2-segmentation/services/node2.json similarity index 81% rename from examples/1-basic/2-segmentation/conf/node2.json rename to examples/1-basic/2-segmentation/services/node2.json index 3389493a..136437dc 100644 --- a/examples/1-basic/2-segmentation/conf/node2.json +++ b/examples/1-basic/2-segmentation/services/node2.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hello" ] + "segments": [ "process" ] } } \ No newline at end of file diff --git a/examples/1-basic/2-segmentation/conf/repo.json b/examples/1-basic/2-segmentation/services/repository.json similarity index 100% rename from examples/1-basic/2-segmentation/conf/repo.json rename to examples/1-basic/2-segmentation/services/repository.json diff --git a/examples/1-basic/4-access-protection/jitar.json b/examples/1-basic/2-segmentation/services/standalone.json similarity index 100% rename from examples/1-basic/4-access-protection/jitar.json rename to examples/1-basic/2-segmentation/services/standalone.json diff --git a/examples/1-basic/2-segmentation/src/greetings/sayBoth.ts b/examples/1-basic/2-segmentation/src/greetings/sayBoth.ts deleted file mode 100644 index 3a2abacd..00000000 --- a/examples/1-basic/2-segmentation/src/greetings/sayBoth.ts +++ /dev/null @@ -1,23 +0,0 @@ - -/* - * Procedures can be imported using the ES module syntax. - * - * If a procedure runs on another node, it will be replaced with a - * remote procedure call. - */ - -import sayHi from './sayHi'; -import sayHello from './sayHello'; - -export default async function sayBoth(firstName: string, lastName: string): Promise -{ - // This procedure will always be called locally because its - // in the same segment. - const hiMessage = await sayHi(firstName); - - // This procedure will be called remotely in production mode - // because its placed in antoher segment. - const helloMessage = await sayHello(firstName, lastName); - - return `${hiMessage}\n${helloMessage}`; -} diff --git a/examples/1-basic/2-segmentation/src/greetings/sayHello.ts b/examples/1-basic/2-segmentation/src/greetings/sayHello.ts deleted file mode 100644 index 62472428..00000000 --- a/examples/1-basic/2-segmentation/src/greetings/sayHello.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export default async function sayHello(firstName: string, lastName: string): Promise -{ - return `Hello ${firstName} ${lastName}`; -} diff --git a/examples/1-basic/2-segmentation/src/greetings/sayHi.ts b/examples/1-basic/2-segmentation/src/greetings/sayHi.ts deleted file mode 100644 index 51d457b5..00000000 --- a/examples/1-basic/2-segmentation/src/greetings/sayHi.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export default async function sayHi(firstName: string): Promise -{ - return `Hi ${firstName}`; -} diff --git a/examples/1-basic/2-segmentation/src/start.ts b/examples/1-basic/2-segmentation/src/jitar.ts similarity index 100% rename from examples/1-basic/2-segmentation/src/start.ts rename to examples/1-basic/2-segmentation/src/jitar.ts diff --git a/examples/1-basic/2-segmentation/src/reporting/createReport.ts b/examples/1-basic/2-segmentation/src/reporting/createReport.ts new file mode 100644 index 00000000..76258862 --- /dev/null +++ b/examples/1-basic/2-segmentation/src/reporting/createReport.ts @@ -0,0 +1,16 @@ + +import getData from './getData'; +import createStatistics from './createStatistics'; + +export default async function createReport(): Promise +{ + // This procedure will be called remotely in production mode + // because its placed in another segment. + const data = await getData(); + + // This procedure will always be called locally because its + // in the same segment. + const statistics = await createStatistics(data); + + return `Total: ${statistics.sum}, Average: ${statistics.average}`; +} diff --git a/examples/1-basic/2-segmentation/src/reporting/createStatistics.ts b/examples/1-basic/2-segmentation/src/reporting/createStatistics.ts new file mode 100644 index 00000000..1851c23a --- /dev/null +++ b/examples/1-basic/2-segmentation/src/reporting/createStatistics.ts @@ -0,0 +1,10 @@ + +type Statistics = { sum: number, average: number }; + +export default async function createStatistics(data: number[]): Promise +{ + const sum = data.reduce((a, b) => a + b, 0); + const average = sum / data.length; + + return { sum, average }; +} diff --git a/examples/1-basic/2-segmentation/src/reporting/getData.ts b/examples/1-basic/2-segmentation/src/reporting/getData.ts new file mode 100644 index 00000000..193036fe --- /dev/null +++ b/examples/1-basic/2-segmentation/src/reporting/getData.ts @@ -0,0 +1,5 @@ + +export default async function getData(): Promise +{ + return [1, 3, 5, 7, 9]; +} diff --git a/examples/1-basic/3-load-balancing/README.md b/examples/1-basic/3-load-balancing/README.md index bddf3bd6..eb575446 100644 --- a/examples/1-basic/3-load-balancing/README.md +++ b/examples/1-basic/3-load-balancing/README.md @@ -3,12 +3,35 @@ This example demonstrates how to load balance application segments by running them on multiple nodes. -The application contains the simple procedure from the "Hello World" example. -It can be found in the ``src/greetings`` directory. +The application contains simple calculator tasks that are placed in a single segment. -Because this example has multiple segment files all the segment files ``(*.segment.json)`` are placed in the ``segments`` directory. The same is done for the configurations, as there are multiple configurations used. +## Project setup -## Running the example +**Procedures** + +* add (`src/calculator/add.ts`) +* subtract (`src/calculator/subtract.ts`) +* multiply (`src/calculator/multiply.ts`) +* divide (`src/calculator/divide.ts`) + +**Segments** + +* Calculator - contains all procedures (`segments/calculator.segment.json`) + +**Services** + +Development + +* Standalone - loads both segments (`services/standalone.json`) + +Production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Node 1 - loads the *calculator* segment (`services/node1.json`) +* Node 2 - loads the *calculator* segment (`services/node2.json`) + +## Running the example (load balanced) Install Jitar by running the following command from the root directory of the example. @@ -45,4 +68,4 @@ npm run node2 ``` The ``requests.http`` file contains example request to call the procedure. -Note that the requests are handled round robin by both nodes. +Note that the requests are handled round robin by both nodes per procedure. diff --git a/examples/1-basic/3-load-balancing/package.json b/examples/1-basic/3-load-balancing/package.json index 64276abc..a1f2a272 100644 --- a/examples/1-basic/3-load-balancing/package.json +++ b/examples/1-basic/3-load-balancing/package.json @@ -4,10 +4,11 @@ "private": true, "scripts": { "build": "tsc", - "repo": "node --experimental-network-imports dist/start.js --config=conf/repo.json", - "gateway": "node --experimental-network-imports dist/start.js --config=conf/gateway.json", - "node1": "node --experimental-network-imports dist/start.js --config=conf/node1.json", - "node2": "node --experimental-network-imports dist/start.js --config=conf/node2.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", + "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", + "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", + "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/1-basic/3-load-balancing/requests.http b/examples/1-basic/3-load-balancing/requests.http index 0a1553cd..dcb0b6f3 100644 --- a/examples/1-basic/3-load-balancing/requests.http +++ b/examples/1-basic/3-load-balancing/requests.http @@ -1,4 +1,46 @@ -// Say hello +// Add -GET http://localhost:3000/rpc/greetings/sayHello?firstName=John HTTP/1.1 +POST http://localhost:3000/rpc/calculator/add HTTP/1.1 +content-type: application/json + +{ + "first": 15, + "second": 27 +} + +### + +// Subtract + +POST http://localhost:3000/rpc/calculator/subtract HTTP/1.1 +content-type: application/json + +{ + "first": 48, + "second": 6 +} + +### + +// Multiply + +POST http://localhost:3000/rpc/calculator/multiply HTTP/1.1 +content-type: application/json + +{ + "first": 5, + "second": 5 +} + +### + +// Divide + +POST http://localhost:3000/rpc/calculator/divide HTTP/1.1 +content-type: application/json + +{ + "first": 42, + "second": 6 +} diff --git a/examples/1-basic/3-load-balancing/segments/calculator.segment.json b/examples/1-basic/3-load-balancing/segments/calculator.segment.json new file mode 100644 index 00000000..08a6a2b5 --- /dev/null +++ b/examples/1-basic/3-load-balancing/segments/calculator.segment.json @@ -0,0 +1,22 @@ +{ + "./calculator/add": { + "default": { + "access": "public" + } + }, + "./calculator/divide": { + "default": { + "access": "public" + } + }, + "./calculator/multiply": { + "default": { + "access": "public" + } + }, + "./calculator/subtract": { + "default": { + "access": "public" + } + } +} \ No newline at end of file diff --git a/examples/1-basic/3-load-balancing/segments/default.segment.json b/examples/1-basic/3-load-balancing/segments/default.segment.json deleted file mode 100644 index c40b9fbd..00000000 --- a/examples/1-basic/3-load-balancing/segments/default.segment.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "./greetings/sayHello": { - "default": { - "access": "public", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/examples/1-basic/3-load-balancing/conf/gateway.json b/examples/1-basic/3-load-balancing/services/gateway.json similarity index 100% rename from examples/1-basic/3-load-balancing/conf/gateway.json rename to examples/1-basic/3-load-balancing/services/gateway.json diff --git a/examples/1-basic/3-load-balancing/conf/node1.json b/examples/1-basic/3-load-balancing/services/node1.json similarity index 80% rename from examples/1-basic/3-load-balancing/conf/node1.json rename to examples/1-basic/3-load-balancing/services/node1.json index 2a755b0e..db078145 100644 --- a/examples/1-basic/3-load-balancing/conf/node1.json +++ b/examples/1-basic/3-load-balancing/services/node1.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "default" ] + "segments": [ "calculator" ] } } \ No newline at end of file diff --git a/examples/1-basic/3-load-balancing/conf/node2.json b/examples/1-basic/3-load-balancing/services/node2.json similarity index 80% rename from examples/1-basic/3-load-balancing/conf/node2.json rename to examples/1-basic/3-load-balancing/services/node2.json index 96d4e1c2..1d0ce82b 100644 --- a/examples/1-basic/3-load-balancing/conf/node2.json +++ b/examples/1-basic/3-load-balancing/services/node2.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "default" ] + "segments": [ "calculator" ] } } \ No newline at end of file diff --git a/examples/1-basic/3-load-balancing/conf/repo.json b/examples/1-basic/3-load-balancing/services/repository.json similarity index 100% rename from examples/1-basic/3-load-balancing/conf/repo.json rename to examples/1-basic/3-load-balancing/services/repository.json diff --git a/examples/1-basic/3-load-balancing/services/standalone.json b/examples/1-basic/3-load-balancing/services/standalone.json new file mode 100644 index 00000000..d697ab68 --- /dev/null +++ b/examples/1-basic/3-load-balancing/services/standalone.json @@ -0,0 +1,8 @@ +{ + "url": "http://127.0.0.1:3000", + "standalone": + { + "source": "./dist", + "cache": "./cache" + } +} \ No newline at end of file diff --git a/examples/1-basic/3-load-balancing/src/calculator/add.ts b/examples/1-basic/3-load-balancing/src/calculator/add.ts new file mode 100644 index 00000000..7de83e2e --- /dev/null +++ b/examples/1-basic/3-load-balancing/src/calculator/add.ts @@ -0,0 +1,5 @@ + +export default async function add(first: number, second: number): Promise +{ + return first + second; +} diff --git a/examples/1-basic/3-load-balancing/src/calculator/divide.ts b/examples/1-basic/3-load-balancing/src/calculator/divide.ts new file mode 100644 index 00000000..01b32551 --- /dev/null +++ b/examples/1-basic/3-load-balancing/src/calculator/divide.ts @@ -0,0 +1,5 @@ + +export default async function divide(first: number, second: number): Promise +{ + return first / second; +} diff --git a/examples/1-basic/3-load-balancing/src/calculator/multiply.ts b/examples/1-basic/3-load-balancing/src/calculator/multiply.ts new file mode 100644 index 00000000..070f0a93 --- /dev/null +++ b/examples/1-basic/3-load-balancing/src/calculator/multiply.ts @@ -0,0 +1,5 @@ + +export default async function multiply(first: number, second: number): Promise +{ + return first * second; +} diff --git a/examples/1-basic/3-load-balancing/src/calculator/subtract.ts b/examples/1-basic/3-load-balancing/src/calculator/subtract.ts new file mode 100644 index 00000000..63b6763f --- /dev/null +++ b/examples/1-basic/3-load-balancing/src/calculator/subtract.ts @@ -0,0 +1,5 @@ + +export default async function subtract(first: number, second: number): Promise +{ + return first - second; +} diff --git a/examples/1-basic/3-load-balancing/src/greetings/sayHello.ts b/examples/1-basic/3-load-balancing/src/greetings/sayHello.ts deleted file mode 100644 index 4463d05d..00000000 --- a/examples/1-basic/3-load-balancing/src/greetings/sayHello.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export default async function sayHello(firstName = 'World'): Promise -{ - return `Hello ${firstName}`; -} diff --git a/examples/1-basic/3-load-balancing/src/start.ts b/examples/1-basic/3-load-balancing/src/jitar.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/start.ts rename to examples/1-basic/3-load-balancing/src/jitar.ts diff --git a/examples/1-basic/4-access-protection/README.md b/examples/1-basic/4-access-protection/README.md index ea57c005..933a2c80 100644 --- a/examples/1-basic/4-access-protection/README.md +++ b/examples/1-basic/4-access-protection/README.md @@ -3,10 +3,23 @@ This example demonstrates how to protect the access to a procedure. -The application consists of a public and a private procedure. All procedures are placed in the -``src/greetings`` directory. The segment file ``(default.segment.json)`` is placed in the ``src`` directory. +The application is a simple game that generates a random secret that needs to be guessed. +The procedure to get the secret has been made private to ensure it isn't accessible from outside its segment. -The Jitar configuration is specified in the ``jitar.json`` file. +## Project setup + +**Procedures** + +* checkSecret (`src/game/checkSecret.ts`) +* getSecret (`src/game/getSecret.ts`) + +**Segments** + +* Game - contains all procedures (`segments/game.segment.json`) + +**Services** + +* Standalone - loads both segments (`services/standalone.json`) ## Running the example @@ -25,7 +38,7 @@ npm run build Then start Jitar with the following command from the same directory. ``` -npm run start +npm run standalone ``` The ``requests.http`` file contains example requests to call the procedures. diff --git a/examples/1-basic/4-access-protection/package.json b/examples/1-basic/4-access-protection/package.json index 5d5f4e22..36e9bcd7 100644 --- a/examples/1-basic/4-access-protection/package.json +++ b/examples/1-basic/4-access-protection/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "tsc", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/1-basic/4-access-protection/requests.http b/examples/1-basic/4-access-protection/requests.http index d9ad1c50..8918931d 100644 --- a/examples/1-basic/4-access-protection/requests.http +++ b/examples/1-basic/4-access-protection/requests.http @@ -1,10 +1,10 @@ // Run the public function (succeeds) -GET http://localhost:3000/rpc/greetings/sayHelloPublic?firstName=John HTTP/1.1 +GET http://localhost:3000/rpc/game/checkSecret?secret=1234 HTTP/1.1 ### // Run the private function (fails -> 404) -GET http://localhost:3000/rpc/greetings/sayHello HTTP/1.1 +GET http://localhost:3000/rpc/game/getSecret HTTP/1.1 diff --git a/examples/1-basic/4-access-protection/default.segment.json b/examples/1-basic/4-access-protection/segments/game.segment.json similarity index 68% rename from examples/1-basic/4-access-protection/default.segment.json rename to examples/1-basic/4-access-protection/segments/game.segment.json index 4d8af653..e711b16b 100644 --- a/examples/1-basic/4-access-protection/default.segment.json +++ b/examples/1-basic/4-access-protection/segments/game.segment.json @@ -1,10 +1,10 @@ { - "./greetings/sayHelloPublic": { + "./game/checkSecret": { "default": { "access": "public" } }, - "./greetings/sayHello": { + "./game/getSecret": { "default": { "access": "private" } diff --git a/examples/1-basic/4-access-protection/services/standalone.json b/examples/1-basic/4-access-protection/services/standalone.json new file mode 100644 index 00000000..d697ab68 --- /dev/null +++ b/examples/1-basic/4-access-protection/services/standalone.json @@ -0,0 +1,8 @@ +{ + "url": "http://127.0.0.1:3000", + "standalone": + { + "source": "./dist", + "cache": "./cache" + } +} \ No newline at end of file diff --git a/examples/1-basic/4-access-protection/src/game/checkSecret.ts b/examples/1-basic/4-access-protection/src/game/checkSecret.ts new file mode 100644 index 00000000..bdfd820c --- /dev/null +++ b/examples/1-basic/4-access-protection/src/game/checkSecret.ts @@ -0,0 +1,7 @@ + +import getSecret from './getSecret'; + +export default async function checkSecret(secret: string): Promise +{ + return secret === await getSecret(); +} diff --git a/examples/1-basic/4-access-protection/src/game/getSecret.ts b/examples/1-basic/4-access-protection/src/game/getSecret.ts new file mode 100644 index 00000000..a1f352b1 --- /dev/null +++ b/examples/1-basic/4-access-protection/src/game/getSecret.ts @@ -0,0 +1,9 @@ + +const SECRET = Math.round(Math.random() * 1000); + +console.log('SECRET:', SECRET); + +export default async function getSecret(): Promise +{ + return SECRET.toString(); +} diff --git a/examples/1-basic/4-access-protection/src/greetings/sayHello.ts b/examples/1-basic/4-access-protection/src/greetings/sayHello.ts deleted file mode 100644 index 6f9c2a7c..00000000 --- a/examples/1-basic/4-access-protection/src/greetings/sayHello.ts +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * This an simple example procedure that returns a string. - * - * Parameters can be mandatory or optional. They will be checked when calling the procedure. - * - * Important note: - * All functions have to be async functions in order to be able to split applications. - */ - -export default async function sayHello(name = 'World'): Promise -{ - return `Hello ${name}`; -} diff --git a/examples/1-basic/4-access-protection/src/greetings/sayHelloPublic.ts b/examples/1-basic/4-access-protection/src/greetings/sayHelloPublic.ts deleted file mode 100644 index 59c7854b..00000000 --- a/examples/1-basic/4-access-protection/src/greetings/sayHelloPublic.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import sayHello from './sayHello'; - -export default async function sayHelloPublic(firstName: string): Promise -{ - return await sayHello(firstName); -} diff --git a/examples/1-basic/4-access-protection/src/start.ts b/examples/1-basic/4-access-protection/src/jitar.ts similarity index 100% rename from examples/1-basic/4-access-protection/src/start.ts rename to examples/1-basic/4-access-protection/src/jitar.ts diff --git a/package-lock.json b/package-lock.json index 30b2649b..05b7a637 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,8 +30,7 @@ "examples/2-advanced/2-run-procedure", "examples/2-advanced/3-health-checks", "examples/2-advanced/4-middleware", - "examples/3-apps/1-contact-list", - "examples/3-apps/2-microservices" + "examples/3-apps/1-contact-list" ], "devDependencies": { "@types/express": "^4.17.17", @@ -161,6 +160,7 @@ } }, "examples/3-apps/1-contact-list": { + "name": "jitar-react", "version": "0.0.0", "dependencies": { "jitar": "^0.4.0", From 3412e24e2ad55b2ccc392400e9a30d293d662e10 Mon Sep 17 00:00:00 2001 From: Peter van Vliet Date: Wed, 26 Apr 2023 12:07:31 +0200 Subject: [PATCH 02/14] #235: corrected readme files --- examples/1-basic/2-segmentation/README.md | 2 +- examples/1-basic/3-load-balancing/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/1-basic/2-segmentation/README.md b/examples/1-basic/2-segmentation/README.md index b044a895..144d08b7 100644 --- a/examples/1-basic/2-segmentation/README.md +++ b/examples/1-basic/2-segmentation/README.md @@ -15,7 +15,7 @@ The application is a simple report creation that separates the data from the pro **Segments** -* Data - contains the *multiply* procedure (`segments/data.segment.json`) +* Data - contains the *getData* procedure (`segments/data.segment.json`) * Process - contains the *createReport* and *process* procedures (`segments/process.segment.json`) **Services** diff --git a/examples/1-basic/3-load-balancing/README.md b/examples/1-basic/3-load-balancing/README.md index eb575446..465e4067 100644 --- a/examples/1-basic/3-load-balancing/README.md +++ b/examples/1-basic/3-load-balancing/README.md @@ -22,7 +22,7 @@ The application contains simple calculator tasks that are placed in a single seg Development -* Standalone - loads both segments (`services/standalone.json`) +* Standalone - loads the *calculator* segment (`services/standalone.json`) Production From 0fb9f0edafe9afb714a00f5590b5bf289e56c7e4 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 27 Apr 2023 21:24:43 +0200 Subject: [PATCH 03/14] JavaScript example is not needed anymore --- examples/1-basic/8-javascript/README.md | 26 ------------------- .../1-basic/8-javascript/default.segment.json | 8 ------ examples/1-basic/8-javascript/jitar.json | 4 --- examples/1-basic/8-javascript/package.json | 12 --------- examples/1-basic/8-javascript/requests.http | 4 --- .../8-javascript/src/greetings/sayHello.js | 14 ---------- examples/1-basic/8-javascript/src/start.js | 6 ----- 7 files changed, 74 deletions(-) delete mode 100644 examples/1-basic/8-javascript/README.md delete mode 100644 examples/1-basic/8-javascript/default.segment.json delete mode 100644 examples/1-basic/8-javascript/jitar.json delete mode 100644 examples/1-basic/8-javascript/package.json delete mode 100644 examples/1-basic/8-javascript/requests.http delete mode 100644 examples/1-basic/8-javascript/src/greetings/sayHello.js delete mode 100644 examples/1-basic/8-javascript/src/start.js diff --git a/examples/1-basic/8-javascript/README.md b/examples/1-basic/8-javascript/README.md deleted file mode 100644 index aef86a1f..00000000 --- a/examples/1-basic/8-javascript/README.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Jitar | Hello World example - -This example demonstrates how to create a simple procedure and call it using the RPC API. - -The application contains a simple "Hello World" procedure that returns a string. -It can be found in the ``src/greetings`` directory. Also the application contains -the ``src/default.segment.json`` segment file. - -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. - -## Running the example - -Install Jitar by running the following command from the root directory of the example. - -``` -npm install -``` - -Then start Jitar with the following command from the same directory. - -``` -npm run start -``` - -The ``requests.http`` file contains example requests to call the procedure. diff --git a/examples/1-basic/8-javascript/default.segment.json b/examples/1-basic/8-javascript/default.segment.json deleted file mode 100644 index c40b9fbd..00000000 --- a/examples/1-basic/8-javascript/default.segment.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "./greetings/sayHello": { - "default": { - "access": "public", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/examples/1-basic/8-javascript/jitar.json b/examples/1-basic/8-javascript/jitar.json deleted file mode 100644 index a697d928..00000000 --- a/examples/1-basic/8-javascript/jitar.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "http://127.0.0.1:3000", - "standalone": {} -} \ No newline at end of file diff --git a/examples/1-basic/8-javascript/package.json b/examples/1-basic/8-javascript/package.json deleted file mode 100644 index c694ab3f..00000000 --- a/examples/1-basic/8-javascript/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "jitar-javascript-example", - "type": "module", - "private": true, - "scripts": { - "build": "", - "start": "node --experimental-network-imports src/start.js --config=jitar.json" - }, - "dependencies": { - "jitar": "^0.4.0" - } -} \ No newline at end of file diff --git a/examples/1-basic/8-javascript/requests.http b/examples/1-basic/8-javascript/requests.http deleted file mode 100644 index a3c3b3e6..00000000 --- a/examples/1-basic/8-javascript/requests.http +++ /dev/null @@ -1,4 +0,0 @@ - -// Say hello - -GET http://localhost:3000/rpc/greetings/sayHello?name=John HTTP/1.1 diff --git a/examples/1-basic/8-javascript/src/greetings/sayHello.js b/examples/1-basic/8-javascript/src/greetings/sayHello.js deleted file mode 100644 index ac466095..00000000 --- a/examples/1-basic/8-javascript/src/greetings/sayHello.js +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * This an simple example procedure that returns a string. - * - * Parameters can be mandatory or optional. They will be checked when calling the procedure. - * - * Important note: - * All functions have to be async functions in order to be able to split applications. - */ - -export default async function sayHello(name = 'World') -{ - return `Hello ${name}`; -} diff --git a/examples/1-basic/8-javascript/src/start.js b/examples/1-basic/8-javascript/src/start.js deleted file mode 100644 index 537fe924..00000000 --- a/examples/1-basic/8-javascript/src/start.js +++ /dev/null @@ -1,6 +0,0 @@ - -import { startServer } from 'jitar'; - -const moduleImporter = async (specifier) => import(specifier); - -startServer(moduleImporter); From 213f0e12f050a29772beba6f85d668de6766ae98 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 27 Apr 2023 21:43:37 +0200 Subject: [PATCH 04/14] Renamed the examples and shuffled the folders --- .../contact-list}/.gitignore | 0 .../contact-list}/README.md | 0 .../contact-list}/conf/dev.json | 0 .../contact-list/conf}/gateway.json | 0 .../contact-list}/conf/node.json | 0 .../contact-list}/conf/proxy.json | 0 .../contact-list}/conf/repo.json | 0 .../contact-list}/docker-compose.yml | 0 .../contact-list}/index.html | 0 .../contact-list}/package.json | 0 .../contact-list}/public/.gitkeep | 0 .../segments/server.segment.json | 0 .../contact-list}/src/App.tsx | 0 .../contact-list}/src/assets/jitar.svg | 0 .../src/components/ContactForm.tsx | 0 .../src/components/ContactItem.tsx | 0 .../src/components/ContactList.tsx | 0 .../contact-list}/src/components/Header.tsx | 0 .../contact-list}/src/jitar.ts | 0 .../contact-list}/src/main.tsx | 0 .../contact-list}/src/pages/ContactPage.tsx | 0 .../src/shared/common/DatabaseError.ts | 0 .../src/shared/common/createId.ts | 0 .../src/shared/common/getCollection.ts | 0 .../src/shared/common/getDatabase.ts | 0 .../src/shared/contact/Contact.ts | 0 .../src/shared/contact/createContact.ts | 0 .../src/shared/contact/deleteContact.ts | 0 .../src/shared/contact/getContacts.ts | 0 .../contact-list}/src/vite-env.d.ts | 0 .../contact-list}/tsconfig.json | 0 .../contact-list}/tsconfig.node.json | 0 .../contact-list}/vite.config.ts | 0 .../access-protection}/README.md | 0 .../access-protection}/package.json | 0 .../access-protection}/requests.http | 0 .../segments/game.segment.json | 0 .../services/standalone.json | 0 .../src/game/checkSecret.ts | 0 .../access-protection}/src/game/getSecret.ts | 0 .../access-protection}/src/jitar.ts | 0 .../access-protection}/tsconfig.json | 0 .../data-transportation}/README.md | 0 .../data-transportation/conf}/gateway.json | 0 .../data-transportation}/conf/node1.json | 0 .../data-transportation}/conf/node2.json | 0 .../data-transportation}/conf/repo.json | 0 .../data-transportation}/package.json | 0 .../data-transportation}/requests.http | 0 .../segments/hello.segment.json | 0 .../segments/hi.segment.json | 0 .../src/greetings/Person.ts | 0 .../src/greetings/sayBoth.ts | 0 .../src/greetings/sayHello.ts | 0 .../src/greetings/sayHi.ts | 0 .../data-transportation}/src/start.ts | 0 .../data-transportation}/tsconfig.json | 0 .../error-handling}/README.md | 0 .../error-handling}/conf/gateway.json | 0 .../error-handling}/conf/node1.json | 0 .../error-handling}/conf/node2.json | 0 .../error-handling}/conf/repo.json | 0 .../error-handling}/jitar.json | 0 .../error-handling}/package.json | 0 .../error-handling}/requests.http | 0 .../segments/hello.segment.json | 0 .../error-handling}/segments/hi.segment.json | 0 .../src/greetings/CustomError.ts | 0 .../error-handling}/src/greetings/Person.ts | 0 .../error-handling}/src/greetings/sayBoth.ts | 0 .../error-handling}/src/greetings/sayHello.ts | 0 .../error-handling}/src/greetings/sayHi.ts | 0 .../error-handling}/src/start.ts | 0 .../error-handling}/tsconfig.json | 0 .../health-checks}/README.md | 0 .../health-checks}/default.segment.json | 0 .../health-checks}/jitar.json | 0 .../health-checks}/package.json | 0 .../health-checks}/requests.http | 0 .../health-checks}/src/DatabaseHealthCheck.ts | 0 .../health-checks/src/greetings}/sayHello.ts | 0 .../health-checks}/src/start.ts | 0 .../health-checks}/tsconfig.json | 0 .../hello-world}/README.md | 0 .../hello-world}/package.json | 0 .../hello-world}/requests.http | 0 .../segments/default.segment.json | 0 .../hello-world}/services/standalone.json | 0 .../hello-world}/src/jitar.ts | 0 .../hello-world/src}/sayHello.ts | 0 .../hello-world}/tsconfig.json | 0 .../load-balancing}/README.md | 0 .../load-balancing}/package.json | 0 .../load-balancing}/requests.http | 0 .../segments/calculator.segment.json | 0 .../load-balancing/services}/gateway.json | 0 .../load-balancing}/services/node1.json | 0 .../load-balancing}/services/node2.json | 0 .../load-balancing}/services/repository.json | 0 .../load-balancing}/services/standalone.json | 0 .../load-balancing}/src/calculator/add.ts | 0 .../load-balancing}/src/calculator/divide.ts | 0 .../src/calculator/multiply.ts | 0 .../src/calculator/subtract.ts | 0 .../load-balancing}/src/jitar.ts | 0 .../load-balancing}/tsconfig.json | 0 .../middleware}/README.md | 0 .../middleware}/default.segment.json | 0 .../middleware}/jitar.json | 0 .../middleware}/package.json | 0 .../middleware}/requests.http | 0 .../middleware}/src/LoggingMiddleware.ts | 0 .../middleware}/src/greetings/sayHello.ts | 0 .../middleware}/src/start.ts | 0 .../middleware}/tsconfig.json | 0 .../multi-version}/README.md | 0 .../multi-version}/default.segment.json | 0 .../multi-version}/jitar.json | 0 .../multi-version}/package.json | 0 .../multi-version}/requests.http | 0 .../multi-version}/src/greetings/sayHello.ts | 0 .../src/greetings/sayHello_v1_0_0.ts | 0 .../multi-version}/src/start.ts | 0 .../multi-version}/tsconfig.json | 0 .../run-procedure}/README.md | 0 .../run-procedure}/default.segment.json | 0 .../run-procedure}/jitar.json | 0 .../run-procedure}/package.json | 0 .../run-procedure}/requests.http | 0 .../run-procedure}/src/greetings/sayBoth.ts | 0 .../run-procedure}/src/greetings/sayHello.ts | 0 .../run-procedure}/src/greetings/sayHi.ts | 0 .../run-procedure}/src/start.ts | 0 .../run-procedure}/tsconfig.json | 0 .../segmentation}/README.md | 0 .../segmentation}/package.json | 0 .../segmentation}/requests.http | 0 .../segmentation}/segments/data.segment.json | 0 .../segments/process.segment.json | 0 .../segmentation/services}/gateway.json | 0 .../segmentation}/services/node1.json | 0 .../segmentation}/services/node2.json | 0 .../segmentation}/services/repository.json | 0 .../segmentation}/services/standalone.json | 0 .../segmentation}/src/jitar.ts | 0 .../src/reporting/createReport.ts | 0 .../src/reporting/createStatistics.ts | 0 .../segmentation}/src/reporting/getData.ts | 0 .../segmentation}/tsconfig.json | 0 .../start-hooks}/README.md | 0 .../start-hooks}/jitar.json | 0 .../start-hooks}/package.json | 0 .../start-hooks}/segments/client.segment.json | 0 .../start-hooks}/segments/server.segment.json | 0 .../start-hooks}/src/client.ts | 0 .../start-hooks}/src/greetings/Person.ts | 0 .../start-hooks}/src/greetings/sayBoth.ts | 0 .../start-hooks}/src/greetings/sayHello.ts | 0 .../start-hooks}/src/greetings/sayHi.ts | 0 .../start-hooks}/src/index.html | 0 .../start-hooks}/src/server.ts | 0 .../start-hooks}/tsconfig.json | 0 package-lock.json | 302 ++++++++++++++---- package.json | 26 +- 164 files changed, 256 insertions(+), 72 deletions(-) rename examples/{3-apps/1-contact-list => apps/contact-list}/.gitignore (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/README.md (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/conf/dev.json (100%) rename examples/{1-basic/2-segmentation/services => apps/contact-list/conf}/gateway.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/conf/node.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/conf/proxy.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/conf/repo.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/docker-compose.yml (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/index.html (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/package.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/public/.gitkeep (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/segments/server.segment.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/App.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/assets/jitar.svg (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/components/ContactForm.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/components/ContactItem.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/components/ContactList.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/components/Header.tsx (100%) rename examples/{1-basic/1-hello-world => apps/contact-list}/src/jitar.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/main.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/pages/ContactPage.tsx (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/common/DatabaseError.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/common/createId.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/common/getCollection.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/common/getDatabase.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/contact/Contact.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/contact/createContact.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/contact/deleteContact.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/shared/contact/getContacts.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/src/vite-env.d.ts (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/tsconfig.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/tsconfig.node.json (100%) rename examples/{3-apps/1-contact-list => apps/contact-list}/vite.config.ts (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/README.md (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/package.json (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/requests.http (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/segments/game.segment.json (100%) rename examples/{1-basic/1-hello-world => concepts/access-protection}/services/standalone.json (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/src/game/checkSecret.ts (100%) rename examples/{1-basic/4-access-protection => concepts/access-protection}/src/game/getSecret.ts (100%) rename examples/{1-basic/2-segmentation => concepts/access-protection}/src/jitar.ts (100%) rename examples/{1-basic/1-hello-world => concepts/access-protection}/tsconfig.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/README.md (100%) rename examples/{1-basic/3-load-balancing/services => concepts/data-transportation/conf}/gateway.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/conf/node1.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/conf/node2.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/conf/repo.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/package.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/requests.http (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/segments/hello.segment.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/segments/hi.segment.json (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/src/greetings/Person.ts (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/src/greetings/sayBoth.ts (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/src/greetings/sayHello.ts (100%) rename examples/{1-basic/6-data-transportation => concepts/data-transportation}/src/greetings/sayHi.ts (100%) rename examples/{1-basic/5-multi-version => concepts/data-transportation}/src/start.ts (100%) rename examples/{1-basic/2-segmentation => concepts/data-transportation}/tsconfig.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/README.md (100%) rename examples/{1-basic/6-data-transportation => concepts/error-handling}/conf/gateway.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/conf/node1.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/conf/node2.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/conf/repo.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/jitar.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/package.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/requests.http (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/segments/hello.segment.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/segments/hi.segment.json (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/src/greetings/CustomError.ts (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/src/greetings/Person.ts (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/src/greetings/sayBoth.ts (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/src/greetings/sayHello.ts (100%) rename examples/{1-basic/7-error-handling => concepts/error-handling}/src/greetings/sayHi.ts (100%) rename examples/{1-basic/6-data-transportation => concepts/error-handling}/src/start.ts (100%) rename examples/{1-basic/3-load-balancing => concepts/error-handling}/tsconfig.json (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/README.md (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/default.segment.json (100%) rename examples/{1-basic/5-multi-version => concepts/health-checks}/jitar.json (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/package.json (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/requests.http (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/src/DatabaseHealthCheck.ts (100%) rename examples/{1-basic/1-hello-world/src => concepts/health-checks/src/greetings}/sayHello.ts (100%) rename examples/{2-advanced/3-health-checks => concepts/health-checks}/src/start.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/health-checks}/tsconfig.json (100%) rename examples/{1-basic/1-hello-world => concepts/hello-world}/README.md (100%) rename examples/{1-basic/1-hello-world => concepts/hello-world}/package.json (100%) rename examples/{1-basic/1-hello-world => concepts/hello-world}/requests.http (100%) rename examples/{1-basic/1-hello-world => concepts/hello-world}/segments/default.segment.json (100%) rename examples/{1-basic/2-segmentation => concepts/hello-world}/services/standalone.json (100%) rename examples/{1-basic/3-load-balancing => concepts/hello-world}/src/jitar.ts (100%) rename examples/{2-advanced/3-health-checks/src/greetings => concepts/hello-world/src}/sayHello.ts (100%) rename examples/{1-basic/4-access-protection => concepts/hello-world}/tsconfig.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/README.md (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/package.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/requests.http (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/segments/calculator.segment.json (100%) rename examples/{1-basic/7-error-handling/conf => concepts/load-balancing/services}/gateway.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/services/node1.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/services/node2.json (100%) rename examples/{1-basic/2-segmentation => concepts/load-balancing}/services/repository.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/services/standalone.json (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/src/calculator/add.ts (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/src/calculator/divide.ts (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/src/calculator/multiply.ts (100%) rename examples/{1-basic/3-load-balancing => concepts/load-balancing}/src/calculator/subtract.ts (100%) rename examples/{1-basic/4-access-protection => concepts/load-balancing}/src/jitar.ts (100%) rename examples/{1-basic/5-multi-version => concepts/load-balancing}/tsconfig.json (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/README.md (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/default.segment.json (100%) rename examples/{2-advanced/2-run-procedure => concepts/middleware}/jitar.json (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/package.json (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/requests.http (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/src/LoggingMiddleware.ts (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/src/greetings/sayHello.ts (100%) rename examples/{2-advanced/4-middleware => concepts/middleware}/src/start.ts (100%) rename examples/{2-advanced/2-run-procedure => concepts/middleware}/tsconfig.json (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/README.md (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/default.segment.json (100%) rename examples/{2-advanced/3-health-checks => concepts/multi-version}/jitar.json (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/package.json (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/requests.http (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/src/greetings/sayHello.ts (100%) rename examples/{1-basic/5-multi-version => concepts/multi-version}/src/greetings/sayHello_v1_0_0.ts (100%) rename examples/{1-basic/7-error-handling => concepts/multi-version}/src/start.ts (100%) rename examples/{1-basic/6-data-transportation => concepts/multi-version}/tsconfig.json (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/README.md (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/default.segment.json (100%) rename examples/{2-advanced/4-middleware => concepts/run-procedure}/jitar.json (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/package.json (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/requests.http (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/src/greetings/sayBoth.ts (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/src/greetings/sayHello.ts (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/src/greetings/sayHi.ts (100%) rename examples/{2-advanced/2-run-procedure => concepts/run-procedure}/src/start.ts (100%) rename examples/{2-advanced/3-health-checks => concepts/run-procedure}/tsconfig.json (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/README.md (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/package.json (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/requests.http (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/segments/data.segment.json (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/segments/process.segment.json (100%) rename examples/{3-apps/1-contact-list/conf => concepts/segmentation/services}/gateway.json (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/services/node1.json (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/services/node2.json (100%) rename examples/{1-basic/3-load-balancing => concepts/segmentation}/services/repository.json (100%) rename examples/{1-basic/4-access-protection => concepts/segmentation}/services/standalone.json (100%) rename examples/{3-apps/1-contact-list => concepts/segmentation}/src/jitar.ts (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/src/reporting/createReport.ts (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/src/reporting/createStatistics.ts (100%) rename examples/{1-basic/2-segmentation => concepts/segmentation}/src/reporting/getData.ts (100%) rename examples/{1-basic/7-error-handling => concepts/segmentation}/tsconfig.json (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/README.md (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/jitar.json (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/package.json (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/segments/client.segment.json (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/segments/server.segment.json (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/client.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/greetings/Person.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/greetings/sayBoth.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/greetings/sayHello.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/greetings/sayHi.ts (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/index.html (100%) rename examples/{2-advanced/1-start-hooks => concepts/start-hooks}/src/server.ts (100%) rename examples/{2-advanced/4-middleware => concepts/start-hooks}/tsconfig.json (100%) diff --git a/examples/3-apps/1-contact-list/.gitignore b/examples/apps/contact-list/.gitignore similarity index 100% rename from examples/3-apps/1-contact-list/.gitignore rename to examples/apps/contact-list/.gitignore diff --git a/examples/3-apps/1-contact-list/README.md b/examples/apps/contact-list/README.md similarity index 100% rename from examples/3-apps/1-contact-list/README.md rename to examples/apps/contact-list/README.md diff --git a/examples/3-apps/1-contact-list/conf/dev.json b/examples/apps/contact-list/conf/dev.json similarity index 100% rename from examples/3-apps/1-contact-list/conf/dev.json rename to examples/apps/contact-list/conf/dev.json diff --git a/examples/1-basic/2-segmentation/services/gateway.json b/examples/apps/contact-list/conf/gateway.json similarity index 100% rename from examples/1-basic/2-segmentation/services/gateway.json rename to examples/apps/contact-list/conf/gateway.json diff --git a/examples/3-apps/1-contact-list/conf/node.json b/examples/apps/contact-list/conf/node.json similarity index 100% rename from examples/3-apps/1-contact-list/conf/node.json rename to examples/apps/contact-list/conf/node.json diff --git a/examples/3-apps/1-contact-list/conf/proxy.json b/examples/apps/contact-list/conf/proxy.json similarity index 100% rename from examples/3-apps/1-contact-list/conf/proxy.json rename to examples/apps/contact-list/conf/proxy.json diff --git a/examples/3-apps/1-contact-list/conf/repo.json b/examples/apps/contact-list/conf/repo.json similarity index 100% rename from examples/3-apps/1-contact-list/conf/repo.json rename to examples/apps/contact-list/conf/repo.json diff --git a/examples/3-apps/1-contact-list/docker-compose.yml b/examples/apps/contact-list/docker-compose.yml similarity index 100% rename from examples/3-apps/1-contact-list/docker-compose.yml rename to examples/apps/contact-list/docker-compose.yml diff --git a/examples/3-apps/1-contact-list/index.html b/examples/apps/contact-list/index.html similarity index 100% rename from examples/3-apps/1-contact-list/index.html rename to examples/apps/contact-list/index.html diff --git a/examples/3-apps/1-contact-list/package.json b/examples/apps/contact-list/package.json similarity index 100% rename from examples/3-apps/1-contact-list/package.json rename to examples/apps/contact-list/package.json diff --git a/examples/3-apps/1-contact-list/public/.gitkeep b/examples/apps/contact-list/public/.gitkeep similarity index 100% rename from examples/3-apps/1-contact-list/public/.gitkeep rename to examples/apps/contact-list/public/.gitkeep diff --git a/examples/3-apps/1-contact-list/segments/server.segment.json b/examples/apps/contact-list/segments/server.segment.json similarity index 100% rename from examples/3-apps/1-contact-list/segments/server.segment.json rename to examples/apps/contact-list/segments/server.segment.json diff --git a/examples/3-apps/1-contact-list/src/App.tsx b/examples/apps/contact-list/src/App.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/App.tsx rename to examples/apps/contact-list/src/App.tsx diff --git a/examples/3-apps/1-contact-list/src/assets/jitar.svg b/examples/apps/contact-list/src/assets/jitar.svg similarity index 100% rename from examples/3-apps/1-contact-list/src/assets/jitar.svg rename to examples/apps/contact-list/src/assets/jitar.svg diff --git a/examples/3-apps/1-contact-list/src/components/ContactForm.tsx b/examples/apps/contact-list/src/components/ContactForm.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/components/ContactForm.tsx rename to examples/apps/contact-list/src/components/ContactForm.tsx diff --git a/examples/3-apps/1-contact-list/src/components/ContactItem.tsx b/examples/apps/contact-list/src/components/ContactItem.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/components/ContactItem.tsx rename to examples/apps/contact-list/src/components/ContactItem.tsx diff --git a/examples/3-apps/1-contact-list/src/components/ContactList.tsx b/examples/apps/contact-list/src/components/ContactList.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/components/ContactList.tsx rename to examples/apps/contact-list/src/components/ContactList.tsx diff --git a/examples/3-apps/1-contact-list/src/components/Header.tsx b/examples/apps/contact-list/src/components/Header.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/components/Header.tsx rename to examples/apps/contact-list/src/components/Header.tsx diff --git a/examples/1-basic/1-hello-world/src/jitar.ts b/examples/apps/contact-list/src/jitar.ts similarity index 100% rename from examples/1-basic/1-hello-world/src/jitar.ts rename to examples/apps/contact-list/src/jitar.ts diff --git a/examples/3-apps/1-contact-list/src/main.tsx b/examples/apps/contact-list/src/main.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/main.tsx rename to examples/apps/contact-list/src/main.tsx diff --git a/examples/3-apps/1-contact-list/src/pages/ContactPage.tsx b/examples/apps/contact-list/src/pages/ContactPage.tsx similarity index 100% rename from examples/3-apps/1-contact-list/src/pages/ContactPage.tsx rename to examples/apps/contact-list/src/pages/ContactPage.tsx diff --git a/examples/3-apps/1-contact-list/src/shared/common/DatabaseError.ts b/examples/apps/contact-list/src/shared/common/DatabaseError.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/common/DatabaseError.ts rename to examples/apps/contact-list/src/shared/common/DatabaseError.ts diff --git a/examples/3-apps/1-contact-list/src/shared/common/createId.ts b/examples/apps/contact-list/src/shared/common/createId.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/common/createId.ts rename to examples/apps/contact-list/src/shared/common/createId.ts diff --git a/examples/3-apps/1-contact-list/src/shared/common/getCollection.ts b/examples/apps/contact-list/src/shared/common/getCollection.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/common/getCollection.ts rename to examples/apps/contact-list/src/shared/common/getCollection.ts diff --git a/examples/3-apps/1-contact-list/src/shared/common/getDatabase.ts b/examples/apps/contact-list/src/shared/common/getDatabase.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/common/getDatabase.ts rename to examples/apps/contact-list/src/shared/common/getDatabase.ts diff --git a/examples/3-apps/1-contact-list/src/shared/contact/Contact.ts b/examples/apps/contact-list/src/shared/contact/Contact.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/contact/Contact.ts rename to examples/apps/contact-list/src/shared/contact/Contact.ts diff --git a/examples/3-apps/1-contact-list/src/shared/contact/createContact.ts b/examples/apps/contact-list/src/shared/contact/createContact.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/contact/createContact.ts rename to examples/apps/contact-list/src/shared/contact/createContact.ts diff --git a/examples/3-apps/1-contact-list/src/shared/contact/deleteContact.ts b/examples/apps/contact-list/src/shared/contact/deleteContact.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/contact/deleteContact.ts rename to examples/apps/contact-list/src/shared/contact/deleteContact.ts diff --git a/examples/3-apps/1-contact-list/src/shared/contact/getContacts.ts b/examples/apps/contact-list/src/shared/contact/getContacts.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/shared/contact/getContacts.ts rename to examples/apps/contact-list/src/shared/contact/getContacts.ts diff --git a/examples/3-apps/1-contact-list/src/vite-env.d.ts b/examples/apps/contact-list/src/vite-env.d.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/vite-env.d.ts rename to examples/apps/contact-list/src/vite-env.d.ts diff --git a/examples/3-apps/1-contact-list/tsconfig.json b/examples/apps/contact-list/tsconfig.json similarity index 100% rename from examples/3-apps/1-contact-list/tsconfig.json rename to examples/apps/contact-list/tsconfig.json diff --git a/examples/3-apps/1-contact-list/tsconfig.node.json b/examples/apps/contact-list/tsconfig.node.json similarity index 100% rename from examples/3-apps/1-contact-list/tsconfig.node.json rename to examples/apps/contact-list/tsconfig.node.json diff --git a/examples/3-apps/1-contact-list/vite.config.ts b/examples/apps/contact-list/vite.config.ts similarity index 100% rename from examples/3-apps/1-contact-list/vite.config.ts rename to examples/apps/contact-list/vite.config.ts diff --git a/examples/1-basic/4-access-protection/README.md b/examples/concepts/access-protection/README.md similarity index 100% rename from examples/1-basic/4-access-protection/README.md rename to examples/concepts/access-protection/README.md diff --git a/examples/1-basic/4-access-protection/package.json b/examples/concepts/access-protection/package.json similarity index 100% rename from examples/1-basic/4-access-protection/package.json rename to examples/concepts/access-protection/package.json diff --git a/examples/1-basic/4-access-protection/requests.http b/examples/concepts/access-protection/requests.http similarity index 100% rename from examples/1-basic/4-access-protection/requests.http rename to examples/concepts/access-protection/requests.http diff --git a/examples/1-basic/4-access-protection/segments/game.segment.json b/examples/concepts/access-protection/segments/game.segment.json similarity index 100% rename from examples/1-basic/4-access-protection/segments/game.segment.json rename to examples/concepts/access-protection/segments/game.segment.json diff --git a/examples/1-basic/1-hello-world/services/standalone.json b/examples/concepts/access-protection/services/standalone.json similarity index 100% rename from examples/1-basic/1-hello-world/services/standalone.json rename to examples/concepts/access-protection/services/standalone.json diff --git a/examples/1-basic/4-access-protection/src/game/checkSecret.ts b/examples/concepts/access-protection/src/game/checkSecret.ts similarity index 100% rename from examples/1-basic/4-access-protection/src/game/checkSecret.ts rename to examples/concepts/access-protection/src/game/checkSecret.ts diff --git a/examples/1-basic/4-access-protection/src/game/getSecret.ts b/examples/concepts/access-protection/src/game/getSecret.ts similarity index 100% rename from examples/1-basic/4-access-protection/src/game/getSecret.ts rename to examples/concepts/access-protection/src/game/getSecret.ts diff --git a/examples/1-basic/2-segmentation/src/jitar.ts b/examples/concepts/access-protection/src/jitar.ts similarity index 100% rename from examples/1-basic/2-segmentation/src/jitar.ts rename to examples/concepts/access-protection/src/jitar.ts diff --git a/examples/1-basic/1-hello-world/tsconfig.json b/examples/concepts/access-protection/tsconfig.json similarity index 100% rename from examples/1-basic/1-hello-world/tsconfig.json rename to examples/concepts/access-protection/tsconfig.json diff --git a/examples/1-basic/6-data-transportation/README.md b/examples/concepts/data-transportation/README.md similarity index 100% rename from examples/1-basic/6-data-transportation/README.md rename to examples/concepts/data-transportation/README.md diff --git a/examples/1-basic/3-load-balancing/services/gateway.json b/examples/concepts/data-transportation/conf/gateway.json similarity index 100% rename from examples/1-basic/3-load-balancing/services/gateway.json rename to examples/concepts/data-transportation/conf/gateway.json diff --git a/examples/1-basic/6-data-transportation/conf/node1.json b/examples/concepts/data-transportation/conf/node1.json similarity index 100% rename from examples/1-basic/6-data-transportation/conf/node1.json rename to examples/concepts/data-transportation/conf/node1.json diff --git a/examples/1-basic/6-data-transportation/conf/node2.json b/examples/concepts/data-transportation/conf/node2.json similarity index 100% rename from examples/1-basic/6-data-transportation/conf/node2.json rename to examples/concepts/data-transportation/conf/node2.json diff --git a/examples/1-basic/6-data-transportation/conf/repo.json b/examples/concepts/data-transportation/conf/repo.json similarity index 100% rename from examples/1-basic/6-data-transportation/conf/repo.json rename to examples/concepts/data-transportation/conf/repo.json diff --git a/examples/1-basic/6-data-transportation/package.json b/examples/concepts/data-transportation/package.json similarity index 100% rename from examples/1-basic/6-data-transportation/package.json rename to examples/concepts/data-transportation/package.json diff --git a/examples/1-basic/6-data-transportation/requests.http b/examples/concepts/data-transportation/requests.http similarity index 100% rename from examples/1-basic/6-data-transportation/requests.http rename to examples/concepts/data-transportation/requests.http diff --git a/examples/1-basic/6-data-transportation/segments/hello.segment.json b/examples/concepts/data-transportation/segments/hello.segment.json similarity index 100% rename from examples/1-basic/6-data-transportation/segments/hello.segment.json rename to examples/concepts/data-transportation/segments/hello.segment.json diff --git a/examples/1-basic/6-data-transportation/segments/hi.segment.json b/examples/concepts/data-transportation/segments/hi.segment.json similarity index 100% rename from examples/1-basic/6-data-transportation/segments/hi.segment.json rename to examples/concepts/data-transportation/segments/hi.segment.json diff --git a/examples/1-basic/6-data-transportation/src/greetings/Person.ts b/examples/concepts/data-transportation/src/greetings/Person.ts similarity index 100% rename from examples/1-basic/6-data-transportation/src/greetings/Person.ts rename to examples/concepts/data-transportation/src/greetings/Person.ts diff --git a/examples/1-basic/6-data-transportation/src/greetings/sayBoth.ts b/examples/concepts/data-transportation/src/greetings/sayBoth.ts similarity index 100% rename from examples/1-basic/6-data-transportation/src/greetings/sayBoth.ts rename to examples/concepts/data-transportation/src/greetings/sayBoth.ts diff --git a/examples/1-basic/6-data-transportation/src/greetings/sayHello.ts b/examples/concepts/data-transportation/src/greetings/sayHello.ts similarity index 100% rename from examples/1-basic/6-data-transportation/src/greetings/sayHello.ts rename to examples/concepts/data-transportation/src/greetings/sayHello.ts diff --git a/examples/1-basic/6-data-transportation/src/greetings/sayHi.ts b/examples/concepts/data-transportation/src/greetings/sayHi.ts similarity index 100% rename from examples/1-basic/6-data-transportation/src/greetings/sayHi.ts rename to examples/concepts/data-transportation/src/greetings/sayHi.ts diff --git a/examples/1-basic/5-multi-version/src/start.ts b/examples/concepts/data-transportation/src/start.ts similarity index 100% rename from examples/1-basic/5-multi-version/src/start.ts rename to examples/concepts/data-transportation/src/start.ts diff --git a/examples/1-basic/2-segmentation/tsconfig.json b/examples/concepts/data-transportation/tsconfig.json similarity index 100% rename from examples/1-basic/2-segmentation/tsconfig.json rename to examples/concepts/data-transportation/tsconfig.json diff --git a/examples/1-basic/7-error-handling/README.md b/examples/concepts/error-handling/README.md similarity index 100% rename from examples/1-basic/7-error-handling/README.md rename to examples/concepts/error-handling/README.md diff --git a/examples/1-basic/6-data-transportation/conf/gateway.json b/examples/concepts/error-handling/conf/gateway.json similarity index 100% rename from examples/1-basic/6-data-transportation/conf/gateway.json rename to examples/concepts/error-handling/conf/gateway.json diff --git a/examples/1-basic/7-error-handling/conf/node1.json b/examples/concepts/error-handling/conf/node1.json similarity index 100% rename from examples/1-basic/7-error-handling/conf/node1.json rename to examples/concepts/error-handling/conf/node1.json diff --git a/examples/1-basic/7-error-handling/conf/node2.json b/examples/concepts/error-handling/conf/node2.json similarity index 100% rename from examples/1-basic/7-error-handling/conf/node2.json rename to examples/concepts/error-handling/conf/node2.json diff --git a/examples/1-basic/7-error-handling/conf/repo.json b/examples/concepts/error-handling/conf/repo.json similarity index 100% rename from examples/1-basic/7-error-handling/conf/repo.json rename to examples/concepts/error-handling/conf/repo.json diff --git a/examples/1-basic/7-error-handling/jitar.json b/examples/concepts/error-handling/jitar.json similarity index 100% rename from examples/1-basic/7-error-handling/jitar.json rename to examples/concepts/error-handling/jitar.json diff --git a/examples/1-basic/7-error-handling/package.json b/examples/concepts/error-handling/package.json similarity index 100% rename from examples/1-basic/7-error-handling/package.json rename to examples/concepts/error-handling/package.json diff --git a/examples/1-basic/7-error-handling/requests.http b/examples/concepts/error-handling/requests.http similarity index 100% rename from examples/1-basic/7-error-handling/requests.http rename to examples/concepts/error-handling/requests.http diff --git a/examples/1-basic/7-error-handling/segments/hello.segment.json b/examples/concepts/error-handling/segments/hello.segment.json similarity index 100% rename from examples/1-basic/7-error-handling/segments/hello.segment.json rename to examples/concepts/error-handling/segments/hello.segment.json diff --git a/examples/1-basic/7-error-handling/segments/hi.segment.json b/examples/concepts/error-handling/segments/hi.segment.json similarity index 100% rename from examples/1-basic/7-error-handling/segments/hi.segment.json rename to examples/concepts/error-handling/segments/hi.segment.json diff --git a/examples/1-basic/7-error-handling/src/greetings/CustomError.ts b/examples/concepts/error-handling/src/greetings/CustomError.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/greetings/CustomError.ts rename to examples/concepts/error-handling/src/greetings/CustomError.ts diff --git a/examples/1-basic/7-error-handling/src/greetings/Person.ts b/examples/concepts/error-handling/src/greetings/Person.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/greetings/Person.ts rename to examples/concepts/error-handling/src/greetings/Person.ts diff --git a/examples/1-basic/7-error-handling/src/greetings/sayBoth.ts b/examples/concepts/error-handling/src/greetings/sayBoth.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/greetings/sayBoth.ts rename to examples/concepts/error-handling/src/greetings/sayBoth.ts diff --git a/examples/1-basic/7-error-handling/src/greetings/sayHello.ts b/examples/concepts/error-handling/src/greetings/sayHello.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/greetings/sayHello.ts rename to examples/concepts/error-handling/src/greetings/sayHello.ts diff --git a/examples/1-basic/7-error-handling/src/greetings/sayHi.ts b/examples/concepts/error-handling/src/greetings/sayHi.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/greetings/sayHi.ts rename to examples/concepts/error-handling/src/greetings/sayHi.ts diff --git a/examples/1-basic/6-data-transportation/src/start.ts b/examples/concepts/error-handling/src/start.ts similarity index 100% rename from examples/1-basic/6-data-transportation/src/start.ts rename to examples/concepts/error-handling/src/start.ts diff --git a/examples/1-basic/3-load-balancing/tsconfig.json b/examples/concepts/error-handling/tsconfig.json similarity index 100% rename from examples/1-basic/3-load-balancing/tsconfig.json rename to examples/concepts/error-handling/tsconfig.json diff --git a/examples/2-advanced/3-health-checks/README.md b/examples/concepts/health-checks/README.md similarity index 100% rename from examples/2-advanced/3-health-checks/README.md rename to examples/concepts/health-checks/README.md diff --git a/examples/2-advanced/3-health-checks/default.segment.json b/examples/concepts/health-checks/default.segment.json similarity index 100% rename from examples/2-advanced/3-health-checks/default.segment.json rename to examples/concepts/health-checks/default.segment.json diff --git a/examples/1-basic/5-multi-version/jitar.json b/examples/concepts/health-checks/jitar.json similarity index 100% rename from examples/1-basic/5-multi-version/jitar.json rename to examples/concepts/health-checks/jitar.json diff --git a/examples/2-advanced/3-health-checks/package.json b/examples/concepts/health-checks/package.json similarity index 100% rename from examples/2-advanced/3-health-checks/package.json rename to examples/concepts/health-checks/package.json diff --git a/examples/2-advanced/3-health-checks/requests.http b/examples/concepts/health-checks/requests.http similarity index 100% rename from examples/2-advanced/3-health-checks/requests.http rename to examples/concepts/health-checks/requests.http diff --git a/examples/2-advanced/3-health-checks/src/DatabaseHealthCheck.ts b/examples/concepts/health-checks/src/DatabaseHealthCheck.ts similarity index 100% rename from examples/2-advanced/3-health-checks/src/DatabaseHealthCheck.ts rename to examples/concepts/health-checks/src/DatabaseHealthCheck.ts diff --git a/examples/1-basic/1-hello-world/src/sayHello.ts b/examples/concepts/health-checks/src/greetings/sayHello.ts similarity index 100% rename from examples/1-basic/1-hello-world/src/sayHello.ts rename to examples/concepts/health-checks/src/greetings/sayHello.ts diff --git a/examples/2-advanced/3-health-checks/src/start.ts b/examples/concepts/health-checks/src/start.ts similarity index 100% rename from examples/2-advanced/3-health-checks/src/start.ts rename to examples/concepts/health-checks/src/start.ts diff --git a/examples/2-advanced/1-start-hooks/tsconfig.json b/examples/concepts/health-checks/tsconfig.json similarity index 100% rename from examples/2-advanced/1-start-hooks/tsconfig.json rename to examples/concepts/health-checks/tsconfig.json diff --git a/examples/1-basic/1-hello-world/README.md b/examples/concepts/hello-world/README.md similarity index 100% rename from examples/1-basic/1-hello-world/README.md rename to examples/concepts/hello-world/README.md diff --git a/examples/1-basic/1-hello-world/package.json b/examples/concepts/hello-world/package.json similarity index 100% rename from examples/1-basic/1-hello-world/package.json rename to examples/concepts/hello-world/package.json diff --git a/examples/1-basic/1-hello-world/requests.http b/examples/concepts/hello-world/requests.http similarity index 100% rename from examples/1-basic/1-hello-world/requests.http rename to examples/concepts/hello-world/requests.http diff --git a/examples/1-basic/1-hello-world/segments/default.segment.json b/examples/concepts/hello-world/segments/default.segment.json similarity index 100% rename from examples/1-basic/1-hello-world/segments/default.segment.json rename to examples/concepts/hello-world/segments/default.segment.json diff --git a/examples/1-basic/2-segmentation/services/standalone.json b/examples/concepts/hello-world/services/standalone.json similarity index 100% rename from examples/1-basic/2-segmentation/services/standalone.json rename to examples/concepts/hello-world/services/standalone.json diff --git a/examples/1-basic/3-load-balancing/src/jitar.ts b/examples/concepts/hello-world/src/jitar.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/jitar.ts rename to examples/concepts/hello-world/src/jitar.ts diff --git a/examples/2-advanced/3-health-checks/src/greetings/sayHello.ts b/examples/concepts/hello-world/src/sayHello.ts similarity index 100% rename from examples/2-advanced/3-health-checks/src/greetings/sayHello.ts rename to examples/concepts/hello-world/src/sayHello.ts diff --git a/examples/1-basic/4-access-protection/tsconfig.json b/examples/concepts/hello-world/tsconfig.json similarity index 100% rename from examples/1-basic/4-access-protection/tsconfig.json rename to examples/concepts/hello-world/tsconfig.json diff --git a/examples/1-basic/3-load-balancing/README.md b/examples/concepts/load-balancing/README.md similarity index 100% rename from examples/1-basic/3-load-balancing/README.md rename to examples/concepts/load-balancing/README.md diff --git a/examples/1-basic/3-load-balancing/package.json b/examples/concepts/load-balancing/package.json similarity index 100% rename from examples/1-basic/3-load-balancing/package.json rename to examples/concepts/load-balancing/package.json diff --git a/examples/1-basic/3-load-balancing/requests.http b/examples/concepts/load-balancing/requests.http similarity index 100% rename from examples/1-basic/3-load-balancing/requests.http rename to examples/concepts/load-balancing/requests.http diff --git a/examples/1-basic/3-load-balancing/segments/calculator.segment.json b/examples/concepts/load-balancing/segments/calculator.segment.json similarity index 100% rename from examples/1-basic/3-load-balancing/segments/calculator.segment.json rename to examples/concepts/load-balancing/segments/calculator.segment.json diff --git a/examples/1-basic/7-error-handling/conf/gateway.json b/examples/concepts/load-balancing/services/gateway.json similarity index 100% rename from examples/1-basic/7-error-handling/conf/gateway.json rename to examples/concepts/load-balancing/services/gateway.json diff --git a/examples/1-basic/3-load-balancing/services/node1.json b/examples/concepts/load-balancing/services/node1.json similarity index 100% rename from examples/1-basic/3-load-balancing/services/node1.json rename to examples/concepts/load-balancing/services/node1.json diff --git a/examples/1-basic/3-load-balancing/services/node2.json b/examples/concepts/load-balancing/services/node2.json similarity index 100% rename from examples/1-basic/3-load-balancing/services/node2.json rename to examples/concepts/load-balancing/services/node2.json diff --git a/examples/1-basic/2-segmentation/services/repository.json b/examples/concepts/load-balancing/services/repository.json similarity index 100% rename from examples/1-basic/2-segmentation/services/repository.json rename to examples/concepts/load-balancing/services/repository.json diff --git a/examples/1-basic/3-load-balancing/services/standalone.json b/examples/concepts/load-balancing/services/standalone.json similarity index 100% rename from examples/1-basic/3-load-balancing/services/standalone.json rename to examples/concepts/load-balancing/services/standalone.json diff --git a/examples/1-basic/3-load-balancing/src/calculator/add.ts b/examples/concepts/load-balancing/src/calculator/add.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/calculator/add.ts rename to examples/concepts/load-balancing/src/calculator/add.ts diff --git a/examples/1-basic/3-load-balancing/src/calculator/divide.ts b/examples/concepts/load-balancing/src/calculator/divide.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/calculator/divide.ts rename to examples/concepts/load-balancing/src/calculator/divide.ts diff --git a/examples/1-basic/3-load-balancing/src/calculator/multiply.ts b/examples/concepts/load-balancing/src/calculator/multiply.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/calculator/multiply.ts rename to examples/concepts/load-balancing/src/calculator/multiply.ts diff --git a/examples/1-basic/3-load-balancing/src/calculator/subtract.ts b/examples/concepts/load-balancing/src/calculator/subtract.ts similarity index 100% rename from examples/1-basic/3-load-balancing/src/calculator/subtract.ts rename to examples/concepts/load-balancing/src/calculator/subtract.ts diff --git a/examples/1-basic/4-access-protection/src/jitar.ts b/examples/concepts/load-balancing/src/jitar.ts similarity index 100% rename from examples/1-basic/4-access-protection/src/jitar.ts rename to examples/concepts/load-balancing/src/jitar.ts diff --git a/examples/1-basic/5-multi-version/tsconfig.json b/examples/concepts/load-balancing/tsconfig.json similarity index 100% rename from examples/1-basic/5-multi-version/tsconfig.json rename to examples/concepts/load-balancing/tsconfig.json diff --git a/examples/2-advanced/4-middleware/README.md b/examples/concepts/middleware/README.md similarity index 100% rename from examples/2-advanced/4-middleware/README.md rename to examples/concepts/middleware/README.md diff --git a/examples/2-advanced/4-middleware/default.segment.json b/examples/concepts/middleware/default.segment.json similarity index 100% rename from examples/2-advanced/4-middleware/default.segment.json rename to examples/concepts/middleware/default.segment.json diff --git a/examples/2-advanced/2-run-procedure/jitar.json b/examples/concepts/middleware/jitar.json similarity index 100% rename from examples/2-advanced/2-run-procedure/jitar.json rename to examples/concepts/middleware/jitar.json diff --git a/examples/2-advanced/4-middleware/package.json b/examples/concepts/middleware/package.json similarity index 100% rename from examples/2-advanced/4-middleware/package.json rename to examples/concepts/middleware/package.json diff --git a/examples/2-advanced/4-middleware/requests.http b/examples/concepts/middleware/requests.http similarity index 100% rename from examples/2-advanced/4-middleware/requests.http rename to examples/concepts/middleware/requests.http diff --git a/examples/2-advanced/4-middleware/src/LoggingMiddleware.ts b/examples/concepts/middleware/src/LoggingMiddleware.ts similarity index 100% rename from examples/2-advanced/4-middleware/src/LoggingMiddleware.ts rename to examples/concepts/middleware/src/LoggingMiddleware.ts diff --git a/examples/2-advanced/4-middleware/src/greetings/sayHello.ts b/examples/concepts/middleware/src/greetings/sayHello.ts similarity index 100% rename from examples/2-advanced/4-middleware/src/greetings/sayHello.ts rename to examples/concepts/middleware/src/greetings/sayHello.ts diff --git a/examples/2-advanced/4-middleware/src/start.ts b/examples/concepts/middleware/src/start.ts similarity index 100% rename from examples/2-advanced/4-middleware/src/start.ts rename to examples/concepts/middleware/src/start.ts diff --git a/examples/2-advanced/2-run-procedure/tsconfig.json b/examples/concepts/middleware/tsconfig.json similarity index 100% rename from examples/2-advanced/2-run-procedure/tsconfig.json rename to examples/concepts/middleware/tsconfig.json diff --git a/examples/1-basic/5-multi-version/README.md b/examples/concepts/multi-version/README.md similarity index 100% rename from examples/1-basic/5-multi-version/README.md rename to examples/concepts/multi-version/README.md diff --git a/examples/1-basic/5-multi-version/default.segment.json b/examples/concepts/multi-version/default.segment.json similarity index 100% rename from examples/1-basic/5-multi-version/default.segment.json rename to examples/concepts/multi-version/default.segment.json diff --git a/examples/2-advanced/3-health-checks/jitar.json b/examples/concepts/multi-version/jitar.json similarity index 100% rename from examples/2-advanced/3-health-checks/jitar.json rename to examples/concepts/multi-version/jitar.json diff --git a/examples/1-basic/5-multi-version/package.json b/examples/concepts/multi-version/package.json similarity index 100% rename from examples/1-basic/5-multi-version/package.json rename to examples/concepts/multi-version/package.json diff --git a/examples/1-basic/5-multi-version/requests.http b/examples/concepts/multi-version/requests.http similarity index 100% rename from examples/1-basic/5-multi-version/requests.http rename to examples/concepts/multi-version/requests.http diff --git a/examples/1-basic/5-multi-version/src/greetings/sayHello.ts b/examples/concepts/multi-version/src/greetings/sayHello.ts similarity index 100% rename from examples/1-basic/5-multi-version/src/greetings/sayHello.ts rename to examples/concepts/multi-version/src/greetings/sayHello.ts diff --git a/examples/1-basic/5-multi-version/src/greetings/sayHello_v1_0_0.ts b/examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts similarity index 100% rename from examples/1-basic/5-multi-version/src/greetings/sayHello_v1_0_0.ts rename to examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts diff --git a/examples/1-basic/7-error-handling/src/start.ts b/examples/concepts/multi-version/src/start.ts similarity index 100% rename from examples/1-basic/7-error-handling/src/start.ts rename to examples/concepts/multi-version/src/start.ts diff --git a/examples/1-basic/6-data-transportation/tsconfig.json b/examples/concepts/multi-version/tsconfig.json similarity index 100% rename from examples/1-basic/6-data-transportation/tsconfig.json rename to examples/concepts/multi-version/tsconfig.json diff --git a/examples/2-advanced/2-run-procedure/README.md b/examples/concepts/run-procedure/README.md similarity index 100% rename from examples/2-advanced/2-run-procedure/README.md rename to examples/concepts/run-procedure/README.md diff --git a/examples/2-advanced/2-run-procedure/default.segment.json b/examples/concepts/run-procedure/default.segment.json similarity index 100% rename from examples/2-advanced/2-run-procedure/default.segment.json rename to examples/concepts/run-procedure/default.segment.json diff --git a/examples/2-advanced/4-middleware/jitar.json b/examples/concepts/run-procedure/jitar.json similarity index 100% rename from examples/2-advanced/4-middleware/jitar.json rename to examples/concepts/run-procedure/jitar.json diff --git a/examples/2-advanced/2-run-procedure/package.json b/examples/concepts/run-procedure/package.json similarity index 100% rename from examples/2-advanced/2-run-procedure/package.json rename to examples/concepts/run-procedure/package.json diff --git a/examples/2-advanced/2-run-procedure/requests.http b/examples/concepts/run-procedure/requests.http similarity index 100% rename from examples/2-advanced/2-run-procedure/requests.http rename to examples/concepts/run-procedure/requests.http diff --git a/examples/2-advanced/2-run-procedure/src/greetings/sayBoth.ts b/examples/concepts/run-procedure/src/greetings/sayBoth.ts similarity index 100% rename from examples/2-advanced/2-run-procedure/src/greetings/sayBoth.ts rename to examples/concepts/run-procedure/src/greetings/sayBoth.ts diff --git a/examples/2-advanced/2-run-procedure/src/greetings/sayHello.ts b/examples/concepts/run-procedure/src/greetings/sayHello.ts similarity index 100% rename from examples/2-advanced/2-run-procedure/src/greetings/sayHello.ts rename to examples/concepts/run-procedure/src/greetings/sayHello.ts diff --git a/examples/2-advanced/2-run-procedure/src/greetings/sayHi.ts b/examples/concepts/run-procedure/src/greetings/sayHi.ts similarity index 100% rename from examples/2-advanced/2-run-procedure/src/greetings/sayHi.ts rename to examples/concepts/run-procedure/src/greetings/sayHi.ts diff --git a/examples/2-advanced/2-run-procedure/src/start.ts b/examples/concepts/run-procedure/src/start.ts similarity index 100% rename from examples/2-advanced/2-run-procedure/src/start.ts rename to examples/concepts/run-procedure/src/start.ts diff --git a/examples/2-advanced/3-health-checks/tsconfig.json b/examples/concepts/run-procedure/tsconfig.json similarity index 100% rename from examples/2-advanced/3-health-checks/tsconfig.json rename to examples/concepts/run-procedure/tsconfig.json diff --git a/examples/1-basic/2-segmentation/README.md b/examples/concepts/segmentation/README.md similarity index 100% rename from examples/1-basic/2-segmentation/README.md rename to examples/concepts/segmentation/README.md diff --git a/examples/1-basic/2-segmentation/package.json b/examples/concepts/segmentation/package.json similarity index 100% rename from examples/1-basic/2-segmentation/package.json rename to examples/concepts/segmentation/package.json diff --git a/examples/1-basic/2-segmentation/requests.http b/examples/concepts/segmentation/requests.http similarity index 100% rename from examples/1-basic/2-segmentation/requests.http rename to examples/concepts/segmentation/requests.http diff --git a/examples/1-basic/2-segmentation/segments/data.segment.json b/examples/concepts/segmentation/segments/data.segment.json similarity index 100% rename from examples/1-basic/2-segmentation/segments/data.segment.json rename to examples/concepts/segmentation/segments/data.segment.json diff --git a/examples/1-basic/2-segmentation/segments/process.segment.json b/examples/concepts/segmentation/segments/process.segment.json similarity index 100% rename from examples/1-basic/2-segmentation/segments/process.segment.json rename to examples/concepts/segmentation/segments/process.segment.json diff --git a/examples/3-apps/1-contact-list/conf/gateway.json b/examples/concepts/segmentation/services/gateway.json similarity index 100% rename from examples/3-apps/1-contact-list/conf/gateway.json rename to examples/concepts/segmentation/services/gateway.json diff --git a/examples/1-basic/2-segmentation/services/node1.json b/examples/concepts/segmentation/services/node1.json similarity index 100% rename from examples/1-basic/2-segmentation/services/node1.json rename to examples/concepts/segmentation/services/node1.json diff --git a/examples/1-basic/2-segmentation/services/node2.json b/examples/concepts/segmentation/services/node2.json similarity index 100% rename from examples/1-basic/2-segmentation/services/node2.json rename to examples/concepts/segmentation/services/node2.json diff --git a/examples/1-basic/3-load-balancing/services/repository.json b/examples/concepts/segmentation/services/repository.json similarity index 100% rename from examples/1-basic/3-load-balancing/services/repository.json rename to examples/concepts/segmentation/services/repository.json diff --git a/examples/1-basic/4-access-protection/services/standalone.json b/examples/concepts/segmentation/services/standalone.json similarity index 100% rename from examples/1-basic/4-access-protection/services/standalone.json rename to examples/concepts/segmentation/services/standalone.json diff --git a/examples/3-apps/1-contact-list/src/jitar.ts b/examples/concepts/segmentation/src/jitar.ts similarity index 100% rename from examples/3-apps/1-contact-list/src/jitar.ts rename to examples/concepts/segmentation/src/jitar.ts diff --git a/examples/1-basic/2-segmentation/src/reporting/createReport.ts b/examples/concepts/segmentation/src/reporting/createReport.ts similarity index 100% rename from examples/1-basic/2-segmentation/src/reporting/createReport.ts rename to examples/concepts/segmentation/src/reporting/createReport.ts diff --git a/examples/1-basic/2-segmentation/src/reporting/createStatistics.ts b/examples/concepts/segmentation/src/reporting/createStatistics.ts similarity index 100% rename from examples/1-basic/2-segmentation/src/reporting/createStatistics.ts rename to examples/concepts/segmentation/src/reporting/createStatistics.ts diff --git a/examples/1-basic/2-segmentation/src/reporting/getData.ts b/examples/concepts/segmentation/src/reporting/getData.ts similarity index 100% rename from examples/1-basic/2-segmentation/src/reporting/getData.ts rename to examples/concepts/segmentation/src/reporting/getData.ts diff --git a/examples/1-basic/7-error-handling/tsconfig.json b/examples/concepts/segmentation/tsconfig.json similarity index 100% rename from examples/1-basic/7-error-handling/tsconfig.json rename to examples/concepts/segmentation/tsconfig.json diff --git a/examples/2-advanced/1-start-hooks/README.md b/examples/concepts/start-hooks/README.md similarity index 100% rename from examples/2-advanced/1-start-hooks/README.md rename to examples/concepts/start-hooks/README.md diff --git a/examples/2-advanced/1-start-hooks/jitar.json b/examples/concepts/start-hooks/jitar.json similarity index 100% rename from examples/2-advanced/1-start-hooks/jitar.json rename to examples/concepts/start-hooks/jitar.json diff --git a/examples/2-advanced/1-start-hooks/package.json b/examples/concepts/start-hooks/package.json similarity index 100% rename from examples/2-advanced/1-start-hooks/package.json rename to examples/concepts/start-hooks/package.json diff --git a/examples/2-advanced/1-start-hooks/segments/client.segment.json b/examples/concepts/start-hooks/segments/client.segment.json similarity index 100% rename from examples/2-advanced/1-start-hooks/segments/client.segment.json rename to examples/concepts/start-hooks/segments/client.segment.json diff --git a/examples/2-advanced/1-start-hooks/segments/server.segment.json b/examples/concepts/start-hooks/segments/server.segment.json similarity index 100% rename from examples/2-advanced/1-start-hooks/segments/server.segment.json rename to examples/concepts/start-hooks/segments/server.segment.json diff --git a/examples/2-advanced/1-start-hooks/src/client.ts b/examples/concepts/start-hooks/src/client.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/client.ts rename to examples/concepts/start-hooks/src/client.ts diff --git a/examples/2-advanced/1-start-hooks/src/greetings/Person.ts b/examples/concepts/start-hooks/src/greetings/Person.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/greetings/Person.ts rename to examples/concepts/start-hooks/src/greetings/Person.ts diff --git a/examples/2-advanced/1-start-hooks/src/greetings/sayBoth.ts b/examples/concepts/start-hooks/src/greetings/sayBoth.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/greetings/sayBoth.ts rename to examples/concepts/start-hooks/src/greetings/sayBoth.ts diff --git a/examples/2-advanced/1-start-hooks/src/greetings/sayHello.ts b/examples/concepts/start-hooks/src/greetings/sayHello.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/greetings/sayHello.ts rename to examples/concepts/start-hooks/src/greetings/sayHello.ts diff --git a/examples/2-advanced/1-start-hooks/src/greetings/sayHi.ts b/examples/concepts/start-hooks/src/greetings/sayHi.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/greetings/sayHi.ts rename to examples/concepts/start-hooks/src/greetings/sayHi.ts diff --git a/examples/2-advanced/1-start-hooks/src/index.html b/examples/concepts/start-hooks/src/index.html similarity index 100% rename from examples/2-advanced/1-start-hooks/src/index.html rename to examples/concepts/start-hooks/src/index.html diff --git a/examples/2-advanced/1-start-hooks/src/server.ts b/examples/concepts/start-hooks/src/server.ts similarity index 100% rename from examples/2-advanced/1-start-hooks/src/server.ts rename to examples/concepts/start-hooks/src/server.ts diff --git a/examples/2-advanced/4-middleware/tsconfig.json b/examples/concepts/start-hooks/tsconfig.json similarity index 100% rename from examples/2-advanced/4-middleware/tsconfig.json rename to examples/concepts/start-hooks/tsconfig.json diff --git a/package-lock.json b/package-lock.json index a039cb53..9dcb4650 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,19 +18,19 @@ "packages/serialization", "packages/server-nodejs", "tools/eslint-plugin", - "examples/1-basic/1-hello-world", - "examples/1-basic/2-segmentation", - "examples/1-basic/3-load-balancing", - "examples/1-basic/4-access-protection", - "examples/1-basic/5-multi-version", - "examples/1-basic/6-data-transportation", - "examples/1-basic/7-error-handling", - "examples/1-basic/8-javascript", - "examples/2-advanced/1-start-hooks", - "examples/2-advanced/2-run-procedure", - "examples/2-advanced/3-health-checks", - "examples/2-advanced/4-middleware", - "examples/3-apps/1-contact-list" + "examples/concepts/access-protection", + "examples/concepts/cors", + "examples/concepts/data-transportation", + "examples/concepts/error-handling", + "examples/concepts/health-checks", + "examples/concepts/hello-world", + "examples/concepts/load-balancing", + "examples/concepts/middleware", + "examples/concepts/multi-version", + "examples/concepts/run-procedure", + "examples/concepts/segmentation", + "examples/concepts/start-hooks", + "examples/apps/contact-list" ], "devDependencies": { "@rollup/plugin-node-resolve": "^15.0.2", @@ -57,54 +57,63 @@ }, "examples/1-basic/1-hello-world": { "name": "jitar-helloworld-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/2-segmentation": { "name": "jitar-segmentation-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/3-load-balancing": { "name": "jitar-load-balancing-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/4-access-protection": { "name": "jitar-access-protection-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/5-multi-version": { "name": "jitar-multi-version-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/6-data-transportation": { "name": "jitar-data-transportation-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/7-error-handling": { "name": "jitar-error-handling-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/1-basic/8-javascript": { "name": "jitar-javascript-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/2-advanced/1-start-hooks": { "name": "jitar-start-hooks-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" }, @@ -114,22 +123,9 @@ "rimraf": "^4.1.2" } }, - "examples/2-advanced/1-start-hooks/node_modules/rimraf": { - "version": "4.1.2", - "dev": true, - "license": "ISC", - "bin": { - "rimraf": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "examples/2-advanced/2-run-procedure": { "name": "jitar-run-procedure-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" }, @@ -139,34 +135,40 @@ "rimraf": "^4.1.2" } }, - "examples/2-advanced/2-run-procedure/node_modules/rimraf": { - "version": "4.1.2", - "dev": true, - "license": "ISC", - "bin": { - "rimraf": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "examples/2-advanced/3-health-checks": { "name": "jitar-health-checks-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/2-advanced/4-middleware": { "name": "jitar-middleware-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } }, "examples/3-apps/1-contact-list": { "name": "jitar-react", + "version": "0.0.0", + "extraneous": true, + "dependencies": { + "jitar": "^0.4.0", + "mongodb": "^5.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@jitar/plugin-vite": "^0.4.0", + "@types/react": "^18.0.28", + "@types/react-dom": "^18.0.11", + "@vitejs/plugin-react": "^3.1.0", + "typescript": "^4.9.5", + "vite": "^4.1.4" + } + }, + "examples/apps/contact-list": { "version": "0.0.0", "dependencies": { "jitar": "^0.4.0", @@ -183,10 +185,11 @@ "vite": "^4.1.4" } }, - "examples/3-apps/1-contact-list/node_modules/typescript": { + "examples/apps/contact-list/node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -195,6 +198,191 @@ "node": ">=4.2.0" } }, + "examples/concepts/access-protection": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/data-transportation": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/error-handling": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/health-checks": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/hello-world": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/load-balancing": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/middleware": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/multi-version": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/run-procedure": { + "dependencies": { + "jitar": "^0.4.0" + }, + "devDependencies": { + "cpx2": "^4.2.0", + "npm-run-all": "^4.1.5", + "rimraf": "^4.1.2" + } + }, + "examples/concepts/run-procedure/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "examples/concepts/run-procedure/node_modules/glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "examples/concepts/run-procedure/node_modules/minimatch": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "examples/concepts/run-procedure/node_modules/rimraf": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", + "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "dev": true, + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "examples/concepts/segmentation": { + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/start-hooks": { + "dependencies": { + "jitar": "^0.4.0" + }, + "devDependencies": { + "cpx2": "^4.2.0", + "npm-run-all": "^4.1.5", + "rimraf": "^4.1.2" + } + }, + "examples/concepts/start-hooks/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "examples/concepts/start-hooks/node_modules/glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "examples/concepts/start-hooks/node_modules/minimatch": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "examples/concepts/start-hooks/node_modules/rimraf": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", + "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "dev": true, + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -7984,55 +8172,51 @@ "link": true }, "node_modules/jitar-access-protection-example": { - "resolved": "examples/1-basic/4-access-protection", + "resolved": "examples/concepts/access-protection", "link": true }, "node_modules/jitar-data-transportation-example": { - "resolved": "examples/1-basic/6-data-transportation", + "resolved": "examples/concepts/data-transportation", "link": true }, "node_modules/jitar-error-handling-example": { - "resolved": "examples/1-basic/7-error-handling", + "resolved": "examples/concepts/error-handling", "link": true }, "node_modules/jitar-health-checks-example": { - "resolved": "examples/2-advanced/3-health-checks", + "resolved": "examples/concepts/health-checks", "link": true }, "node_modules/jitar-helloworld-example": { - "resolved": "examples/1-basic/1-hello-world", - "link": true - }, - "node_modules/jitar-javascript-example": { - "resolved": "examples/1-basic/8-javascript", + "resolved": "examples/concepts/hello-world", "link": true }, "node_modules/jitar-load-balancing-example": { - "resolved": "examples/1-basic/3-load-balancing", + "resolved": "examples/concepts/load-balancing", "link": true }, "node_modules/jitar-middleware-example": { - "resolved": "examples/2-advanced/4-middleware", + "resolved": "examples/concepts/middleware", "link": true }, "node_modules/jitar-multi-version-example": { - "resolved": "examples/1-basic/5-multi-version", + "resolved": "examples/concepts/multi-version", "link": true }, "node_modules/jitar-react": { - "resolved": "examples/3-apps/1-contact-list", + "resolved": "examples/apps/contact-list", "link": true }, "node_modules/jitar-run-procedure-example": { - "resolved": "examples/2-advanced/2-run-procedure", + "resolved": "examples/concepts/run-procedure", "link": true }, "node_modules/jitar-segmentation-example": { - "resolved": "examples/1-basic/2-segmentation", + "resolved": "examples/concepts/segmentation", "link": true }, "node_modules/jitar-start-hooks-example": { - "resolved": "examples/2-advanced/1-start-hooks", + "resolved": "examples/concepts/start-hooks", "link": true }, "node_modules/js-sdsl": { diff --git a/package.json b/package.json index 0694a4bc..0fa73833 100644 --- a/package.json +++ b/package.json @@ -14,19 +14,19 @@ "packages/serialization", "packages/server-nodejs", "tools/eslint-plugin", - "examples/1-basic/1-hello-world", - "examples/1-basic/2-segmentation", - "examples/1-basic/3-load-balancing", - "examples/1-basic/4-access-protection", - "examples/1-basic/5-multi-version", - "examples/1-basic/6-data-transportation", - "examples/1-basic/7-error-handling", - "examples/1-basic/8-javascript", - "examples/2-advanced/1-start-hooks", - "examples/2-advanced/2-run-procedure", - "examples/2-advanced/3-health-checks", - "examples/2-advanced/4-middleware", - "examples/3-apps/1-contact-list" + "examples/concepts/access-protection", + "examples/concepts/cors", + "examples/concepts/data-transportation", + "examples/concepts/error-handling", + "examples/concepts/health-checks", + "examples/concepts/hello-world", + "examples/concepts/load-balancing", + "examples/concepts/middleware", + "examples/concepts/multi-version", + "examples/concepts/run-procedure", + "examples/concepts/segmentation", + "examples/concepts/start-hooks", + "examples/apps/contact-list" ], "scripts": { "build": "npm run build --workspace=packages/reflection --workspace=packages/serialization --workspace=packages/runtime --workspace=packages/caching --workspace=packages/server-nodejs --workspace=packages/jitar --workspace=packages/create-jitar --workspace=packages/plugin-vite --if-present", From c2306ed415869f057d1af49d88e5986c8217e7c4 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 1 May 2023 07:29:35 +0200 Subject: [PATCH 05/14] Updated the multi version example --- examples/concepts/multi-version/README.md | 24 +++++++++++---- .../multi-version/default.segment.json | 13 -------- examples/concepts/multi-version/package.json | 2 +- examples/concepts/multi-version/requests.http | 18 +++++++---- .../segments/server.segment.json | 24 +++++++++++++++ .../{jitar.json => services/standalone.json} | 0 .../src/employee/getEmployeeDetails.ts | 30 +++++++++++++++++++ .../multi-version/src/greetings/sayHello.ts | 9 ------ .../src/greetings/sayHello_v1_0_0.ts | 9 ------ .../multi-version/src/{start.ts => jitar.ts} | 0 .../multi-version/src/organization/Details.ts | 6 ++++ .../src/organization/getDetailsV2.ts | 16 ++++++++++ .../organization/getOrganizationDetails.ts | 14 +++++++++ package-lock.json | 12 ++++++++ 14 files changed, 134 insertions(+), 43 deletions(-) delete mode 100644 examples/concepts/multi-version/default.segment.json create mode 100644 examples/concepts/multi-version/segments/server.segment.json rename examples/concepts/multi-version/{jitar.json => services/standalone.json} (100%) create mode 100644 examples/concepts/multi-version/src/employee/getEmployeeDetails.ts delete mode 100644 examples/concepts/multi-version/src/greetings/sayHello.ts delete mode 100644 examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts rename examples/concepts/multi-version/src/{start.ts => jitar.ts} (100%) create mode 100644 examples/concepts/multi-version/src/organization/Details.ts create mode 100644 examples/concepts/multi-version/src/organization/getDetailsV2.ts create mode 100644 examples/concepts/multi-version/src/organization/getOrganizationDetails.ts diff --git a/examples/concepts/multi-version/README.md b/examples/concepts/multi-version/README.md index 28999d8e..b6bdae75 100644 --- a/examples/concepts/multi-version/README.md +++ b/examples/concepts/multi-version/README.md @@ -1,12 +1,26 @@ # Jitar | Multi Version example -This example demonstrates how to create multiple versions for a procedure. +This example demonstrates how to create multiple versions for a procedure and how to register them as versioned procedures in a segment. -The application consists of a single procedure with two versions. All procedure is placed in the -``src/greetings`` directory. The segment file ``(default.segment.json)`` is placed in the ``src`` directory. +The application is a simple application that returns information about a person and an organization. Each of these entities has a version 1 and version 2 of the procedure to get its details. -The Jitar configuration is specified in the ``jitar.json`` file. +## Project setup + +**Procedures** + +* getEmployeeDetails (`src/employees/getDetails.ts`) +* getEmployeeDetailsV2 (`src/employees/getDetails.ts`) +* getOrganizationDetails (`src/organizations/getDetails.ts`) +* getOrganizationDetailsV2 (`src/organizations/getDetailsV2.ts`) + +**Segments** + +* Server - contains all procedures (`segments/server.segment.json`) + +**Services** + +* Standalone - loads the Server segment (`services/standalone.json`) ## Running the example @@ -25,7 +39,7 @@ npm run build Then start Jitar with the following command from the same directory. ``` -npm run start +npm run standalone ``` The ``requests.http`` file contains example requests to call the procedure. diff --git a/examples/concepts/multi-version/default.segment.json b/examples/concepts/multi-version/default.segment.json deleted file mode 100644 index 8fcca344..00000000 --- a/examples/concepts/multi-version/default.segment.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "./greetings/sayHello": { - "default": { - "access": "public" - } - }, - "./greetings/sayHello_v1_0_0": { - "default": { - "access": "public", - "version": "1.0.0" - } - } -} \ No newline at end of file diff --git a/examples/concepts/multi-version/package.json b/examples/concepts/multi-version/package.json index d561b2dd..87979173 100644 --- a/examples/concepts/multi-version/package.json +++ b/examples/concepts/multi-version/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "tsc", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/multi-version/requests.http b/examples/concepts/multi-version/requests.http index d5ee177f..fa24cfc4 100644 --- a/examples/concepts/multi-version/requests.http +++ b/examples/concepts/multi-version/requests.http @@ -1,16 +1,22 @@ -// Say hello without specifying a version (uses the default version) +// Get the employee details without any version (defaults to version 0.0.0) -GET http://localhost:3000/rpc/greetings/sayHello?name=John HTTP/1.1 +GET http://localhost:3000/rpc/employee/getEmployeeDetails?id=1 HTTP/1.1 ### -// Say hello with the first version 0.0.0 +// Get the employee details with version 1.0.0 -GET http://localhost:3000/rpc/greetings/sayHello?version=0.0.0&name=Jane HTTP/1.1 +GET http://localhost:3000/rpc/employee/getEmployeeDetails?version=1.0.0&id=1 HTTP/1.1 ### -// Say hello with the second version 1.0.0 +// Get the organization details with version 0.0.0 -GET http://localhost:3000/rpc/greetings/sayHello?version=1.0.0&firstName=Jim&lastName=Doe HTTP/1.1 +GET http://localhost:3000/rpc/organization/getOrganizationDetails?version=0.0.0&id=2 HTTP/1.1 + +### + +// Get the organization details with version 1.0.0 + +GET http://localhost:3000/rpc/organization/getOrganizationDetails?version=1.0.0&id=2 HTTP/1.1 diff --git a/examples/concepts/multi-version/segments/server.segment.json b/examples/concepts/multi-version/segments/server.segment.json new file mode 100644 index 00000000..08b7be05 --- /dev/null +++ b/examples/concepts/multi-version/segments/server.segment.json @@ -0,0 +1,24 @@ +{ + "./employee/getDetails": { + "getEmployeeDetails": { + "access": "public" + }, + "getEmployeeDetailsV2": { + "as": "getEmployeeDetails", + "access": "public", + "version": "1.0.0" + } + }, + "./organization/getDetails": { + "default": { + "access": "public" + } + }, + "./organization/getDetailsV2": { + "default": { + "as": "getOrganizationDetails", + "access": "public", + "version": "1.0.0" + } + } +} \ No newline at end of file diff --git a/examples/concepts/multi-version/jitar.json b/examples/concepts/multi-version/services/standalone.json similarity index 100% rename from examples/concepts/multi-version/jitar.json rename to examples/concepts/multi-version/services/standalone.json diff --git a/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts b/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts new file mode 100644 index 00000000..cd74ea32 --- /dev/null +++ b/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts @@ -0,0 +1,30 @@ + +const names = ['John Doe', 'Jane Doe', 'John Smith', 'Jane Smith', 'John Johnson', 'Jane Johnson']; +const ages = [33, 52, 27, 48, 35, 44]; +const addresses = ['123 Main St.', '456 Main St.', '789 Main St.', '123 Elm St.', '456 Elm St.', '789 Elm St.']; + +export async function getEmployeeDetails(id: number): Promise> +{ + const name = names[id % names.length]; + const age = ages[id % ages.length]; + + return { + id: id, + name: name, + age: age, + }; +} + +export async function getEmployeeDetailsV2(id: number): Promise> +{ + const name = names[id % names.length]; + const age = ages[id % ages.length]; + const address = addresses[id % addresses.length]; + + return { + id: id, + name: name, + age: age, + address: address, + }; +} diff --git a/examples/concepts/multi-version/src/greetings/sayHello.ts b/examples/concepts/multi-version/src/greetings/sayHello.ts deleted file mode 100644 index 992566ed..00000000 --- a/examples/concepts/multi-version/src/greetings/sayHello.ts +++ /dev/null @@ -1,9 +0,0 @@ - -/* - * This is the first (and default) version of the procedure (version 0.0.0) - */ - -export default async function sayHello(name: string = 'World'): Promise -{ - return `Hello ${name}`; -} diff --git a/examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts b/examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts deleted file mode 100644 index eca2908b..00000000 --- a/examples/concepts/multi-version/src/greetings/sayHello_v1_0_0.ts +++ /dev/null @@ -1,9 +0,0 @@ - -/* - * This is the second version of the procedure (version 1.0.0) - */ - -export default async function sayHello(firstName: string, lastName: string): Promise -{ - return `Hello ${firstName} ${lastName}`; -} diff --git a/examples/concepts/multi-version/src/start.ts b/examples/concepts/multi-version/src/jitar.ts similarity index 100% rename from examples/concepts/multi-version/src/start.ts rename to examples/concepts/multi-version/src/jitar.ts diff --git a/examples/concepts/multi-version/src/organization/Details.ts b/examples/concepts/multi-version/src/organization/Details.ts new file mode 100644 index 00000000..0188105a --- /dev/null +++ b/examples/concepts/multi-version/src/organization/Details.ts @@ -0,0 +1,6 @@ + +const names = ['ABC Corp.', 'XYZ Corp.', '123 Corp.', 'ACME Corp.', 'Foo Corp.', 'Bar Corp.']; +const addresses = ['123 Main St.', '456 Main St.', '789 Main St.', '123 Elm St.', '456 Elm St.', '789 Elm St.']; +const phoneNumbers = ['555-555-5555', '555-555-5556', '555-555-5557', '555-555-5558', '555-555-5559', '555-555-5560']; + +export { names, addresses, phoneNumbers }; diff --git a/examples/concepts/multi-version/src/organization/getDetailsV2.ts b/examples/concepts/multi-version/src/organization/getDetailsV2.ts new file mode 100644 index 00000000..40625bea --- /dev/null +++ b/examples/concepts/multi-version/src/organization/getDetailsV2.ts @@ -0,0 +1,16 @@ + +import { names, addresses, phoneNumbers } from './Details.js'; + +export default async function getOrganizationDetailsV2(id: number): Promise> +{ + const name = names[id % names.length]; + const address = addresses[id % addresses.length]; + const phoneNumber = phoneNumbers[id % phoneNumbers.length]; + + return { + id: id, + name: name, + address: address, + phoneNumber: phoneNumber + }; +} diff --git a/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts b/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts new file mode 100644 index 00000000..b9379ba8 --- /dev/null +++ b/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts @@ -0,0 +1,14 @@ + +import { names, addresses } from './Details.js'; + +export default async function getOrganizationDetails(id: number): Promise> +{ + const name = names[id % names.length]; + const address = addresses[id % addresses.length]; + + return { + id: id, + name: name, + address: address + } +} diff --git a/package-lock.json b/package-lock.json index 0de26010..e736bf36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -169,6 +169,7 @@ } }, "examples/apps/contact-list": { + "name": "jitar-react", "version": "0.0.0", "dependencies": { "jitar": "^0.4.0", @@ -199,46 +200,55 @@ } }, "examples/concepts/access-protection": { + "name": "jitar-access-protection-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/data-transportation": { + "name": "jitar-data-transportation-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/error-handling": { + "name": "jitar-error-handling-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/health-checks": { + "name": "jitar-health-checks-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/hello-world": { + "name": "jitar-helloworld-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/load-balancing": { + "name": "jitar-load-balancing-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/middleware": { + "name": "jitar-middleware-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/multi-version": { + "name": "jitar-multi-version-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/run-procedure": { + "name": "jitar-run-procedure-example", "dependencies": { "jitar": "^0.4.0" }, @@ -309,11 +319,13 @@ } }, "examples/concepts/segmentation": { + "name": "jitar-segmentation-example", "dependencies": { "jitar": "^0.4.0" } }, "examples/concepts/start-hooks": { + "name": "jitar-start-hooks-example", "dependencies": { "jitar": "^0.4.0" }, From ef303de26fdd221468e87b98d2d22e9220f8e473 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 1 May 2023 10:41:03 +0200 Subject: [PATCH 06/14] Updated the data transportation example --- .../concepts/data-transportation/README.md | 34 ++++++++++++++++--- .../concepts/data-transportation/package.json | 9 ++--- .../data-transportation/requests.http | 4 +-- .../{hi.segment.json => data.segment.json} | 2 +- ...llo.segment.json => greeting.segment.json} | 0 .../{conf => services}/gateway.json | 0 .../{conf => services}/node1.json | 2 +- .../{conf => services}/node2.json | 2 +- .../{conf => services}/repo.json | 0 .../services/standalone.json | 8 +++++ .../src/{greetings => data}/Person.ts | 0 .../src/data/createPerson.ts | 7 ++++ .../src/greetings/sayBoth.ts | 21 ------------ .../src/greetings/sayHello.ts | 10 ++++-- .../src/greetings/sayHi.ts | 7 ---- .../src/{start.ts => jitar.ts} | 0 16 files changed, 63 insertions(+), 43 deletions(-) rename examples/concepts/data-transportation/segments/{hi.segment.json => data.segment.json} (78%) rename examples/concepts/data-transportation/segments/{hello.segment.json => greeting.segment.json} (100%) rename examples/concepts/data-transportation/{conf => services}/gateway.json (100%) rename examples/concepts/data-transportation/{conf => services}/node1.json (81%) rename examples/concepts/data-transportation/{conf => services}/node2.json (82%) rename examples/concepts/data-transportation/{conf => services}/repo.json (100%) create mode 100644 examples/concepts/data-transportation/services/standalone.json rename examples/concepts/data-transportation/src/{greetings => data}/Person.ts (100%) create mode 100644 examples/concepts/data-transportation/src/data/createPerson.ts delete mode 100644 examples/concepts/data-transportation/src/greetings/sayBoth.ts delete mode 100644 examples/concepts/data-transportation/src/greetings/sayHi.ts rename examples/concepts/data-transportation/src/{start.ts => jitar.ts} (100%) diff --git a/examples/concepts/data-transportation/README.md b/examples/concepts/data-transportation/README.md index 32a8a2d3..174cdd24 100644 --- a/examples/concepts/data-transportation/README.md +++ b/examples/concepts/data-transportation/README.md @@ -3,10 +3,36 @@ This example demonstrates how data is transported between segments. -The application consists of three simple procedures, a data model class and two segments. -The procedures and the model are placed in the ``src/greetings`` directory. +The application consists of two simple procedures, a data model class and two segments. The object created on one segment is passed to the other segment. -Because this example has multiple segment files all the segment files ``(*.segment.json)`` are placed in the ``segments`` directory. The same is done for the configurations, as there are multiple configurations used. +## Project setup + +**Procedures** + +* createPerson (`src/person/createPerson.ts`) +* sayHello (`src/person/sayHello.ts`) + +**Data model** + +* Person (`src/person/Person.ts`) + +**Segments** + +* Data - contains the createPerson procedure and the data model (`segments/data.segment.json`) +* Greeting - contains the sayHello procedure (`segments/greeting.segment.json`) + +**Services** + +For development + +* Standalone - loads both segments (`services/data.json`, `services/greeting.json`) + +For production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Node 1 - loads the *greeting* segment (`services/node1.json`) +* Node 2 - loads the *data* segment (`services/node2.json`) ## Running the example @@ -44,4 +70,4 @@ npm run node1 npm run node2 ``` -The ``requests.http`` file contains example requests to call the procedures. +The ``requests.http`` file contains example requests to call the procedures. Note that the Person object is created on the *data* segment and then passed to the *greeting* segment to say hello. diff --git a/examples/concepts/data-transportation/package.json b/examples/concepts/data-transportation/package.json index 6d85940f..565c3e83 100644 --- a/examples/concepts/data-transportation/package.json +++ b/examples/concepts/data-transportation/package.json @@ -4,10 +4,11 @@ "private": true, "scripts": { "build": "tsc", - "repo": "node --experimental-network-imports dist/start.js --config=conf/repo.json", - "gateway": "node --experimental-network-imports dist/start.js --config=conf/gateway.json", - "node1": "node --experimental-network-imports dist/start.js --config=conf/node1.json", - "node2": "node --experimental-network-imports dist/start.js --config=conf/node2.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repo.json", + "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", + "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", + "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/data-transportation/requests.http b/examples/concepts/data-transportation/requests.http index 24485873..1f7342ae 100644 --- a/examples/concepts/data-transportation/requests.http +++ b/examples/concepts/data-transportation/requests.http @@ -1,4 +1,4 @@ -// Say hi and hello (from both segments) +// Say hello to a person -GET http://localhost:3000/rpc/greetings/sayBoth?firstName=Jim&lastName=Doe HTTP/1.1 \ No newline at end of file +GET http://localhost:3000/rpc/greetings/sayHello?firstName=Jim&lastName=Doe HTTP/1.1 \ No newline at end of file diff --git a/examples/concepts/data-transportation/segments/hi.segment.json b/examples/concepts/data-transportation/segments/data.segment.json similarity index 78% rename from examples/concepts/data-transportation/segments/hi.segment.json rename to examples/concepts/data-transportation/segments/data.segment.json index 63866715..930ea58e 100644 --- a/examples/concepts/data-transportation/segments/hi.segment.json +++ b/examples/concepts/data-transportation/segments/data.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayBoth": { + "./data/createPerson": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/data-transportation/segments/hello.segment.json b/examples/concepts/data-transportation/segments/greeting.segment.json similarity index 100% rename from examples/concepts/data-transportation/segments/hello.segment.json rename to examples/concepts/data-transportation/segments/greeting.segment.json diff --git a/examples/concepts/data-transportation/conf/gateway.json b/examples/concepts/data-transportation/services/gateway.json similarity index 100% rename from examples/concepts/data-transportation/conf/gateway.json rename to examples/concepts/data-transportation/services/gateway.json diff --git a/examples/concepts/data-transportation/conf/node1.json b/examples/concepts/data-transportation/services/node1.json similarity index 81% rename from examples/concepts/data-transportation/conf/node1.json rename to examples/concepts/data-transportation/services/node1.json index 9bebcb9f..207d134c 100644 --- a/examples/concepts/data-transportation/conf/node1.json +++ b/examples/concepts/data-transportation/services/node1.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hi" ] + "segments": [ "greeting" ] } } \ No newline at end of file diff --git a/examples/concepts/data-transportation/conf/node2.json b/examples/concepts/data-transportation/services/node2.json similarity index 82% rename from examples/concepts/data-transportation/conf/node2.json rename to examples/concepts/data-transportation/services/node2.json index 3389493a..0d33c800 100644 --- a/examples/concepts/data-transportation/conf/node2.json +++ b/examples/concepts/data-transportation/services/node2.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hello" ] + "segments": [ "data" ] } } \ No newline at end of file diff --git a/examples/concepts/data-transportation/conf/repo.json b/examples/concepts/data-transportation/services/repo.json similarity index 100% rename from examples/concepts/data-transportation/conf/repo.json rename to examples/concepts/data-transportation/services/repo.json diff --git a/examples/concepts/data-transportation/services/standalone.json b/examples/concepts/data-transportation/services/standalone.json new file mode 100644 index 00000000..0a2f6c60 --- /dev/null +++ b/examples/concepts/data-transportation/services/standalone.json @@ -0,0 +1,8 @@ +{ + "url": "http://127.0.0.1:3000", + "standalone": + { + "source": "./dist", + "cache": "./cache" + } +} diff --git a/examples/concepts/data-transportation/src/greetings/Person.ts b/examples/concepts/data-transportation/src/data/Person.ts similarity index 100% rename from examples/concepts/data-transportation/src/greetings/Person.ts rename to examples/concepts/data-transportation/src/data/Person.ts diff --git a/examples/concepts/data-transportation/src/data/createPerson.ts b/examples/concepts/data-transportation/src/data/createPerson.ts new file mode 100644 index 00000000..16654a80 --- /dev/null +++ b/examples/concepts/data-transportation/src/data/createPerson.ts @@ -0,0 +1,7 @@ + +import Person from './Person.js'; + +export default async function createPerson(firstName: string, lastName: string): Promise +{ + return new Person(firstName, lastName); +} diff --git a/examples/concepts/data-transportation/src/greetings/sayBoth.ts b/examples/concepts/data-transportation/src/greetings/sayBoth.ts deleted file mode 100644 index 3330983f..00000000 --- a/examples/concepts/data-transportation/src/greetings/sayBoth.ts +++ /dev/null @@ -1,21 +0,0 @@ - -/* - * Procedures can import classes and make use of class object. - * - * Their data will be serialized and transported to remote procedures. - */ - -import Person from './Person'; - -import sayHi from './sayHi'; -import sayHello from './sayHello'; - -export default async function sayBoth(firstName: string, lastName: string): Promise -{ - const person = new Person(firstName, lastName); - - const hiMessage = await sayHi(person); - const helloMessage = await sayHello(person); - - return `${hiMessage}\n${helloMessage}`; -} diff --git a/examples/concepts/data-transportation/src/greetings/sayHello.ts b/examples/concepts/data-transportation/src/greetings/sayHello.ts index 93fb7b2e..16290cb3 100644 --- a/examples/concepts/data-transportation/src/greetings/sayHello.ts +++ b/examples/concepts/data-transportation/src/greetings/sayHello.ts @@ -1,7 +1,13 @@ -import Person from './Person'; +import createPerson from '../data/createPerson'; -export default async function sayHello(person: Person): Promise +export default async function sayHello(firstName: string, lastName: string): Promise { + // Note that the Person object is not defined in this file, + // but it is still fully usable because it is returned by + // the createPerson function. + + const person = await createPerson(firstName, lastName); + return `Hello ${person.fullName}`; } diff --git a/examples/concepts/data-transportation/src/greetings/sayHi.ts b/examples/concepts/data-transportation/src/greetings/sayHi.ts deleted file mode 100644 index 44005e2c..00000000 --- a/examples/concepts/data-transportation/src/greetings/sayHi.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person'; - -export default async function sayHi(person: Person): Promise -{ - return `Hi ${person.firstName}`; -} diff --git a/examples/concepts/data-transportation/src/start.ts b/examples/concepts/data-transportation/src/jitar.ts similarity index 100% rename from examples/concepts/data-transportation/src/start.ts rename to examples/concepts/data-transportation/src/jitar.ts From 135271c3fab626707dc0fa6d8137960577b0bd3b Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 1 May 2023 13:00:58 +0200 Subject: [PATCH 07/14] Updated the error handling --- examples/concepts/error-handling/README.md | 33 +++++++++++++++---- examples/concepts/error-handling/jitar.json | 6 ---- examples/concepts/error-handling/package.json | 9 ++--- .../concepts/error-handling/requests.http | 11 ++----- ...ello.segment.json => contact.segment.json} | 2 +- ...segment.json => organization.segment.json} | 2 +- .../{conf => services}/gateway.json | 0 .../{conf => services}/node1.json | 2 +- .../{conf => services}/node2.json | 2 +- .../{conf => services}/repo.json | 0 .../error-handling/services/standalone.json | 8 +++++ .../error-handling/src/contact/Contact.ts | 16 +++++++++ .../src/contact/DatabaseError.ts | 17 ++++++++++ .../error-handling/src/contact/getContacts.ts | 8 +++++ .../src/greetings/CustomError.ts | 9 ----- .../error-handling/src/greetings/Person.ts | 31 ----------------- .../error-handling/src/greetings/sayBoth.ts | 28 ---------------- .../error-handling/src/greetings/sayHello.ts | 7 ---- .../error-handling/src/greetings/sayHi.ts | 7 ---- .../error-handling/src/{start.ts => jitar.ts} | 0 .../src/organization/getContactList.ts | 23 +++++++++++++ 21 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 examples/concepts/error-handling/jitar.json rename examples/concepts/error-handling/segments/{hello.segment.json => contact.segment.json} (76%) rename examples/concepts/error-handling/segments/{hi.segment.json => organization.segment.json} (72%) rename examples/concepts/error-handling/{conf => services}/gateway.json (100%) rename examples/concepts/error-handling/{conf => services}/node1.json (81%) rename examples/concepts/error-handling/{conf => services}/node2.json (79%) rename examples/concepts/error-handling/{conf => services}/repo.json (100%) create mode 100644 examples/concepts/error-handling/services/standalone.json create mode 100644 examples/concepts/error-handling/src/contact/Contact.ts create mode 100644 examples/concepts/error-handling/src/contact/DatabaseError.ts create mode 100644 examples/concepts/error-handling/src/contact/getContacts.ts delete mode 100644 examples/concepts/error-handling/src/greetings/CustomError.ts delete mode 100644 examples/concepts/error-handling/src/greetings/Person.ts delete mode 100644 examples/concepts/error-handling/src/greetings/sayBoth.ts delete mode 100644 examples/concepts/error-handling/src/greetings/sayHello.ts delete mode 100644 examples/concepts/error-handling/src/greetings/sayHi.ts rename examples/concepts/error-handling/src/{start.ts => jitar.ts} (100%) create mode 100644 examples/concepts/error-handling/src/organization/getContactList.ts diff --git a/examples/concepts/error-handling/README.md b/examples/concepts/error-handling/README.md index f115c05e..ccb54169 100644 --- a/examples/concepts/error-handling/README.md +++ b/examples/concepts/error-handling/README.md @@ -1,13 +1,34 @@ -# Jitar | Error Handling example +# Jitar | Custom Error Handling example -This example demonstrates how the Jitar error handling works. -It based on the [Data Transportation example](../6-data-transportation/README.md). +This example demonstrates how custom errors are supported. -The application consists of three simple procedures, a data model class and two segments. -The procedures and the model are placed in the ``src/greetings`` directory. +The application contains a custom error and procedures to handle it. -Because this example has multiple segment files all the segment files ``(*.segment.json)`` are placed in the ``segments`` directory. The same is done for the configurations, as there are multiple configurations used. +## Project setup + +**Procedures** + +* getContacts (`src/contact/getContacts.ts`) +* getContactList (`src/organization/getContactList.ts`) + +**Segments** + +* Contact - contains all procedures (`segments/contact.segment.json`) +* Organization - contains all procedures (`segments/organization.segment.json`) + +**Services** + +Development + +* Standalone - loads the *contact* and *organization* segments (`services/standalone.json`) + +Production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Node 1 - loads the *contact* segment (`services/node1.json`) +* Node 2 - loads the *organization* segment (`services/node2.json`) ## Running the example diff --git a/examples/concepts/error-handling/jitar.json b/examples/concepts/error-handling/jitar.json deleted file mode 100644 index 1572c443..00000000 --- a/examples/concepts/error-handling/jitar.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "mode": "standalone", - "url": "http://127.0.0.1:3000", - "source": "./dist", - "cache": "./cache" -} \ No newline at end of file diff --git a/examples/concepts/error-handling/package.json b/examples/concepts/error-handling/package.json index 363fee26..c7f313a9 100644 --- a/examples/concepts/error-handling/package.json +++ b/examples/concepts/error-handling/package.json @@ -4,10 +4,11 @@ "private": true, "scripts": { "build": "tsc", - "repo": "node --experimental-network-imports dist/start.js --config=conf/repo.json", - "gateway": "node --experimental-network-imports dist/start.js --config=conf/gateway.json", - "node1": "node --experimental-network-imports dist/start.js --config=conf/node1.json", - "node2": "node --experimental-network-imports dist/start.js --config=conf/node2.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repo.json", + "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", + "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", + "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/error-handling/requests.http b/examples/concepts/error-handling/requests.http index de374c0a..4c34d005 100644 --- a/examples/concepts/error-handling/requests.http +++ b/examples/concepts/error-handling/requests.http @@ -1,11 +1,4 @@ -// Say hi and hello (should return an error message) +// The database error is caught and printed to the console. -GET http://localhost:3000/rpc/greetings/sayBoth?firstName=Jim&lastName=Doe HTTP/1.1 - - -### - -// Forget the input parameters for the method (should return an error message) - -GET http://localhost:3000/rpc/greetings/sayBoth HTTP/1.1 +GET http://localhost:3000/rpc/organization/getContactList?organizationId=1 HTTP/1.1 diff --git a/examples/concepts/error-handling/segments/hello.segment.json b/examples/concepts/error-handling/segments/contact.segment.json similarity index 76% rename from examples/concepts/error-handling/segments/hello.segment.json rename to examples/concepts/error-handling/segments/contact.segment.json index c40b9fbd..9e5612cc 100644 --- a/examples/concepts/error-handling/segments/hello.segment.json +++ b/examples/concepts/error-handling/segments/contact.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./contact/getContacts": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/error-handling/segments/hi.segment.json b/examples/concepts/error-handling/segments/organization.segment.json similarity index 72% rename from examples/concepts/error-handling/segments/hi.segment.json rename to examples/concepts/error-handling/segments/organization.segment.json index 63866715..96b3ecf5 100644 --- a/examples/concepts/error-handling/segments/hi.segment.json +++ b/examples/concepts/error-handling/segments/organization.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayBoth": { + "./organization/getContactList": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/error-handling/conf/gateway.json b/examples/concepts/error-handling/services/gateway.json similarity index 100% rename from examples/concepts/error-handling/conf/gateway.json rename to examples/concepts/error-handling/services/gateway.json diff --git a/examples/concepts/error-handling/conf/node1.json b/examples/concepts/error-handling/services/node1.json similarity index 81% rename from examples/concepts/error-handling/conf/node1.json rename to examples/concepts/error-handling/services/node1.json index 9bebcb9f..854770bd 100644 --- a/examples/concepts/error-handling/conf/node1.json +++ b/examples/concepts/error-handling/services/node1.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hi" ] + "segments": [ "contact" ] } } \ No newline at end of file diff --git a/examples/concepts/error-handling/conf/node2.json b/examples/concepts/error-handling/services/node2.json similarity index 79% rename from examples/concepts/error-handling/conf/node2.json rename to examples/concepts/error-handling/services/node2.json index 3389493a..0136acb8 100644 --- a/examples/concepts/error-handling/conf/node2.json +++ b/examples/concepts/error-handling/services/node2.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "hello" ] + "segments": [ "organization" ] } } \ No newline at end of file diff --git a/examples/concepts/error-handling/conf/repo.json b/examples/concepts/error-handling/services/repo.json similarity index 100% rename from examples/concepts/error-handling/conf/repo.json rename to examples/concepts/error-handling/services/repo.json diff --git a/examples/concepts/error-handling/services/standalone.json b/examples/concepts/error-handling/services/standalone.json new file mode 100644 index 00000000..d697ab68 --- /dev/null +++ b/examples/concepts/error-handling/services/standalone.json @@ -0,0 +1,8 @@ +{ + "url": "http://127.0.0.1:3000", + "standalone": + { + "source": "./dist", + "cache": "./cache" + } +} \ No newline at end of file diff --git a/examples/concepts/error-handling/src/contact/Contact.ts b/examples/concepts/error-handling/src/contact/Contact.ts new file mode 100644 index 00000000..1a9edf07 --- /dev/null +++ b/examples/concepts/error-handling/src/contact/Contact.ts @@ -0,0 +1,16 @@ + +export default class Contact +{ + #name: string; + #email: string; + + constructor(name: string, email: string) + { + this.#name = name; + this.#email = email; + } + + get name() { return this.#name; }; + + get email() { return this.#email; }; +} \ No newline at end of file diff --git a/examples/concepts/error-handling/src/contact/DatabaseError.ts b/examples/concepts/error-handling/src/contact/DatabaseError.ts new file mode 100644 index 00000000..d4ffae87 --- /dev/null +++ b/examples/concepts/error-handling/src/contact/DatabaseError.ts @@ -0,0 +1,17 @@ + +// This is a custom error class that extends the built-in Error class. +// For serialization purposes, it is required to save input parameters. + +export default class DatabaseError extends Error +{ + #text: string; + + constructor(text: string) + { + super(`This is a database error: '${text}'`); + + this.#text = text; + } + + get text() { return this.#text; }; +} diff --git a/examples/concepts/error-handling/src/contact/getContacts.ts b/examples/concepts/error-handling/src/contact/getContacts.ts new file mode 100644 index 00000000..bda18a8c --- /dev/null +++ b/examples/concepts/error-handling/src/contact/getContacts.ts @@ -0,0 +1,8 @@ + +import DatabaseError from './DatabaseError'; +import Contact from './Contact'; + +export default async function getContacts(organizationId: number): Promise +{ + throw new DatabaseError('Oops... Something went wrong'); +} diff --git a/examples/concepts/error-handling/src/greetings/CustomError.ts b/examples/concepts/error-handling/src/greetings/CustomError.ts deleted file mode 100644 index a5236435..00000000 --- a/examples/concepts/error-handling/src/greetings/CustomError.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default class CustomError extends Error -{ - constructor(message: string) - { - super(message); - - this.name = 'CustomError'; - } -} \ No newline at end of file diff --git a/examples/concepts/error-handling/src/greetings/Person.ts b/examples/concepts/error-handling/src/greetings/Person.ts deleted file mode 100644 index bfffd4ac..00000000 --- a/examples/concepts/error-handling/src/greetings/Person.ts +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * Any class object can be transported between segments as - * long as they can be reconstructed. - * - * Private fields are supported as long as they are initialized - * in the constructor or can be set using a setter. Otherwise, - * their value will get lost in the transportation process. - * - * If a class is transported between segments, it doesn't have - * to be added to a segment file. All unsegmented components - * are considered as sharable. - */ - -export default class Person -{ - #firstName: string; - #lastName: string; - - constructor(firstName: string, lastName: string) - { - this.#firstName = firstName; - this.#lastName = lastName; - } - - get firstName() { return this.#firstName; } - - get lastName() { return this.#lastName; } - - get fullName() { return `${this.#firstName} ${this.#lastName}`; } -} diff --git a/examples/concepts/error-handling/src/greetings/sayBoth.ts b/examples/concepts/error-handling/src/greetings/sayBoth.ts deleted file mode 100644 index 4dd79b8b..00000000 --- a/examples/concepts/error-handling/src/greetings/sayBoth.ts +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Procedures can import classes and make use of class object. - * - * Their data will be serialized and transported to remote procedures. - */ - -import Person from './Person'; - -import sayHi from './sayHi'; -import sayHello from './sayHello'; - -export default async function sayBoth(firstName: string, lastName: string): Promise -{ - const person = new Person(firstName, lastName); - - try - { - const hiMessage = await sayHi(person); - const helloMessage = await sayHello(person); - - return `${hiMessage}\n${helloMessage}`; - } - catch (error: any) - { - return error.message; - } -} diff --git a/examples/concepts/error-handling/src/greetings/sayHello.ts b/examples/concepts/error-handling/src/greetings/sayHello.ts deleted file mode 100644 index 5e809064..00000000 --- a/examples/concepts/error-handling/src/greetings/sayHello.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person'; - -export default async function sayHello(person: Person): Promise -{ - throw new Error('Oops... Something went wrong'); -} diff --git a/examples/concepts/error-handling/src/greetings/sayHi.ts b/examples/concepts/error-handling/src/greetings/sayHi.ts deleted file mode 100644 index 44005e2c..00000000 --- a/examples/concepts/error-handling/src/greetings/sayHi.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person'; - -export default async function sayHi(person: Person): Promise -{ - return `Hi ${person.firstName}`; -} diff --git a/examples/concepts/error-handling/src/start.ts b/examples/concepts/error-handling/src/jitar.ts similarity index 100% rename from examples/concepts/error-handling/src/start.ts rename to examples/concepts/error-handling/src/jitar.ts diff --git a/examples/concepts/error-handling/src/organization/getContactList.ts b/examples/concepts/error-handling/src/organization/getContactList.ts new file mode 100644 index 00000000..da0b3662 --- /dev/null +++ b/examples/concepts/error-handling/src/organization/getContactList.ts @@ -0,0 +1,23 @@ + +import Contact from '../contact/Contact'; +import DatabaseError from '../contact/DatabaseError'; +import getContacts from '../contact/getContacts'; + +export default async function getContactList(organizationId: number): Promise +{ + try + { + return await getContacts(organizationId); + } + catch (error: unknown) + { + // Note that the error can be checked with instanceof. + + if (error instanceof DatabaseError) + { + console.log(error); + } + + throw error; + } +} From 91374ad28fc1bb0ba19e3744f9e070ead4c4fd4f Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 1 May 2023 15:41:38 +0200 Subject: [PATCH 08/14] Updated run procedure example --- examples/concepts/multi-version/README.md | 2 +- examples/concepts/run-procedure/README.md | 21 ++++++-- examples/concepts/run-procedure/package.json | 11 +--- examples/concepts/run-procedure/requests.http | 4 +- .../{ => segments}/default.segment.json | 13 +++-- .../{jitar.json => services/standalone.json} | 0 .../src/app/getContactOverview.ts | 18 +++++++ .../src/contact/printContactInformation.ts | 12 +++++ .../run-procedure/src/greetings/sayBoth.ts | 15 ------ .../run-procedure/src/greetings/sayHello.ts | 5 -- .../run-procedure/src/greetings/sayHi.ts | 5 -- .../run-procedure/src/{start.ts => jitar.ts} | 0 .../run-procedure/src/model/Contact.ts | 50 +++++++++++++++++++ .../concepts/run-procedure/src/stubs/data.ts | 11 ++++ 14 files changed, 119 insertions(+), 48 deletions(-) rename examples/concepts/run-procedure/{ => segments}/default.segment.json (53%) rename examples/concepts/run-procedure/{jitar.json => services/standalone.json} (100%) create mode 100644 examples/concepts/run-procedure/src/app/getContactOverview.ts create mode 100644 examples/concepts/run-procedure/src/contact/printContactInformation.ts delete mode 100644 examples/concepts/run-procedure/src/greetings/sayBoth.ts delete mode 100644 examples/concepts/run-procedure/src/greetings/sayHello.ts delete mode 100644 examples/concepts/run-procedure/src/greetings/sayHi.ts rename examples/concepts/run-procedure/src/{start.ts => jitar.ts} (100%) create mode 100644 examples/concepts/run-procedure/src/model/Contact.ts create mode 100644 examples/concepts/run-procedure/src/stubs/data.ts diff --git a/examples/concepts/multi-version/README.md b/examples/concepts/multi-version/README.md index b6bdae75..68285521 100644 --- a/examples/concepts/multi-version/README.md +++ b/examples/concepts/multi-version/README.md @@ -20,7 +20,7 @@ The application is a simple application that returns information about a person **Services** -* Standalone - loads the Server segment (`services/standalone.json`) +* Standalone - loads the *Server* segment (`services/standalone.json`) ## Running the example diff --git a/examples/concepts/run-procedure/README.md b/examples/concepts/run-procedure/README.md index e44d2163..df8d16d3 100644 --- a/examples/concepts/run-procedure/README.md +++ b/examples/concepts/run-procedure/README.md @@ -3,11 +3,22 @@ This example demonstrates how the run procedure hook works. -The application consists of three simple procedures two segments and one segment. -All procedures are placed in the ``src/greetings`` directory. The segment file``(default.segment.ts)`` is placed in -the ``src`` directory. +The application is a simple phonebook application. The model of the contacts in the phonebook has been updated in the latest version. The procedure to print the contact information has been updated, but the overview procedure has not. It uses the run procedure hook to dynamically call the correct version of the print procedure. -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. +## Project setup + +**Procedures** + +* getContactOverview (`src/app/getContactOverview.ts`) +* printContactInformation (`src/contact/printContactInformation.ts`) + +**Segments** + +* Default - contains all procedures (`segments/default.segment.json`) + +**Services** + +* Standalone - loads the *Default* segment (`services/standalone.json`) ## Running the example @@ -26,7 +37,7 @@ npm run build Then start Jitar with the following command from the same directory. ``` -npm run start +npm run standalone ``` The ``requests.http`` file contains example requests to call the procedure. diff --git a/examples/concepts/run-procedure/package.json b/examples/concepts/run-procedure/package.json index 75c1c758..c95e52e2 100644 --- a/examples/concepts/run-procedure/package.json +++ b/examples/concepts/run-procedure/package.json @@ -3,17 +3,10 @@ "type": "module", "private": true, "scripts": { - "clean": "rimraf dist", - "compile": "tsc", - "build": "npm-run-all clean compile", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "build": "tsc", + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" - }, - "devDependencies": { - "cpx2": "^4.2.0", - "npm-run-all": "^4.1.5", - "rimraf": "^4.1.2" } } \ No newline at end of file diff --git a/examples/concepts/run-procedure/requests.http b/examples/concepts/run-procedure/requests.http index 71b86476..843d8cbb 100644 --- a/examples/concepts/run-procedure/requests.http +++ b/examples/concepts/run-procedure/requests.http @@ -1,2 +1,4 @@ -GET http://localhost:3000/rpc/greetings/sayBoth?firstName=Jim&lastName=Doe HTTP/1.1 \ No newline at end of file +// Run the procedure + +GET http://localhost:3000/rpc/app/getContactOverview HTTP/1.1 diff --git a/examples/concepts/run-procedure/default.segment.json b/examples/concepts/run-procedure/segments/default.segment.json similarity index 53% rename from examples/concepts/run-procedure/default.segment.json rename to examples/concepts/run-procedure/segments/default.segment.json index d7acdedd..c7462b38 100644 --- a/examples/concepts/run-procedure/default.segment.json +++ b/examples/concepts/run-procedure/segments/default.segment.json @@ -1,20 +1,19 @@ { - "./greetings/sayBoth": { + "./app/getContactOverview": { "default": { "access": "public", "version": "0.0.0" } }, - "./greetings/sayHi": { + "./contact/printContactInformation": { "default": { "access": "private", "version": "0.0.0" - } - }, - "./greetings/sayHello": { - "default": { + }, + "printContactInformationV2": { + "as": "printContactInformation", "access": "private", - "version": "0.0.0" + "version": "1.0.0" } } } \ No newline at end of file diff --git a/examples/concepts/run-procedure/jitar.json b/examples/concepts/run-procedure/services/standalone.json similarity index 100% rename from examples/concepts/run-procedure/jitar.json rename to examples/concepts/run-procedure/services/standalone.json diff --git a/examples/concepts/run-procedure/src/app/getContactOverview.ts b/examples/concepts/run-procedure/src/app/getContactOverview.ts new file mode 100644 index 00000000..3fdf46ef --- /dev/null +++ b/examples/concepts/run-procedure/src/app/getContactOverview.ts @@ -0,0 +1,18 @@ + +// This is a simple example of how to use the runProcedure function to call a version of a procedure dynamically. +// These dynamic calls are very powerful for dynamic version switching, but they break the type safety of TypeScript and +// increase the complexity of debugging. Use them with caution. + +import { contacts } from '../stubs/data.js'; + +export default async function getContactOverview() +{ + let result = ''; + + for (const contact of contacts) + { + result += await __runProcedure('contact/printContactInformation', contact.version, { 'contact': contact }, undefined) + '\n\n'; + } + + return result; +} diff --git a/examples/concepts/run-procedure/src/contact/printContactInformation.ts b/examples/concepts/run-procedure/src/contact/printContactInformation.ts new file mode 100644 index 00000000..bbed218b --- /dev/null +++ b/examples/concepts/run-procedure/src/contact/printContactInformation.ts @@ -0,0 +1,12 @@ + +import { Contact, ContactV2 } from '../model/Contact'; + +export default async function printContactInformation(contact: Contact): Promise +{ + return `name\t\t: ${contact.name}\nemail\t\t: ${contact.email}`; +} + +export async function printContactInformationV2(contact: ContactV2): Promise +{ + return `lastName\t: ${contact.lastName}\nfirstName\t: ${contact.firstName}\nemails\t\t: ${contact.emails.join(', ')}`; +} diff --git a/examples/concepts/run-procedure/src/greetings/sayBoth.ts b/examples/concepts/run-procedure/src/greetings/sayBoth.ts deleted file mode 100644 index f6d8179e..00000000 --- a/examples/concepts/run-procedure/src/greetings/sayBoth.ts +++ /dev/null @@ -1,15 +0,0 @@ - -/* - * Procedures can be dynamically imported and called using the runProcedure hook. - * - * Note 1: Only procedures that are added to a segment file can be called. - * Note 2: Using this hook breaks the IntelliSense support and will make your application dependent on Jitar. - */ - -export default async function sayBoth(firstName: string, lastName: string): Promise -{ - const hiMessage = await __runProcedure('greetings/sayHi', '0.0.0', { 'firstName': firstName }); - const helloMessage = await __runProcedure('greetings/sayHello', '0.0.0', { 'firstName': firstName, 'lastName': lastName }); - - return `${hiMessage}\n${helloMessage}`; -} diff --git a/examples/concepts/run-procedure/src/greetings/sayHello.ts b/examples/concepts/run-procedure/src/greetings/sayHello.ts deleted file mode 100644 index 62472428..00000000 --- a/examples/concepts/run-procedure/src/greetings/sayHello.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export default async function sayHello(firstName: string, lastName: string): Promise -{ - return `Hello ${firstName} ${lastName}`; -} diff --git a/examples/concepts/run-procedure/src/greetings/sayHi.ts b/examples/concepts/run-procedure/src/greetings/sayHi.ts deleted file mode 100644 index 51d457b5..00000000 --- a/examples/concepts/run-procedure/src/greetings/sayHi.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export default async function sayHi(firstName: string): Promise -{ - return `Hi ${firstName}`; -} diff --git a/examples/concepts/run-procedure/src/start.ts b/examples/concepts/run-procedure/src/jitar.ts similarity index 100% rename from examples/concepts/run-procedure/src/start.ts rename to examples/concepts/run-procedure/src/jitar.ts diff --git a/examples/concepts/run-procedure/src/model/Contact.ts b/examples/concepts/run-procedure/src/model/Contact.ts new file mode 100644 index 00000000..7ff835b4 --- /dev/null +++ b/examples/concepts/run-procedure/src/model/Contact.ts @@ -0,0 +1,50 @@ + +// The different versions of the Contact model. Note that it has a version property with a fixed value. +// In real-world applications, the version number could be determined from anywhere, e.g. a database. The version number +// is set here for demonstration purposes. + +export class Contact +{ + #name: string; + #email: string; + #version: string; + + constructor(name: string, email: string) + { + this.#name = name; + this.#email = email; + + this.#version = '0.0.0'; + } + + get name() { return this.#name; }; + + get email() { return this.#email; }; + + get version() { return this.#version; }; +} + +export class ContactV2 +{ + #firstName: string; + #lastName: string; + #emails: string[]; + #version: string; + + constructor(firstName: string, lastName: string, emails: string[]) + { + this.#firstName = firstName; + this.#lastName = lastName; + this.#emails = emails; + + this.#version = '1.0.0'; + } + + get firstName() { return this.#firstName; }; + + get lastName() { return this.#lastName; }; + + get emails() { return this.#emails; }; + + get version() { return this.#version; }; +} diff --git a/examples/concepts/run-procedure/src/stubs/data.ts b/examples/concepts/run-procedure/src/stubs/data.ts new file mode 100644 index 00000000..fc402c8b --- /dev/null +++ b/examples/concepts/run-procedure/src/stubs/data.ts @@ -0,0 +1,11 @@ + +import { Contact, ContactV2 } from '../model/Contact.js'; + +const contacts = [ + new Contact('John Doe', 'john.doe@acme.com'), + new Contact('Jane Doe', 'jane.doe@acme.com'), + new ContactV2('Mary', 'Doe', ['mary.doe@acme.com', 'mary@doe.com']), + new ContactV2('Catherine', 'Doe', ['catherine.doe@acme.com']) +]; + +export { contacts }; From da55139777f812529c020dc288612707154007fd Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 1 May 2023 19:53:07 +0200 Subject: [PATCH 09/14] Updated the start-hooks example --- examples/concepts/run-procedure/README.md | 2 ++ examples/concepts/start-hooks/README.md | 36 ++++++++++++++----- examples/concepts/start-hooks/package.json | 3 +- .../{jitar.json => services/standalone.json} | 0 .../src/{client.ts => browserClient.ts} | 6 ++-- .../start-hooks/src/greetings/Person.ts | 2 +- examples/concepts/start-hooks/src/index.html | 2 +- .../concepts/start-hooks/src/nodeClient.ts | 14 ++++++++ 8 files changed, 52 insertions(+), 13 deletions(-) rename examples/concepts/start-hooks/{jitar.json => services/standalone.json} (100%) rename examples/concepts/start-hooks/src/{client.ts => browserClient.ts} (60%) create mode 100644 examples/concepts/start-hooks/src/nodeClient.ts diff --git a/examples/concepts/run-procedure/README.md b/examples/concepts/run-procedure/README.md index df8d16d3..09392bc8 100644 --- a/examples/concepts/run-procedure/README.md +++ b/examples/concepts/run-procedure/README.md @@ -5,6 +5,8 @@ This example demonstrates how the run procedure hook works. The application is a simple phonebook application. The model of the contacts in the phonebook has been updated in the latest version. The procedure to print the contact information has been updated, but the overview procedure has not. It uses the run procedure hook to dynamically call the correct version of the print procedure. +The run procedure hook is a powerful function to dynamically switch between versions of procedures. Using this hook breaks the IntelliSense support in Visual Studio Code. It is recommended to use the run procedure hook only when necessary. + ## Project setup **Procedures** diff --git a/examples/concepts/start-hooks/README.md b/examples/concepts/start-hooks/README.md index f710e248..a518ca32 100644 --- a/examples/concepts/start-hooks/README.md +++ b/examples/concepts/start-hooks/README.md @@ -3,12 +3,24 @@ This example demonstrates how the client and server start hooks work. -The application consists of three simple procedures two segments and an ``index html`` -file for bootstrapping the client. All procedures are placed in the ``src/greetings`` -directory. The ``index html`` file and segment files ``(*.segment.ts)`` are placed in -the ``src`` directory. +The client start hook can be used to start any client (browser or Node), and the server start hook can be used to start the Node server. -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. +## Project setup + +**Procedures** + +* sayBoth (`src/greetings/sayBoth.ts`) +* sayHello (`src/greetings/sayHello.ts`) +* sayHi (`src/greetings/sayHi.ts`) + +**Segments** + +* Server - contains the *server* procedures (`segments/server.segment.json`) +* Client - contains the *client* procedures (`segments/client.segment.json`) + +**Services** + +* Standalone - loads the *Server* segments (`services/standalone.json`) ## Running the example @@ -24,10 +36,18 @@ Next build the application by running the following command. npm run build ``` -Then start Jitar with the following command from the same directory. +To start Jitar we need two terminal sessions to start the repository and the node client. The starting order is of importantance. +**Standalone** (terminal 1) +``` +npm run standalone ``` -npm run start + +**Node client** (terminal 2) ``` +npm run client +``` + +Now open the following URL in your browser `http://localhost:3000`. -Now open the following URL in your browser ``http://localhost:3000`` +Both clients show the same result. The browser client as an alert, and the Node client in the terminal. diff --git a/examples/concepts/start-hooks/package.json b/examples/concepts/start-hooks/package.json index 99e1be5f..879a1149 100644 --- a/examples/concepts/start-hooks/package.json +++ b/examples/concepts/start-hooks/package.json @@ -7,7 +7,8 @@ "compile": "tsc", "copy": "cpx -u 'src/index.html' dist", "build": "npm-run-all clean copy compile", - "start": "node --experimental-network-imports dist/server.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/server.js --config=services/standalone.json", + "client": "node --experimental-network-imports dist/nodeClient.js" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/start-hooks/jitar.json b/examples/concepts/start-hooks/services/standalone.json similarity index 100% rename from examples/concepts/start-hooks/jitar.json rename to examples/concepts/start-hooks/services/standalone.json diff --git a/examples/concepts/start-hooks/src/client.ts b/examples/concepts/start-hooks/src/browserClient.ts similarity index 60% rename from examples/concepts/start-hooks/src/client.ts rename to examples/concepts/start-hooks/src/browserClient.ts index 2d3691c0..d04bef9d 100644 --- a/examples/concepts/start-hooks/src/client.ts +++ b/examples/concepts/start-hooks/src/browserClient.ts @@ -1,11 +1,13 @@ +// This is the browser client entry point. It uses the `startClient` function +// to start a Jitar client. Note that the differences between this starter and +// the Node.js starter. + // @ts-ignore import { startClient } from '/jitar/client.js'; const client = await startClient(document.location.origin, ['client']); -// We need to import the sayHello component with the Jitar client. -// This enables the segmentation of the application. const { default: sayBoth } = await client.import('./greetings/sayBoth') as any; const message = await sayBoth('John', 'Doe'); diff --git a/examples/concepts/start-hooks/src/greetings/Person.ts b/examples/concepts/start-hooks/src/greetings/Person.ts index 826b0153..32e84f60 100644 --- a/examples/concepts/start-hooks/src/greetings/Person.ts +++ b/examples/concepts/start-hooks/src/greetings/Person.ts @@ -14,5 +14,5 @@ export default class Person get lastName() { return this.#lastName; } - get fullName() { return `${this.#firstName} ${this.#lastName}`; } + get fullName() { return `${this.#lastName} ${this.#firstName}`; } } diff --git a/examples/concepts/start-hooks/src/index.html b/examples/concepts/start-hooks/src/index.html index 7c02d463..0f6aa1f6 100644 --- a/examples/concepts/start-hooks/src/index.html +++ b/examples/concepts/start-hooks/src/index.html @@ -5,6 +5,6 @@ Start hooks example | Jitar - + \ No newline at end of file diff --git a/examples/concepts/start-hooks/src/nodeClient.ts b/examples/concepts/start-hooks/src/nodeClient.ts new file mode 100644 index 00000000..f0733918 --- /dev/null +++ b/examples/concepts/start-hooks/src/nodeClient.ts @@ -0,0 +1,14 @@ + +// This is a Node.js client that uses the `startClient` function to start a +// Jitar client. Note that the differences between this starter and +// the browser starter. + +import { startClient } from 'jitar'; + +const client = await startClient('http://127.0.0.1:3000', ['client']); + +const { default: sayBoth } = await client.import('greetings/sayBoth') as any; + +const message = await sayBoth('John', 'Doe'); + +console.log(message); From 33f7ea73aa25bb94ec3c7b4a53b22a8e2636dc3e Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Wed, 3 May 2023 14:57:48 +0200 Subject: [PATCH 10/14] Matched all examples with best practices --- examples/apps/contact-list/package.json | 22 +- .../{conf => services}/gateway.json | 0 .../contact-list/{conf => services}/node.json | 0 .../{conf => services}/proxy.json | 0 .../repo.json => services/repository.json} | 2 - .../dev.json => services/standalone.json} | 2 - examples/concepts/access-protection/README.md | 2 +- .../concepts/access-protection/requests.http | 2 +- .../services/standalone.json | 3 +- examples/concepts/cors/README.md | 65 +++++ .../{start-hooks => cors}/package.json | 9 +- .../segments/server.segment.json | 2 +- .../services/standalone.json} | 3 +- examples/concepts/cors/src/app.ts | 12 + examples/concepts/cors/src/client.ts | 20 ++ .../concepts/cors/src/getWeatherForecast.ts | 5 + examples/concepts/cors/src/index.html | 21 ++ examples/concepts/cors/src/jitar.ts | 7 + .../{start-hooks => cors}/tsconfig.json | 5 +- .../concepts/data-transportation/package.json | 6 +- .../data-transportation/requests.http | 2 +- .../segments/account.segment.json} | 2 +- .../segments/helpdesk.segment.json} | 2 +- .../services/account.json} | 2 +- .../services/helpdesk.json} | 2 +- .../services/{repo.json => repository.json} | 3 +- .../services/standalone.json | 3 +- .../src/account/Account.ts} | 7 +- .../src/account/createAccount.ts | 7 + .../data-transportation/src/client.ts | 10 + .../data-transportation/src/data/Person.ts | 31 --- .../src/data/createPerson.ts | 7 - .../src/greetings/sayHello.ts | 13 - .../src/helpdesk/Registration.ts | 23 ++ .../src/helpdesk/register.ts | 11 + examples/concepts/error-handling/package.json | 6 +- .../concepts/error-handling/requests.http | 8 +- .../segments/data.segment.json | 2 +- .../segments/organization.segment.json | 8 - .../segments/process.segment.json} | 2 +- .../services/data.json} | 0 .../services/process.json} | 0 .../services/{repo.json => repository.json} | 3 +- .../error-handling/services/standalone.json | 3 +- .../error-handling/src/contact/Contact.ts | 16 -- .../error-handling/src/contact/getContacts.ts | 8 - .../src/organization/getContactList.ts | 23 -- .../src/{contact => sales}/DatabaseError.ts | 0 .../error-handling/src/sales/exportData.ts | 24 ++ .../error-handling/src/sales/getData.ts | 7 + examples/concepts/health-checks/package.json | 2 +- .../segments/default.segment.json | 3 + .../{jitar.json => services/standalone.json} | 3 +- .../health-checks/src/greetings/sayHello.ts | 14 - examples/concepts/health-checks/src/jitar.ts | 9 + examples/concepts/health-checks/src/start.ts | 15 -- .../hello-world/services/standalone.json | 3 +- examples/concepts/hello-world/src/sayHello.ts | 4 +- .../load-balancing/services/repository.json | 3 +- .../load-balancing/services/standalone.json | 3 +- examples/concepts/middleware/package.json | 2 +- examples/concepts/middleware/requests.http | 7 +- .../{ => segments}/default.segment.json | 2 +- .../middleware/services/standalone.json | 7 + .../middleware/src/greetings/sayHello.ts | 14 - examples/concepts/middleware/src/jitar.ts | 9 + examples/concepts/middleware/src/ping.ts | 5 + examples/concepts/middleware/src/start.ts | 15 -- examples/concepts/multi-version/requests.http | 20 +- .../segments/default.segment.json | 13 + .../segments/server.segment.json | 24 -- .../multi-version/services/standalone.json | 3 +- .../src/employee/getEmployeeDetails.ts | 30 --- .../concepts/multi-version/src/getEmployee.ts | 19 ++ .../multi-version/src/organization/Details.ts | 6 - .../src/organization/getDetailsV2.ts | 16 -- .../organization/getOrganizationDetails.ts | 14 - .../{start-hooks => node-client}/README.md | 0 .../package.json | 5 +- .../segments/client.segment.json | 2 +- .../services/standalone.json | 2 +- examples/concepts/node-client/src/client.ts | 10 + .../node-client/src/getLuckyNumber.ts | 5 + .../src/jitar.ts | 0 .../tsconfig.json | 0 examples/concepts/run-procedure/README.md | 45 ---- examples/concepts/run-procedure/requests.http | 4 - .../segments/default.segment.json | 19 -- .../src/app/getContactOverview.ts | 18 -- .../src/contact/printContactInformation.ts | 12 - .../run-procedure/src/model/Contact.ts | 50 ---- .../concepts/run-procedure/src/stubs/data.ts | 11 - examples/concepts/segmentation/package.json | 4 +- .../services/data.json} | 2 +- .../services/process.json} | 2 +- .../segmentation/services/repository.json | 3 +- .../segmentation/services/standalone.json | 3 +- .../start-hooks/services/standalone.json | 11 - .../concepts/start-hooks/src/browserClient.ts | 15 -- .../start-hooks/src/greetings/sayBoth.ts | 15 -- .../start-hooks/src/greetings/sayHello.ts | 7 - .../start-hooks/src/greetings/sayHi.ts | 7 - examples/concepts/start-hooks/src/index.html | 10 - .../concepts/start-hooks/src/nodeClient.ts | 14 - examples/concepts/start-hooks/src/server.ts | 6 - package-lock.json | 247 ++++++------------ 106 files changed, 455 insertions(+), 762 deletions(-) rename examples/apps/contact-list/{conf => services}/gateway.json (100%) rename examples/apps/contact-list/{conf => services}/node.json (100%) rename examples/apps/contact-list/{conf => services}/proxy.json (100%) rename examples/apps/contact-list/{conf/repo.json => services/repository.json} (75%) rename examples/apps/contact-list/{conf/dev.json => services/standalone.json} (75%) create mode 100644 examples/concepts/cors/README.md rename examples/concepts/{start-hooks => cors}/package.json (69%) rename examples/concepts/{start-hooks => cors}/segments/server.segment.json (77%) rename examples/concepts/{middleware/jitar.json => cors/services/standalone.json} (55%) create mode 100644 examples/concepts/cors/src/app.ts create mode 100644 examples/concepts/cors/src/client.ts create mode 100644 examples/concepts/cors/src/getWeatherForecast.ts create mode 100644 examples/concepts/cors/src/index.html create mode 100644 examples/concepts/cors/src/jitar.ts rename examples/concepts/{start-hooks => cors}/tsconfig.json (78%) rename examples/concepts/{error-handling/segments/contact.segment.json => data-transportation/segments/account.segment.json} (75%) rename examples/concepts/{health-checks/default.segment.json => data-transportation/segments/helpdesk.segment.json} (77%) rename examples/concepts/{error-handling/services/node1.json => data-transportation/services/account.json} (81%) rename examples/concepts/{error-handling/services/node2.json => data-transportation/services/helpdesk.json} (79%) rename examples/concepts/data-transportation/services/{repo.json => repository.json} (55%) rename examples/concepts/{start-hooks/src/greetings/Person.ts => data-transportation/src/account/Account.ts} (72%) create mode 100644 examples/concepts/data-transportation/src/account/createAccount.ts create mode 100644 examples/concepts/data-transportation/src/client.ts delete mode 100644 examples/concepts/data-transportation/src/data/Person.ts delete mode 100644 examples/concepts/data-transportation/src/data/createPerson.ts delete mode 100644 examples/concepts/data-transportation/src/greetings/sayHello.ts create mode 100644 examples/concepts/data-transportation/src/helpdesk/Registration.ts create mode 100644 examples/concepts/data-transportation/src/helpdesk/register.ts rename examples/concepts/{data-transportation => error-handling}/segments/data.segment.json (78%) delete mode 100644 examples/concepts/error-handling/segments/organization.segment.json rename examples/concepts/{data-transportation/segments/greeting.segment.json => error-handling/segments/process.segment.json} (77%) rename examples/concepts/{segmentation/services/node1.json => error-handling/services/data.json} (100%) rename examples/concepts/{segmentation/services/node2.json => error-handling/services/process.json} (100%) rename examples/concepts/error-handling/services/{repo.json => repository.json} (55%) delete mode 100644 examples/concepts/error-handling/src/contact/Contact.ts delete mode 100644 examples/concepts/error-handling/src/contact/getContacts.ts delete mode 100644 examples/concepts/error-handling/src/organization/getContactList.ts rename examples/concepts/error-handling/src/{contact => sales}/DatabaseError.ts (100%) create mode 100644 examples/concepts/error-handling/src/sales/exportData.ts create mode 100644 examples/concepts/error-handling/src/sales/getData.ts create mode 100644 examples/concepts/health-checks/segments/default.segment.json rename examples/concepts/health-checks/{jitar.json => services/standalone.json} (55%) delete mode 100644 examples/concepts/health-checks/src/greetings/sayHello.ts create mode 100644 examples/concepts/health-checks/src/jitar.ts delete mode 100644 examples/concepts/health-checks/src/start.ts rename examples/concepts/middleware/{ => segments}/default.segment.json (77%) create mode 100644 examples/concepts/middleware/services/standalone.json delete mode 100644 examples/concepts/middleware/src/greetings/sayHello.ts create mode 100644 examples/concepts/middleware/src/jitar.ts create mode 100644 examples/concepts/middleware/src/ping.ts delete mode 100644 examples/concepts/middleware/src/start.ts create mode 100644 examples/concepts/multi-version/segments/default.segment.json delete mode 100644 examples/concepts/multi-version/segments/server.segment.json delete mode 100644 examples/concepts/multi-version/src/employee/getEmployeeDetails.ts create mode 100644 examples/concepts/multi-version/src/getEmployee.ts delete mode 100644 examples/concepts/multi-version/src/organization/Details.ts delete mode 100644 examples/concepts/multi-version/src/organization/getDetailsV2.ts delete mode 100644 examples/concepts/multi-version/src/organization/getOrganizationDetails.ts rename examples/concepts/{start-hooks => node-client}/README.md (100%) rename examples/concepts/{run-procedure => node-client}/package.json (55%) rename examples/concepts/{start-hooks => node-client}/segments/client.segment.json (78%) rename examples/concepts/{run-procedure => node-client}/services/standalone.json (78%) create mode 100644 examples/concepts/node-client/src/client.ts create mode 100644 examples/concepts/node-client/src/getLuckyNumber.ts rename examples/concepts/{run-procedure => node-client}/src/jitar.ts (100%) rename examples/concepts/{run-procedure => node-client}/tsconfig.json (100%) delete mode 100644 examples/concepts/run-procedure/README.md delete mode 100644 examples/concepts/run-procedure/requests.http delete mode 100644 examples/concepts/run-procedure/segments/default.segment.json delete mode 100644 examples/concepts/run-procedure/src/app/getContactOverview.ts delete mode 100644 examples/concepts/run-procedure/src/contact/printContactInformation.ts delete mode 100644 examples/concepts/run-procedure/src/model/Contact.ts delete mode 100644 examples/concepts/run-procedure/src/stubs/data.ts rename examples/concepts/{data-transportation/services/node1.json => segmentation/services/data.json} (81%) rename examples/concepts/{data-transportation/services/node2.json => segmentation/services/process.json} (81%) delete mode 100644 examples/concepts/start-hooks/services/standalone.json delete mode 100644 examples/concepts/start-hooks/src/browserClient.ts delete mode 100644 examples/concepts/start-hooks/src/greetings/sayBoth.ts delete mode 100644 examples/concepts/start-hooks/src/greetings/sayHello.ts delete mode 100644 examples/concepts/start-hooks/src/greetings/sayHi.ts delete mode 100644 examples/concepts/start-hooks/src/index.html delete mode 100644 examples/concepts/start-hooks/src/nodeClient.ts delete mode 100644 examples/concepts/start-hooks/src/server.ts diff --git a/examples/apps/contact-list/package.json b/examples/apps/contact-list/package.json index f7ac6b7d..f01d1f6a 100644 --- a/examples/apps/contact-list/package.json +++ b/examples/apps/contact-list/package.json @@ -6,25 +6,25 @@ "scripts": { "dev": "vite", "build": "vite build && tsc", - "standalone": "node --experimental-network-imports dist/jitar.js --config=./conf/dev.json", - "repo": "node --experimental-network-imports dist/jitar.js --config=./conf/repo.json", - "gateway": "node --experimental-network-imports dist/jitar.js --config=./conf/gateway.json", - "node": "node --experimental-network-imports dist/jitar.js --config=./conf/node.json", - "proxy": "node --experimental-network-imports dist/jitar.js --config=./conf/proxy.json", + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", + "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", + "node": "node --experimental-network-imports dist/jitar.js --config=services/node.json", + "proxy": "node --experimental-network-imports dist/jitar.js --config=services/proxy.json", "preview": "vite preview" }, "dependencies": { "jitar": "^0.4.0", - "mongodb": "^5.1.0", + "mongodb": "^5.3.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@jitar/plugin-vite": "^0.4.0", - "@types/react": "^18.0.28", - "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^3.1.0", - "typescript": "^4.9.5", - "vite": "^4.1.4" + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.1", + "@vitejs/plugin-react": "^4.0.0", + "typescript": "^5.0.4", + "vite": "^4.3.4" } } \ No newline at end of file diff --git a/examples/apps/contact-list/conf/gateway.json b/examples/apps/contact-list/services/gateway.json similarity index 100% rename from examples/apps/contact-list/conf/gateway.json rename to examples/apps/contact-list/services/gateway.json diff --git a/examples/apps/contact-list/conf/node.json b/examples/apps/contact-list/services/node.json similarity index 100% rename from examples/apps/contact-list/conf/node.json rename to examples/apps/contact-list/services/node.json diff --git a/examples/apps/contact-list/conf/proxy.json b/examples/apps/contact-list/services/proxy.json similarity index 100% rename from examples/apps/contact-list/conf/proxy.json rename to examples/apps/contact-list/services/proxy.json diff --git a/examples/apps/contact-list/conf/repo.json b/examples/apps/contact-list/services/repository.json similarity index 75% rename from examples/apps/contact-list/conf/repo.json rename to examples/apps/contact-list/services/repository.json index a0ae4a9e..26f2c89a 100644 --- a/examples/apps/contact-list/conf/repo.json +++ b/examples/apps/contact-list/services/repository.json @@ -3,8 +3,6 @@ "repository": { "source": "./dist", - "cache": "./cache", - "index": "index.html", "assets": [ "index.html", "main.js", "App.js", "vite.svg", "assets/**/*" ] } } \ No newline at end of file diff --git a/examples/apps/contact-list/conf/dev.json b/examples/apps/contact-list/services/standalone.json similarity index 75% rename from examples/apps/contact-list/conf/dev.json rename to examples/apps/contact-list/services/standalone.json index e9afbe1d..ffbbf5e1 100644 --- a/examples/apps/contact-list/conf/dev.json +++ b/examples/apps/contact-list/services/standalone.json @@ -3,8 +3,6 @@ "standalone": { "source": "./dist", - "cache": "./cache", - "index": "index.html", "assets": [ "index.html", "main.js", "App.js", "vite.svg", "assets/**/*" ] } } \ No newline at end of file diff --git a/examples/concepts/access-protection/README.md b/examples/concepts/access-protection/README.md index 933a2c80..dc803ae5 100644 --- a/examples/concepts/access-protection/README.md +++ b/examples/concepts/access-protection/README.md @@ -19,7 +19,7 @@ The procedure to get the secret has been made private to ensure it isn't accessi **Services** -* Standalone - loads both segments (`services/standalone.json`) +* Standalone - loads the segment (`services/standalone.json`) ## Running the example diff --git a/examples/concepts/access-protection/requests.http b/examples/concepts/access-protection/requests.http index 8918931d..f9f36e49 100644 --- a/examples/concepts/access-protection/requests.http +++ b/examples/concepts/access-protection/requests.http @@ -1,7 +1,7 @@ // Run the public function (succeeds) -GET http://localhost:3000/rpc/game/checkSecret?secret=1234 HTTP/1.1 +GET http://localhost:3000/rpc/game/checkSecret?secret=123 HTTP/1.1 ### diff --git a/examples/concepts/access-protection/services/standalone.json b/examples/concepts/access-protection/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/access-protection/services/standalone.json +++ b/examples/concepts/access-protection/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/cors/README.md b/examples/concepts/cors/README.md new file mode 100644 index 00000000..8f8bc52e --- /dev/null +++ b/examples/concepts/cors/README.md @@ -0,0 +1,65 @@ + +# Jitar | Cors example + +This example demonstrates how to enable CORS. + +The application contains a single procedure that returns a message. The index.html file contains a simple form that calls the procedure and displays the result. + +## Project setup + +**Procedures** + +* serve (`src/server/serve.ts`) + +**Segments** + +* Server - contains the *server* procedures (`segments/server.segment.json`) + +**Services** + +Development + +* Standalone - loads the *server* segment (`services/standalone.json`) + +Production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Node 1 - loads the *server* segment (`services/node1.json`) +* Node 2 - loads the *server* segment (`services/node2.json`) + +## Running the example + +Install Jitar by running the following command from the root directory of the example. + +``` +npm install +``` + +Next build the application by running the following command. + +``` +npm run build +``` + +To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. + +**Repository** (terminal 1) +``` +npm run repo +``` + +**Gateway** (terminal 2) +``` +npm run gateway +``` + +**Node** (terminal 3) +``` +npm run node1 +``` + +**Node 2** (terminal 4) +``` +npm run node2 +``` diff --git a/examples/concepts/start-hooks/package.json b/examples/concepts/cors/package.json similarity index 69% rename from examples/concepts/start-hooks/package.json rename to examples/concepts/cors/package.json index 879a1149..ed32126c 100644 --- a/examples/concepts/start-hooks/package.json +++ b/examples/concepts/cors/package.json @@ -1,5 +1,5 @@ { - "name": "jitar-start-hooks-example", + "name": "jitar-cors-example", "type": "module", "private": true, "scripts": { @@ -7,11 +7,12 @@ "compile": "tsc", "copy": "cpx -u 'src/index.html' dist", "build": "npm-run-all clean copy compile", - "standalone": "node --experimental-network-imports dist/server.js --config=services/standalone.json", - "client": "node --experimental-network-imports dist/nodeClient.js" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "client": "node dist/client.js" }, "dependencies": { - "jitar": "^0.4.0" + "jitar": "^0.4.0", + "express": "^4.18.2" }, "devDependencies": { "cpx2": "^4.2.0", diff --git a/examples/concepts/start-hooks/segments/server.segment.json b/examples/concepts/cors/segments/server.segment.json similarity index 77% rename from examples/concepts/start-hooks/segments/server.segment.json rename to examples/concepts/cors/segments/server.segment.json index c40b9fbd..82599c3c 100644 --- a/examples/concepts/start-hooks/segments/server.segment.json +++ b/examples/concepts/cors/segments/server.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./getWeatherForecast": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/middleware/jitar.json b/examples/concepts/cors/services/standalone.json similarity index 55% rename from examples/concepts/middleware/jitar.json rename to examples/concepts/cors/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/middleware/jitar.json +++ b/examples/concepts/cors/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/cors/src/app.ts b/examples/concepts/cors/src/app.ts new file mode 100644 index 00000000..2f5191ac --- /dev/null +++ b/examples/concepts/cors/src/app.ts @@ -0,0 +1,12 @@ + +try +{ + const result = await fetch(`http://localhost:3000/rpc/server/serve`); + alert(await result.text()); +} +catch (error: unknown) +{ + alert(error); +} + +export {}; diff --git a/examples/concepts/cors/src/client.ts b/examples/concepts/cors/src/client.ts new file mode 100644 index 00000000..65653bd8 --- /dev/null +++ b/examples/concepts/cors/src/client.ts @@ -0,0 +1,20 @@ + +import express, { Request, Response } from 'express'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const filePath = fileURLToPath(import.meta.url); +const fileLocation = path.dirname(filePath); + +const app = express(); +const port = 8080; + +app.get('/', (request: Request, response: Response) => +{ + response.sendFile(path.join(fileLocation, 'index.html')); +}); + +app.listen(port, () => +{ + console.log(`Server is listening on port ${port}`); +}); diff --git a/examples/concepts/cors/src/getWeatherForecast.ts b/examples/concepts/cors/src/getWeatherForecast.ts new file mode 100644 index 00000000..1c4d2b91 --- /dev/null +++ b/examples/concepts/cors/src/getWeatherForecast.ts @@ -0,0 +1,5 @@ + +export default async function getWeatherForecast(): Promise +{ + return 'Sunny'; +} diff --git a/examples/concepts/cors/src/index.html b/examples/concepts/cors/src/index.html new file mode 100644 index 00000000..845822d8 --- /dev/null +++ b/examples/concepts/cors/src/index.html @@ -0,0 +1,21 @@ + + + + + CORS | Jitar + + +

The weather forecast for today

+

+ + + + \ No newline at end of file diff --git a/examples/concepts/cors/src/jitar.ts b/examples/concepts/cors/src/jitar.ts new file mode 100644 index 00000000..13d86a27 --- /dev/null +++ b/examples/concepts/cors/src/jitar.ts @@ -0,0 +1,7 @@ + +import { startServer, CorsMiddleware } from 'jitar'; + +const moduleImporter = async (specifier: string) => import(specifier); + +const server = await startServer(moduleImporter); +server.addMiddleware(new CorsMiddleware('http://localhost:8080')); diff --git a/examples/concepts/start-hooks/tsconfig.json b/examples/concepts/cors/tsconfig.json similarity index 78% rename from examples/concepts/start-hooks/tsconfig.json rename to examples/concepts/cors/tsconfig.json index 387be42e..e7194b17 100644 --- a/examples/concepts/start-hooks/tsconfig.json +++ b/examples/concepts/cors/tsconfig.json @@ -1,12 +1,13 @@ { "compilerOptions": { - "target": "es2022", - "module": "es2022", + "target": "ESNext", + "module": "ESNext", "rootDir": "./src/", "moduleResolution": "node", "outDir": "./dist", "removeComments": true, + "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true diff --git a/examples/concepts/data-transportation/package.json b/examples/concepts/data-transportation/package.json index 565c3e83..62a0df45 100644 --- a/examples/concepts/data-transportation/package.json +++ b/examples/concepts/data-transportation/package.json @@ -5,10 +5,10 @@ "scripts": { "build": "tsc", "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", - "repo": "node --experimental-network-imports dist/jitar.js --config=services/repo.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", - "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", - "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" + "account": "node --experimental-network-imports dist/jitar.js --config=services/account.json", + "helpdesk": "node --experimental-network-imports dist/jitar.js --config=services/helpdesk.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/data-transportation/requests.http b/examples/concepts/data-transportation/requests.http index 1f7342ae..c206b9aa 100644 --- a/examples/concepts/data-transportation/requests.http +++ b/examples/concepts/data-transportation/requests.http @@ -1,4 +1,4 @@ // Say hello to a person -GET http://localhost:3000/rpc/greetings/sayHello?firstName=Jim&lastName=Doe HTTP/1.1 \ No newline at end of file +GET http://localhost:3000/rpc/helpdesk/register?firstName=John&lastName=Doe HTTP/1.1 diff --git a/examples/concepts/error-handling/segments/contact.segment.json b/examples/concepts/data-transportation/segments/account.segment.json similarity index 75% rename from examples/concepts/error-handling/segments/contact.segment.json rename to examples/concepts/data-transportation/segments/account.segment.json index 9e5612cc..e14b94a1 100644 --- a/examples/concepts/error-handling/segments/contact.segment.json +++ b/examples/concepts/data-transportation/segments/account.segment.json @@ -1,5 +1,5 @@ { - "./contact/getContacts": { + "./account/createAccount": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/health-checks/default.segment.json b/examples/concepts/data-transportation/segments/helpdesk.segment.json similarity index 77% rename from examples/concepts/health-checks/default.segment.json rename to examples/concepts/data-transportation/segments/helpdesk.segment.json index c40b9fbd..b0b5ad2e 100644 --- a/examples/concepts/health-checks/default.segment.json +++ b/examples/concepts/data-transportation/segments/helpdesk.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./helpdesk/register": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/error-handling/services/node1.json b/examples/concepts/data-transportation/services/account.json similarity index 81% rename from examples/concepts/error-handling/services/node1.json rename to examples/concepts/data-transportation/services/account.json index 854770bd..2d243224 100644 --- a/examples/concepts/error-handling/services/node1.json +++ b/examples/concepts/data-transportation/services/account.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "contact" ] + "segments": [ "account" ] } } \ No newline at end of file diff --git a/examples/concepts/error-handling/services/node2.json b/examples/concepts/data-transportation/services/helpdesk.json similarity index 79% rename from examples/concepts/error-handling/services/node2.json rename to examples/concepts/data-transportation/services/helpdesk.json index 0136acb8..b897a28d 100644 --- a/examples/concepts/error-handling/services/node2.json +++ b/examples/concepts/data-transportation/services/helpdesk.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "organization" ] + "segments": [ "helpdesk" ] } } \ No newline at end of file diff --git a/examples/concepts/data-transportation/services/repo.json b/examples/concepts/data-transportation/services/repository.json similarity index 55% rename from examples/concepts/data-transportation/services/repo.json rename to examples/concepts/data-transportation/services/repository.json index 16aa0d38..8c4ec353 100644 --- a/examples/concepts/data-transportation/services/repo.json +++ b/examples/concepts/data-transportation/services/repository.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:2999", "repository": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/data-transportation/services/standalone.json b/examples/concepts/data-transportation/services/standalone.json index 0a2f6c60..10f8392c 100644 --- a/examples/concepts/data-transportation/services/standalone.json +++ b/examples/concepts/data-transportation/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } diff --git a/examples/concepts/start-hooks/src/greetings/Person.ts b/examples/concepts/data-transportation/src/account/Account.ts similarity index 72% rename from examples/concepts/start-hooks/src/greetings/Person.ts rename to examples/concepts/data-transportation/src/account/Account.ts index 32e84f60..f6579c74 100644 --- a/examples/concepts/start-hooks/src/greetings/Person.ts +++ b/examples/concepts/data-transportation/src/account/Account.ts @@ -1,5 +1,5 @@ -export default class Person +export default class Account { #firstName: string; #lastName: string; @@ -14,5 +14,8 @@ export default class Person get lastName() { return this.#lastName; } - get fullName() { return `${this.#lastName} ${this.#firstName}`; } + toString() + { + return `${this.#firstName} ${this.#lastName}`; + } } diff --git a/examples/concepts/data-transportation/src/account/createAccount.ts b/examples/concepts/data-transportation/src/account/createAccount.ts new file mode 100644 index 00000000..f06c3362 --- /dev/null +++ b/examples/concepts/data-transportation/src/account/createAccount.ts @@ -0,0 +1,7 @@ + +import Account from './Account.js'; + +export default async function createAccount(firstName: string, lastName: string): Promise +{ + return new Account(firstName, lastName); +} diff --git a/examples/concepts/data-transportation/src/client.ts b/examples/concepts/data-transportation/src/client.ts new file mode 100644 index 00000000..143fe2e2 --- /dev/null +++ b/examples/concepts/data-transportation/src/client.ts @@ -0,0 +1,10 @@ + +import { startClient } from 'jitar'; + +const client = await startClient('http://127.0.0.1:3000', ['helpdesk']); + +const { default: register } = await client.import('helpdesk/register') as any; + +const registration = await register('John', 'Doe'); + +console.log(`Registration successful! Created on ${registration.created} for ${registration.account.toString()}!`); diff --git a/examples/concepts/data-transportation/src/data/Person.ts b/examples/concepts/data-transportation/src/data/Person.ts deleted file mode 100644 index bfffd4ac..00000000 --- a/examples/concepts/data-transportation/src/data/Person.ts +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * Any class object can be transported between segments as - * long as they can be reconstructed. - * - * Private fields are supported as long as they are initialized - * in the constructor or can be set using a setter. Otherwise, - * their value will get lost in the transportation process. - * - * If a class is transported between segments, it doesn't have - * to be added to a segment file. All unsegmented components - * are considered as sharable. - */ - -export default class Person -{ - #firstName: string; - #lastName: string; - - constructor(firstName: string, lastName: string) - { - this.#firstName = firstName; - this.#lastName = lastName; - } - - get firstName() { return this.#firstName; } - - get lastName() { return this.#lastName; } - - get fullName() { return `${this.#firstName} ${this.#lastName}`; } -} diff --git a/examples/concepts/data-transportation/src/data/createPerson.ts b/examples/concepts/data-transportation/src/data/createPerson.ts deleted file mode 100644 index 16654a80..00000000 --- a/examples/concepts/data-transportation/src/data/createPerson.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person.js'; - -export default async function createPerson(firstName: string, lastName: string): Promise -{ - return new Person(firstName, lastName); -} diff --git a/examples/concepts/data-transportation/src/greetings/sayHello.ts b/examples/concepts/data-transportation/src/greetings/sayHello.ts deleted file mode 100644 index 16290cb3..00000000 --- a/examples/concepts/data-transportation/src/greetings/sayHello.ts +++ /dev/null @@ -1,13 +0,0 @@ - -import createPerson from '../data/createPerson'; - -export default async function sayHello(firstName: string, lastName: string): Promise -{ - // Note that the Person object is not defined in this file, - // but it is still fully usable because it is returned by - // the createPerson function. - - const person = await createPerson(firstName, lastName); - - return `Hello ${person.fullName}`; -} diff --git a/examples/concepts/data-transportation/src/helpdesk/Registration.ts b/examples/concepts/data-transportation/src/helpdesk/Registration.ts new file mode 100644 index 00000000..e48789c3 --- /dev/null +++ b/examples/concepts/data-transportation/src/helpdesk/Registration.ts @@ -0,0 +1,23 @@ + +import Account from '../account/Account'; + +export default class Registration +{ + #account: Account; + #created: Date; + + constructor(account: Account) + { + this.#account = account; + this.#created = new Date(); + } + + get account() { return this.#account; } + + get created() { return this.#created; } + + toString(): string + { + return `Registration for ${this.#account} created on ${this.#created}`; + } +} diff --git a/examples/concepts/data-transportation/src/helpdesk/register.ts b/examples/concepts/data-transportation/src/helpdesk/register.ts new file mode 100644 index 00000000..b797e829 --- /dev/null +++ b/examples/concepts/data-transportation/src/helpdesk/register.ts @@ -0,0 +1,11 @@ + +import createAccount from '../account/createAccount'; +import Registration from './Registration'; + +export default async function register(firstName: string, lastName: string): Promise +{ + const account = await createAccount(firstName, lastName); + const registration = new Registration(account); + + return registration.toString(); +} diff --git a/examples/concepts/error-handling/package.json b/examples/concepts/error-handling/package.json index c7f313a9..b49f2249 100644 --- a/examples/concepts/error-handling/package.json +++ b/examples/concepts/error-handling/package.json @@ -5,10 +5,10 @@ "scripts": { "build": "tsc", "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", - "repo": "node --experimental-network-imports dist/jitar.js --config=services/repo.json", + "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", - "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", - "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" + "data": "node --experimental-network-imports dist/jitar.js --config=services/data.json", + "process": "node --experimental-network-imports dist/jitar.js --config=services/process.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/error-handling/requests.http b/examples/concepts/error-handling/requests.http index 4c34d005..14753393 100644 --- a/examples/concepts/error-handling/requests.http +++ b/examples/concepts/error-handling/requests.http @@ -1,4 +1,10 @@ // The database error is caught and printed to the console. -GET http://localhost:3000/rpc/organization/getContactList?organizationId=1 HTTP/1.1 +GET http://localhost:3000/rpc/sales/getData HTTP/1.1 + +### + +// + +GET http://localhost:3000/rpc/sales/exportData HTTP/1.1 diff --git a/examples/concepts/data-transportation/segments/data.segment.json b/examples/concepts/error-handling/segments/data.segment.json similarity index 78% rename from examples/concepts/data-transportation/segments/data.segment.json rename to examples/concepts/error-handling/segments/data.segment.json index 930ea58e..234e225a 100644 --- a/examples/concepts/data-transportation/segments/data.segment.json +++ b/examples/concepts/error-handling/segments/data.segment.json @@ -1,5 +1,5 @@ { - "./data/createPerson": { + "./sales/getData": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/error-handling/segments/organization.segment.json b/examples/concepts/error-handling/segments/organization.segment.json deleted file mode 100644 index 96b3ecf5..00000000 --- a/examples/concepts/error-handling/segments/organization.segment.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "./organization/getContactList": { - "default": { - "access": "public", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/examples/concepts/data-transportation/segments/greeting.segment.json b/examples/concepts/error-handling/segments/process.segment.json similarity index 77% rename from examples/concepts/data-transportation/segments/greeting.segment.json rename to examples/concepts/error-handling/segments/process.segment.json index c40b9fbd..cba9d2c8 100644 --- a/examples/concepts/data-transportation/segments/greeting.segment.json +++ b/examples/concepts/error-handling/segments/process.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./sales/exportData": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/segmentation/services/node1.json b/examples/concepts/error-handling/services/data.json similarity index 100% rename from examples/concepts/segmentation/services/node1.json rename to examples/concepts/error-handling/services/data.json diff --git a/examples/concepts/segmentation/services/node2.json b/examples/concepts/error-handling/services/process.json similarity index 100% rename from examples/concepts/segmentation/services/node2.json rename to examples/concepts/error-handling/services/process.json diff --git a/examples/concepts/error-handling/services/repo.json b/examples/concepts/error-handling/services/repository.json similarity index 55% rename from examples/concepts/error-handling/services/repo.json rename to examples/concepts/error-handling/services/repository.json index 16aa0d38..8c4ec353 100644 --- a/examples/concepts/error-handling/services/repo.json +++ b/examples/concepts/error-handling/services/repository.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:2999", "repository": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/error-handling/services/standalone.json b/examples/concepts/error-handling/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/error-handling/services/standalone.json +++ b/examples/concepts/error-handling/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/error-handling/src/contact/Contact.ts b/examples/concepts/error-handling/src/contact/Contact.ts deleted file mode 100644 index 1a9edf07..00000000 --- a/examples/concepts/error-handling/src/contact/Contact.ts +++ /dev/null @@ -1,16 +0,0 @@ - -export default class Contact -{ - #name: string; - #email: string; - - constructor(name: string, email: string) - { - this.#name = name; - this.#email = email; - } - - get name() { return this.#name; }; - - get email() { return this.#email; }; -} \ No newline at end of file diff --git a/examples/concepts/error-handling/src/contact/getContacts.ts b/examples/concepts/error-handling/src/contact/getContacts.ts deleted file mode 100644 index bda18a8c..00000000 --- a/examples/concepts/error-handling/src/contact/getContacts.ts +++ /dev/null @@ -1,8 +0,0 @@ - -import DatabaseError from './DatabaseError'; -import Contact from './Contact'; - -export default async function getContacts(organizationId: number): Promise -{ - throw new DatabaseError('Oops... Something went wrong'); -} diff --git a/examples/concepts/error-handling/src/organization/getContactList.ts b/examples/concepts/error-handling/src/organization/getContactList.ts deleted file mode 100644 index da0b3662..00000000 --- a/examples/concepts/error-handling/src/organization/getContactList.ts +++ /dev/null @@ -1,23 +0,0 @@ - -import Contact from '../contact/Contact'; -import DatabaseError from '../contact/DatabaseError'; -import getContacts from '../contact/getContacts'; - -export default async function getContactList(organizationId: number): Promise -{ - try - { - return await getContacts(organizationId); - } - catch (error: unknown) - { - // Note that the error can be checked with instanceof. - - if (error instanceof DatabaseError) - { - console.log(error); - } - - throw error; - } -} diff --git a/examples/concepts/error-handling/src/contact/DatabaseError.ts b/examples/concepts/error-handling/src/sales/DatabaseError.ts similarity index 100% rename from examples/concepts/error-handling/src/contact/DatabaseError.ts rename to examples/concepts/error-handling/src/sales/DatabaseError.ts diff --git a/examples/concepts/error-handling/src/sales/exportData.ts b/examples/concepts/error-handling/src/sales/exportData.ts new file mode 100644 index 00000000..040bd9a7 --- /dev/null +++ b/examples/concepts/error-handling/src/sales/exportData.ts @@ -0,0 +1,24 @@ + +import DatabaseError from './DatabaseError'; +import getData from './getData'; + +export default async function exportData(): Promise +{ + try + { + const data = await getData(); + + // export data to data warehouse + + return 'Success'; + } + catch (error: unknown) + { + if (error instanceof DatabaseError) + { + console.log(`Database error occured`); + } + + return 'Failed, see log for details'; + } +} diff --git a/examples/concepts/error-handling/src/sales/getData.ts b/examples/concepts/error-handling/src/sales/getData.ts new file mode 100644 index 00000000..98c42c96 --- /dev/null +++ b/examples/concepts/error-handling/src/sales/getData.ts @@ -0,0 +1,7 @@ + +import DatabaseError from './DatabaseError'; + +export default async function getData(): Promise +{ + throw new DatabaseError('Oops... Something went wrong'); +} diff --git a/examples/concepts/health-checks/package.json b/examples/concepts/health-checks/package.json index 20ed616f..4490e8d4 100644 --- a/examples/concepts/health-checks/package.json +++ b/examples/concepts/health-checks/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "tsc", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/health-checks/segments/default.segment.json b/examples/concepts/health-checks/segments/default.segment.json new file mode 100644 index 00000000..544b7b4d --- /dev/null +++ b/examples/concepts/health-checks/segments/default.segment.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/examples/concepts/health-checks/jitar.json b/examples/concepts/health-checks/services/standalone.json similarity index 55% rename from examples/concepts/health-checks/jitar.json rename to examples/concepts/health-checks/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/health-checks/jitar.json +++ b/examples/concepts/health-checks/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/health-checks/src/greetings/sayHello.ts b/examples/concepts/health-checks/src/greetings/sayHello.ts deleted file mode 100644 index 6f9c2a7c..00000000 --- a/examples/concepts/health-checks/src/greetings/sayHello.ts +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * This an simple example procedure that returns a string. - * - * Parameters can be mandatory or optional. They will be checked when calling the procedure. - * - * Important note: - * All functions have to be async functions in order to be able to split applications. - */ - -export default async function sayHello(name = 'World'): Promise -{ - return `Hello ${name}`; -} diff --git a/examples/concepts/health-checks/src/jitar.ts b/examples/concepts/health-checks/src/jitar.ts new file mode 100644 index 00000000..8a84a57b --- /dev/null +++ b/examples/concepts/health-checks/src/jitar.ts @@ -0,0 +1,9 @@ + +import { startServer } from 'jitar'; + +import DatabaseHealthCheck from './DatabaseHealthCheck.js'; + +const moduleImporter = async (specifier: string) => import(specifier); + +const server = await startServer(moduleImporter); +server.addHealthCheck('database', new DatabaseHealthCheck()); diff --git a/examples/concepts/health-checks/src/start.ts b/examples/concepts/health-checks/src/start.ts deleted file mode 100644 index e561e452..00000000 --- a/examples/concepts/health-checks/src/start.ts +++ /dev/null @@ -1,15 +0,0 @@ - -import { startServer } from 'jitar'; - -import DatabaseHealthCheck from './DatabaseHealthCheck.js'; - -const moduleImporter = async (specifier: string) => import(specifier); - -// Top level await is not supported in Node.js yet, -// so we use the classic promise syntax for this case. -startServer(moduleImporter).then(server => -{ - // When the server has started we can add one or more health checks. - // The name is used to identify its status in the health check API. - server.addHealthCheck('database', new DatabaseHealthCheck()); -}); diff --git a/examples/concepts/hello-world/services/standalone.json b/examples/concepts/hello-world/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/hello-world/services/standalone.json +++ b/examples/concepts/hello-world/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/hello-world/src/sayHello.ts b/examples/concepts/hello-world/src/sayHello.ts index 6f9c2a7c..5c354ae2 100644 --- a/examples/concepts/hello-world/src/sayHello.ts +++ b/examples/concepts/hello-world/src/sayHello.ts @@ -1,8 +1,8 @@ /* - * This an simple example procedure that returns a string. + * This an simple example function that returns a string. * - * Parameters can be mandatory or optional. They will be checked when calling the procedure. + * Parameters can be mandatory or optional. They will be checked when calling the function. * * Important note: * All functions have to be async functions in order to be able to split applications. diff --git a/examples/concepts/load-balancing/services/repository.json b/examples/concepts/load-balancing/services/repository.json index 16aa0d38..8c4ec353 100644 --- a/examples/concepts/load-balancing/services/repository.json +++ b/examples/concepts/load-balancing/services/repository.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:2999", "repository": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/load-balancing/services/standalone.json b/examples/concepts/load-balancing/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/load-balancing/services/standalone.json +++ b/examples/concepts/load-balancing/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/middleware/package.json b/examples/concepts/middleware/package.json index 0f618310..36571dca 100644 --- a/examples/concepts/middleware/package.json +++ b/examples/concepts/middleware/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "tsc", - "start": "node --experimental-network-imports dist/start.js --config=jitar.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/middleware/requests.http b/examples/concepts/middleware/requests.http index 6f3de4d3..736d922f 100644 --- a/examples/concepts/middleware/requests.http +++ b/examples/concepts/middleware/requests.http @@ -1,7 +1,2 @@ -POST http://localhost:3000/rpc/greetings/sayHello HTTP/1.1 -content-type: application/json - -{ - "name": "Jane" -} +GET http://localhost:3000/rpc/ping HTTP/1.1 diff --git a/examples/concepts/middleware/default.segment.json b/examples/concepts/middleware/segments/default.segment.json similarity index 77% rename from examples/concepts/middleware/default.segment.json rename to examples/concepts/middleware/segments/default.segment.json index c40b9fbd..c8770391 100644 --- a/examples/concepts/middleware/default.segment.json +++ b/examples/concepts/middleware/segments/default.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayHello": { + "./ping": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/middleware/services/standalone.json b/examples/concepts/middleware/services/standalone.json new file mode 100644 index 00000000..e243f24d --- /dev/null +++ b/examples/concepts/middleware/services/standalone.json @@ -0,0 +1,7 @@ +{ + "url": "http://127.0.0.1:3000", + "standalone": + { + "source": "./dist" + } +} \ No newline at end of file diff --git a/examples/concepts/middleware/src/greetings/sayHello.ts b/examples/concepts/middleware/src/greetings/sayHello.ts deleted file mode 100644 index 6f9c2a7c..00000000 --- a/examples/concepts/middleware/src/greetings/sayHello.ts +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * This an simple example procedure that returns a string. - * - * Parameters can be mandatory or optional. They will be checked when calling the procedure. - * - * Important note: - * All functions have to be async functions in order to be able to split applications. - */ - -export default async function sayHello(name = 'World'): Promise -{ - return `Hello ${name}`; -} diff --git a/examples/concepts/middleware/src/jitar.ts b/examples/concepts/middleware/src/jitar.ts new file mode 100644 index 00000000..9c18990d --- /dev/null +++ b/examples/concepts/middleware/src/jitar.ts @@ -0,0 +1,9 @@ + +import { startServer } from 'jitar'; + +import LoggingMiddleware from './LoggingMiddleware.js'; + +const moduleImporter = async (specifier: string) => import(specifier); + +const server = await startServer(moduleImporter); +server.addMiddleware(new LoggingMiddleware()); diff --git a/examples/concepts/middleware/src/ping.ts b/examples/concepts/middleware/src/ping.ts new file mode 100644 index 00000000..cb32b7a1 --- /dev/null +++ b/examples/concepts/middleware/src/ping.ts @@ -0,0 +1,5 @@ + +export default async function ping(): Promise +{ + return 'pong'; +} diff --git a/examples/concepts/middleware/src/start.ts b/examples/concepts/middleware/src/start.ts deleted file mode 100644 index 95bdd1d7..00000000 --- a/examples/concepts/middleware/src/start.ts +++ /dev/null @@ -1,15 +0,0 @@ - -import { startServer } from 'jitar'; - -import LoggingMiddleware from './LoggingMiddleware.js'; - -const moduleImporter = async (specifier: string) => import(specifier); - -// Top level await is not supported in Node.js yet, -// so we use the classic promise syntax for this case. -startServer(moduleImporter).then(server => -{ - // When the server has started we can add one or middleware implementations. - // Note that the execution order of the middleware is reversed. - server.addMiddleware(new LoggingMiddleware()); -}); diff --git a/examples/concepts/multi-version/requests.http b/examples/concepts/multi-version/requests.http index fa24cfc4..dfc10866 100644 --- a/examples/concepts/multi-version/requests.http +++ b/examples/concepts/multi-version/requests.http @@ -1,22 +1,10 @@ -// Get the employee details without any version (defaults to version 0.0.0) +// Get the employee with version 1.0.0 -GET http://localhost:3000/rpc/employee/getEmployeeDetails?id=1 HTTP/1.1 +GET http://localhost:3000/rpc/getEmployee?version=1.0.0&id=1 HTTP/1.1 ### -// Get the employee details with version 1.0.0 +// Get the employee with version 2.0.0 -GET http://localhost:3000/rpc/employee/getEmployeeDetails?version=1.0.0&id=1 HTTP/1.1 - -### - -// Get the organization details with version 0.0.0 - -GET http://localhost:3000/rpc/organization/getOrganizationDetails?version=0.0.0&id=2 HTTP/1.1 - -### - -// Get the organization details with version 1.0.0 - -GET http://localhost:3000/rpc/organization/getOrganizationDetails?version=1.0.0&id=2 HTTP/1.1 +GET http://localhost:3000/rpc/getEmployee?version=2.0.0&uuid=f507cf82-ca51-4a42-8c20-ce5c7c42a77e HTTP/1.1 diff --git a/examples/concepts/multi-version/segments/default.segment.json b/examples/concepts/multi-version/segments/default.segment.json new file mode 100644 index 00000000..103b5839 --- /dev/null +++ b/examples/concepts/multi-version/segments/default.segment.json @@ -0,0 +1,13 @@ +{ + "./getEmployee": { + "getEmployee": { + "access": "public", + "version": "1.0.0" + }, + "getEmployeeV2": { + "as": "getEmployee", + "access": "public", + "version": "2.0.0" + } + } +} \ No newline at end of file diff --git a/examples/concepts/multi-version/segments/server.segment.json b/examples/concepts/multi-version/segments/server.segment.json deleted file mode 100644 index 08b7be05..00000000 --- a/examples/concepts/multi-version/segments/server.segment.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "./employee/getDetails": { - "getEmployeeDetails": { - "access": "public" - }, - "getEmployeeDetailsV2": { - "as": "getEmployeeDetails", - "access": "public", - "version": "1.0.0" - } - }, - "./organization/getDetails": { - "default": { - "access": "public" - } - }, - "./organization/getDetailsV2": { - "default": { - "as": "getOrganizationDetails", - "access": "public", - "version": "1.0.0" - } - } -} \ No newline at end of file diff --git a/examples/concepts/multi-version/services/standalone.json b/examples/concepts/multi-version/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/multi-version/services/standalone.json +++ b/examples/concepts/multi-version/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts b/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts deleted file mode 100644 index cd74ea32..00000000 --- a/examples/concepts/multi-version/src/employee/getEmployeeDetails.ts +++ /dev/null @@ -1,30 +0,0 @@ - -const names = ['John Doe', 'Jane Doe', 'John Smith', 'Jane Smith', 'John Johnson', 'Jane Johnson']; -const ages = [33, 52, 27, 48, 35, 44]; -const addresses = ['123 Main St.', '456 Main St.', '789 Main St.', '123 Elm St.', '456 Elm St.', '789 Elm St.']; - -export async function getEmployeeDetails(id: number): Promise> -{ - const name = names[id % names.length]; - const age = ages[id % ages.length]; - - return { - id: id, - name: name, - age: age, - }; -} - -export async function getEmployeeDetailsV2(id: number): Promise> -{ - const name = names[id % names.length]; - const age = ages[id % ages.length]; - const address = addresses[id % addresses.length]; - - return { - id: id, - name: name, - age: age, - address: address, - }; -} diff --git a/examples/concepts/multi-version/src/getEmployee.ts b/examples/concepts/multi-version/src/getEmployee.ts new file mode 100644 index 00000000..262d3b7f --- /dev/null +++ b/examples/concepts/multi-version/src/getEmployee.ts @@ -0,0 +1,19 @@ + +export async function getEmployee(id: number): Promise> +{ + return { + id: id, + name: 'John Doe', + age: 42, + }; +} + +export async function getEmployeeV2(uuid: string): Promise> +{ + return { + uuid: uuid, + name: 'John Doe', + age: 42, + address: '123 Main St.' + }; +} diff --git a/examples/concepts/multi-version/src/organization/Details.ts b/examples/concepts/multi-version/src/organization/Details.ts deleted file mode 100644 index 0188105a..00000000 --- a/examples/concepts/multi-version/src/organization/Details.ts +++ /dev/null @@ -1,6 +0,0 @@ - -const names = ['ABC Corp.', 'XYZ Corp.', '123 Corp.', 'ACME Corp.', 'Foo Corp.', 'Bar Corp.']; -const addresses = ['123 Main St.', '456 Main St.', '789 Main St.', '123 Elm St.', '456 Elm St.', '789 Elm St.']; -const phoneNumbers = ['555-555-5555', '555-555-5556', '555-555-5557', '555-555-5558', '555-555-5559', '555-555-5560']; - -export { names, addresses, phoneNumbers }; diff --git a/examples/concepts/multi-version/src/organization/getDetailsV2.ts b/examples/concepts/multi-version/src/organization/getDetailsV2.ts deleted file mode 100644 index 40625bea..00000000 --- a/examples/concepts/multi-version/src/organization/getDetailsV2.ts +++ /dev/null @@ -1,16 +0,0 @@ - -import { names, addresses, phoneNumbers } from './Details.js'; - -export default async function getOrganizationDetailsV2(id: number): Promise> -{ - const name = names[id % names.length]; - const address = addresses[id % addresses.length]; - const phoneNumber = phoneNumbers[id % phoneNumbers.length]; - - return { - id: id, - name: name, - address: address, - phoneNumber: phoneNumber - }; -} diff --git a/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts b/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts deleted file mode 100644 index b9379ba8..00000000 --- a/examples/concepts/multi-version/src/organization/getOrganizationDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ - -import { names, addresses } from './Details.js'; - -export default async function getOrganizationDetails(id: number): Promise> -{ - const name = names[id % names.length]; - const address = addresses[id % addresses.length]; - - return { - id: id, - name: name, - address: address - } -} diff --git a/examples/concepts/start-hooks/README.md b/examples/concepts/node-client/README.md similarity index 100% rename from examples/concepts/start-hooks/README.md rename to examples/concepts/node-client/README.md diff --git a/examples/concepts/run-procedure/package.json b/examples/concepts/node-client/package.json similarity index 55% rename from examples/concepts/run-procedure/package.json rename to examples/concepts/node-client/package.json index c95e52e2..ae329751 100644 --- a/examples/concepts/run-procedure/package.json +++ b/examples/concepts/node-client/package.json @@ -1,10 +1,11 @@ { - "name": "jitar-run-procedure-example", + "name": "jitar-node-client-example", "type": "module", "private": true, "scripts": { "build": "tsc", - "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json" + "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", + "client": "node --experimental-network-imports --no-warnings dist/client.js" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/start-hooks/segments/client.segment.json b/examples/concepts/node-client/segments/client.segment.json similarity index 78% rename from examples/concepts/start-hooks/segments/client.segment.json rename to examples/concepts/node-client/segments/client.segment.json index 63866715..076cbd6e 100644 --- a/examples/concepts/start-hooks/segments/client.segment.json +++ b/examples/concepts/node-client/segments/client.segment.json @@ -1,5 +1,5 @@ { - "./greetings/sayBoth": { + "./getLuckyNumber": { "default": { "access": "public", "version": "0.0.0" diff --git a/examples/concepts/run-procedure/services/standalone.json b/examples/concepts/node-client/services/standalone.json similarity index 78% rename from examples/concepts/run-procedure/services/standalone.json rename to examples/concepts/node-client/services/standalone.json index d697ab68..37eaf2f1 100644 --- a/examples/concepts/run-procedure/services/standalone.json +++ b/examples/concepts/node-client/services/standalone.json @@ -3,6 +3,6 @@ "standalone": { "source": "./dist", - "cache": "./cache" + "segments": [ ] } } \ No newline at end of file diff --git a/examples/concepts/node-client/src/client.ts b/examples/concepts/node-client/src/client.ts new file mode 100644 index 00000000..25bcefa3 --- /dev/null +++ b/examples/concepts/node-client/src/client.ts @@ -0,0 +1,10 @@ + +import { startClient, Version } from 'jitar'; + +const client = await startClient('http://127.0.0.1:3000', ['client']); + +const { default: getLuckyNumber } = await client.import('getLuckyNumber') as any; + +const number = await getLuckyNumber(0, 100); + +console.log(`Your lucky number is ${number}!`); diff --git a/examples/concepts/node-client/src/getLuckyNumber.ts b/examples/concepts/node-client/src/getLuckyNumber.ts new file mode 100644 index 00000000..bc5b239b --- /dev/null +++ b/examples/concepts/node-client/src/getLuckyNumber.ts @@ -0,0 +1,5 @@ + +export default async function getLuckyNumber(min: number, max: number): Promise +{ + return Math.round(Math.random() * (max - min) + min); +} diff --git a/examples/concepts/run-procedure/src/jitar.ts b/examples/concepts/node-client/src/jitar.ts similarity index 100% rename from examples/concepts/run-procedure/src/jitar.ts rename to examples/concepts/node-client/src/jitar.ts diff --git a/examples/concepts/run-procedure/tsconfig.json b/examples/concepts/node-client/tsconfig.json similarity index 100% rename from examples/concepts/run-procedure/tsconfig.json rename to examples/concepts/node-client/tsconfig.json diff --git a/examples/concepts/run-procedure/README.md b/examples/concepts/run-procedure/README.md deleted file mode 100644 index 09392bc8..00000000 --- a/examples/concepts/run-procedure/README.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Jitar | Run procedure hook example - -This example demonstrates how the run procedure hook works. - -The application is a simple phonebook application. The model of the contacts in the phonebook has been updated in the latest version. The procedure to print the contact information has been updated, but the overview procedure has not. It uses the run procedure hook to dynamically call the correct version of the print procedure. - -The run procedure hook is a powerful function to dynamically switch between versions of procedures. Using this hook breaks the IntelliSense support in Visual Studio Code. It is recommended to use the run procedure hook only when necessary. - -## Project setup - -**Procedures** - -* getContactOverview (`src/app/getContactOverview.ts`) -* printContactInformation (`src/contact/printContactInformation.ts`) - -**Segments** - -* Default - contains all procedures (`segments/default.segment.json`) - -**Services** - -* Standalone - loads the *Default* segment (`services/standalone.json`) - -## Running the example - -Install Jitar by running the following command from the root directory of the example. - -``` -npm install -``` - -Next build the application by running the following command. - -``` -npm run build -``` - -Then start Jitar with the following command from the same directory. - -``` -npm run standalone -``` - -The ``requests.http`` file contains example requests to call the procedure. diff --git a/examples/concepts/run-procedure/requests.http b/examples/concepts/run-procedure/requests.http deleted file mode 100644 index 843d8cbb..00000000 --- a/examples/concepts/run-procedure/requests.http +++ /dev/null @@ -1,4 +0,0 @@ - -// Run the procedure - -GET http://localhost:3000/rpc/app/getContactOverview HTTP/1.1 diff --git a/examples/concepts/run-procedure/segments/default.segment.json b/examples/concepts/run-procedure/segments/default.segment.json deleted file mode 100644 index c7462b38..00000000 --- a/examples/concepts/run-procedure/segments/default.segment.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "./app/getContactOverview": { - "default": { - "access": "public", - "version": "0.0.0" - } - }, - "./contact/printContactInformation": { - "default": { - "access": "private", - "version": "0.0.0" - }, - "printContactInformationV2": { - "as": "printContactInformation", - "access": "private", - "version": "1.0.0" - } - } -} \ No newline at end of file diff --git a/examples/concepts/run-procedure/src/app/getContactOverview.ts b/examples/concepts/run-procedure/src/app/getContactOverview.ts deleted file mode 100644 index 3fdf46ef..00000000 --- a/examples/concepts/run-procedure/src/app/getContactOverview.ts +++ /dev/null @@ -1,18 +0,0 @@ - -// This is a simple example of how to use the runProcedure function to call a version of a procedure dynamically. -// These dynamic calls are very powerful for dynamic version switching, but they break the type safety of TypeScript and -// increase the complexity of debugging. Use them with caution. - -import { contacts } from '../stubs/data.js'; - -export default async function getContactOverview() -{ - let result = ''; - - for (const contact of contacts) - { - result += await __runProcedure('contact/printContactInformation', contact.version, { 'contact': contact }, undefined) + '\n\n'; - } - - return result; -} diff --git a/examples/concepts/run-procedure/src/contact/printContactInformation.ts b/examples/concepts/run-procedure/src/contact/printContactInformation.ts deleted file mode 100644 index bbed218b..00000000 --- a/examples/concepts/run-procedure/src/contact/printContactInformation.ts +++ /dev/null @@ -1,12 +0,0 @@ - -import { Contact, ContactV2 } from '../model/Contact'; - -export default async function printContactInformation(contact: Contact): Promise -{ - return `name\t\t: ${contact.name}\nemail\t\t: ${contact.email}`; -} - -export async function printContactInformationV2(contact: ContactV2): Promise -{ - return `lastName\t: ${contact.lastName}\nfirstName\t: ${contact.firstName}\nemails\t\t: ${contact.emails.join(', ')}`; -} diff --git a/examples/concepts/run-procedure/src/model/Contact.ts b/examples/concepts/run-procedure/src/model/Contact.ts deleted file mode 100644 index 7ff835b4..00000000 --- a/examples/concepts/run-procedure/src/model/Contact.ts +++ /dev/null @@ -1,50 +0,0 @@ - -// The different versions of the Contact model. Note that it has a version property with a fixed value. -// In real-world applications, the version number could be determined from anywhere, e.g. a database. The version number -// is set here for demonstration purposes. - -export class Contact -{ - #name: string; - #email: string; - #version: string; - - constructor(name: string, email: string) - { - this.#name = name; - this.#email = email; - - this.#version = '0.0.0'; - } - - get name() { return this.#name; }; - - get email() { return this.#email; }; - - get version() { return this.#version; }; -} - -export class ContactV2 -{ - #firstName: string; - #lastName: string; - #emails: string[]; - #version: string; - - constructor(firstName: string, lastName: string, emails: string[]) - { - this.#firstName = firstName; - this.#lastName = lastName; - this.#emails = emails; - - this.#version = '1.0.0'; - } - - get firstName() { return this.#firstName; }; - - get lastName() { return this.#lastName; }; - - get emails() { return this.#emails; }; - - get version() { return this.#version; }; -} diff --git a/examples/concepts/run-procedure/src/stubs/data.ts b/examples/concepts/run-procedure/src/stubs/data.ts deleted file mode 100644 index fc402c8b..00000000 --- a/examples/concepts/run-procedure/src/stubs/data.ts +++ /dev/null @@ -1,11 +0,0 @@ - -import { Contact, ContactV2 } from '../model/Contact.js'; - -const contacts = [ - new Contact('John Doe', 'john.doe@acme.com'), - new Contact('Jane Doe', 'jane.doe@acme.com'), - new ContactV2('Mary', 'Doe', ['mary.doe@acme.com', 'mary@doe.com']), - new ContactV2('Catherine', 'Doe', ['catherine.doe@acme.com']) -]; - -export { contacts }; diff --git a/examples/concepts/segmentation/package.json b/examples/concepts/segmentation/package.json index 7c4ff6f5..f435be35 100644 --- a/examples/concepts/segmentation/package.json +++ b/examples/concepts/segmentation/package.json @@ -7,8 +7,8 @@ "standalone": "node --experimental-network-imports dist/jitar.js --config=services/standalone.json", "repo": "node --experimental-network-imports dist/jitar.js --config=services/repository.json", "gateway": "node --experimental-network-imports dist/jitar.js --config=services/gateway.json", - "node1": "node --experimental-network-imports dist/jitar.js --config=services/node1.json", - "node2": "node --experimental-network-imports dist/jitar.js --config=services/node2.json" + "data": "node --experimental-network-imports dist/jitar.js --config=services/data.json", + "process": "node --experimental-network-imports dist/jitar.js --config=services/process.json" }, "dependencies": { "jitar": "^0.4.0" diff --git a/examples/concepts/data-transportation/services/node1.json b/examples/concepts/segmentation/services/data.json similarity index 81% rename from examples/concepts/data-transportation/services/node1.json rename to examples/concepts/segmentation/services/data.json index 207d134c..cd5b90ba 100644 --- a/examples/concepts/data-transportation/services/node1.json +++ b/examples/concepts/segmentation/services/data.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "greeting" ] + "segments": [ "data" ] } } \ No newline at end of file diff --git a/examples/concepts/data-transportation/services/node2.json b/examples/concepts/segmentation/services/process.json similarity index 81% rename from examples/concepts/data-transportation/services/node2.json rename to examples/concepts/segmentation/services/process.json index 0d33c800..136437dc 100644 --- a/examples/concepts/data-transportation/services/node2.json +++ b/examples/concepts/segmentation/services/process.json @@ -4,6 +4,6 @@ { "gateway": "http://127.0.0.1:3000", "repository": "http://127.0.0.1:2999", - "segments": [ "data" ] + "segments": [ "process" ] } } \ No newline at end of file diff --git a/examples/concepts/segmentation/services/repository.json b/examples/concepts/segmentation/services/repository.json index 16aa0d38..8c4ec353 100644 --- a/examples/concepts/segmentation/services/repository.json +++ b/examples/concepts/segmentation/services/repository.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:2999", "repository": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/segmentation/services/standalone.json b/examples/concepts/segmentation/services/standalone.json index d697ab68..e243f24d 100644 --- a/examples/concepts/segmentation/services/standalone.json +++ b/examples/concepts/segmentation/services/standalone.json @@ -2,7 +2,6 @@ "url": "http://127.0.0.1:3000", "standalone": { - "source": "./dist", - "cache": "./cache" + "source": "./dist" } } \ No newline at end of file diff --git a/examples/concepts/start-hooks/services/standalone.json b/examples/concepts/start-hooks/services/standalone.json deleted file mode 100644 index 996cfdd9..00000000 --- a/examples/concepts/start-hooks/services/standalone.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "url": "http://127.0.0.1:3000", - "standalone": - { - "source": "./dist", - "cache": "./cache", - "index": "index.html", - "segments": [ "server" ], - "assets": [ "*.html", "*.js" ] - } -} \ No newline at end of file diff --git a/examples/concepts/start-hooks/src/browserClient.ts b/examples/concepts/start-hooks/src/browserClient.ts deleted file mode 100644 index d04bef9d..00000000 --- a/examples/concepts/start-hooks/src/browserClient.ts +++ /dev/null @@ -1,15 +0,0 @@ - -// This is the browser client entry point. It uses the `startClient` function -// to start a Jitar client. Note that the differences between this starter and -// the Node.js starter. - -// @ts-ignore -import { startClient } from '/jitar/client.js'; - -const client = await startClient(document.location.origin, ['client']); - -const { default: sayBoth } = await client.import('./greetings/sayBoth') as any; - -const message = await sayBoth('John', 'Doe'); - -alert(message); diff --git a/examples/concepts/start-hooks/src/greetings/sayBoth.ts b/examples/concepts/start-hooks/src/greetings/sayBoth.ts deleted file mode 100644 index af94a645..00000000 --- a/examples/concepts/start-hooks/src/greetings/sayBoth.ts +++ /dev/null @@ -1,15 +0,0 @@ - -import Person from './Person'; - -import sayHi from './sayHi'; -import sayHello from './sayHello'; - -export default async function sayBoth(firstName: string, lastName: string): Promise -{ - const person = new Person(firstName, lastName); - - const hiMessage = await sayHi(person); - const helloMessage = await sayHello(person); - - return `${hiMessage}\n${helloMessage}`; -} diff --git a/examples/concepts/start-hooks/src/greetings/sayHello.ts b/examples/concepts/start-hooks/src/greetings/sayHello.ts deleted file mode 100644 index 93fb7b2e..00000000 --- a/examples/concepts/start-hooks/src/greetings/sayHello.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person'; - -export default async function sayHello(person: Person): Promise -{ - return `Hello ${person.fullName}`; -} diff --git a/examples/concepts/start-hooks/src/greetings/sayHi.ts b/examples/concepts/start-hooks/src/greetings/sayHi.ts deleted file mode 100644 index 44005e2c..00000000 --- a/examples/concepts/start-hooks/src/greetings/sayHi.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import Person from './Person'; - -export default async function sayHi(person: Person): Promise -{ - return `Hi ${person.firstName}`; -} diff --git a/examples/concepts/start-hooks/src/index.html b/examples/concepts/start-hooks/src/index.html deleted file mode 100644 index 0f6aa1f6..00000000 --- a/examples/concepts/start-hooks/src/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Start hooks example | Jitar - - - - - \ No newline at end of file diff --git a/examples/concepts/start-hooks/src/nodeClient.ts b/examples/concepts/start-hooks/src/nodeClient.ts deleted file mode 100644 index f0733918..00000000 --- a/examples/concepts/start-hooks/src/nodeClient.ts +++ /dev/null @@ -1,14 +0,0 @@ - -// This is a Node.js client that uses the `startClient` function to start a -// Jitar client. Note that the differences between this starter and -// the browser starter. - -import { startClient } from 'jitar'; - -const client = await startClient('http://127.0.0.1:3000', ['client']); - -const { default: sayBoth } = await client.import('greetings/sayBoth') as any; - -const message = await sayBoth('John', 'Doe'); - -console.log(message); diff --git a/examples/concepts/start-hooks/src/server.ts b/examples/concepts/start-hooks/src/server.ts deleted file mode 100644 index 70eda387..00000000 --- a/examples/concepts/start-hooks/src/server.ts +++ /dev/null @@ -1,6 +0,0 @@ - -import { startServer } from 'jitar'; - -const moduleImporter = async (specifier: string) => import(specifier); - -startServer(moduleImporter); diff --git a/package-lock.json b/package-lock.json index e736bf36..3952eba3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -173,30 +173,35 @@ "version": "0.0.0", "dependencies": { "jitar": "^0.4.0", - "mongodb": "^5.1.0", + "mongodb": "^5.3.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@jitar/plugin-vite": "^0.4.0", - "@types/react": "^18.0.28", - "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^3.1.0", - "typescript": "^4.9.5", - "vite": "^4.1.4" + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.1", + "@vitejs/plugin-react": "^4.0.0", + "typescript": "^5.0.4", + "vite": "^4.3.4" } }, - "examples/apps/contact-list/node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "examples/apps/contact-list/node_modules/@vitejs/plugin-react": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.0.0.tgz", + "integrity": "sha512-HX0XzMjL3hhOYm+0s95pb0Z7F8O81G7joUHgfDd/9J/ZZf5k4xX6QAMFkKsHFxaHlf6X7GD7+XuaZ66ULiJuhQ==", "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "dependencies": { + "@babel/core": "^7.21.4", + "@babel/plugin-transform-react-jsx-self": "^7.21.0", + "@babel/plugin-transform-react-jsx-source": "^7.19.6", + "react-refresh": "^0.14.0" }, "engines": { - "node": ">=4.2.0" + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0" } }, "examples/concepts/access-protection": { @@ -205,51 +210,10 @@ "jitar": "^0.4.0" } }, - "examples/concepts/data-transportation": { - "name": "jitar-data-transportation-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/error-handling": { - "name": "jitar-error-handling-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/health-checks": { - "name": "jitar-health-checks-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/hello-world": { - "name": "jitar-helloworld-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/load-balancing": { - "name": "jitar-load-balancing-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/middleware": { - "name": "jitar-middleware-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/multi-version": { - "name": "jitar-multi-version-example", - "dependencies": { - "jitar": "^0.4.0" - } - }, - "examples/concepts/run-procedure": { - "name": "jitar-run-procedure-example", + "examples/concepts/cors": { + "name": "jitar-cors-example", "dependencies": { + "express": "^4.18.2", "jitar": "^0.4.0" }, "devDependencies": { @@ -258,7 +222,7 @@ "rimraf": "^4.1.2" } }, - "examples/concepts/run-procedure/node_modules/brace-expansion": { + "examples/concepts/cors/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -267,7 +231,7 @@ "balanced-match": "^1.0.0" } }, - "examples/concepts/run-procedure/node_modules/glob": { + "examples/concepts/cors/node_modules/glob": { "version": "9.3.5", "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", @@ -285,7 +249,7 @@ "url": "https://github.com/sponsors/isaacs" } }, - "examples/concepts/run-procedure/node_modules/minimatch": { + "examples/concepts/cors/node_modules/minimatch": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", @@ -300,7 +264,7 @@ "url": "https://github.com/sponsors/isaacs" } }, - "examples/concepts/run-procedure/node_modules/rimraf": { + "examples/concepts/cors/node_modules/rimraf": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", @@ -318,81 +282,70 @@ "url": "https://github.com/sponsors/isaacs" } }, - "examples/concepts/segmentation": { - "name": "jitar-segmentation-example", + "examples/concepts/data-transportation": { + "name": "jitar-data-transportation-example", "dependencies": { "jitar": "^0.4.0" } }, - "examples/concepts/start-hooks": { - "name": "jitar-start-hooks-example", + "examples/concepts/error-handling": { + "name": "jitar-error-handling-example", "dependencies": { "jitar": "^0.4.0" - }, - "devDependencies": { - "cpx2": "^4.2.0", - "npm-run-all": "^4.1.5", - "rimraf": "^4.1.2" } }, - "examples/concepts/start-hooks/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, + "examples/concepts/health-checks": { + "name": "jitar-health-checks-example", "dependencies": { - "balanced-match": "^1.0.0" + "jitar": "^0.4.0" } }, - "examples/concepts/start-hooks/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", - "dev": true, + "examples/concepts/hello-world": { + "name": "jitar-helloworld-example", "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "jitar": "^0.4.0" } }, - "examples/concepts/start-hooks/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", - "dev": true, + "examples/concepts/load-balancing": { + "name": "jitar-load-balancing-example", "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "jitar": "^0.4.0" } }, - "examples/concepts/start-hooks/node_modules/rimraf": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", - "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", - "dev": true, + "examples/concepts/middleware": { + "name": "jitar-middleware-example", "dependencies": { - "glob": "^9.2.0" - }, - "bin": { - "rimraf": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=14" + "jitar": "^0.4.0" + } + }, + "examples/concepts/multi-version": { + "name": "jitar-multi-version-example", + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/run-procedure": { + "name": "jitar-run-procedure-example", + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/segmentation": { + "name": "jitar-segmentation-example", + "dependencies": { + "jitar": "^0.4.0" + } + }, + "examples/concepts/start-hooks": { + "name": "jitar-start-hooks-example", + "extraneous": true, + "dependencies": { + "jitar": "^0.4.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "devDependencies": { + "cpx2": "^4.2.0", + "npm-run-all": "^4.1.5", + "rimraf": "^4.1.2" } }, "node_modules/@ampproject/remapping": { @@ -3593,9 +3546,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.0.37", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.37.tgz", - "integrity": "sha512-4yaZZtkRN3ZIQD3KSEwkfcik8s0SWV+82dlJot1AbGYHCzJkWP3ENBY6wYeDRmKZ6HkrgoGAmR2HqdwYGp6OEw==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.0.tgz", + "integrity": "sha512-0FLj93y5USLHdnhIhABk83rm8XEGA7kH3cr+YUlvxoUGp1xNt/DINUMvqPxLyOQMzLmZe8i4RTHbvb8MC7NmrA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -3604,9 +3557,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz", - "integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.1.tgz", + "integrity": "sha512-8QZEV9+Kwy7tXFmjJrp3XUKQSs9LTnE0KnoUb0YCguWBiNW0Yfb2iBMYZ08WPg35IR6P3Z0s00B15SwZnO26+w==", "dev": true, "dependencies": { "@types/react": "*" @@ -4040,37 +3993,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vitejs/plugin-react": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-3.1.0.tgz", - "integrity": "sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==", - "dev": true, - "dependencies": { - "@babel/core": "^7.20.12", - "@babel/plugin-transform-react-jsx-self": "^7.18.6", - "@babel/plugin-transform-react-jsx-source": "^7.19.6", - "magic-string": "^0.27.0", - "react-refresh": "^0.14.0" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.1.0-beta.0" - } - }, - "node_modules/@vitejs/plugin-react/node_modules/magic-string": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", - "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.13" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@vitest/coverage-c8": { "version": "0.30.1", "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.30.1.tgz", @@ -8370,6 +8292,10 @@ "resolved": "examples/concepts/access-protection", "link": true }, + "node_modules/jitar-cors-example": { + "resolved": "examples/concepts/cors", + "link": true + }, "node_modules/jitar-data-transportation-example": { "resolved": "examples/concepts/data-transportation", "link": true @@ -8410,10 +8336,6 @@ "resolved": "examples/concepts/segmentation", "link": true }, - "node_modules/jitar-start-hooks-example": { - "resolved": "examples/concepts/start-hooks", - "link": true - }, "node_modules/js-sdsl": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", @@ -13682,7 +13604,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -13915,9 +13836,9 @@ } }, "node_modules/vite": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.3.tgz", - "integrity": "sha512-MwFlLBO4udZXd+VBcezo3u8mC77YQk+ik+fbc0GZWGgzfbPP+8Kf0fldhARqvSYmtIWoAJ5BXPClUbMTlqFxrA==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.4.tgz", + "integrity": "sha512-f90aqGBoxSFxWph2b39ae2uHAxm5jFBBdnfueNxZAT1FTpM13ccFQExCaKbR2xFW5atowjleRniQ7onjJ22QEg==", "dependencies": { "esbuild": "^0.17.5", "postcss": "^8.4.23", From 918503014d82ed8e17a9549637a2eb9cb519d604 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Sun, 7 May 2023 23:13:29 +0200 Subject: [PATCH 11/14] Harmonized all examples --- examples/README.md | 39 ++++++------- examples/apps/contact-list/README.md | 57 ++++++++++++++----- examples/apps/contact-list/package.json | 2 +- examples/concepts/access-protection/README.md | 16 +++--- examples/concepts/cors/README.md | 43 ++++---------- .../concepts/data-transportation/README.md | 49 +++++++++------- .../data-transportation/requests.http | 2 +- examples/concepts/error-handling/README.md | 46 ++++++++------- examples/concepts/health-checks/README.md | 31 ++++++---- examples/concepts/hello-world/README.md | 14 ++--- examples/concepts/load-balancing/README.md | 20 ++++--- examples/concepts/middleware/README.md | 31 ++++++---- examples/concepts/middleware/requests.http | 2 + examples/concepts/multi-version/README.md | 24 ++++---- examples/concepts/node-client/README.md | 29 +++++----- examples/concepts/node-client/src/client.ts | 2 +- examples/concepts/segmentation/README.md | 34 ++++++----- 17 files changed, 237 insertions(+), 204 deletions(-) diff --git a/examples/README.md b/examples/README.md index 5e928d33..18579b95 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,7 +1,7 @@ # Jitar | Examples -To get started with Jitar we've created examples to explain and demonstrate the features of Jitar. +To get started with Jitar we've created examples to explain and demonstrate the concepts of Jitar. We advice to study these examples in the order they're specified below. **Note:** All examples are in TypeScript. If you're not familiar with TypeScript, @@ -20,31 +20,24 @@ A ``requests.http`` file is provided containing example requests to call the pro [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) extension to run these requests. But you can use any http client like [Postman](https://www.postman.com/). -## Basic examples +## Concepts -The following examples are the most basic examples to get started with Jitar. They demonstrate the following basic features. +The following examples focus on one particular concept at a time. The examples are kept simple to explain the concept. -1. [Hello Word](1-basic/1-hello-world/README.md) - Demonstrates how to create a procedure and call it using the RPC API. -1. [Segmentation](1-basic/2-segmentation/README.md) - Demonstrates how to split an application into multiple segments. -1. [Load balancing](1-basic/3-load-balancing/README.md) - Demonstrates how to load balance segments. -1. [Access protection](1-basic/4-access-protection/README.md) - Demonstrates how to protect the access to a procedure. -1. [Multi Version](1-basic/5-multi-version/README.md) - Demonstrates how to create multiple versions of a procedure. -1. [Data Transportation](1-basic/6-data-transportation/README.md) - Demonstrates how to transport data between segmented procedures. -1. [Error handling](1-basic/7-error-handling/README.md) - Demonstrates how to the error handling works. -1. [JavaScript](1-basic/8-javascript/README.md) - Demonstrates how to work with JavaScript instead of TypeScript. - -## Advanced examples - -The following examples are more advanced examples to get started with Jitar. They demonstrate the following advanced features. - -1. [Start hooks](2-advanced/1-start-hooks/README.md) - Demonstrates how to start a Jitar server and client. -1. [Run procedure](2-advanced/2-run-procedure/README.md) - Demonstrates how to run a procedure dynamically. -1. [Health checks](2-advanced/3-health-checks/README.md) - Demonstrates how to use health checks. -1. [Middleware](2-advanced/4-middleware/README.md) - Demonstrates how to use middleware. +1. [Hello Word](concepts/hello-world/README.md) - Demonstrates how to create a procedure and call it using the RPC API. +1. [Segmentation](concepts/segmentation/README.md) - Demonstrates how to split an application into multiple segments. +1. [Load balancing](concepts/load-balancing/README.md) - Demonstrates how to load balance segments. +1. [Access protection](concepts/access-protection/README.md) - Demonstrates how to protect the access to a procedure. +1. [Multi Version](concepts/multi-version/README.md) - Demonstrates how to create multiple versions of a procedure. +1. [Data Transportation](concepts/data-transportation/README.md) - Demonstrates how to transport data between segmented procedures. +1. [Error handling](concepts/error-handling/README.md) - Demonstrates how to the error handling works. +1. [Node client](concepts/node-client/README.md) - Demonstrates how to start a Jitar server and client. +1. [Health checks](concepts/health-checks/README.md) - Demonstrates how to use health checks. +1. [Middleware](concepts/middleware/README.md) - Demonstrates how to use middleware. +1. [Cors](concepts/cors/README.md) - Demonstrates how to enable cors. ## Application examples -The following examples combine the basic and advanced features. They demonstrate how to build real-world -applications using Jitar. +The following examples demonstrate how to build real-world applications using Jitar. -1. [Contact list](3-apps/1-contact-list/README.md) - Example of a full stack application build with React, MongoDB and Jitar. +1. [Contact list](apps/contact-list/README.md) - Example of a full stack application build with React, MongoDB and Jitar. diff --git a/examples/apps/contact-list/README.md b/examples/apps/contact-list/README.md index 1e928d33..a7bc3ce4 100644 --- a/examples/apps/contact-list/README.md +++ b/examples/apps/contact-list/README.md @@ -4,13 +4,38 @@ This example contact list application is build with React, MongoDB and Jitar (ReMoJi stack). It includes frontend and backend components and a database for storing contacts. -If you want to create a new application with the same setup, you can use the following command. +## Project setup -``` -npm create jitar@latest -``` +**Procedures** + +* createId (`src/shared/common/createId.ts`) +* getCollection (`src/shared/common/getCollection.ts`) +* getDatabase (`src/shared/common/getDatabase.ts`) +* createContact (`src/shared/contact/createContact.ts`) +* deleteContact (`src/shared/contact/deleteContact.ts`) +* getContacts (`src/shared/contact/getContacts.ts`) + +**Data model** + +* DatabaseError (`src/shared/common/DatabaseError.ts`) +* Contact (`src/shared/contact/Contact.ts`) + +**Segments** -Then type the name of the project and select the frontend framework you want. +* Server - contains all *shared* procedures (`segments/server.segment.json`) + +**Services** + +Development + +* Standalone - loads all segments (`services/standalone.json`) + +Production + +* Repository (`services/repository.json`) +* Gateway (`services/gateway.json`) +* Proxy (`services/proxy.json`) +* Node - loads the *server* segment (`services/node.json`) ## Running the example @@ -18,25 +43,25 @@ For running the example, Docker is required for setting up MongoDB. 1\. Install all dependencies by running the following command from the root directory of the example. -``` +```bash npm install ``` 2\. Build the application from the same directory. -``` +```bash npm run build ``` 3\. Start MongoDB with docker-compose. -``` +```bash docker-compose up ``` 4\. Start Jitar in development mode with the following command. -``` +```bash npm run standalone ``` @@ -44,7 +69,7 @@ npm run standalone The example uses our Vite plugin. To run Vite in dev mode (for HMR) use the following command. -``` +```bash npm run dev ``` @@ -56,22 +81,26 @@ Note that the Jitar instance needs to run beside Vite, otherwise the backend com To run the application in production mode, we need four terminal sessions to start the repository, gateway, node and proxy (as webserver) separately. The starting order is of importance. **Repository** (terminal 1) -``` + +```bash npm run repo ``` **Gateway** (terminal 2) -``` + +```bash npm run gateway ``` **Node** (terminal 3) -``` + +```bash npm run node ``` **Proxy** (terminal 4) -``` + +```bash npm run proxy ``` diff --git a/examples/apps/contact-list/package.json b/examples/apps/contact-list/package.json index f01d1f6a..8a0ee3be 100644 --- a/examples/apps/contact-list/package.json +++ b/examples/apps/contact-list/package.json @@ -1,5 +1,5 @@ { - "name": "jitar-react", + "name": "jitar-contact-list", "private": true, "version": "0.0.0", "type": "module", diff --git a/examples/concepts/access-protection/README.md b/examples/concepts/access-protection/README.md index dc803ae5..23fc549d 100644 --- a/examples/concepts/access-protection/README.md +++ b/examples/concepts/access-protection/README.md @@ -15,29 +15,29 @@ The procedure to get the secret has been made private to ensure it isn't accessi **Segments** -* Game - contains all procedures (`segments/game.segment.json`) +* Game - contains the *game* procedures (`segments/game.segment.json`) **Services** -* Standalone - loads the segment (`services/standalone.json`) +* Standalone - loads all segments (`services/standalone.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -Then start Jitar with the following command from the same directory. +3\. Then start Jitar with the following command from the same directory. -``` +```bash npm run standalone ``` diff --git a/examples/concepts/cors/README.md b/examples/concepts/cors/README.md index 8f8bc52e..9bfde7db 100644 --- a/examples/concepts/cors/README.md +++ b/examples/concepts/cors/README.md @@ -3,13 +3,13 @@ This example demonstrates how to enable CORS. -The application contains a single procedure that returns a message. The index.html file contains a simple form that calls the procedure and displays the result. +The application contains a single procedure that returns the weather forecast. The index.html file contains a simple form that calls the procedure and displays the result. ## Project setup **Procedures** -* serve (`src/server/serve.ts`) +* getWeatherForecast (`src/getWeatherForecase.ts`) **Segments** @@ -19,47 +19,26 @@ The application contains a single procedure that returns a message. The index.ht Development -* Standalone - loads the *server* segment (`services/standalone.json`) - -Production - -* Repository (`services/repository.json`) -* Gateway (`services/gateway.json`) -* Node 1 - loads the *server* segment (`services/node1.json`) -* Node 2 - loads the *server* segment (`services/node2.json`) +* Standalone - loads all segments (`services/standalone.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. +3\. Start a simple HTTP server from the same directory. -**Repository** (terminal 1) -``` -npm run repo +```bash +npm run client ``` -**Gateway** (terminal 2) -``` -npm run gateway -``` - -**Node** (terminal 3) -``` -npm run node1 -``` - -**Node 2** (terminal 4) -``` -npm run node2 -``` +Go to `http://localhost:8080` in your browser to see the result. diff --git a/examples/concepts/data-transportation/README.md b/examples/concepts/data-transportation/README.md index 174cdd24..d0563455 100644 --- a/examples/concepts/data-transportation/README.md +++ b/examples/concepts/data-transportation/README.md @@ -3,71 +3,76 @@ This example demonstrates how data is transported between segments. -The application consists of two simple procedures, a data model class and two segments. The object created on one segment is passed to the other segment. +The application simulates a helpdesk where a person can register for an account. ## Project setup **Procedures** -* createPerson (`src/person/createPerson.ts`) -* sayHello (`src/person/sayHello.ts`) +* createAccount (`src/account/createAccount.ts`) +* register (`src/helpdesk/register.ts`) **Data model** -* Person (`src/person/Person.ts`) +* Account (`src/account/Account.ts`) +* Registration (`src/helpdesk/Registration.ts`) **Segments** -* Data - contains the createPerson procedure and the data model (`segments/data.segment.json`) -* Greeting - contains the sayHello procedure (`segments/greeting.segment.json`) +* Account - contains the *account* procedures (`segments/account.segment.json`) +* Helpdesk - contains the *helpdesk* procedures (`segments/greeting.segment.json`) **Services** For development -* Standalone - loads both segments (`services/data.json`, `services/greeting.json`) +* Standalone - loads all segments (`services/data.json`, `services/greeting.json`) For production * Repository (`services/repository.json`) * Gateway (`services/gateway.json`) -* Node 1 - loads the *greeting* segment (`services/node1.json`) -* Node 2 - loads the *data* segment (`services/node2.json`) +* Account - loads the *account* segment (`services/account.json`) +* Helpdesk - loads the *helpdesk* segment (`services/helpdesk.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2.\ Next build the application by running the following command. -``` +```bash npm run build ``` To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. **Repository** (terminal 1) -``` + +```bash npm run repo ``` **Gateway** (terminal 2) -``` + +```bash npm run gateway ``` -**Hi segment** (terminal 3) -``` -npm run node1 -``` +**Account segment** (terminal 3) -**Hello segment** (terminal 4) +```bash +npm run account ``` -npm run node2 + +**Helpdesk segment** (terminal 4) + +```bash +npm run helpdesk ``` -The ``requests.http`` file contains example requests to call the procedures. Note that the Person object is created on the *data* segment and then passed to the *greeting* segment to say hello. +The ``requests.http`` file contains example request to call the procedures. Note that the Account object is created on the *account* segment. diff --git a/examples/concepts/data-transportation/requests.http b/examples/concepts/data-transportation/requests.http index c206b9aa..4d1b581e 100644 --- a/examples/concepts/data-transportation/requests.http +++ b/examples/concepts/data-transportation/requests.http @@ -1,4 +1,4 @@ -// Say hello to a person +// Register John Doe for an account GET http://localhost:3000/rpc/helpdesk/register?firstName=John&lastName=Doe HTTP/1.1 diff --git a/examples/concepts/error-handling/README.md b/examples/concepts/error-handling/README.md index ccb54169..756ead4a 100644 --- a/examples/concepts/error-handling/README.md +++ b/examples/concepts/error-handling/README.md @@ -3,19 +3,23 @@ This example demonstrates how custom errors are supported. -The application contains a custom error and procedures to handle it. +The application contains a procedure to get data from a database and a procedure to export the data. ## Project setup **Procedures** -* getContacts (`src/contact/getContacts.ts`) -* getContactList (`src/organization/getContactList.ts`) +* getData (`src/sales/getData.ts`) +* exportData (`src/sales/exportData.ts`) + +**Data model** + +* DatabaseError (`src/sales/DatabaseError.ts`) **Segments** -* Contact - contains all procedures (`segments/contact.segment.json`) -* Organization - contains all procedures (`segments/organization.segment.json`) +* Data - contains the *data* procedures (`segments/data.segment.json`) +* Process - contains the *process* procedures (`segments/process.segment.json`) **Services** @@ -27,43 +31,47 @@ Production * Repository (`services/repository.json`) * Gateway (`services/gateway.json`) -* Node 1 - loads the *contact* segment (`services/node1.json`) -* Node 2 - loads the *organization* segment (`services/node2.json`) +* Data - loads the *contact* segment (`services/node1.json`) +* Process - loads the *organization* segment (`services/node2.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. **Repository** (terminal 1) -``` + +```bash npm run repo ``` **Gateway** (terminal 2) -``` + +```bash npm run gateway ``` -**Hi segment** (terminal 3) -``` -npm run node1 -``` +**Data segment** (terminal 3) -**Hello segment** (terminal 4) +```bash +npm run data ``` -npm run node2 + +**Process segment** (terminal 4) + +```bash +npm run process ``` The ``requests.http`` file contains example requests to call the procedures. diff --git a/examples/concepts/health-checks/README.md b/examples/concepts/health-checks/README.md index 9a173ae3..eae4f5c7 100644 --- a/examples/concepts/health-checks/README.md +++ b/examples/concepts/health-checks/README.md @@ -3,31 +3,38 @@ This example demonstrates how to create heath checks and request the health of a service. -The application contains a simple "Hello World" procedure that returns a string. -It can be found in the ``src/greetings`` directory. Also the application contains -the ``src/DatabaseHealthCheck.ts`` health check file and the ``src/default.segment.ts`` -segment file. +## Project setup -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. +**Procedures** + +* DatabaseHealthCheck (`src/DatabaseHealthCheck.ts`) + +**Segments** + +* None + +**Services** + +* Standalone - loads no segments (`services/default.segment.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -Then start Jitar with the following command from the same directory. +3\. Then start Jitar with the following command from the same directory. -``` -npm run start +```bash +npm run standalone ``` The ``requests.http`` file contains example requests to call the procedure. diff --git a/examples/concepts/hello-world/README.md b/examples/concepts/hello-world/README.md index effe273a..1fedb9ab 100644 --- a/examples/concepts/hello-world/README.md +++ b/examples/concepts/hello-world/README.md @@ -2,8 +2,6 @@ # Jitar | Hello World example This example demonstrates the simplest Jitar application possible. -It contains a single backend procedure and does not have a frontend. -Therefore the procedure needs to be called using the RPC API. ## Project setup @@ -21,21 +19,21 @@ Therefore the procedure needs to be called using the RPC API. ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -Then start Jitar with the following command from the same directory. +3\. Then start Jitar with the following command from the same directory. -``` +```bash npm run standalone ``` diff --git a/examples/concepts/load-balancing/README.md b/examples/concepts/load-balancing/README.md index 465e4067..e341070e 100644 --- a/examples/concepts/load-balancing/README.md +++ b/examples/concepts/load-balancing/README.md @@ -33,37 +33,41 @@ Production ## Running the example (load balanced) -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. **Repository** (terminal 1) -``` + +```bash npm run repo ``` **Gateway** (terminal 2) -``` + +```bash npm run gateway ``` **Node 1** (terminal 3) -``` + +```bash npm run node1 ``` **Node 2** (terminal 4) -``` + +```bash npm run node2 ``` diff --git a/examples/concepts/middleware/README.md b/examples/concepts/middleware/README.md index d866b21e..9486445a 100644 --- a/examples/concepts/middleware/README.md +++ b/examples/concepts/middleware/README.md @@ -3,30 +3,39 @@ This example demonstrates how to create and add middleware. -The application contains a simple "Hello World" procedure that returns a string. -It can be found in the ``src/greetings`` directory. Also the application contains -the ``src/LoggingMiddleware.ts`` middleware file and the ``src/default.segment.ts`` -segment file. +The application implements a simple logging middleware. -For fireing up Jitar its configuration is specified in the ``jitar.json`` file. +## Project setup + +**Procedures** + +* ping (`src/ping.ts`) + +**Segments** + +* Default - contains the *ping* procedure (`src/segments/default.segment.json`) + +**Services** + +* Standalone (`src/services/standalone.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -Then start Jitar with the following command from the same directory. +3\. Then start Jitar with the following command from the same directory. -``` +```bash npm run start ``` diff --git a/examples/concepts/middleware/requests.http b/examples/concepts/middleware/requests.http index 736d922f..05dc4adc 100644 --- a/examples/concepts/middleware/requests.http +++ b/examples/concepts/middleware/requests.http @@ -1,2 +1,4 @@ +// Execute the procedure and check the terminal + GET http://localhost:3000/rpc/ping HTTP/1.1 diff --git a/examples/concepts/multi-version/README.md b/examples/concepts/multi-version/README.md index 68285521..ae72eb00 100644 --- a/examples/concepts/multi-version/README.md +++ b/examples/concepts/multi-version/README.md @@ -3,42 +3,40 @@ This example demonstrates how to create multiple versions for a procedure and how to register them as versioned procedures in a segment. -The application is a simple application that returns information about a person and an organization. Each of these entities has a version 1 and version 2 of the procedure to get its details. +The application returns two different versions of an employee. ## Project setup **Procedures** -* getEmployeeDetails (`src/employees/getDetails.ts`) -* getEmployeeDetailsV2 (`src/employees/getDetails.ts`) -* getOrganizationDetails (`src/organizations/getDetails.ts`) -* getOrganizationDetailsV2 (`src/organizations/getDetailsV2.ts`) +* getEmployee (`src/getEmployee.ts`) +* getEmployeeV2 (`src/getEmployee.ts`) **Segments** -* Server - contains all procedures (`segments/server.segment.json`) +* Default - contains all procedures (`segments/default.segment.json`) **Services** -* Standalone - loads the *Server* segment (`services/standalone.json`) +* Standalone - loads the *Default* segment (`services/standalone.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -Then start Jitar with the following command from the same directory. +3\. Then start Jitar with the following command from the same directory. -``` +```bash npm run standalone ``` diff --git a/examples/concepts/node-client/README.md b/examples/concepts/node-client/README.md index a518ca32..04785aa7 100644 --- a/examples/concepts/node-client/README.md +++ b/examples/concepts/node-client/README.md @@ -1,7 +1,7 @@ # Jitar | Start Hooks example -This example demonstrates how the client and server start hooks work. +This example demonstrates how the node client and server start hooks work. The client start hook can be used to start any client (browser or Node), and the server start hook can be used to start the Node server. @@ -9,45 +9,42 @@ The client start hook can be used to start any client (browser or Node), and the **Procedures** -* sayBoth (`src/greetings/sayBoth.ts`) -* sayHello (`src/greetings/sayHello.ts`) -* sayHi (`src/greetings/sayHi.ts`) +* getLuckyNumber (`src/getLuckyNumber.ts`) **Segments** -* Server - contains the *server* procedures (`segments/server.segment.json`) * Client - contains the *client* procedures (`segments/client.segment.json`) **Services** -* Standalone - loads the *Server* segments (`services/standalone.json`) +* Standalone - loads no segments (`services/standalone.json`) ## Running the example -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` -To start Jitar we need two terminal sessions to start the repository and the node client. The starting order is of importantance. +To start Jitar we need two terminal sessions to start the server and the node client. The starting order is of importantance. **Standalone** (terminal 1) -``` + +```bash npm run standalone ``` **Node client** (terminal 2) -``` + +```bash npm run client ``` -Now open the following URL in your browser `http://localhost:3000`. - -Both clients show the same result. The browser client as an alert, and the Node client in the terminal. +The lucky number is printed to the console. diff --git a/examples/concepts/node-client/src/client.ts b/examples/concepts/node-client/src/client.ts index 25bcefa3..7a841e40 100644 --- a/examples/concepts/node-client/src/client.ts +++ b/examples/concepts/node-client/src/client.ts @@ -1,5 +1,5 @@ -import { startClient, Version } from 'jitar'; +import { startClient } from 'jitar'; const client = await startClient('http://127.0.0.1:3000', ['client']); diff --git a/examples/concepts/segmentation/README.md b/examples/concepts/segmentation/README.md index 144d08b7..298d05b7 100644 --- a/examples/concepts/segmentation/README.md +++ b/examples/concepts/segmentation/README.md @@ -15,8 +15,8 @@ The application is a simple report creation that separates the data from the pro **Segments** -* Data - contains the *getData* procedure (`segments/data.segment.json`) -* Process - contains the *createReport* and *process* procedures (`segments/process.segment.json`) +* Data - contains the *data* procedure (`segments/data.segment.json`) +* Process - contains the *process* procedures (`segments/process.segment.json`) **Services** @@ -28,42 +28,46 @@ Production * Repository (`services/repository.json`) * Gateway (`services/gateway.json`) -* Node 1 - loads the *data* segment (`services/node1.json`) -* Node 2 - loads the *process* segment (`services/node2.json`) +* Data - loads the *data* segment (`services/data.json`) +* Process - loads the *process* segment (`services/process.json`) ## Running the example (production) -Install Jitar by running the following command from the root directory of the example. +1\. Install Jitar by running the following command from the root directory of the example. -``` +```bash npm install ``` -Next build the application by running the following command. +2\. Next build the application by running the following command. -``` +```bash npm run build ``` To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importance. **Repository** (terminal 1) -``` + +```bash npm run repo ``` **Gateway** (terminal 2) -``` + +```bash npm run gateway ``` -**Hi segment** (terminal 3) -``` -npm run node1 -``` +**Data segment** (terminal 3) -**Hello segment** (terminal 4) +```bash +npm run data ``` + +**Process segment** (terminal 4) + +```bash npm run node2 ``` From 12525c7baf7be77f7d2ba6bb6798b4741e415efa Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Sun, 7 May 2023 23:26:05 +0200 Subject: [PATCH 12/14] Updated dependencies --- examples/apps/contact-list/package.json | 8 +- examples/concepts/cors/package.json | 2 +- package-lock.json | 2171 +++++++++++------------ package.json | 14 +- packages/create-jitar/package.json | 2 +- packages/jitar/package.json | 2 +- packages/plugin-vite/package.json | 2 +- 7 files changed, 1068 insertions(+), 1133 deletions(-) diff --git a/examples/apps/contact-list/package.json b/examples/apps/contact-list/package.json index 8a0ee3be..eb6d84d0 100644 --- a/examples/apps/contact-list/package.json +++ b/examples/apps/contact-list/package.json @@ -15,16 +15,16 @@ }, "dependencies": { "jitar": "^0.4.0", - "mongodb": "^5.3.0", + "mongodb": "^5.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@jitar/plugin-vite": "^0.4.0", - "@types/react": "^18.2.0", - "@types/react-dom": "^18.2.1", + "@types/react": "^18.2.6", + "@types/react-dom": "^18.2.4", "@vitejs/plugin-react": "^4.0.0", "typescript": "^5.0.4", - "vite": "^4.3.4" + "vite": "^4.3.5" } } \ No newline at end of file diff --git a/examples/concepts/cors/package.json b/examples/concepts/cors/package.json index ed32126c..ec23d651 100644 --- a/examples/concepts/cors/package.json +++ b/examples/concepts/cors/package.json @@ -17,6 +17,6 @@ "devDependencies": { "cpx2": "^4.2.0", "npm-run-all": "^4.1.5", - "rimraf": "^4.1.2" + "rimraf": "^5.0.0" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3952eba3..b0248055 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,16 +43,16 @@ "@types/mime-types": "^2.1.1", "@types/prompts": "^2.4.4", "@types/yargs": "^17.0.24", - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@vitest/coverage-c8": "^0.30.1", + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@vitest/coverage-c8": "^0.31.0", "degit": "^2.8.4", - "eslint": "^8.39.0", + "eslint": "^8.40.0", "eslint-plugin-jitar": "0.0.1", - "lerna": "^6.6.1", - "rollup": "^3.21.0", + "lerna": "^6.6.2", + "rollup": "^3.21.5", "rollup-plugin-dts": "^5.3.0", - "vite": "^4.3.3", - "vitest": "^0.30.1" + "vite": "^4.3.5", + "vitest": "^0.31.0" } }, "examples/1-basic/1-hello-world": { @@ -169,21 +169,21 @@ } }, "examples/apps/contact-list": { - "name": "jitar-react", + "name": "jitar-contact-list", "version": "0.0.0", "dependencies": { "jitar": "^0.4.0", - "mongodb": "^5.3.0", + "mongodb": "^5.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@jitar/plugin-vite": "^0.4.0", - "@types/react": "^18.2.0", - "@types/react-dom": "^18.2.1", + "@types/react": "^18.2.6", + "@types/react-dom": "^18.2.4", "@vitejs/plugin-react": "^4.0.0", "typescript": "^5.0.4", - "vite": "^4.3.4" + "vite": "^4.3.5" } }, "examples/apps/contact-list/node_modules/@vitejs/plugin-react": { @@ -219,7 +219,7 @@ "devDependencies": { "cpx2": "^4.2.0", "npm-run-all": "^4.1.5", - "rimraf": "^4.1.2" + "rimraf": "^5.0.0" } }, "examples/concepts/cors/node_modules/brace-expansion": { @@ -231,16 +231,36 @@ "balanced-match": "^1.0.0" } }, + "examples/concepts/cors/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "examples/concepts/cors/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.2.tgz", + "integrity": "sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -250,9 +270,9 @@ } }, "examples/concepts/cors/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -264,13 +284,22 @@ "url": "https://github.com/sponsors/isaacs" } }, + "examples/concepts/cors/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "examples/concepts/cors/node_modules/rimraf": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", - "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", + "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", "dev": true, "dependencies": { - "glob": "^9.2.0" + "glob": "^10.0.0" }, "bin": { "rimraf": "dist/cjs/src/bin.js" @@ -282,6 +311,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "examples/concepts/cors/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "examples/concepts/data-transportation": { "name": "jitar-data-transportation-example", "dependencies": { @@ -326,6 +367,7 @@ }, "examples/concepts/run-procedure": { "name": "jitar-run-procedure-example", + "extraneous": true, "dependencies": { "jitar": "^0.4.0" } @@ -1164,14 +1206,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz", - "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", + "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.1", + "espree": "^9.5.2", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -1187,9 +1229,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz", - "integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==", + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", + "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1243,6 +1285,102 @@ "node": ">=6.9.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", @@ -1359,9 +1497,9 @@ "devOptional": true }, "node_modules/@lerna/child-process": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-6.6.1.tgz", - "integrity": "sha512-yUCDCcRNNbI9UUsUB6FYEmDHpo5Tn/f0q5D7vhDP4i6Or8kBj82y7+e31hwfLvK2ykOYlDVs2MxAluH/+QUBOQ==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-6.6.2.tgz", + "integrity": "sha512-QyKIWEnKQFnYu2ey+SAAm1A5xjzJLJJj3bhIZd3QKyXKKjaJ0hlxam/OsWSltxTNbcyH1jRJjC6Cxv31usv0Ag==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -1369,22 +1507,22 @@ "strong-log-transformer": "^2.1.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" } }, "node_modules/@lerna/create": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-6.6.1.tgz", - "integrity": "sha512-GDmHFhQ0mr0RcXWXrsLyfMV6ch/dZV/Ped1e6sFVQhsLL9P+FFXX1ZWxa/dQQ90VWF2qWcmK0+S/L3kUz2xvTA==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-6.6.2.tgz", + "integrity": "sha512-xQ+1Y7D+9etvUlE+unhG/TwmM6XBzGIdFBaNoW8D8kyOa9M2Jf3vdEtAxVa7mhRz66CENfhL/+I/QkVaa7pwbQ==", "dev": true, "dependencies": { - "@lerna/child-process": "6.6.1", + "@lerna/child-process": "6.6.2", "dedent": "^0.7.0", "fs-extra": "^9.1.0", "init-package-json": "^3.0.2", "npm-package-arg": "8.1.1", "p-reduce": "^2.1.0", - "pacote": "^13.6.1", + "pacote": "15.1.1", "pify": "^5.0.0", "semver": "^7.3.4", "slash": "^3.0.0", @@ -1393,7 +1531,7 @@ "yargs-parser": "20.2.4" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" } }, "node_modules/@lerna/create/node_modules/fs-extra": { @@ -1421,9 +1559,9 @@ } }, "node_modules/@lerna/legacy-package-management": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/@lerna/legacy-package-management/-/legacy-package-management-6.6.1.tgz", - "integrity": "sha512-0EYxSFr34VgeudA5rvjGJSY7s4seITMVB7AJ9LRFv9QDUk6jpvapV13ZAaKnhDTxX5vNCfnJuWHXXWq0KyPF/Q==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/@lerna/legacy-package-management/-/legacy-package-management-6.6.2.tgz", + "integrity": "sha512-0hZxUPKnHwehUO2xC4ldtdX9bW0W1UosxebDIQlZL2STnZnA2IFmIk2lJVUyFW+cmTPQzV93jfS0i69T9Z+teg==", "dev": true, "dependencies": { "@npmcli/arborist": "6.2.3", @@ -1455,7 +1593,7 @@ "inquirer": "8.2.4", "is-ci": "2.0.0", "is-stream": "2.0.0", - "libnpmpublish": "6.0.4", + "libnpmpublish": "7.1.4", "load-json-file": "6.2.0", "make-dir": "3.1.0", "minimatch": "3.0.5", @@ -1469,7 +1607,7 @@ "p-map-series": "2.1.0", "p-queue": "6.6.2", "p-waterfall": "2.1.1", - "pacote": "13.6.2", + "pacote": "15.1.1", "pify": "5.0.0", "pretty-format": "29.4.3", "read-cmd-shim": "3.0.0", @@ -1490,7 +1628,7 @@ "yargs": "16.2.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" } }, "node_modules/@lerna/legacy-package-management/node_modules/chalk": { @@ -1579,9 +1717,9 @@ } }, "node_modules/@lerna/legacy-package-management/node_modules/make-fetch-happen": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.0.tgz", - "integrity": "sha512-7ChuOzCb1LzdQZrTy0ky6RsCoMYeM+Fh4cY0+4zsJVhNcH5Q3OJojLY1mGkD0xAhWB29lskECVb6ZopofwjldA==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", + "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -1591,7 +1729,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -1604,13 +1742,22 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@lerna/legacy-package-management/node_modules/make-fetch-happen/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@lerna/legacy-package-management/node_modules/make-fetch-happen/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -1629,12 +1776,12 @@ } }, "node_modules/@lerna/legacy-package-management/node_modules/minipass-fetch": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.2.tgz", - "integrity": "sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", + "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -1645,6 +1792,15 @@ "encoding": "^0.1.13" } }, + "node_modules/@lerna/legacy-package-management/node_modules/minipass-fetch/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@lerna/legacy-package-management/node_modules/npm-registry-fetch": { "version": "14.0.3", "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz", @@ -1826,25 +1982,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/@npmcli/git": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.4.tgz", - "integrity": "sha512-5yZghx+u5M47LghaybLCkdSyFzV/w4OuH12d96HO389Ik9CDsLaDZJVynSGGVJOLn6gy/k7Dz5XYcplM3uxXRg==", - "dev": true, - "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", - "proc-log": "^3.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/arborist/node_modules/@npmcli/promise-spawn": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", @@ -1858,9 +1995,9 @@ } }, "node_modules/@npmcli/arborist/node_modules/@npmcli/run-script": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.0.tgz", - "integrity": "sha512-ql+AbRur1TeOdl1FY+RAwGW9fcr4ZwiVKabdvm93mujGREVuVLbdkXRJDrkTXSdCjaxYydr1wlA2v67jxWG5BQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.1.tgz", + "integrity": "sha512-Yi04ZSold8jcbBJD/ahKMJSQCQifH8DAbMwkBvoLaTpGFxzHC3B/5ZyoVR69q/4xedz84tvi9DJOJjNe17h+LA==", "dev": true, "dependencies": { "@npmcli/node-gyp": "^3.0.0", @@ -1920,16 +2057,16 @@ } }, "node_modules/@npmcli/arborist/node_modules/gauge": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-5.0.0.tgz", - "integrity": "sha512-0s5T5eciEG7Q3ugkxAkFtaDhrrhXsCRivA5y8C9WMHWuI8UlMOJg7+Iwf7Mccii+Dfs3H5jHepU0joPVyQU0Lw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-5.0.1.tgz", + "integrity": "sha512-CmykPMJGuNan/3S4kZOpvvPYSNqSHANiWnh9XcMU2pSjtBfF0XzZ2p1bFAxTbnFxyBuPxQYHhzwaoOmUdqzvxQ==", "dev": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.3", "console-control-strings": "^1.1.0", "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", + "signal-exit": "^4.0.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wide-align": "^1.1.5" @@ -1938,66 +2075,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@npmcli/arborist/node_modules/glob/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@npmcli/arborist/node_modules/ignore-walk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.2.tgz", - "integrity": "sha512-ezmQ1Dg2b3jVZh2Dh+ar6Eu2MqNSTkyb32HU2MAQQQX9tKM3q/UQ/9lf03lQ5hW+fOeoMnwxwkleZ0xcNp0/qg==", - "dev": true, - "dependencies": { - "minimatch": "^7.4.2" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/arborist/node_modules/ignore-walk/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@npmcli/arborist/node_modules/minimatch": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", @@ -2013,19 +2090,13 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/arborist/node_modules/normalize-package-data": { + "node_modules/@npmcli/arborist/node_modules/minipass": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=8" } }, "node_modules/@npmcli/arborist/node_modules/npm-package-arg": { @@ -2043,18 +2114,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/npm-packlist": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", - "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", - "dev": true, - "dependencies": { - "ignore-walk": "^6.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/arborist/node_modules/npmlog": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-7.0.1.tgz", @@ -2070,53 +2129,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/pacote": { - "version": "15.1.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.1.1.tgz", - "integrity": "sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ==", - "dev": true, - "dependencies": { - "@npmcli/git": "^4.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", - "fs-minipass": "^3.0.0", - "minipass": "^4.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^1.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11" - }, - "bin": { - "pacote": "lib/bin.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/arborist/node_modules/read-package-json": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.1.tgz", - "integrity": "sha512-AaHqXxfAVa+fNL07x8iAghfKOds/XXsu7zoouIVsbm7PEbQ3nMWXlvjcbrNLjElnUHWQtAo4QEa0RXuvD4XlpA==", - "dev": true, - "dependencies": { - "glob": "^9.3.0", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/arborist/node_modules/readable-stream": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.3.0.tgz", @@ -2132,253 +2144,70 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@npmcli/arborist/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", - "dev": true, - "dependencies": { - "minipass": "^4.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/arborist/node_modules/validate-npm-package-name": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", - "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", - "dev": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/arborist/node_modules/which": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz", - "integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/fs": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", - "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", - "dev": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", - "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", - "dev": true, - "dependencies": { - "@npmcli/promise-spawn": "^3.0.0", - "lru-cache": "^7.4.4", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^7.0.0", - "proc-log": "^2.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/hosted-git-info": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", - "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", - "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-install-checks": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", - "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", - "dev": true, - "dependencies": { - "semver": "^7.1.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-normalize-package-bin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", - "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", - "dev": true, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-package-arg": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", - "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", - "dev": true, - "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-pick-manifest": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", - "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", - "dev": true, - "dependencies": { - "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^2.0.0", - "npm-package-arg": "^9.0.0", - "semver": "^7.3.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/proc-log": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", - "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "node_modules/@npmcli/arborist/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", "dev": true, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", - "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", - "dev": true, - "dependencies": { - "npm-bundled": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "bin": { - "installed-package-contents": "lib/index.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/map-workspaces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.3.tgz", - "integrity": "sha512-HlCvFuTzw4UNoKyZdqiNrln+qMF71QJkxy2dsusV8QQdoa89e2TF4dATCzBxbl4zzRzdDoWWyP5ADVrNAH9cRQ==", - "dev": true, - "dependencies": { - "@npmcli/name-from-folder": "^2.0.0", - "glob": "^9.3.1", - "minimatch": "^7.4.2", - "read-package-json-fast": "^3.0.0" + "node": ">=14" }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/map-workspaces/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "node_modules/@npmcli/arborist/node_modules/ssri": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "minipass": "^5.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/map-workspaces/node_modules/glob/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "node_modules/@npmcli/arborist/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "builtins": "^5.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "node_modules/@npmcli/arborist/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "isexe": "^2.0.0" }, - "engines": { - "node": ">=10" + "bin": { + "node-which": "bin/which.js" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/metavuln-calculator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-5.0.1.tgz", - "integrity": "sha512-qb8Q9wIIlEPj3WeA1Lba91R4ZboPL0uspzV0F9uwP+9AYMVB2zOoa7Pbk12g6D2NHAinSbHh6QYmGuRyHZ874Q==", + "node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", "dev": true, "dependencies": { - "cacache": "^17.0.0", - "json-parse-even-better-errors": "^3.0.0", - "pacote": "^15.0.0", "semver": "^7.3.5" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git": { + "node_modules/@npmcli/git": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.4.tgz", "integrity": "sha512-5yZghx+u5M47LghaybLCkdSyFzV/w4OuH12d96HO389Ik9CDsLaDZJVynSGGVJOLn6gy/k7Dz5XYcplM3uxXRg==", @@ -2397,7 +2226,7 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/promise-spawn": { + "node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", @@ -2409,23 +2238,53 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/run-script": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.0.tgz", - "integrity": "sha512-ql+AbRur1TeOdl1FY+RAwGW9fcr4ZwiVKabdvm93mujGREVuVLbdkXRJDrkTXSdCjaxYydr1wlA2v67jxWG5BQ==", + "node_modules/@npmcli/git/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "dependencies": { - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", + "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", + "dev": true, + "dependencies": { + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/map-workspaces": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz", + "integrity": "sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==", + "dev": true, + "dependencies": { + "@npmcli/name-from-folder": "^2.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0", + "read-package-json-fast": "^3.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/brace-expansion": { + "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -2434,31 +2293,36 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "node_modules/@npmcli/map-workspaces/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/glob/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "node_modules/@npmcli/map-workspaces/node_modules/glob": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.2.tgz", + "integrity": "sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -2467,156 +2331,52 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/ignore-walk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.2.tgz", - "integrity": "sha512-ezmQ1Dg2b3jVZh2Dh+ar6Eu2MqNSTkyb32HU2MAQQQX9tKM3q/UQ/9lf03lQ5hW+fOeoMnwxwkleZ0xcNp0/qg==", - "dev": true, - "dependencies": { - "minimatch": "^7.4.2" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/normalize-package-data": { + "node_modules/@npmcli/map-workspaces/node_modules/minipass": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "node_modules/@npmcli/map-workspaces/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/npm-packlist": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", - "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", - "dev": true, - "dependencies": { - "ignore-walk": "^6.0.0" + "node": ">=14" }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/metavuln-calculator/node_modules/pacote": { - "version": "15.1.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.1.1.tgz", - "integrity": "sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ==", + "node_modules/@npmcli/metavuln-calculator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-5.0.1.tgz", + "integrity": "sha512-qb8Q9wIIlEPj3WeA1Lba91R4ZboPL0uspzV0F9uwP+9AYMVB2zOoa7Pbk12g6D2NHAinSbHh6QYmGuRyHZ874Q==", "dev": true, "dependencies": { - "@npmcli/git": "^4.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", "cacache": "^17.0.0", - "fs-minipass": "^3.0.0", - "minipass": "^4.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^1.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11" - }, - "bin": { - "pacote": "lib/bin.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/read-package-json": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.1.tgz", - "integrity": "sha512-AaHqXxfAVa+fNL07x8iAghfKOds/XXsu7zoouIVsbm7PEbQ3nMWXlvjcbrNLjElnUHWQtAo4QEa0RXuvD4XlpA==", - "dev": true, - "dependencies": { - "glob": "^9.3.0", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", - "dev": true, - "dependencies": { - "minipass": "^4.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/validate-npm-package-name": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", - "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", - "dev": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/metavuln-calculator/node_modules/which": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz", - "integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" + "pacote": "^15.0.0", + "semver": "^7.3.5" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -2741,18 +2501,18 @@ } }, "node_modules/@nrwl/cli": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-15.9.2.tgz", - "integrity": "sha512-QoCmyrcGakHAYTJaNBbOerRQAmqJHMYGCdqtQidV+aP9p1Dy33XxDELfhd+IYmGqngutXuEWChNpWNhPloLnoA==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-15.9.4.tgz", + "integrity": "sha512-FoiGFCLpb/r4HXCM3KYqT0xteP+MRV6bIHjz3bdPHIDLmBNQQnRRaV2K47jtJ6zjh1eOU5UHKyDtDDYf80Idpw==", "dev": true, "dependencies": { - "nx": "15.9.2" + "nx": "15.9.4" } }, "node_modules/@nrwl/devkit": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.9.2.tgz", - "integrity": "sha512-2DvTstVZb91m+d4wqUJMBHQ3elxyabdmFE6/3aXmtOGeDxTyXyDzf/1O6JvBBiL8K6XC3ZYchjtxUHgxl/NJ5A==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.9.4.tgz", + "integrity": "sha512-mUX1kXTuPMdTzFxIzH+MsSNvdppOmstPDOEtiGFZJTuJ625ki0HhNJILO3N2mJ7MeMrLqIlAiNdvelQaObxYsQ==", "dev": true, "dependencies": { "ejs": "^3.1.7", @@ -2793,9 +2553,9 @@ } }, "node_modules/@nrwl/nx-darwin-arm64": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.9.2.tgz", - "integrity": "sha512-Yv+OVsQt3C/hmWOC+YhJZQlsyph5w1BHfbp4jyCvV1ZXBbb8NdvwxgDHPWXxKPTc1EXuB7aEX3qzxM3/OWEUJg==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.9.4.tgz", + "integrity": "sha512-XnvrnT9BJsgThY/4xUcYtE077ERq/img8CkRj7MOOBNOh0/nVcR4LGbBKDHtwE3HPk0ikyS/SxRyNa9msvi3QQ==", "cpu": [ "arm64" ], @@ -2809,9 +2569,9 @@ } }, "node_modules/@nrwl/nx-darwin-x64": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.9.2.tgz", - "integrity": "sha512-qHfdluHlPzV0UHOwj1ZJ+qNEhzfLGiBuy1cOth4BSzDlvMnkuqBWoprfaXoztzYcus2NSILY1/7b3Jw4DAWmMw==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.9.4.tgz", + "integrity": "sha512-WKSfSlpVMLchpXkax0geeUNyhvNxwO7qUz/s0/HJWBekt8fizwKDwDj1gP7fOu+YWb/tHiSscbR1km8PtdjhQw==", "cpu": [ "x64" ], @@ -2825,9 +2585,9 @@ } }, "node_modules/@nrwl/nx-linux-arm-gnueabihf": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.9.2.tgz", - "integrity": "sha512-0GzwbablosnYnnJDCJvAeZv8LlelSrNwUnGhe43saeoZdAew35Ay1E34zBrg/GCGTASuz+knEEYFM+gDD9Mc6A==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.9.4.tgz", + "integrity": "sha512-a/b4PP7lP/Cgrh0LjC4O2YTt5pyf4DQTGtuE8qlo8o486UiofCtk4QGJX72q80s23L0ejCaKY2ULKx/3zMLjuA==", "cpu": [ "arm" ], @@ -2841,9 +2601,9 @@ } }, "node_modules/@nrwl/nx-linux-arm64-gnu": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.9.2.tgz", - "integrity": "sha512-3mFIY7iUTPG45hSIRaM2DmraCy8W6hNoArAGRrTgYw40BIJHtLrW+Rt7DLyvVXaYCvrKugWOKtxC+jG7kpIZVA==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.9.4.tgz", + "integrity": "sha512-ibBV8fMhSfLVd/2WzcDuUm32BoZsattuKkvMmOoyU6Pzoznc3AqyDjJR4xCIoAn5Rf+Nu1oeQONr5FAtb1Ugow==", "cpu": [ "arm64" ], @@ -2857,9 +2617,9 @@ } }, "node_modules/@nrwl/nx-linux-arm64-musl": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.9.2.tgz", - "integrity": "sha512-FNBnXEtockwxZa4I3NqggrJp0YIbNokJvt/clrICP+ijOacdUDkv8mJedavobkFsRsNq9gzCbRbUScKymrOLrg==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.9.4.tgz", + "integrity": "sha512-iIjvVYd7+uM4jVD461+PvU5XTALgSvJOODUaMRGOoDl0KlMuTe6pQZlw0eXjl5rcTd6paKaVFWT5j6awr8kj7w==", "cpu": [ "arm64" ], @@ -2873,9 +2633,9 @@ } }, "node_modules/@nrwl/nx-linux-x64-gnu": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.9.2.tgz", - "integrity": "sha512-gHWsP5lbe4FNQCa1Q/VLxIuik+BqAOcSzyPjdUa4gCDcbxPa8xiE57PgXB5E1XUzOWNnDTlXa/Ll07/TIuKuog==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.9.4.tgz", + "integrity": "sha512-q4OyH72mdrE4KellBWtwpr5EwfxHKNoFP9//7FAILO68ROh0rpMd7YQMlTB7T04UEUHjKEEsFGTlVXIee3Viwg==", "cpu": [ "x64" ], @@ -2889,9 +2649,9 @@ } }, "node_modules/@nrwl/nx-linux-x64-musl": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.9.2.tgz", - "integrity": "sha512-EaFUukCbmoHsYECX2AS4pxXH933yesBFVvBgD38DkoFDxDoJMVt6JqYwm+d5R7S4R2P9U3l++aurljQTRq567Q==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.9.4.tgz", + "integrity": "sha512-67+/XNMR1CgLPyeGX8jqSG6l8yYD0iiwUgcu1Vaxq6N05WwnqVisIW8XzLSRUtKt4WyVQgOWk3aspImpMVOG3Q==", "cpu": [ "x64" ], @@ -2905,9 +2665,9 @@ } }, "node_modules/@nrwl/nx-win32-arm64-msvc": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.9.2.tgz", - "integrity": "sha512-PGAe7QMr51ivx1X3avvs8daNlvv1wGo3OFrobjlu5rSyjC1Y3qHwT9+wdlwzNZ93FIqWOq09s+rE5gfZRfpdAg==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.9.4.tgz", + "integrity": "sha512-2rEsq3eOGVCYpYJn2tTJkOGNJm/U8rP/FmqtZXYa6VJv/00XP3Gl00IXFEDaYV6rZo7SWqLxtEPUbjK5LwPzZA==", "cpu": [ "arm64" ], @@ -2921,9 +2681,9 @@ } }, "node_modules/@nrwl/nx-win32-x64-msvc": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.9.2.tgz", - "integrity": "sha512-Q8onNzhuAZ0l9DNkm8D4Z1AEIzJr8JiT4L2fVBLYrV/R75C2HS3q7lzvfo6oqMY6mXge1cFPcrTtg3YXBQaSWA==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.9.4.tgz", + "integrity": "sha512-bogVju4Z/hy1jbppqaTNbmV1R4Kg0R5fKxXAXC2LaL7FL0dup31wPumdV+mXttXBNOBDjV8V/Oz1ZqdmxpOJUw==", "cpu": [ "x64" ], @@ -2937,12 +2697,12 @@ } }, "node_modules/@nrwl/tao": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.9.2.tgz", - "integrity": "sha512-+LqNC37w9c6q6Ukdpf0z0tt1PQFNi4gwhHpJvkYQiKRETHjyrrlyqTNEPEyA7PI62RuYC6VrpVw2gzI7ufqZEA==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.9.4.tgz", + "integrity": "sha512-m90iz8UsXx1rgPm1dxsBQjSrCViWYZIrp8bpwjSCW24j3kifyilYSXGuKaRwZwUn7eNmH/kZcI9/8qeGIPF4Sg==", "dev": true, "dependencies": { - "nx": "15.9.2" + "nx": "15.9.4" }, "bin": { "tao": "index.js" @@ -3007,9 +2767,9 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz", - "integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA==", + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-17.1.1.tgz", + "integrity": "sha512-/X7Gh/qWiWaooJmUnYD48SYy72fyrk2ceisOSe89JojK7r0j8YrTwYpDi76kI+c6QiqX1KSgdoBTMJvktsDkYw==", "dev": true }, "node_modules/@octokit/plugin-enterprise-rest": { @@ -3135,12 +2895,12 @@ } }, "node_modules/@octokit/types": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz", - "integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.1.tgz", + "integrity": "sha512-Vx4keMiD/CAiwVFasLcH0xBSVbKIHebIZke9i7ZbUWGNN4vJFWSYH6Nvga7UY9NIJCGa6x3QG849XTbi5wYmkA==", "dev": true, "dependencies": { - "@octokit/openapi-types": "^16.0.0" + "@octokit/openapi-types": "^17.1.1" } }, "node_modules/@parcel/watcher": { @@ -3161,6 +2921,16 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.2.tgz", @@ -3323,13 +3093,13 @@ } }, "node_modules/@tufjs/models": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.3.tgz", - "integrity": "sha512-mkFEqqRisi13DmR5pX4x+Zk97EiU8djTtpNW1GeuX410y/raAsq/T3ZCjwoRIZ8/cIBfW0olK/sywlAiWevDVw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", + "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", "dev": true, "dependencies": { "@tufjs/canonical-json": "1.0.0", - "minimatch": "^7.4.6" + "minimatch": "^9.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -3345,15 +3115,15 @@ } }, "node_modules/@tufjs/models/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -3546,9 +3316,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.0.tgz", - "integrity": "sha512-0FLj93y5USLHdnhIhABk83rm8XEGA7kH3cr+YUlvxoUGp1xNt/DINUMvqPxLyOQMzLmZe8i4RTHbvb8MC7NmrA==", + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.6.tgz", + "integrity": "sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -3557,9 +3327,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.1", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.1.tgz", - "integrity": "sha512-8QZEV9+Kwy7tXFmjJrp3XUKQSs9LTnE0KnoUb0YCguWBiNW0Yfb2iBMYZ08WPg35IR6P3Z0s00B15SwZnO26+w==", + "version": "18.2.4", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.4.tgz", + "integrity": "sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==", "dev": true, "dependencies": { "@types/react": "*" @@ -3623,15 +3393,15 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.1.tgz", - "integrity": "sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", + "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.1", - "@typescript-eslint/type-utils": "5.59.1", - "@typescript-eslint/utils": "5.59.1", + "@typescript-eslint/scope-manager": "5.59.2", + "@typescript-eslint/type-utils": "5.59.2", + "@typescript-eslint/utils": "5.59.2", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -3657,13 +3427,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.1.tgz", - "integrity": "sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", + "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1" + "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/visitor-keys": "5.59.2" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3674,9 +3444,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.1.tgz", - "integrity": "sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", + "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3687,12 +3457,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.1.tgz", - "integrity": "sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", + "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/types": "5.59.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -3750,13 +3520,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.1.tgz", - "integrity": "sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", + "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.1", - "@typescript-eslint/utils": "5.59.1", + "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/utils": "5.59.2", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -3777,9 +3547,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.1.tgz", - "integrity": "sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", + "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3790,13 +3560,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.1.tgz", - "integrity": "sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", + "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1", + "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/visitor-keys": "5.59.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3817,12 +3587,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.1.tgz", - "integrity": "sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", + "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/types": "5.59.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -3876,17 +3646,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.1.tgz", - "integrity": "sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", + "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.1", - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/typescript-estree": "5.59.1", + "@typescript-eslint/scope-manager": "5.59.2", + "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/typescript-estree": "5.59.2", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -3902,13 +3672,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.1.tgz", - "integrity": "sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", + "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1" + "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/visitor-keys": "5.59.2" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3919,9 +3689,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.1.tgz", - "integrity": "sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", + "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3932,13 +3702,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.1.tgz", - "integrity": "sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", + "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1", + "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/visitor-keys": "5.59.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3959,12 +3729,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.1.tgz", - "integrity": "sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==", + "version": "5.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", + "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/types": "5.59.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -3994,43 +3764,51 @@ } }, "node_modules/@vitest/coverage-c8": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.30.1.tgz", - "integrity": "sha512-/Wa3dtSuckpdngAmiCwowaEXXgJkqPrtfvrs9HTB9QoEfNbZWPu4E4cjEn4lJZb4qcGf4fxFtUA2f9DnDNAzBA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.31.0.tgz", + "integrity": "sha512-h72qN1D962AO7UefQVulm9JFP5ACS7OfhCdBHioXU8f7ohH/+NTZCgAqmgcfRNHHO/8wLFxx+93YVxhodkEJVA==", "dev": true, "dependencies": { + "@ampproject/remapping": "^2.2.0", "c8": "^7.13.0", + "magic-string": "^0.30.0", "picocolors": "^1.0.0", "std-env": "^3.3.2" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://opencollective.com/vitest" }, "peerDependencies": { "vitest": ">=0.30.0 <1" } }, "node_modules/@vitest/expect": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.30.1.tgz", - "integrity": "sha512-c3kbEtN8XXJSeN81iDGq29bUzSjQhjES2WR3aColsS4lPGbivwLtas4DNUe0jD9gg/FYGIteqOenfU95EFituw==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.0.tgz", + "integrity": "sha512-Jlm8ZTyp6vMY9iz9Ny9a0BHnCG4fqBa8neCF6Pk/c/6vkUk49Ls6UBlgGAU82QnzzoaUs9E/mUhq/eq9uMOv/g==", "dev": true, "dependencies": { - "@vitest/spy": "0.30.1", - "@vitest/utils": "0.30.1", + "@vitest/spy": "0.31.0", + "@vitest/utils": "0.31.0", "chai": "^4.3.7" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.30.1.tgz", - "integrity": "sha512-W62kT/8i0TF1UBCNMRtRMOBWJKRnNyv9RrjIgdUryEe0wNpGZvvwPDLuzYdxvgSckzjp54DSpv1xUbv4BQ0qVA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.0.tgz", + "integrity": "sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==", "dev": true, "dependencies": { - "@vitest/utils": "0.30.1", + "@vitest/utils": "0.31.0", "concordance": "^5.0.4", "p-limit": "^4.0.0", "pathe": "^1.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner/node_modules/p-limit": { @@ -4061,14 +3839,17 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.30.1.tgz", - "integrity": "sha512-fJZqKrE99zo27uoZA/azgWyWbFvM1rw2APS05yB0JaLwUIg9aUtvvnBf4q7JWhEcAHmSwbrxKFgyBUga6tq9Tw==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.0.tgz", + "integrity": "sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==", "dev": true, "dependencies": { "magic-string": "^0.30.0", "pathe": "^1.1.0", "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot/node_modules/ansi-styles": { @@ -4104,23 +3885,29 @@ "dev": true }, "node_modules/@vitest/spy": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.30.1.tgz", - "integrity": "sha512-YfJeIf37GvTZe04ZKxzJfnNNuNSmTEGnla2OdL60C8od16f3zOfv9q9K0nNii0NfjDJRt/CVN/POuY5/zTS+BA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.0.tgz", + "integrity": "sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==", "dev": true, "dependencies": { "tinyspy": "^2.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.30.1.tgz", - "integrity": "sha512-/c8Xv2zUVc+rnNt84QF0Y0zkfxnaGhp87K2dYJMLtLOIckPzuxLVzAtFCicGFdB4NeBHNzTRr1tNn7rCtQcWFA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.0.tgz", + "integrity": "sha512-kahaRyLX7GS1urekRXN2752X4gIgOGVX4Wo8eDUGUkTWlGpXzf5ZS6N9RUUS+Re3XEE8nVGqNyxkSxF5HXlGhQ==", "dev": true, "dependencies": { "concordance": "^5.0.4", "loupe": "^2.3.6", "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils/node_modules/ansi-styles": { @@ -4162,9 +3949,9 @@ "dev": true }, "node_modules/@yarnpkg/parsers": { - "version": "3.0.0-rc.42", - "resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.42.tgz", - "integrity": "sha512-eW9Mbegmb5bJjwawJM9ghjUjUqciNMhC6L7XrQPF/clXS5bbP66MstsgCT5hy9VlfUh/CfBT+0Wucf531dMjHA==", + "version": "3.0.0-rc.43", + "resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.43.tgz", + "integrity": "sha512-AhFF3mIDfA+jEwQv2WMHmiYhOvmdbh2qhUkDVQfiqzQtUwS4BgoWwom5NpSPg4Ix5vOul+w1690Bt21CkVLpgg==", "dev": true, "dependencies": { "js-yaml": "^3.10.0", @@ -4509,9 +4296,9 @@ } }, "node_modules/axios": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.5.tgz", - "integrity": "sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", "dev": true, "dependencies": { "follow-redirects": "^1.15.0", @@ -4583,14 +4370,26 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/bin-links/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/bin-links/node_modules/write-file-atomic": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.0.tgz", - "integrity": "sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4829,21 +4628,20 @@ } }, "node_modules/cacache": { - "version": "17.0.5", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.5.tgz", - "integrity": "sha512-Y/PRQevNSsjAPWykl9aeGz8Pr+OI6BYM9fYDNMvOkuUiG9IhG4LEmaYrZZZvioMUEQ+cBCxT0v8wrnCURccyKA==", + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.0.tgz", + "integrity": "sha512-hXpFU+Z3AfVmNuiLve1qxWHMq0RSIt5gjCKAHi/M6DktwFwDdAXAtunl1i4WSKaaVcU9IsRvXFg42jTHigcC6Q==", "dev": true, "dependencies": { "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", - "glob": "^9.3.1", + "glob": "^10.2.2", "lru-cache": "^7.7.1", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", "ssri": "^10.0.0", "tar": "^6.1.11", "unique-filename": "^3.0.0" @@ -4861,16 +4659,36 @@ "balanced-match": "^1.0.0" } }, + "node_modules/cacache/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/cacache/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.2.tgz", + "integrity": "sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -4880,9 +4698,9 @@ } }, "node_modules/cacache/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -4894,13 +4712,34 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/cacache/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacache/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/cacache/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -5859,6 +5698,12 @@ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -6124,15 +5969,15 @@ } }, "node_modules/eslint": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz", - "integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==", + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", + "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.2", - "@eslint/js": "8.39.0", + "@eslint/eslintrc": "^2.0.3", + "@eslint/js": "8.40.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -6143,8 +5988,8 @@ "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.0", - "espree": "^9.5.1", + "eslint-visitor-keys": "^3.4.1", + "espree": "^9.5.2", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -6198,9 +6043,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", - "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6235,14 +6080,14 @@ } }, "node_modules/espree": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz", - "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", + "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.0" + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6806,17 +6651,26 @@ } }, "node_modules/fs-minipass": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", - "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", + "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -8266,6 +8120,24 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.0.tgz", + "integrity": "sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jake": { "version": "10.8.5", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", @@ -8292,6 +8164,10 @@ "resolved": "examples/concepts/access-protection", "link": true }, + "node_modules/jitar-contact-list": { + "resolved": "examples/apps/contact-list", + "link": true + }, "node_modules/jitar-cors-example": { "resolved": "examples/concepts/cors", "link": true @@ -8324,14 +8200,6 @@ "resolved": "examples/concepts/multi-version", "link": true }, - "node_modules/jitar-react": { - "resolved": "examples/apps/contact-list", - "link": true - }, - "node_modules/jitar-run-procedure-example": { - "resolved": "examples/concepts/run-procedure", - "link": true - }, "node_modules/jitar-segmentation-example": { "resolved": "examples/concepts/segmentation", "link": true @@ -8510,19 +8378,19 @@ } }, "node_modules/kolorist": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.7.0.tgz", - "integrity": "sha512-ymToLHqL02udwVdbkowNpzjFd6UzozMtshPQKVi5k1EjKRqKqBrOnE9QbLEb0/pV76SAiIT13hdL8R6suc+f3g==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==" }, "node_modules/lerna": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.6.1.tgz", - "integrity": "sha512-WJtrvmbmR+6hMB9b5pvsxJzew0lRL6hARgW/My9BM4vYaxwPIA2I0riv3qQu5Zd7lYse7FEqJkTnl9Kn1bXhLA==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.6.2.tgz", + "integrity": "sha512-W4qrGhcdutkRdHEaDf9eqp7u4JvI+1TwFy5woX6OI8WPe4PYBdxuILAsvhp614fUG41rKSGDKlOh+AWzdSidTg==", "dev": true, "dependencies": { - "@lerna/child-process": "6.6.1", - "@lerna/create": "6.6.1", - "@lerna/legacy-package-management": "6.6.1", + "@lerna/child-process": "6.6.2", + "@lerna/create": "6.6.2", + "@lerna/legacy-package-management": "6.6.2", "@npmcli/arborist": "6.2.3", "@npmcli/run-script": "4.1.7", "@nrwl/devkit": ">=15.5.2 < 16", @@ -8556,8 +8424,8 @@ "is-ci": "2.0.0", "is-stream": "2.0.0", "js-yaml": "^4.1.0", - "libnpmaccess": "6.0.3", - "libnpmpublish": "6.0.4", + "libnpmaccess": "^6.0.3", + "libnpmpublish": "7.1.4", "load-json-file": "6.2.0", "make-dir": "3.1.0", "minimatch": "3.0.5", @@ -8574,7 +8442,7 @@ "p-queue": "6.6.2", "p-reduce": "2.1.0", "p-waterfall": "2.1.1", - "pacote": "13.6.2", + "pacote": "15.1.1", "pify": "5.0.0", "read-cmd-shim": "3.0.0", "read-package-json": "5.0.1", @@ -8601,7 +8469,7 @@ "lerna": "dist/cli.js" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" } }, "node_modules/lerna/node_modules/chalk": { @@ -8863,100 +8731,100 @@ } }, "node_modules/libnpmpublish": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-6.0.4.tgz", - "integrity": "sha512-lvAEYW8mB8QblL6Q/PI/wMzKNvIrF7Kpujf/4fGS/32a2i3jzUXi04TNyIBcK6dQJ34IgywfaKGh+Jq4HYPFmg==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-7.1.4.tgz", + "integrity": "sha512-mMntrhVwut5prP4rJ228eEbEyvIzLWhqFuY90j5QeXBCTT2pWSMno7Yo2S2qplPUr02zPurGH4heGLZ+wORczg==", "dev": true, "dependencies": { - "normalize-package-data": "^4.0.0", - "npm-package-arg": "^9.0.1", - "npm-registry-fetch": "^13.0.0", + "ci-info": "^3.6.1", + "normalize-package-data": "^5.0.0", + "npm-package-arg": "^10.1.0", + "npm-registry-fetch": "^14.0.3", + "proc-log": "^3.0.0", "semver": "^7.3.7", - "ssri": "^9.0.0" + "sigstore": "^1.4.0", + "ssri": "^10.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/hosted-git-info": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", - "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", + "node_modules/libnpmpublish/node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, "node_modules/libnpmpublish/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { "node": ">=8" } }, "node_modules/libnpmpublish/node_modules/normalize-package-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", - "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^6.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/libnpmpublish/node_modules/npm-package-arg": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", - "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/npm-registry-fetch": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz", - "integrity": "sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw==", + "node_modules/libnpmpublish/node_modules/ssri": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "make-fetch-happen": "^10.0.6", - "minipass": "^3.1.6", - "minipass-fetch": "^2.0.3", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^9.0.1", - "proc-log": "^2.0.0" + "minipass": "^5.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/proc-log": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", - "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "node_modules/libnpmpublish/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, + "dependencies": { + "builtins": "^5.0.0" + }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/lines-and-columns": { @@ -9821,9 +9689,9 @@ } }, "node_modules/mongodb": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.3.0.tgz", - "integrity": "sha512-Wy/sbahguL8c3TXQWXmuBabiLD+iVmz+tOgQf+FwkCjhUIorqbAxRbbz00g4ZoN4sXIPwpAlTANMaGRjGGTikQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.4.0.tgz", + "integrity": "sha512-6GDKgO7WiYUw+ILap143VXfAou06hjxDGgYUZWGnI4hgoZfP3el0G3l69JqJF8SEQbZmC+SN/2a0aWI/aWJoxA==", "dependencies": { "bson": "^5.2.0", "mongodb-connection-string-url": "^2.6.0", @@ -10167,9 +10035,9 @@ } }, "node_modules/npm-normalize-package-bin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.0.tgz", - "integrity": "sha512-g+DPQSkusnk7HYXr75NtzkIP4+N81i3RPsGFidF3DzHd9MT9wWngmqoeg/fnHFz5MNdtG4w03s+QnhewSLTT2Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", + "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", "dev": true, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -10304,13 +10172,13 @@ } }, "node_modules/npm-registry-fetch": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.4.tgz", - "integrity": "sha512-pMS2DRkwg+M44ct65zrN/Cr9IHK1+n6weuefAo6Er4lc+/8YBCU0Czq04H3ZiSigluh7pb2rMM5JpgcytctB+Q==", + "version": "14.0.5", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", + "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==", "dev": true, "dependencies": { "make-fetch-happen": "^11.0.0", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", @@ -10322,9 +10190,9 @@ } }, "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.0.tgz", - "integrity": "sha512-7ChuOzCb1LzdQZrTy0ky6RsCoMYeM+Fh4cY0+4zsJVhNcH5Q3OJojLY1mGkD0xAhWB29lskECVb6ZopofwjldA==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", + "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -10334,7 +10202,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -10347,13 +10215,22 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm-registry-fetch/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/npm-registry-fetch/node_modules/minipass-fetch": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.2.tgz", - "integrity": "sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", + "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -10380,12 +10257,12 @@ } }, "node_modules/npm-registry-fetch/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -10594,14 +10471,14 @@ } }, "node_modules/nx": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/nx/-/nx-15.9.2.tgz", - "integrity": "sha512-wtcs+wsuplSckvgk+bV+/XuGlo+sVWzSG0RpgWBjQYeqA3QsVFEAPVY66Z5cSoukDbTV77ddcAjEw+Rz8oOR1A==", + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.9.4.tgz", + "integrity": "sha512-P1G4t59UvE/lkHyruLeSOB5ZuNyh01IwU0tTUOi8f9s/NbP7+OQ8MYVwDV74JHTr6mQgjlS+n+4Eox8tVm9itA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@nrwl/cli": "15.9.2", - "@nrwl/tao": "15.9.2", + "@nrwl/cli": "15.9.4", + "@nrwl/tao": "15.9.4", "@parcel/watcher": "2.0.4", "@yarnpkg/lockfile": "^1.1.0", "@yarnpkg/parsers": "^3.0.0-rc.18", @@ -10640,15 +10517,15 @@ "nx": "bin/nx.js" }, "optionalDependencies": { - "@nrwl/nx-darwin-arm64": "15.9.2", - "@nrwl/nx-darwin-x64": "15.9.2", - "@nrwl/nx-linux-arm-gnueabihf": "15.9.2", - "@nrwl/nx-linux-arm64-gnu": "15.9.2", - "@nrwl/nx-linux-arm64-musl": "15.9.2", - "@nrwl/nx-linux-x64-gnu": "15.9.2", - "@nrwl/nx-linux-x64-musl": "15.9.2", - "@nrwl/nx-win32-arm64-msvc": "15.9.2", - "@nrwl/nx-win32-x64-msvc": "15.9.2" + "@nrwl/nx-darwin-arm64": "15.9.4", + "@nrwl/nx-darwin-x64": "15.9.4", + "@nrwl/nx-linux-arm-gnueabihf": "15.9.4", + "@nrwl/nx-linux-arm64-gnu": "15.9.4", + "@nrwl/nx-linux-arm64-musl": "15.9.4", + "@nrwl/nx-linux-x64-gnu": "15.9.4", + "@nrwl/nx-linux-x64-musl": "15.9.4", + "@nrwl/nx-win32-arm64-msvc": "15.9.4", + "@nrwl/nx-win32-x64-msvc": "15.9.4" }, "peerDependencies": { "@swc-node/register": "^1.4.2", @@ -11028,268 +10905,263 @@ } }, "node_modules/pacote": { - "version": "13.6.2", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.2.tgz", - "integrity": "sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg==", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.1.1.tgz", + "integrity": "sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ==", "dev": true, "dependencies": { - "@npmcli/git": "^3.0.0", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/run-script": "^4.1.0", - "cacache": "^16.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "infer-owner": "^1.0.4", - "minipass": "^3.1.6", - "mkdirp": "^1.0.4", - "npm-package-arg": "^9.0.0", - "npm-packlist": "^5.1.0", - "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.1", - "proc-log": "^2.0.0", + "@npmcli/git": "^4.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/run-script": "^6.0.0", + "cacache": "^17.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^4.0.0", + "npm-package-arg": "^10.0.0", + "npm-packlist": "^7.0.0", + "npm-pick-manifest": "^8.0.0", + "npm-registry-fetch": "^14.0.0", + "proc-log": "^3.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^5.0.0", - "read-package-json-fast": "^2.0.3", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", + "read-package-json": "^6.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^1.0.0", + "ssri": "^10.0.0", "tar": "^6.1.11" }, "bin": { "pacote": "lib/bin.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/pacote/node_modules/@npmcli/fs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", - "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", - "dev": true, - "dependencies": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/@npmcli/installed-package-contents": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", - "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", + "node_modules/pacote/node_modules/@npmcli/promise-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "dependencies": { - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - }, - "bin": { - "installed-package-contents": "index.js" + "which": "^3.0.0" }, "engines": { - "node": ">= 10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/cacache": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", - "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", + "node_modules/pacote/node_modules/@npmcli/run-script": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.1.tgz", + "integrity": "sha512-Yi04ZSold8jcbBJD/ahKMJSQCQifH8DAbMwkBvoLaTpGFxzHC3B/5ZyoVR69q/4xedz84tvi9DJOJjNe17h+LA==", "dev": true, "dependencies": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^2.0.0" + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^6.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "node_modules/pacote/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" + "balanced-match": "^1.0.0" } }, - "node_modules/pacote/node_modules/hosted-git-info": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", - "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", + "node_modules/pacote/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pacote/node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/pacote/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/pacote/node_modules/glob": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.2.tgz", + "integrity": "sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/glob/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/pacote/node_modules/npm-bundled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", - "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "node_modules/pacote/node_modules/ignore-walk": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.3.tgz", + "integrity": "sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==", "dev": true, "dependencies": { - "npm-normalize-package-bin": "^1.0.1" + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/npm-install-checks": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", - "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", + "node_modules/pacote/node_modules/minimatch": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { - "semver": "^7.1.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pacote/node_modules/npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true - }, - "node_modules/pacote/node_modules/npm-package-arg": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", - "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", + "node_modules/pacote/node_modules/normalize-package-data": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/npm-pick-manifest": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", - "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", + "node_modules/pacote/node_modules/npm-package-arg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "dependencies": { - "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^2.0.0", - "npm-package-arg": "^9.0.0", - "semver": "^7.3.5" + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", - "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "node_modules/pacote/node_modules/npm-packlist": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", "dev": true, + "dependencies": { + "ignore-walk": "^6.0.0" + }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/npm-registry-fetch": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz", - "integrity": "sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw==", + "node_modules/pacote/node_modules/read-package-json": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.3.tgz", + "integrity": "sha512-4QbpReW4kxFgeBQ0vPAqh2y8sXEB3D4t3jsXbJKIhBiF80KT6XRo45reqwtftju5J6ru1ax06A2Gb/wM1qCOEQ==", "dev": true, "dependencies": { - "make-fetch-happen": "^10.0.6", - "minipass": "^3.1.6", - "minipass-fetch": "^2.0.3", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^9.0.1", - "proc-log": "^2.0.0" + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/proc-log": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", - "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "node_modules/pacote/node_modules/signal-exit": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", "dev": true, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pacote/node_modules/read-package-json-fast": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", - "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "node_modules/pacote/node_modules/ssri": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" + "minipass": "^5.0.0" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/unique-filename": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", - "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", + "node_modules/pacote/node_modules/ssri/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pacote/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "dependencies": { - "unique-slug": "^3.0.0" + "builtins": "^5.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/unique-slug": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", - "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", + "node_modules/pacote/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "dependencies": { - "imurmurhash": "^0.1.4" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/parent-module": { @@ -11576,13 +11448,13 @@ } }, "node_modules/pkg-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.2.tgz", - "integrity": "sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, "dependencies": { "jsonc-parser": "^3.2.0", - "mlly": "^1.1.1", + "mlly": "^1.2.0", "pathe": "^1.1.0" } }, @@ -11614,9 +11486,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", - "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.12.tgz", + "integrity": "sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -12337,9 +12209,9 @@ } }, "node_modules/rollup": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.0.tgz", - "integrity": "sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ==", + "version": "3.21.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.5.tgz", + "integrity": "sha512-a4NTKS4u9PusbUJcfF4IMxuqjFzjm6ifj76P54a7cKnvVzJaG12BLVR+hgU2YDGHzyMMQNxLAZWuALsn8q2oQg==", "bin": { "rollup": "dist/bin/rollup" }, @@ -12642,9 +12514,9 @@ "dev": true }, "node_modules/sigstore": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.3.0.tgz", - "integrity": "sha512-dhdv+jOAi1RgLHw13lxumk3rlgZtumUz9QrCNPTx9MazUnUV3BfAb74oYAMPQQ7uaeogB5vTosbz3POzKbEHUQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.4.0.tgz", + "integrity": "sha512-N7TRpSbFjY/TrFDg6yGAQSYBrQ5s6qmPiq4pD6fkv1LoyfMsLG0NwZWG2s5q+uttLHgyVyTa0Rogx2P78rN8kQ==", "dev": true, "dependencies": { "@sigstore/protobuf-specs": "^0.1.0", @@ -12659,9 +12531,9 @@ } }, "node_modules/sigstore/node_modules/make-fetch-happen": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.0.tgz", - "integrity": "sha512-7ChuOzCb1LzdQZrTy0ky6RsCoMYeM+Fh4cY0+4zsJVhNcH5Q3OJojLY1mGkD0xAhWB29lskECVb6ZopofwjldA==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", + "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -12671,7 +12543,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -12684,13 +12556,22 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/sigstore/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/sigstore/node_modules/minipass-fetch": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.2.tgz", - "integrity": "sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", + "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -12702,12 +12583,12 @@ } }, "node_modules/sigstore/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -12942,6 +12823,21 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.padend": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.4.tgz", @@ -13015,6 +12911,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -13323,9 +13232,9 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.4.0.tgz", - "integrity": "sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz", + "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==", "dev": true, "engines": { "node": ">=14.0.0" @@ -13467,22 +13376,22 @@ "dev": true }, "node_modules/tuf-js": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.4.tgz", - "integrity": "sha512-Lw2JRM3HTYhEtQJM2Th3aNCPbnXirtWMl065BawwmM2pX6XStH/ZO9e8T2hh0zk/HUa+1i6j+Lv6eDitKTau6A==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.5.tgz", + "integrity": "sha512-inqodgxdsmuxrtQVbu6tPNgRKWD1Boy3VB6GO7KczJZpAHiTukwhSzXUSzvDcw5pE2Jo8ua+e1ykpHv7VdPVlQ==", "dev": true, "dependencies": { - "@tufjs/models": "1.0.3", - "make-fetch-happen": "^11.0.1" + "@tufjs/models": "1.0.4", + "make-fetch-happen": "^11.1.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/tuf-js/node_modules/make-fetch-happen": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.0.tgz", - "integrity": "sha512-7ChuOzCb1LzdQZrTy0ky6RsCoMYeM+Fh4cY0+4zsJVhNcH5Q3OJojLY1mGkD0xAhWB29lskECVb6ZopofwjldA==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", + "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -13492,7 +13401,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -13505,13 +13414,22 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/tuf-js/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/tuf-js/node_modules/minipass-fetch": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.2.tgz", - "integrity": "sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", + "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -13523,12 +13441,12 @@ } }, "node_modules/tuf-js/node_modules/ssri": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.3.tgz", - "integrity": "sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", "dev": true, "dependencies": { - "minipass": "^4.0.0" + "minipass": "^5.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -13613,9 +13531,9 @@ } }, "node_modules/ufo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.1.tgz", - "integrity": "sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, "node_modules/uglify-js": { @@ -13836,9 +13754,9 @@ } }, "node_modules/vite": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.4.tgz", - "integrity": "sha512-f90aqGBoxSFxWph2b39ae2uHAxm5jFBBdnfueNxZAT1FTpM13ccFQExCaKbR2xFW5atowjleRniQ7onjJ22QEg==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==", "dependencies": { "esbuild": "^0.17.5", "postcss": "^8.4.23", @@ -13883,9 +13801,9 @@ } }, "node_modules/vite-node": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.30.1.tgz", - "integrity": "sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.0.tgz", + "integrity": "sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -13902,23 +13820,23 @@ "node": ">=v14.18.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://opencollective.com/vitest" } }, "node_modules/vitest": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.30.1.tgz", - "integrity": "sha512-y35WTrSTlTxfMLttgQk4rHcaDkbHQwDP++SNwPb+7H8yb13Q3cu2EixrtHzF27iZ8v0XCciSsLg00RkPAzB/aA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.0.tgz", + "integrity": "sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==", "dev": true, "dependencies": { "@types/chai": "^4.3.4", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.30.1", - "@vitest/runner": "0.30.1", - "@vitest/snapshot": "0.30.1", - "@vitest/spy": "0.30.1", - "@vitest/utils": "0.30.1", + "@vitest/expect": "0.31.0", + "@vitest/runner": "0.31.0", + "@vitest/snapshot": "0.31.0", + "@vitest/spy": "0.31.0", + "@vitest/utils": "0.31.0", "acorn": "^8.8.2", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -13929,13 +13847,12 @@ "magic-string": "^0.30.0", "pathe": "^1.1.0", "picocolors": "^1.0.0", - "source-map": "^0.6.1", "std-env": "^3.3.2", "strip-literal": "^1.0.1", "tinybench": "^2.4.0", - "tinypool": "^0.4.0", + "tinypool": "^0.5.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.30.1", + "vite-node": "0.31.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -13945,7 +13862,7 @@ "node": ">=v14.18.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", @@ -14131,6 +14048,24 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -14343,7 +14278,7 @@ "version": "0.0.8", "license": "MIT", "dependencies": { - "kolorist": "1.7.0", + "kolorist": "1.8.0", "minimist": "^1.2.8", "prompts": "^2.4.2" }, @@ -14375,7 +14310,7 @@ "glob-promise": "6.0.2", "mime-types": "^2.1.35", "tslog": "^4.8.2", - "yargs": "^17.7.1", + "yargs": "^17.7.2", "zod": "^3.21.4" }, "engines": { @@ -14390,7 +14325,7 @@ "@jitar/reflection": "^0.4.0" }, "peerDependencies": { - "vite": "^4.1.4" + "vite": "^4.3.5" } }, "packages/reflection": { diff --git a/package.json b/package.json index ceb2053e..be73696b 100644 --- a/package.json +++ b/package.json @@ -44,15 +44,15 @@ "@types/mime-types": "^2.1.1", "@types/prompts": "^2.4.4", "@types/yargs": "^17.0.24", - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@vitest/coverage-c8": "^0.30.1", + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@vitest/coverage-c8": "^0.31.0", "degit": "^2.8.4", - "eslint": "^8.39.0", + "eslint": "^8.40.0", "eslint-plugin-jitar": "0.0.1", - "lerna": "^6.6.1", - "rollup": "^3.21.0", + "lerna": "^6.6.2", + "rollup": "^3.21.5", "rollup-plugin-dts": "^5.3.0", - "vite": "^4.3.3", - "vitest": "^0.30.1" + "vite": "^4.3.5", + "vitest": "^0.31.0" } } \ No newline at end of file diff --git a/packages/create-jitar/package.json b/packages/create-jitar/package.json index 588d4178..e137d0c1 100644 --- a/packages/create-jitar/package.json +++ b/packages/create-jitar/package.json @@ -35,7 +35,7 @@ "dependencies": { "minimist": "^1.2.8", "prompts": "^2.4.2", - "kolorist": "1.7.0" + "kolorist": "1.8.0" }, "repository": { "type": "git", diff --git a/packages/jitar/package.json b/packages/jitar/package.json index 33fa8ce7..32f6d7e7 100644 --- a/packages/jitar/package.json +++ b/packages/jitar/package.json @@ -28,7 +28,7 @@ "glob-promise": "6.0.2", "mime-types": "^2.1.35", "tslog": "^4.8.2", - "yargs": "^17.7.1", + "yargs": "^17.7.2", "zod": "^3.21.4" }, "engines": { diff --git a/packages/plugin-vite/package.json b/packages/plugin-vite/package.json index e7b8f676..7be47ba9 100644 --- a/packages/plugin-vite/package.json +++ b/packages/plugin-vite/package.json @@ -22,7 +22,7 @@ "@jitar/reflection": "^0.4.0" }, "peerDependencies": { - "vite": "^4.1.4" + "vite": "^4.3.5" }, "repository": { "type": "git", From af10af29acef5de3762e6a70be8e186d6e275fcb Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Mon, 8 May 2023 09:38:45 +0200 Subject: [PATCH 13/14] We prefer to go for functions --- examples/apps/contact-list/README.md | 6 +++--- examples/concepts/access-protection/README.md | 2 +- examples/concepts/cors/README.md | 2 +- examples/concepts/data-transportation/README.md | 2 +- examples/concepts/error-handling/README.md | 2 +- examples/concepts/health-checks/README.md | 2 +- examples/concepts/hello-world/README.md | 2 +- examples/concepts/load-balancing/README.md | 2 +- examples/concepts/middleware/README.md | 2 +- examples/concepts/multi-version/README.md | 2 +- examples/concepts/node-client/README.md | 2 +- examples/concepts/segmentation/README.md | 4 ++-- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/apps/contact-list/README.md b/examples/apps/contact-list/README.md index a7bc3ce4..b096f2cf 100644 --- a/examples/apps/contact-list/README.md +++ b/examples/apps/contact-list/README.md @@ -2,11 +2,11 @@ # Jitar | Contact list This example contact list application is build with React, MongoDB and Jitar (ReMoJi stack). -It includes frontend and backend components and a database for storing contacts. +It includes frontend and backend functions and a database for storing contacts. ## Project setup -**Procedures** +**Functions** * createId (`src/shared/common/createId.ts`) * getCollection (`src/shared/common/getCollection.ts`) @@ -22,7 +22,7 @@ It includes frontend and backend components and a database for storing contacts. **Segments** -* Server - contains all *shared* procedures (`segments/server.segment.json`) +* Server - contains all *shared* functions (`segments/server.segment.json`) **Services** diff --git a/examples/concepts/access-protection/README.md b/examples/concepts/access-protection/README.md index 23fc549d..595cbea5 100644 --- a/examples/concepts/access-protection/README.md +++ b/examples/concepts/access-protection/README.md @@ -8,7 +8,7 @@ The procedure to get the secret has been made private to ensure it isn't accessi ## Project setup -**Procedures** +**Functions** * checkSecret (`src/game/checkSecret.ts`) * getSecret (`src/game/getSecret.ts`) diff --git a/examples/concepts/cors/README.md b/examples/concepts/cors/README.md index 9bfde7db..bdbb38b5 100644 --- a/examples/concepts/cors/README.md +++ b/examples/concepts/cors/README.md @@ -7,7 +7,7 @@ The application contains a single procedure that returns the weather forecast. T ## Project setup -**Procedures** +**Functions** * getWeatherForecast (`src/getWeatherForecase.ts`) diff --git a/examples/concepts/data-transportation/README.md b/examples/concepts/data-transportation/README.md index d0563455..bd9d1c0d 100644 --- a/examples/concepts/data-transportation/README.md +++ b/examples/concepts/data-transportation/README.md @@ -7,7 +7,7 @@ The application simulates a helpdesk where a person can register for an account. ## Project setup -**Procedures** +**Functions** * createAccount (`src/account/createAccount.ts`) * register (`src/helpdesk/register.ts`) diff --git a/examples/concepts/error-handling/README.md b/examples/concepts/error-handling/README.md index 756ead4a..7b4f3889 100644 --- a/examples/concepts/error-handling/README.md +++ b/examples/concepts/error-handling/README.md @@ -7,7 +7,7 @@ The application contains a procedure to get data from a database and a procedure ## Project setup -**Procedures** +**Functions** * getData (`src/sales/getData.ts`) * exportData (`src/sales/exportData.ts`) diff --git a/examples/concepts/health-checks/README.md b/examples/concepts/health-checks/README.md index eae4f5c7..8e71cafd 100644 --- a/examples/concepts/health-checks/README.md +++ b/examples/concepts/health-checks/README.md @@ -5,7 +5,7 @@ This example demonstrates how to create heath checks and request the health of a ## Project setup -**Procedures** +**Functions** * DatabaseHealthCheck (`src/DatabaseHealthCheck.ts`) diff --git a/examples/concepts/hello-world/README.md b/examples/concepts/hello-world/README.md index 1fedb9ab..3643e2bb 100644 --- a/examples/concepts/hello-world/README.md +++ b/examples/concepts/hello-world/README.md @@ -5,7 +5,7 @@ This example demonstrates the simplest Jitar application possible. ## Project setup -**Procedures** +**Functions** * sayHello (`src/sayHello.ts`) diff --git a/examples/concepts/load-balancing/README.md b/examples/concepts/load-balancing/README.md index e341070e..f326bddd 100644 --- a/examples/concepts/load-balancing/README.md +++ b/examples/concepts/load-balancing/README.md @@ -7,7 +7,7 @@ The application contains simple calculator tasks that are placed in a single seg ## Project setup -**Procedures** +**Functions** * add (`src/calculator/add.ts`) * subtract (`src/calculator/subtract.ts`) diff --git a/examples/concepts/middleware/README.md b/examples/concepts/middleware/README.md index 9486445a..0866da30 100644 --- a/examples/concepts/middleware/README.md +++ b/examples/concepts/middleware/README.md @@ -7,7 +7,7 @@ The application implements a simple logging middleware. ## Project setup -**Procedures** +**Functions** * ping (`src/ping.ts`) diff --git a/examples/concepts/multi-version/README.md b/examples/concepts/multi-version/README.md index ae72eb00..1879892a 100644 --- a/examples/concepts/multi-version/README.md +++ b/examples/concepts/multi-version/README.md @@ -7,7 +7,7 @@ The application returns two different versions of an employee. ## Project setup -**Procedures** +**Functions** * getEmployee (`src/getEmployee.ts`) * getEmployeeV2 (`src/getEmployee.ts`) diff --git a/examples/concepts/node-client/README.md b/examples/concepts/node-client/README.md index 04785aa7..654335e2 100644 --- a/examples/concepts/node-client/README.md +++ b/examples/concepts/node-client/README.md @@ -7,7 +7,7 @@ The client start hook can be used to start any client (browser or Node), and the ## Project setup -**Procedures** +**Functions** * getLuckyNumber (`src/getLuckyNumber.ts`) diff --git a/examples/concepts/segmentation/README.md b/examples/concepts/segmentation/README.md index 298d05b7..981c032f 100644 --- a/examples/concepts/segmentation/README.md +++ b/examples/concepts/segmentation/README.md @@ -7,7 +7,7 @@ The application is a simple report creation that separates the data from the pro ## Project setup -**Procedures** +**Functions** * getData (`src/reporting/getData.ts`) * createStatistics (`src/reporting/createStatistics.ts`) @@ -68,7 +68,7 @@ npm run data **Process segment** (terminal 4) ```bash -npm run node2 +npm run process ``` The ``requests.http`` file contains example requests to call the procedures. From 918b02df6b903d36e051a590f5169ed0e81c4ec9 Mon Sep 17 00:00:00 2001 From: Peter van Vliet Date: Mon, 8 May 2023 10:19:04 +0200 Subject: [PATCH 14/14] #235: Updated readme files with additional information --- examples/concepts/cors/README.md | 9 ++++++--- examples/concepts/data-transportation/README.md | 7 ++++--- examples/concepts/error-handling/README.md | 3 ++- examples/concepts/error-handling/requests.http | 2 +- examples/concepts/error-handling/src/sales/exportData.ts | 2 +- examples/concepts/health-checks/README.md | 4 +++- examples/concepts/hello-world/README.md | 2 ++ examples/concepts/load-balancing/README.md | 3 ++- examples/concepts/multi-version/README.md | 3 ++- examples/concepts/node-client/README.md | 7 ++++--- 10 files changed, 27 insertions(+), 15 deletions(-) diff --git a/examples/concepts/cors/README.md b/examples/concepts/cors/README.md index bdbb38b5..c89fec67 100644 --- a/examples/concepts/cors/README.md +++ b/examples/concepts/cors/README.md @@ -3,13 +3,16 @@ This example demonstrates how to enable CORS. -The application contains a single procedure that returns the weather forecast. The index.html file contains a simple form that calls the procedure and displays the result. +The application shows a fake weather forecast app. +The procedure is called by an external client (index.html) using Jitar's RPC API. +For serving the HTML file we've created a simple web server. +Because Jitar and the web server both run on a different port, a CORS rule is required to make this work. ## Project setup **Functions** -* getWeatherForecast (`src/getWeatherForecase.ts`) +* getWeatherForecast (`src/getWeatherForecast.ts`) **Segments** @@ -35,7 +38,7 @@ npm install npm run build ``` -3\. Start a simple HTTP server from the same directory. +3\. Start web server from the same directory. ```bash npm run client diff --git a/examples/concepts/data-transportation/README.md b/examples/concepts/data-transportation/README.md index bd9d1c0d..475ba309 100644 --- a/examples/concepts/data-transportation/README.md +++ b/examples/concepts/data-transportation/README.md @@ -4,6 +4,7 @@ This example demonstrates how data is transported between segments. The application simulates a helpdesk where a person can register for an account. +It contains a registration process that creates and transports a data object. ## Project setup @@ -12,7 +13,7 @@ The application simulates a helpdesk where a person can register for an account. * createAccount (`src/account/createAccount.ts`) * register (`src/helpdesk/register.ts`) -**Data model** +**Data models** * Account (`src/account/Account.ts`) * Registration (`src/helpdesk/Registration.ts`) @@ -26,7 +27,7 @@ The application simulates a helpdesk where a person can register for an account. For development -* Standalone - loads all segments (`services/data.json`, `services/greeting.json`) +* Standalone - loads all segments (`services/standalone.json`) For production @@ -49,7 +50,7 @@ npm install npm run build ``` -To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. +To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importance. **Repository** (terminal 1) diff --git a/examples/concepts/error-handling/README.md b/examples/concepts/error-handling/README.md index 7b4f3889..ab642b81 100644 --- a/examples/concepts/error-handling/README.md +++ b/examples/concepts/error-handling/README.md @@ -3,7 +3,8 @@ This example demonstrates how custom errors are supported. -The application contains a procedure to get data from a database and a procedure to export the data. +The application is a simple setup for exporting sales data. +Getting the data results into an error that is caught when trying to export it. ## Project setup diff --git a/examples/concepts/error-handling/requests.http b/examples/concepts/error-handling/requests.http index 14753393..f9ac20d2 100644 --- a/examples/concepts/error-handling/requests.http +++ b/examples/concepts/error-handling/requests.http @@ -5,6 +5,6 @@ GET http://localhost:3000/rpc/sales/getData HTTP/1.1 ### -// +// The database error is uncaught and send as reponse. GET http://localhost:3000/rpc/sales/exportData HTTP/1.1 diff --git a/examples/concepts/error-handling/src/sales/exportData.ts b/examples/concepts/error-handling/src/sales/exportData.ts index 040bd9a7..3120c492 100644 --- a/examples/concepts/error-handling/src/sales/exportData.ts +++ b/examples/concepts/error-handling/src/sales/exportData.ts @@ -16,7 +16,7 @@ export default async function exportData(): Promise { if (error instanceof DatabaseError) { - console.log(`Database error occured`); + console.log(`Database error occurred`); } return 'Failed, see log for details'; diff --git a/examples/concepts/health-checks/README.md b/examples/concepts/health-checks/README.md index 8e71cafd..51236aa3 100644 --- a/examples/concepts/health-checks/README.md +++ b/examples/concepts/health-checks/README.md @@ -3,9 +3,11 @@ This example demonstrates how to create heath checks and request the health of a service. +There is no application for this example, only a health check that is registered at the Jitar server. + ## Project setup -**Functions** +**Health checks** * DatabaseHealthCheck (`src/DatabaseHealthCheck.ts`) diff --git a/examples/concepts/hello-world/README.md b/examples/concepts/hello-world/README.md index 3643e2bb..c790fd8c 100644 --- a/examples/concepts/hello-world/README.md +++ b/examples/concepts/hello-world/README.md @@ -3,6 +3,8 @@ This example demonstrates the simplest Jitar application possible. +The application says hello to the given name. + ## Project setup **Functions** diff --git a/examples/concepts/load-balancing/README.md b/examples/concepts/load-balancing/README.md index f326bddd..344273c1 100644 --- a/examples/concepts/load-balancing/README.md +++ b/examples/concepts/load-balancing/README.md @@ -4,6 +4,7 @@ This example demonstrates how to load balance application segments by running them on multiple nodes. The application contains simple calculator tasks that are placed in a single segment. +Each of its functions can be used independently. ## Project setup @@ -45,7 +46,7 @@ npm install npm run build ``` -To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importantance. +To start Jitar we need four terminal sessions to start the repository, gateway, and nodes separately. The starting order is of importance. **Repository** (terminal 1) diff --git a/examples/concepts/multi-version/README.md b/examples/concepts/multi-version/README.md index 1879892a..d769ef0c 100644 --- a/examples/concepts/multi-version/README.md +++ b/examples/concepts/multi-version/README.md @@ -3,7 +3,8 @@ This example demonstrates how to create multiple versions for a procedure and how to register them as versioned procedures in a segment. -The application returns two different versions of an employee. +The application holds two different versions of an employee. +Both versions can be requested independently. ## Project setup diff --git a/examples/concepts/node-client/README.md b/examples/concepts/node-client/README.md index 654335e2..9ebf7e5e 100644 --- a/examples/concepts/node-client/README.md +++ b/examples/concepts/node-client/README.md @@ -1,9 +1,10 @@ # Jitar | Start Hooks example -This example demonstrates how the node client and server start hooks work. +This example demonstrates how to set up a node client. -The client start hook can be used to start any client (browser or Node), and the server start hook can be used to start the Node server. +The application draws a random lucky number. +The client connects to the Jitar server and gets a number. ## Project setup @@ -33,7 +34,7 @@ npm install npm run build ``` -To start Jitar we need two terminal sessions to start the server and the node client. The starting order is of importantance. +To start Jitar we need two terminal sessions to start the server and the node client. The starting order is of importance. **Standalone** (terminal 1)