diff --git a/.gitignore b/.gitignore index f98e09801..ca54735b0 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,10 @@ bundle.Dockerfile hack/istio*/ /java/certs/ .flattened-pom.xml + +# Examples noise +node_modules +.coh-history +.cohql-history +runner +venv diff --git a/Makefile b/Makefile index 617166cec..dd68ae7e2 100644 --- a/Makefile +++ b/Makefile @@ -907,6 +907,9 @@ copyright: ## Check copyright headers -X tools.go \ -X .tpl \ -X .txt \ + -X node_modules \ + -X venv \ + -X runner \ -X .yaml \ -X pkg/data/assets/ \ -X zz_generated. diff --git a/examples/910_polyglot_demo/Makefile b/examples/910_polyglot_demo/Makefile new file mode 100644 index 000000000..d9139a310 --- /dev/null +++ b/examples/910_polyglot_demo/Makefile @@ -0,0 +1,118 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# +CURRDIR := $(shell pwd) +NAMESPACE ?= coherence-demo +IMAGE_PREFIX ?= +IMAGE_VERSION ?= 1.0.0 +PLATFORM ?= linux/arm64 +GO_IMAGE ?= $(IMAGE_PREFIX)polyglot-client-go:$(IMAGE_VERSION) +PY_IMAGE ?= $(IMAGE_PREFIX)polyglot-client-py:$(IMAGE_VERSION) +JS_IMAGE ?= $(IMAGE_PREFIX)polyglot-client-js:$(IMAGE_VERSION) + + +# ====================================================================================================================== +# Makefile targets start here +# ====================================================================================================================== + +# ---------------------------------------------------------------------------------------------------------------------- +# Display the Makefile help - this is a list of the targets with a description. +# This target MUST be the first target in the Makefile so that it is run when running make with no arguments +# ---------------------------------------------------------------------------------------------------------------------- +help: ## Display this help. + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + + +# ====================================================================================================================== +# Build targets +# ====================================================================================================================== +##@ Build + +.PHONY: create-namespace +create-namespace: ## Create the namespace + kubectl create namespace $(NAMESPACE) || true + +.PHONY: delete-namespace +delete-namespace: ## Delete the namespace + kubectl delete namespace $(NAMESPACE) || true + +.PHONY: create-go-image +create-go-image: ## Create the Go Docker image + cd go && docker buildx build --platform $(PLATFORM) -t $(GO_IMAGE) . + +.PHONY: create-py-image +create-py-image: ## Create the Python Docker image + cd py && docker buildx build --platform $(PLATFORM) -t $(PY_IMAGE) . + +.PHONY: create-js-image +create-js-image: ## Create the JavaScript Docker image + cd js && docker buildx build --platform $(PLATFORM) -t $(JS_IMAGE) . + +.PHONY: kind-load-images +kind-load-images: ## Load images into kind + kind load docker-image $(GO_IMAGE) + kind load docker-image $(PY_IMAGE) + kind load docker-image $(JS_IMAGE) + +.PHONY: create-all-images +create-all-images: create-go-image create-js-image create-py-image ## Create all images + +.PHONY: push-image +push-image: ## Push the docker image + docker push $(IMAGE_REGISTRY)/$(DOCS_IMAGE):$(DOCS_VERSION) + +# ====================================================================================================================== +# Deploy targets +# ====================================================================================================================== +##@ Deploy + +.PHONY: deploy-operator +deploy-operator: ## Deploy the Coherence Operator + kubectl apply -f https://github.com/oracle/coherence-operator/releases/download/v3.4.3/coherence-operator.yaml + +.PHONY: undeploy-operator +undeploy-operator: ## Undeploy the Coherence Operator + kubectl delete -f https://github.com/oracle/coherence-operator/releases/download/v3.4.3/coherence-operator.yaml + +.PHONY: deploy-coherence +deploy-coherence: ## Deploy the Coherence Cluster + kubectl -n $(NAMESPACE) apply -f yaml/coherence-cluster.yaml + sleep 5 + kubectl -n $(NAMESPACE) get pods + +.PHONY: undeploy-coherence +undeploy-coherence: ## Deploy the Coherence Cluster + kubectl -n $(NAMESPACE) delete -f yaml/coherence-cluster.yaml + +.PHONY: deploy-go-client +deploy-go-client: ## Deploy the Go client + kubectl -n $(NAMESPACE) apply -f yaml/go-client.yaml + +.PHONY: undeploy-go-client +undeploy-go-client: ## Undeploy the Go client + kubectl -n $(NAMESPACE) delete -f yaml/go-client.yaml + +.PHONY: deploy-py-client +deploy-py-client: ## Deploy the Python client + kubectl -n $(NAMESPACE) apply -f yaml/py-client.yaml + +.PHONY: undeploy-py-client +undeploy-py-client: ## Undeploy the Python client + kubectl -n $(NAMESPACE) delete -f yaml/py-client.yaml + +.PHONY: deploy-js-client +deploy-js-client: ## Deploy the JavaScript client + kubectl -n $(NAMESPACE) apply -f yaml/js-client.yaml + +.PHONY: undeploy-js-client +undeploy-js-client: ## Deploy the JavaScript client + kubectl -n $(NAMESPACE) delete -f yaml/js-client.yaml + +.PHONY: deploy-all-clients +deploy-all-clients: deploy-go-client deploy-js-client deploy-py-client ## Deploy all clients + +.PHONY: undeploy-all-clients +undeploy-all-clients: undeploy-go-client undeploy-js-client undeploy-py-client ## Undeploy all clients diff --git a/examples/910_polyglot_demo/README.adoc b/examples/910_polyglot_demo/README.adoc new file mode 100644 index 000000000..e4afd6964 --- /dev/null +++ b/examples/910_polyglot_demo/README.adoc @@ -0,0 +1,728 @@ +/////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2025 Oracle and/or its affiliates. + Licensed under the Universal Permissive License v 1.0 as shown at + http://oss.oracle.com/licenses/upl. + +/////////////////////////////////////////////////////////////////////////////// += Polyglot Client Demo + +== Polyglot Client Demo + +This example shows how to deploy simple Python, JavaScript or Go applications that connect to Coherence running in Kubernetes. +The Coherence Operator is used to deploy a Coherence cluster and the applications connect via gRPC using the gRPC proxy. + +A basic REST serve is written in each language which exposes the following endpoints to create, get, update or remove JSON people objects in the Coherence cluster. + +* `POST /api/people` - create a person +* `GET /api/people` - return all people +* `GET /api/people/{id}` - return a single person +* `DELETE /api/people/{id}` - delete a person + +The example shows how to connect to the Coherence cluster from any of the clients via two different methods: + +1. From an application deployed with Kubernetes (purple processes shown below, accessed via `1. REST Client`) + +2. From an application outside of Kubernetes using simple port-forward or LBR (yellow gRPC Service, accessed via `2. Python, JS or Go Client`) + +**The diagram below outlines the example components.** + +NOTE: We use `port-forward` for this example, but you would normally expose the services via load balancers. + +image::images/example-overview.png[Service Details,width="100%",align="center"] + +See below for information on the Coherence langauge clients used: + +* https://github.com/oracle/coherence-py-client[Coherence Python Client] +* https://github.com/oracle/coherence-js-client[Coherence JavaScript Client] +* https://github.com/oracle/coherence-go-client[Coherence Go Client] + +== What the Example Will Cover + +* <> +** <> +** <> +** <> +** <> +* <> +** <> +** <> +** <> +** <> +* <> +** <> +** <> +** <> +* <> + + +[#pre] +=== PreRequisites + +You must have: + +1. Docker running on your system. Either Docker Desktop or Rancher will work +2. Access to a Kubernetes cluster. You can use `kind` to create a local cluster on Mac. See https://kind.sigs.k8s.io/[Kind Documentation] +3. `kubectl` executable - See https://kubernetes.io/docs/tasks/tools/[Kubernetes Documentation] + +NOTE: We have `Makefile` targets that will make the building and running of the example easier. + +[#pre-1] +==== Clone the Coherence Operator Repository: + +To build the examples, you first need to clone the Operator GitHub repository to your development machine. + +[source,bash] +---- +git clone https://github.com/oracle/coherence-operator + +cd coherence-operator/examples/910_polyglot_demo +---- + +[#pre-2] +==== Create the coherence-demo Namespace + +[source,bash] +---- +make create-namespace +---- + +[source,bash] +.Output +---- +kubectl create namespace coherence-demo || true +namespace/coherence-demo created +---- + +[#pre-3] +==== Install the Coherence Operator + +TIP: The Coherence Operator is installed installed into a namespace called `coherence`. To change this see the documentation below. + +[source,bash] +---- +make deploy-operator +---- + +[source,bash] +.Output +---- +kubectl apply -f https://github.com/oracle/coherence-operator/releases/download/v3.4.3/coherence-operator.yaml + +namespace/coherence created +customresourcedefinition.apiextensions.k8s.io/coherence.coherence.oracle.com created +... +service/coherence-operator-webhook created +deployment.apps/coherence-operator-controller-manager created +---- + +You can check to see the Coherence Operator in running by issuing the following command, which will wait for it to be available. + +[source,bash] +---- +kubectl -n coherence wait --for=condition=available deployment/coherence-operator-controller-manager --timeout 120s +---- + +When you see the following message, you can continue. + +[source,bash] +.Output +---- +deployment.apps/coherence-operator-controller-manager condition met +---- + +See the <> for more information about installing the Coherence Operator. + +[#pre-4] +==== Download Additional Software (Optional) + +If you are planning on running the clients locally, E.g. **not just from within the Kuberenetes cluster**, and connect to the cluster, you must install the following +software for your operating system. + +Otherwise, you can continue to the next step. + +1. Python 3.9 or Later - https://www.python.org/downloads/[https://www.python.org/downloads/] +2. Node 18.15.x or later and NPM 9.x or later - https://nodejs.org/en/download[https://nodejs.org/en/download] +3. Go 1.23 or later - https://go.dev/doc/install[https://go.dev/doc/install] + +TIP: If you are just going to run the example within your Kubernetes cluster then you do not need the software. + +[#deploy] +=== Deploy the Example + +[#dep-1] +==== Examine the Docker Files + +Each of the clients has a `Dockerfile` to build for the specific language client. You can inspect each of them below: + +**Python Client** + +[source,bash,indent=0] +---- +include::py/Dockerfile[tag=dockerfile] +---- + +**JavScript Client** + +[source,bash,indent=0] +---- +include::js/Dockerfile[tag=dockerfile] +---- + +**Go Client** + +[source,bash,indent=0] +---- +include::go/Dockerfile[tag=dockerfile] +---- + +[#code] +==== Examine the Code + +You can view the source of each of the language clients here: + +* link:py/main.py[py/main.py] +* link:js/main.js[js/main.js] +* link:go/main.go[go/main.go] + +[#dep-2] +==== Build the Example images + +TIP: If you are deploying to a remote cluster or deploying to a different architecture in Kubernetes, please read the *Important Notes* below before you build. + +Build each of the images using make, or run `make create-all-images`, as shown below. + +* `make create-py-image` +* `make create-js-image` +* `make create-go-image` + +[source,bash,indent=0] +---- + make create-all-images +---- + +[source,bash,indent=0] +.Output +---- +cd go && docker buildx build --platform linux/arm64 -t polyglot-client-go:1.0.0 . +[+] Building 27.8s (12/12) FINISHED +.... +cd js && docker buildx build --platform linux/arm64 -t polyglot-client-js:1.0.0 . +[+] Building 4.2s (10/10) FINISHED +... +cd py && docker buildx build --platform linux/arm64 -t polyglot-client-py:1.0.0 . +[+] Building 3.0s (8/8) FINISHED +---- + +You will end up with the following images: + +* `polyglot-client-py:1.0.0` - Python Client +* `polyglot-client-js:1.0.0` - JavaScript Client +* `polyglot-client-go:1.0.0` - Go Client + +**Important Notes** + +1. The images are built by default for arm64, you can specify `PLATFORM=linux/amd64` before your make commands to change the architecture. + +2. If you need to push the images to a remote repository, you will need to specify the IMAGE_PREFIX=.. before the make commands, e.g.: ++ +[source,bash,indent=0] +---- +IMAGE_PREFIX=ghcr.io/username/repo/ make create-py-image +---- ++ +[source,bash,indent=0] +.Output +---- +cd py && docker buildx build --platform linux/arm64 -t ghcr.io/username/repo/polyglot-client-py:1.0.0 . +... +---- ++ +NOTE: In this example the image will be `ghcr.io/username/repo/polyglot-client-py:1.0.0`. You will also need to update the deployment yaml files. + +[#dep-3] +==== Push Images + +Choose one of the following methods, depending upon if you are using a local *kind* cluster or not. + +**You are running a local cluster using kind** + +Run the following to load the images you just created to the cluster. + +[source,bash] +---- +make kind-load-images +---- + +**You need to push to a remote repository** + +1. Push the images to your local container repository. E.g. for the example above: ++ +[source,bash] +---- +docker push ghcr.io/username/repo/polyglot-client-py:1.0.0 +docker push ghcr.io/username/repo/polyglot-client-js:1.0.0 +docker push ghcr.io/username/repo/polyglot-client-go:1.0.0 +---- + +2. Modify the following files to change the image name accordingly in the following deployment yaml files: ++ +* link:yaml/py-client.yaml[py-client.yaml] +* link:yaml/js-client.yaml[js-client.yaml] +* link:yaml/go-client.yaml[go-client.yaml] + +[#dep-4] +==== 4. Deploy the Coherence Cluster + +The following deployment file is used to deploy a 3 node Coherence cluster to your Kubernetes cluster. + +[source,bash,indent=0] +---- +include::yaml/coherence-cluster.yaml[] +---- +<1> the cluster name +<2> the number of replicas to create +<3> Image to use to start Coherence +<4> Enable management +<5> Enable gRPC port + +NOTE: When we deploy this yaml, each of the ports will become a service that we can use to connect to. + +Deploy the Coherence Cluster using the following: + +[source,bash,indent=0] +---- +make deploy-coherence +---- + +[source,bash,indent=0] +.Output +---- +kubectl -n coherence-demo apply -f yaml/coherence-cluster.yaml +coherence.coherence.oracle.com/demo-cluster created +sleep 5 +kubectl -n coherence-demo get pods +NAME READY STATUS RESTARTS AGE +demo-cluster-0 0/1 Running 0 5s +demo-cluster-1 0/1 Running 0 5s +demo-cluster-2 0/1 Running 0 5s +---- + +Issue the following command to wait until the Coherence cluster is ready. + +[source,bash,indent=0] +---- +kubectl -n coherence-demo wait --for=condition=ready coherence/demo-cluster --timeout 120s +coherence.coherence.oracle.com/demo-cluster condition met +---- + +[#run-example] +=== Run the example + +Choose one of the methods below to demo the application. + +1. <> +2. <> + +[#run-1] +==== Run from within Kubernetes + +In this section, we will deploy all the client pods to Kubernetes, and access the REST endpoints via their services, using the `port-forward` command. + +See **1. REST Client** on the right of the diagram below: + +image::images/example-overview.png[Service Details,width="100%",align="center"] + +NOTE: We are accessing the application HTTP endpoint via port-forward, but the client pods within Kubernetes +are directly accessing cluster within Kubernetes. + +When we deploy the clients, the yaml used is shown below: + +* link:yaml/py-client.yaml[Python Client] +* link:yaml/js-client.yaml[JavaScript Client] +* link:yaml/go-client.yaml[Go Client] + +By default, the Python, JavaScript and Go clients connect to `localhost:1408` on startup, but you can specify the gRPC host and port to connect to in the +code or use the `COHERENCE_SERVER_ADDRESS` environment variable to specify this which is more flexible. + +Each of the clients, (Python shown below for example), have this variable set to `demo-cluster-grpc:1408` where `demo-cluster-grpc` +is the service for the grpc port created when we deployed the Coherence cluster. + +[source,yaml,indent=0] +---- +include::yaml/py-client.yaml[tag=yaml] +---- + +**Deploy the clients** + +Firstly, run the following to deploy all the clients. This yaml also deploys a service from which you can connect to the client. + +[source,bash,indent=0] +---- +make deploy-all-clients +---- + +[source,bash,indent=0] +.Output +---- +kubectl -n coherence-demo apply -f yaml/go-client.yaml +service/go-client created +deployment.apps/go-client created +kubectl -n coherence-demo apply -f yaml/js-client.yaml +service/js-client created +deployment.apps/js-client created +kubectl -n coherence-demo apply -f yaml/py-client.yaml +service/py-client created +deployment.apps/py-client created +---- + +Issue the following to show the deployments and services. + +[source,bash,indent=0] +---- +kubectl get deployments -n coherence-demo +---- + +[source,bash,indent=0] +.Output +---- +NAME READY UP-TO-DATE AVAILABLE AGE +go-client 1/1 1 1 3s +js-client 1/1 1 1 3s +py-client 1/1 1 1 3s +---- + +**Port forward to access the HTTP endpoint** + +To port-forward the clients we will first need to view the services: + +[source,bash,indent=0] +---- +kubectl get services -n coherence-demo +---- + +[source,bash,indent=0] +.Output +---- +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +demo-cluster-grpc ClusterIP 10.96.200.57 1408/TCP 8m2s +demo-cluster-management ClusterIP 10.96.46.69 30000/TCP 8m2s +demo-cluster-sts ClusterIP None 7/TCP,7575/TCP,7574/TCP,6676/TCP,1408/TCP,30000/TCP 8m2s +demo-cluster-wka ClusterIP None 7/TCP,7575/TCP,7574/TCP,6676/TCP 8m2s +go-client-http ClusterIP 10.96.249.42 8080/TCP 32s +js-client-http ClusterIP 10.96.114.88 8080/TCP 31s +py-client-http ClusterIP 10.96.196.163 8080/TCP 31s +---- + +The services we are interested in are the `go-client-http`, `js-client-http` or `py-client-http`. + +As all the clients expose the same API, You can choose any of the clients to port-forward to. For this example will +choose the JavaScript client. + +[source,bash,indent=0] +---- +kubectl port-forward -n coherence-demo svc/js-client-http 8080:8080 +---- + +[source,bash,indent=0] +.Output +---- +Forwarding from 127.0.0.1:8080 -> 8080 +Forwarding from [::1]:8080 -> 8080 +---- + +[#rest-endpoints] +**Exercise the REST endpoints** + +Use the following commands to work with the REST endpoints. + +**Create two People** + +[source,bash] +---- +curl -X POST -H 'Content-Type: application/json' http://localhost:8080/api/people -d '{"id": 1,"name":"Tim", "age": 25}' +---- + +[source,bash] +---- +curl -X POST -H 'Content-Type: application/json' http://localhost:8080/api/people -d '{"id": 2,"name":"John", "age": 35}' +---- + +*List the people in the cache* + +[source,bash] +---- +curl http://localhost:8080/api/people +---- + +[source,bash] +.Output +---- +[{"id":1,"name":"Tim","age":25},{"id":2,"name":"John","age":35}] +---- + +*Get a single Person* + +[source,bash] +---- +curl http://localhost:8080/api/people/1 +---- + +[source,bash] +.Output +---- +{"id":1,"name":"Tim","age":25} +---- + +*Remove a Person* + +[source,bash] +---- +curl -X DELETE http://localhost:8080/api/people/1 +---- + +[source,bash] +.Output +---- +OK +---- + +*Try to retrieve the deleted person* + +[source,bash] +---- +curl http://localhost:8080/api/people/1 +---- + +[source,bash] +.Output +---- +Not Found +---- + +[#run-2] +==== View the cache information + +You can use the https://github.com/oracle/coherence-cli[Coherence CLI] to view cluster and cache information. + +NOTE: The Coherence CLI is automatically bundled with the Coherence Operator and can be accessed via `kuebctl exec`. + +**Display the cluster members** + +Use the following to show the cluster members: + +[source,bash] +---- +kubectl exec demo-cluster-0 -c coherence -n coherence-demo -- /coherence-operator/utils/cohctl get members +---- + +[source,bash] +.Output +---- + +Total cluster members: 3 +Storage enabled count: 3 +Departure count: 0 + +Cluster Heap - Total: 8,964 MB Used: 150 MB Available: 8,814 MB (98.3%) +Storage Heap - Total: 8,964 MB Used: 150 MB Available: 8,814 MB (98.3%) + +NODE ID ADDRESS PORT PROCESS MEMBER ROLE STORAGE MAX HEAP USED HEAP AVAIL HEAP + 1 demo-cluster-wka.coherence-demo.svc/10.244.0.31 7575 56 demo-cluster-0 demo-cluster true 2,988 MB 45 MB 2,943 MB + 2 demo-cluster-wka.coherence-demo.svc/10.244.0.32 7575 57 demo-cluster-2 demo-cluster true 2,988 MB 36 MB 2,952 MB + 3 demo-cluster-wka.coherence-demo.svc/10.244.0.33 7575 57 demo-cluster-1 demo-cluster true 2,988 MB 69 MB 2,919 MB +---- + +**Display the cache information** + +Use the following to show the cache information: + +[source,bash] +---- +kubectl exec demo-cluster-0 -c coherence -n coherence-demo -- /coherence-operator/utils/cohctl get caches -o wide +---- + +NOTE: You will see other system caches, but you should also see the `people` cache with one entry. + +[source,bash] +.Output +---- +Total Caches: 7, Total primary storage: 0 MB + +SERVICE CACHE COUNT SIZE AVG SIZE PUTS GETS REMOVES EVICTIONS HITS MISSES HIT PROB +"$SYS:Concurrent" executor-assignments 0 0 MB 0 0 0 0 0 0 0 0.00% +"$SYS:Concurrent" executor-executors 2 0 MB 1,248 12,105 12,103 1 0 12,103 0 100.00% +"$SYS:Concurrent" executor-tasks 0 0 MB 0 0 0 0 0 0 0 0.00% +"$SYS:Concurrent" locks-exclusive 0 0 MB 0 0 0 0 0 0 0 0.00% +"$SYS:Concurrent" locks-read-write 0 0 MB 0 0 0 0 0 0 0 0.00% +"$SYS:Concurrent" semaphores 0 0 MB 0 0 0 0 0 0 0 0.00% +PartitionedCache people 1 0 MB 224 6 29 2 0 26 3 89.66% +---- + +[#run-3] +==== Run locally using native clients + +Depending upon the client you are wanting to run you need to ensure you have installed the relevant +client software as shown in the <>. + +TIP: Ensure you stopped the port-forward from the previous step if you ran this. + +See **2. Python, JS or GO Client** on the bottom of the diagram below: + +image::images/example-overview.png[Service Details,width="100%",align="center"] + + +**Run Port forward** + +Firstly we have to run a `port-forward` command to port-forward the gRPC 1408 locally to the `demo-cluster-grpc:1408` port on the Kubernetes cluster. + +Typically, if you want to access a service from outside the Kubernetes cluster, you would have a load balancer configured to access this directly, but in example we will use `port-forward`. + +Run the following: + +[source,bash] +---- +kubectl -n coherence-demo port-forward svc/demo-cluster-grpc 1408:1408 +---- + +[source,bash] +.Output +---- +Forwarding from 127.0.0.1:1408 -> 1408 +Forwarding from [::1]:1408 -> 1408 +---- + +the **DIAGARM**... + +Then follow the instructions to start either of the clients below, which will list on port 8080 locally and connect to the Coherence cluster via gRPC on localhost:1408 which will be port-forwarded. + + +**Python Client** + +NOTE: We are install a python virtual environment for this example. + +1. Change to the `py` directory + +2. Create a python virtual environment ++ +[source,bash] +---- +python3 -m venv ./venv +. venv/bin/activate +---- + +3. Install the requirements ++ +[source,bash] +---- +python3 -m pip install -r requirements.txt +---- + +4. Run the Python example ++ +[source,bash] +---- +python3 main.py +---- ++ +[source,bash] +.Output +---- +2025-04-07 11:06:42,501 - coherence - INFO - Session [5d940a05-1cfc-4e6c-9ef8-52cc6e7705ba] connected to [localhost:1408]. +2025-04-07 11:06:42,525 - coherence - INFO - Session(id=5d940a05-1cfc-4e6c-9ef8-52cc6e7705ba, connected to [localhost:1408] proxy-version=14.1.2.0.1, protocol-version=1 proxy-member-id=1) +[2025-04-07 11:06:42 +0800] [27645] [INFO] Running on http://0.0.0.0:8080 (CTRL + C to quit) +---- ++ +NOTE: This is now showing the HTTP server is running locally and connecting via port-forward to the Coherence Cluster. + +5. Exercise the REST end-points as per the instructions <> + +**JavaScript Client** + +1. Change to the `js` directory + +2. Install the modules ++ +[source,bash] +---- +npm install +---- + +3. Run the JavaScript example ++ +[source,bash] +---- +node main.js +---- + +4. Exercise the REST end-points as per the instructions <> + +**Go Client** + +1. Change to the `go` directory + +2. Ensure you have the latest Coherence Go client ++ +[source,bash] +---- +npm install +---- + +3. Build the executable ++ +[source,bash] +---- +go get github.com/oracle/coherence-go-client/v2@latest +go mod tidy +---- + +4. Run the Go example ++ +[source,bash] +---- +/runner +---- ++ +[source,bash] +.Output +---- +2025/04/07 11:19:21 INFO: Session [2073aa45-68aa-426d-a0b8-99405dcaa942] connected to [localhost:1408] Coherence version: 14.1.2.0.1, serverProtocolVersion: 1, proxyMemberId: 1 +Server running on port 8080 +---- + +5. Exercise the REST end-points as per the instructions <> + + +[#cleanup] +=== Cleaning Up + +1. Undeploy the clients using: ++ +[source,bash] +---- +make undeploy-all-clients +---- + +2. Undeploy the Coherence cluster ++ +[source,bash] +---- +make undeploy-coherence +---- + +3. Undeploy the Coherence Operator ++ +[source,bash] +---- +make undeploy-operator +---- + +4. Delete the namespace ++ +[source,bash] +---- +make delete-namespace +---- + + + diff --git a/examples/910_polyglot_demo/go/Dockerfile b/examples/910_polyglot_demo/go/Dockerfile new file mode 100644 index 000000000..8a5db8f4d --- /dev/null +++ b/examples/910_polyglot_demo/go/Dockerfile @@ -0,0 +1,31 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# tag::dockerfile[] + +FROM golang:1.24 as builder + +WORKDIR /app + +COPY go.mod ./ +COPY go.sum ./ +COPY main.go ./ + +ENV APP_USER_UID=1000 +ENV APP_USER_GID=1000 + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o runner . +RUN chown ${APP_USER_UID}:${APP_USER_GID} /app/runner + +FROM scratch + +COPY --from=builder /app/runner /files/runner +USER 1000:1000 + +EXPOSE 8080 +ENTRYPOINT ["/files/runner"] +CMD ["-h"] + +# end::dockerfile[] \ No newline at end of file diff --git a/examples/910_polyglot_demo/go/go.mod b/examples/910_polyglot_demo/go/go.mod new file mode 100644 index 000000000..1f31b9c30 --- /dev/null +++ b/examples/910_polyglot_demo/go/go.mod @@ -0,0 +1,18 @@ +module main + +go 1.23.0 + +toolchain go1.24.1 + +require github.com/oracle/coherence-go-client/v2 v2.1.0 + +require ( + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.6.0 // indirect + golang.org/x/net v0.36.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/grpc v1.58.3 // indirect + google.golang.org/protobuf v1.36.1 // indirect +) diff --git a/examples/910_polyglot_demo/go/go.sum b/examples/910_polyglot_demo/go/go.sum new file mode 100644 index 000000000..45f9c7436 --- /dev/null +++ b/examples/910_polyglot_demo/go/go.sum @@ -0,0 +1,29 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= +github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/oracle/coherence-go-client/v2 v2.1.0 h1:EQ9kmwJP9ERA/TtdsIG/mEDyUMm596FxM2pKR+9l1zw= +github.com/oracle/coherence-go-client/v2 v2.1.0/go.mod h1:Myuz1GfRntOmNTV2tdFLSFJafmL1Iq1PJiwXZjGCmhI= +golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= +golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/910_polyglot_demo/go/main.go b/examples/910_polyglot_demo/go/main.go new file mode 100644 index 000000000..abe5937a6 --- /dev/null +++ b/examples/910_polyglot_demo/go/main.go @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2025, Oracle and/or its affiliates. + * Licensed under the Universal Permissive License v 1.0 as shown at + * http://oss.oracle.com/licenses/upl. + */ + +package main + +import ( + "context" + "encoding/json" + "fmt" + "github.com/oracle/coherence-go-client/v2/coherence" + "log" + "net/http" + "strconv" +) + +type Person struct { + ID int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} + +var ( + cache coherence.NamedMap[int, Person] + ctx = context.TODO() +) + +func main() { + session, err := coherence.NewSession(ctx, coherence.WithPlainText()) + if err != nil { + log.Println("unable to connect to Coherence", err) + return + } + defer session.Close() + + cache, err = coherence.GetNamedMap[int, Person](session, "people") + if err != nil { + log.Println("unable to create namedMap 'people'", err) + return + } + + http.HandleFunc("/api/people", personHandler) + http.HandleFunc("/api/people/", personByIDHandler) + + fmt.Println("Server running on port 8080") + log.Fatal(http.ListenAndServe(":8080", nil)) + +} + +func personHandler(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodPost: + var p Person + if err := json.NewDecoder(r.Body).Decode(&p); err != nil { + http.Error(w, "Invalid JSON", http.StatusBadRequest) + return + } + + _, err := cache.Put(ctx, p.ID, p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } + w.WriteHeader(http.StatusCreated) + _ = json.NewEncoder(w).Encode(p) + + case http.MethodGet: + var people = make([]Person, 0) + + for ch := range cache.Values(ctx) { + if ch.Err != nil { + http.Error(w, ch.Err.Error(), http.StatusInternalServerError) + return + } + people = append(people, ch.Value) + } + _ = json.NewEncoder(w).Encode(people) + return + default: + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + } +} + +func personByIDHandler(w http.ResponseWriter, r *http.Request) { + idStr := r.URL.Path[len("/api/people/"):] + id, err := strconv.Atoi(idStr) + if err != nil { + fmt.Println(err) + http.Error(w, "Invalid ID", http.StatusBadRequest) + return + } + + switch r.Method { + case http.MethodGet: + p, err1 := cache.Get(ctx, id) + + if err1 != nil { + http.Error(w, err1.Error(), http.StatusInternalServerError) + } + if p == nil { + http.NotFound(w, r) + return + } + w.Header().Set("Content-Type", "application/json") + err1 = json.NewEncoder(w).Encode(&p) + if err1 != nil { + http.Error(w, err1.Error(), http.StatusInternalServerError) + return + } + + case http.MethodDelete: + old, err2 := cache.Remove(ctx, id) + if err2 != nil { + http.Error(w, err2.Error(), http.StatusInternalServerError) + return + } + if old == nil { + http.NotFound(w, r) + return + } + w.WriteHeader(http.StatusNoContent) + + default: + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + } +} diff --git a/examples/910_polyglot_demo/images/example-overview.png b/examples/910_polyglot_demo/images/example-overview.png new file mode 100644 index 000000000..de4f76f35 Binary files /dev/null and b/examples/910_polyglot_demo/images/example-overview.png differ diff --git a/examples/910_polyglot_demo/js/.dockerignore b/examples/910_polyglot_demo/js/.dockerignore new file mode 100644 index 000000000..93f136199 --- /dev/null +++ b/examples/910_polyglot_demo/js/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/examples/910_polyglot_demo/js/Dockerfile b/examples/910_polyglot_demo/js/Dockerfile new file mode 100644 index 000000000..3f10a4651 --- /dev/null +++ b/examples/910_polyglot_demo/js/Dockerfile @@ -0,0 +1,27 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# tag::dockerfile[] + +FROM node:18-alpine + +RUN addgroup -S appgroup && adduser -S appuser -G appgroup + +WORKDIR /usr/src/app + +COPY --chown=appuser:appgroup package*.json ./ +COPY --chown=appuser:appgroup main.js ./ + +RUN chmod 444 package*.json main.js + +RUN npm install --ignore-scripts +RUN chown -R appuser:appgroup /usr/src/app + +USER appuser +EXPOSE 8080 + +CMD [ "node", "main.js" ] + +# end::dockerfile[] \ No newline at end of file diff --git a/examples/910_polyglot_demo/js/main.js b/examples/910_polyglot_demo/js/main.js new file mode 100644 index 000000000..7514bbaaa --- /dev/null +++ b/examples/910_polyglot_demo/js/main.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2025 Oracle and/or its affiliates. + * Licensed under the Universal Permissive License v 1.0 as shown at + * http://oss.oracle.com/licenses/upl. + */ + +const coh = require('@oracle/coherence') + +const Session = coh.Session + +const express = require('express'); +const port = process.env.PORT || 8080 +const api = express(); + +api.use(express.json()); // to parse JSON request bodies + +// setup session to Coherence +const session = new Session() +const people = session.getCache('people') + +// ----- REST API ----------------------------------------------------------- + +/** + * Returns all people. + */ +api.get('/api/people', (req, res, next) => { + const toSend = [] + people.values() + .then(async values => { + // copy values to array to be sent via express + for await (let value of values) { + toSend.push(value) + } + res.send(toSend) + }) + .catch(err => next(err)) +}) + + +/** + * Create a person. + */ +api.post('/api/people', (req, res, next) => { + const id = req.body.id + const person = { + id: req.body.id, + name: req.body.name, + age: req.body.age + } + + people.set(id, person) + .then(() => { + res.send(JSON.stringify(person)) + }) + .catch(err => next(err)) +}) + + +/** + * Get a single person. + */ +api.get('/api/people/:id', (req, res, next) => { + const id = Number(req.params.id); + people.get(id) + .then(person => { + if (person) { + res.status(200).json(person); + } else { + res.sendStatus(404); + } + }) + .catch(err => next(err)); +}); + +/** + * Delete a person. + */ +api.delete('/api/people/:id', (req, res, next) => { + const id = Number(req.params.id); + people.delete(id) + .then(oldValue => { + res.sendStatus(oldValue ? 200 : 404) + }) + .catch(err => next(err)) +}) + +api.listen(port, () => console.log(`Listening on port ${port}`)) diff --git a/examples/910_polyglot_demo/js/package-lock.json b/examples/910_polyglot_demo/js/package-lock.json new file mode 100644 index 000000000..e35d49726 --- /dev/null +++ b/examples/910_polyglot_demo/js/package-lock.json @@ -0,0 +1,1266 @@ +{ + "name": "person-js", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "person-js", + "version": "1.0.0", + "dependencies": { + "@oracle/coherence": "^1.2.3", + "classnames": "^2.2.6", + "express": "^4.21.2", + "prop-types": "^15.7.2", + "typescript": "^3.9.7", + "uuid": "^8.3.0" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.13.2.tgz", + "integrity": "sha512-nnR5nmL6lxF8YBqb6gWvEgLdLh/Fn+kvAdX5hUOnt48sNSb0riz/93ASd2E5gvanPA41X6Yp25bIfGRp1SMb2g==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@oracle/coherence": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@oracle/coherence/-/coherence-1.2.3.tgz", + "integrity": "sha512-eOAFg15rTkSfHEjrmXLOVpTrs1RHs8OwWeN1StjYh5WcAWW+s7DrKIiZMUUIlvkvOXqQdmn4s7QXhg9bqtq6rQ==", + "license": "UPL-1.0", + "dependencies": { + "@grpc/grpc-js": "^1.12", + "@grpc/proto-loader": "^0.7", + "decimal.js": "^10.5", + "google-protobuf": "^3.21" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@types/node": { + "version": "22.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decimal.js": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.5.0.tgz", + "integrity": "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==", + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/google-protobuf": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", + "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", + "license": "(BSD-3-Clause AND Apache-2.0)" + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", + "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==", + "license": "Apache-2.0" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/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==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/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==", + "license": "MIT", + "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/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/examples/910_polyglot_demo/js/package.json b/examples/910_polyglot_demo/js/package.json new file mode 100644 index 000000000..ae6cad0b4 --- /dev/null +++ b/examples/910_polyglot_demo/js/package.json @@ -0,0 +1,13 @@ +{ + "name": "person-js", + "version": "1.0.0", + "private": true, + "dependencies": { + "@oracle/coherence": "^1.2.3", + "express": "^4.21.2", + "classnames": "^2.2.6", + "prop-types": "^15.7.2", + "typescript": "^3.9.7", + "uuid": "^8.3.0" + } +} \ No newline at end of file diff --git a/examples/910_polyglot_demo/py/Dockerfile b/examples/910_polyglot_demo/py/Dockerfile new file mode 100644 index 000000000..8082ab5cf --- /dev/null +++ b/examples/910_polyglot_demo/py/Dockerfile @@ -0,0 +1,24 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# tag::dockerfile[] + +FROM python:3.11-slim + +RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser + +WORKDIR /app +COPY --chown=appuser:appgroup main.py . +RUN chmod 444 main.py + +RUN pip install --no-cache-dir coherence-client==2.0.0 Quart + +RUN chown -R appuser:appgroup /app + +USER appuser + +CMD ["python3", "./main.py"] + +# end::dockerfile[] \ No newline at end of file diff --git a/examples/910_polyglot_demo/py/main.py b/examples/910_polyglot_demo/py/main.py new file mode 100644 index 000000000..0d97c7a65 --- /dev/null +++ b/examples/910_polyglot_demo/py/main.py @@ -0,0 +1,100 @@ +# +# Copyright (c) 2025, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# + +from typing import List +import jsonpickle +import quart +from coherence import NamedMap, Session, Filters, Processors +from dataclasses import dataclass +from coherence.serialization import proxy +from quart import Quart, request, redirect + + +@dataclass +class Person: + id: int + name: str + age: int + + +# ---- init ------------ + +# the Quart application. Quart was chosen over Flask due to better +# handling of asyncio which is required to use the Coherence client +# library +app: Quart = Quart(__name__, + static_url_path='', + static_folder='./') + + +# the Session with the gRPC proxy +session: Session + +people: NamedMap[int, Person] + + +@app.before_serving +async def init(): + + # initialize the session using the default localhost:1408 or the value of COHERENCE_SERVER_ADDRESS + global session + session = await Session.create() + + global people + people = await session.get_map('people') + +# ----- routes -------------------------------------------------------------- + +# Get all people +@app.route('/api/people', methods=['GET']) +async def get_people(): + people_list: List[People] = [] + async for person in await people.values(): + people_list.append(person) + + return quart.Response(jsonpickle.encode(people_list, unpicklable=False), mimetype="application/json") + +# Create a person with JSON as body +@app.route('/api/people', methods=['POST']) +async def create_person(): + data = await request.get_json(force=True) + name: str = data['name'] + id: int = data['id'] + age: int = data['age'] + person: Person = Person(id, name, age) + await people.put(person.id, person) + + return quart.Response( + jsonpickle.encode(person, unpicklable=False), + status=201, + mimetype='application/json' + ) + +# Get a single person +@app.route('/api/people/', methods=['GET']) +async def get_person(id: str): + existing: Person = await people.get(int(id)) + if existing == None: + return "", 404 + + return jsonpickle.encode(existing, unpicklable=False), 200 + +# Delete a person +@app.route('/api/people/', methods=['DELETE']) +async def delete_person(id: str): + """ + This route will delete the person with the given id. + + :param id: the id of the person to delete + """ + existing: Person = await people.remove(int(id)) + return "", 404 if existing is None else 200 + +# ----- main ---------------------------------------------------------------- + +if __name__ == '__main__': + # run the application on port 8080 + app.run(host='0.0.0.0', port=8080) \ No newline at end of file diff --git a/examples/910_polyglot_demo/py/requirements.txt b/examples/910_polyglot_demo/py/requirements.txt new file mode 100644 index 000000000..8a53fa7bf --- /dev/null +++ b/examples/910_polyglot_demo/py/requirements.txt @@ -0,0 +1,2 @@ +coherence-client==2.0.0 +Quart==0.20.0 diff --git a/examples/910_polyglot_demo/yaml/coherence-cluster.yaml b/examples/910_polyglot_demo/yaml/coherence-cluster.yaml new file mode 100644 index 000000000..4646cec65 --- /dev/null +++ b/examples/910_polyglot_demo/yaml/coherence-cluster.yaml @@ -0,0 +1,18 @@ +apiVersion: coherence.oracle.com/v1 +kind: Coherence +metadata: + name: demo-cluster # <1> +spec: + jvm: + memory: + initialHeapSize: 1g + maxHeapSize: 1g + replicas: 3 # <2> + image: "ghcr.io/oracle/coherence-ce:14.1.2-0-1-java17" # <3> + coherence: + management: # <4> + enabled: true + ports: + - name: grpc # <5> + port: 1408 + - name: management \ No newline at end of file diff --git a/examples/910_polyglot_demo/yaml/go-client.yaml b/examples/910_polyglot_demo/yaml/go-client.yaml new file mode 100644 index 000000000..303baf717 --- /dev/null +++ b/examples/910_polyglot_demo/yaml/go-client.yaml @@ -0,0 +1,52 @@ +kind: Service +apiVersion: v1 +metadata: + name: go-client-http + labels: + app: go-client + coherence-language: go +spec: + type: ClusterIP + ports: + - port: 8080 + targetPort: 8080 + selector: + app: go-client +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: go-client +spec: + replicas: 1 + selector: + matchLabels: + app: go-client + template: + metadata: + labels: + app: go-client + spec: + containers: + - name: go-client + image: polyglot-client-go:1.0.0 + imagePullPolicy: IfNotPresent + env: + - name: COHERENCE_SERVER_ADDRESS + value: "demo-cluster-grpc:1408" + - name: COHERENCE_READY_TIMEOUT + value: "60000" + resources: + requests: + memory: "512Mi" + limits: + memory: "512Mi" + ports: + - containerPort: 8080 + securityContext: + runAsNonRoot: true + runAsUser: 10001 + capabilities: + drop: + - all + readOnlyRootFilesystem: true \ No newline at end of file diff --git a/examples/910_polyglot_demo/yaml/js-client.yaml b/examples/910_polyglot_demo/yaml/js-client.yaml new file mode 100644 index 000000000..e7a9ae10f --- /dev/null +++ b/examples/910_polyglot_demo/yaml/js-client.yaml @@ -0,0 +1,52 @@ +kind: Service +apiVersion: v1 +metadata: + name: js-client-http + labels: + app: js-client + coherence-language: go +spec: + type: ClusterIP + ports: + - port: 8080 + targetPort: 8080 + selector: + app: js-client +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: js-client +spec: + replicas: 1 + selector: + matchLabels: + app: js-client + template: + metadata: + labels: + app: js-client + spec: + containers: + - name: js-client + image: polyglot-client-js:1.0.0 + imagePullPolicy: IfNotPresent + env: + - name: COHERENCE_SERVER_ADDRESS + value: "demo-cluster-grpc:1408" + - name: COHERENCE_READY_TIMEOUT + value: "60000" + resources: + requests: + memory: "512Mi" + limits: + memory: "512Mi" + ports: + - containerPort: 8080 + securityContext: + runAsNonRoot: true + runAsUser: 10001 + capabilities: + drop: + - all + readOnlyRootFilesystem: true \ No newline at end of file diff --git a/examples/910_polyglot_demo/yaml/py-client.yaml b/examples/910_polyglot_demo/yaml/py-client.yaml new file mode 100644 index 000000000..9c248ba34 --- /dev/null +++ b/examples/910_polyglot_demo/yaml/py-client.yaml @@ -0,0 +1,53 @@ +kind: Service +apiVersion: v1 +metadata: + name: py-client-http + labels: + app: py-client + coherence-language: go +spec: + type: ClusterIP + ports: + - port: 8080 + targetPort: 8080 + selector: + app: py-client +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: py-client +spec: + replicas: 1 + selector: + matchLabels: + app: py-client + template: + metadata: + labels: + app: py-client + spec: + containers: # tag::yaml[] + - name: py-client + image: polyglot-client-py:1.0.0 + imagePullPolicy: IfNotPresent + env: + - name: COHERENCE_SERVER_ADDRESS + value: "demo-cluster-grpc:1408" + - name: COHERENCE_READY_TIMEOUT + value: "60000" + resources: + requests: + memory: "512Mi" + limits: + memory: "512Mi" + ports: + - containerPort: 8080 + securityContext: + runAsNonRoot: true + runAsUser: 10001 + capabilities: + drop: + - all + readOnlyRootFilesystem: true + # end::yaml[] \ No newline at end of file diff --git a/examples/README.adoc b/examples/README.adoc index af5bf915e..de72cb083 100644 --- a/examples/README.adoc +++ b/examples/README.adoc @@ -108,3 +108,13 @@ Istio Support Deploying the Coherence demo application. -- ==== + +[PILLARS] +==== +[CARD] +.Polyglot Client Demo +[link=examples/910_polyglot_demo/README.adoc] +-- +Deploy Python, JavaScript or Go applications using the Operator. +-- +====