diff --git a/.gitignore b/.gitignore index 98359d3..90922cc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,11 @@ *.tfstate *.tfstate.* +# tf plan files +*.tfplan* +*.tfplan +**/.*tfplan*/* + # Crash log files crash.log diff --git a/asset.tf b/asset.tf new file mode 100644 index 0000000..b0d32a3 --- /dev/null +++ b/asset.tf @@ -0,0 +1,45 @@ + +# Create a feed that sends notifications about resource updates under a +# particular folder. + +# resource "google_cloud_asset_folder_feed" "folder_feed" { +# billing_project = "content-eng-billing-report" +# folder = data.google_folder.this.folder_id +# feed_id = "observe-asset-updates" +# content_type = "RESOURCE" + +# asset_types = ["aiplatform.googleapis.com.*", "anthos.googleapis.com.*", "apigateway.googleapis.com.*", "apikeys.googleapis.com.*", "appengine.googleapis.com.*", "apps.k8s.io.*", "artifactregistry.googleapis.com.*", "assuredworkloads.googleapis.com.*", "batch.k8s.io.*", "beyondcorp.googleapis.com.*", "bigquery.googleapis.com.*", "bigquerymigration.googleapis.com.*", "bigtableadmin.googleapis.com.*", "cloudbilling.googleapis.com.*", "clouddeploy.googleapis.com.*", "cloudfunctions.googleapis.com.*", "cloudkms.googleapis.com.*", "cloudresourcemanager.googleapis.com.*", "composer.googleapis.com.*", "compute.googleapis.com.*", "connectors.googleapis.com.*", "container.googleapis.com.*", "containerregistry.googleapis.com.*", "dataflow.googleapis.com.*", "dataform.googleapis.com.*", "datafusion.googleapis.com.*", "datamigration.googleapis.com.*", "dataplex.googleapis.com.*", "dataproc.googleapis.com.*", "datastream.googleapis.com.*", "dialogflow.googleapis.com.*", "dlp.googleapis.com.*", "dns.googleapis.com.*", "documentai.googleapis.com.*", "domains.googleapis.com.*", "eventarc.googleapis.com.*", "extensions.k8s.io.*", "file.googleapis.com.*", "firestore.googleapis.com.*", "gameservices.googleapis.com.*", "gkebackup.googleapis.com.*", "gkehub.googleapis.com.*", "healthcare.googleapis.com.*", "iam.googleapis.com.*", "ids.googleapis.com.*", "k8s.io.*", "logging.googleapis.com.*", "managedidentities.googleapis.com.*", "memcache.googleapis.com.*", "metastore.googleapis.com.*", "monitoring.googleapis.com.*", "networkconnectivity.googleapis.com.*", "networking.k8s.io.*", "networkmanagement.googleapis.com.*", "networkservices.googleapis.com.*", "orgpolicy.googleapis.com.*", "osconfig.googleapis.com.*", "privateca.googleapis.com.*", "pubsub.googleapis.com.*", "rbac.authorization.k8s.io.*", "redis.googleapis.com.*", "run.googleapis.com.*", "secretmanager.googleapis.com.*", "servicedirectory.googleapis.com.*", "servicemanagement.googleapis.com.*", "serviceusage.googleapis.com.*", "spanner.googleapis.com.*", "speech.googleapis.com.*", "sqladmin.googleapis.com.*", "storage.googleapis.com.*", "tpu.googleapis.com.*", "transcoder.googleapis.com.*", "vpcaccess.googleapis.com.*", "workflows.googleapis.com.*"] + +# feed_output_config { +# pubsub_destination { +# topic = "projects/joe-test-proj/topics/observe" +# } +# } + + # condition { + # expression = <<-EOT + # temporal_asset.deleted && + # temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST + # EOT + # title = "created and deleted" + # description = "Send notifications on creation events" + # } +# } + +# # The topic where the resource change notifications will be sent. +# resource "google_pubsub_topic" "feed_output" { +# project = "my-project-name" +# name = "network-updates" +# } + +# # The folder that will be monitored for resource updates. +# resource "google_folder" "my_folder" { +# display_name = "Networking" +# parent = "organizations/123456789" +# } + +# # Find the project number of the project whose identity will be used for sending +# # the asset change notifications. +# data "google_project" "project" { +# project_id = "my-project-name" +# } \ No newline at end of file diff --git a/examples/gcp_create_project/main.tf b/examples/gcp_create_project/main.tf new file mode 100644 index 0000000..ded3b09 --- /dev/null +++ b/examples/gcp_create_project/main.tf @@ -0,0 +1,11 @@ + +module "gcp_service_proj" { + source = "../../modules/gcp_project" + org_id = var.org_id + folder_id = var.folder_id + project_id = var.project_id + project_name = var.project_id + billing_account = var.billing_account + project_owners = var.project_owners + #project_editors = ["serviceAccount:1009076385151@cloudservices.gserviceaccount.com"] +} \ No newline at end of file diff --git a/examples/gcp_create_project/project.auto.tfvars b/examples/gcp_create_project/project.auto.tfvars new file mode 100644 index 0000000..f538fbe --- /dev/null +++ b/examples/gcp_create_project/project.auto.tfvars @@ -0,0 +1,5 @@ +billing_account = "value" +org_id = "value" +folder_id = "value" +project_id = "value" +project_owners = ["user:@observeinc.com"] \ No newline at end of file diff --git a/examples/gcp_create_project/variables.tf b/examples/gcp_create_project/variables.tf new file mode 100644 index 0000000..fba64d8 --- /dev/null +++ b/examples/gcp_create_project/variables.tf @@ -0,0 +1,24 @@ +variable "billing_account" { + type = string +} + +variable "org_id" { + type = string + description = "Org ID from GCP console" +} + +variable "folder_id" { + type = string + description = "GCP folder id to deploy service project" +} + + +variable "project_id" { + type = string + description = "GCP project used as a service/collection project" +} + +variable "project_owners" { + description = "Add the user emails of of the project owners" + type = list(string) +} \ No newline at end of file diff --git a/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars b/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars new file mode 100644 index 0000000..029ad42 --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars @@ -0,0 +1,4 @@ +name_format = "joe-test-%s" +project_id = "joe-test-proj" +folder_number = "831845457119" +region = "us-central1" \ No newline at end of file diff --git a/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars.back b/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars.back new file mode 100644 index 0000000..077cc2e --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/ephem-proj.auto.tfvars.back @@ -0,0 +1,3 @@ +project_id = "service-proj-391021" +name_format = "service-proj-%s" +folder_number = "12345678900" \ No newline at end of file diff --git a/examples/gcp_observe_collection_for_folder/main.tf b/examples/gcp_observe_collection_for_folder/main.tf new file mode 100644 index 0000000..a0db67c --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/main.tf @@ -0,0 +1,120 @@ +locals { + projects = data.google_projects.my_folder_projects.projects +} + +####################################################################### +# +# The Obseverve GCP Collection that creates the PubSub, Log Sinks, +# and deploys a GCP Cloud Function used to collect Asset Information +# +####################################################################### + +module "observe_gcp_collection" { + source = "../../" + name = var.name + resource = "folders/${var.folder_number}" +} + +data "google_project" "service_project" { + project_id = var.project_id +} + +##################################################################### +# +# Determines all the sibling GCP Projects inside the folder the +# service/collection project was deployed +# +##################################################################### + +data "google_projects" "my_folder_projects" { + filter = "parent.id:${data.google_project.service_project.folder_id} lifecycleState:ACTIVE" +} + +############################################################### +# +# This enables all the GCP API Services needed for metrics in +# each project in the Folder the service/collection +# Project is deployed. +# +############################################################## + + +module "google_project_service" { + for_each = { + for index, project in local.projects : + project.project_id => project if project.project_id != var.project_id + } + + source = "../../modules/gcp_project_services" + project_id = each.value.project_id + services_to_enable = var.metric_services +} + + +####################################################################################### +# +# This will add all sibling projects that reside in the same +# folder as the collection/service project as Metric Montiored Projects. +# +# The result will be: Metrics for all projects flowing through the collection/service +# project and collected with a single Observe poller. +# +####################################################################################### + +resource "google_monitoring_monitored_project" "primary" { + for_each = { + for index, project in local.projects : + project.project_id => project if project.project_id != var.project_id + } + metrics_scope = var.project_id + name = each.value.project_id +} + +####################################################################################### +# +# The following would replace the steps of creating connections to GPC using Observe +# Pollers inside "Creating the required connections to GCP" +# found in https://docs.observeinc.com/en/latest/content/integrations/gcp/gcp.html#id1 +# +# The following still requires an Observe Datastream to be created. The simplest way +# to accomplish this is by installing the Observe Application for GCP. +# +# NOTE: YOU NEED TO UNCOMMENT OUT THE Observe PROVIER in versions.tf to use below. +# +####################################################################################### + +# locals { +# workspace = data.observe_workspace.default +# datastream = data.observe_datastream.gcp +# } + +# data "observe_workspace" "default" { +# name = "Default" +# } + +# data "observe_datastream" "google" { +# workspace = data.observe_workspace.default.oid +# name = "GCP" +# } + +# module "observe_gcp_metrics_poller" { +# workspace = data.observe_workspace.default +# datastream = data.observe_datastream.google +# source = "../../modules/observe_metrics_poller" +# project_id = var.project_id +# name_format = "${var.project_id}-poller-%s" +# service_account_private_key_json = base64decode(module.observe_gcp_collection.service_account_key.private_key) + +# depends_on = [module.observe_gcp_collection] +# } + +# module "pubsub_poller" { +# source = "../../modules/observe_pubsub_poller" +# workspace = local.workspace +# datastream = local.datastream +# name = format(var.name_format, "assets-logs") +# description = "terraform only poller" +# project = var.project_id +# service_account_private_key_json = base64decode(module.observe_gcp_collection.service_account_key.private_key) +# subscription = module.observe_gcp_collection.subscription.name +# } diff --git a/examples/gcp_observe_collection_for_folder/outputs.tf b/examples/gcp_observe_collection_for_folder/outputs.tf new file mode 100644 index 0000000..7b9f9a7 --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/outputs.tf @@ -0,0 +1,18 @@ +output "subscription" { + description = "The Pub/Sub subscription created by this module." + value = module.observe_gcp_collection.subscription +} + +output "service_account_private_key" { + description = "A service account key sent to the pollers for Pub/Sub and Cloud Monitoring" + value = base64decode(module.observe_gcp_collection.service_account_key.private_key) + sensitive = true +} + +output "project_info" { + value = data.google_project.service_project +} + +output "projects" { + value = data.google_projects.my_folder_projects +} \ No newline at end of file diff --git a/examples/gcp_observe_collection_for_folder/provider.tf b/examples/gcp_observe_collection_for_folder/provider.tf new file mode 100644 index 0000000..b30913e --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/provider.tf @@ -0,0 +1,28 @@ +# locals { +# domain = "observeinc.com" +# customer = "126329491179" +# user_email = "user@observeinc.com" +# } + +# provider "aws" { +# region = "us-west-2" +# } + +# data "aws_secretsmanager_secret" "secret" { +# name = format("tf-password-%s-%s", local.domain, local.customer) +# } + +# data "aws_secretsmanager_secret_version" "secret" { +# secret_id = data.aws_secretsmanager_secret.secret.id +# } + +# provider "observe" { +# customer = local.customer +# domain = local.domain +# user_email = local.user_email +# user_password = data.aws_secretsmanager_secret_version.secret.secret_string +# } + +# provider "google"{ +# project = "joe-test-proj" +# } \ No newline at end of file diff --git a/examples/gcp_observe_collection_for_folder/variables.tf b/examples/gcp_observe_collection_for_folder/variables.tf new file mode 100644 index 0000000..7a8a7c8 --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/variables.tf @@ -0,0 +1,52 @@ +variable "name" { + type = string + description = "Name of Observe's GCP Collection" + default = "observe" +} + +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +variable "folder_number" { + type = string + description = "GCP folder number to deploy sample env" +} + +variable "datastream_name" { + type = string + description = "GCP datastream" + default = "GCP" +} + +variable "region" { + type = string + description = "GCP region to deploy sample env. Required for Google provider." +} + +variable "name_format" { + type = string + description = "Format string to use for infra names." +} + +variable "metric_services" { + description = "Default metric service prefixes to poll" + type = list(string) + default = [ + "cloudfunctions.googleapis.com", + "cloudasset.googleapis.com", + "logging.googleapis.com", + "iam.googleapis.com", + "monitoring.googleapis.com", + "pubsub.googleapis.com", + "storage.googleapis.com", + "sql-component.googleapis.com", + "compute.googleapis.com", + "serviceusage.googleapis.com", + "servicenetworking.googleapis.com", + "container.googleapis.com", + "redis.googleapis.com", + "run.googleapis.com" + ] +} diff --git a/examples/gcp_observe_collection_for_folder/versions.tf b/examples/gcp_observe_collection_for_folder/versions.tf new file mode 100644 index 0000000..4a7815a --- /dev/null +++ b/examples/gcp_observe_collection_for_folder/versions.tf @@ -0,0 +1,18 @@ +terraform { + required_providers { + # observe = { + # source = "terraform.observeinc.com/observeinc/observe" + # version = "~> 0.13" + # } + google = { + source = "hashicorp/google" + version = "<= 4.67.0" + } + } + required_version = ">= 1.3.0" +} + +# provider "google" { +# project = var.project_id +# region = var.region +# } diff --git a/examples/gcp_project_deploy_infra_and_observe_collection/ephem-proj-collect.auto.tfvars b/examples/gcp_project_deploy_infra_and_observe_collection/ephem-proj-collect.auto.tfvars new file mode 100644 index 0000000..ada288f --- /dev/null +++ b/examples/gcp_project_deploy_infra_and_observe_collection/ephem-proj-collect.auto.tfvars @@ -0,0 +1,9 @@ +region = "us-central1" +project_id = "project-id" + +observe = { + customer_id = "126329491179" + otel_datastream_token = "ds1J8gzPachy4fscTzSD:csenknPbvhkV8WHdjVxaShMbf5HgBY6B" + host_datastream_token = "ds1oYxW0CSmcWk14uwsX:hUIOgRqLbLZcrCYdNSnfnkJP0TyR_F_-" + domain = "observeinc.com" +} \ No newline at end of file diff --git a/examples/gcp_project_deploy_infra_and_observe_collection/main.tf b/examples/gcp_project_deploy_infra_and_observe_collection/main.tf new file mode 100644 index 0000000..31d389d --- /dev/null +++ b/examples/gcp_project_deploy_infra_and_observe_collection/main.tf @@ -0,0 +1,105 @@ +locals { + # observe = { + # customer_id = "126329491179" + # otel_datastream_token = "ds1J8gzPachy4fscTzSD:csenknPbvhkV8WHdjVxaShMbf5HgBY6B" + # host_datastream_token = "ds1oYxW0CSmcWk14uwsX:hUIOgRqLbLZcrCYdNSnfnkJP0TyR_F_-" + # domain = "observeinc.com" + # } +} + +# TO DO +# 2. Fix the zones in Compute and LoadBalancing +# 3. instructions for all + +############################################################### +# +# This enables all the GCP Services needed to deploy sample +# GCP infrastructure below +# +############################################################## + + +module "google_project_service" { + source = "../modules/gcp_project_services" + project_id = var.project_id + services_to_enable = var.gcp_services +} + +##################################################################################### +# +# Deploys GCP infrastrucure that will generate requisite data to populate datasets and +# dashboards within the Observe App for GCP +# +##################################################################################### + +module "gcp_sample_infrastructure" { + source = "../modules/gcp_infrastructure" + project_id = var.project_id + region = var.region + zone1 = "${var.region}-a" + zone2 = "${var.region}-b" + name_format = var.name_format + observe = var.observe +} + +##################################################################################### +# +# The following will deploy the Observe GCP Collection that: +# - Deploys Cloud Functions responsible for gathering and sending GCP Asset Inventory +# - A GCP PubSub Topic and Subscription to that Topic +# - Log Sink between Project resources and the Topic +# +##################################################################################### + +module "observe_gcp_collection" { + source = "../../" + name = format(var.name_format, "env") + resource = "projects/${var.project_id}" +} + +####################################################################################### +# +# The following would replace the steps of creating connections to GPC using Observe +# Pollers inside "Creating the required connections to GCP" +# found in https://docs.observeinc.com/en/latest/content/integrations/gcp/gcp.html#id1 +# +# The following still requires an Observe Datastream to be created. The simplest way +# to accomplish this is by installing the Observe Application for GCP. +# +####################################################################################### + +# locals { +# workspace = data.observe_workspace.default +# datastream = data.observe_datastream.gcp +# } + +# data "observe_workspace" "default" { +# name = "Default" +# } + +# data "observe_datastream" "google" { +# workspace = data.observe_workspace.default.oid +# name = "GCP" +# } + +# module "observe_gcp_metrics_poller" { +# workspace = data.observe_workspace.default +# datastream = data.observe_datastream.google +# source = "../../modules/observe_metrics_poller" +# project_id = var.project_id +# name_format = "${var.project_id}-poller-%s" +# service_account_private_key_json = base64decode(module.observe_gcp_collection.service_account_key.private_key) + +# depends_on = [module.observe_gcp_collection] +# } + +# module "pubsub_poller" { +# source = "../../modules/observe_pubsub_poller" +# workspace = local.workspace +# datastream = local.datastream +# name = format(var.name_format, "assets-logs") +# description = "terraform only poller" +# project = var.project_id +# service_account_private_key_json = base64decode(module.observe_gcp_collection.service_account_key.private_key) +# subscription = module.observe_gcp_collection.subscription.name +# } diff --git a/examples/gcp_project_deploy_infra_and_observe_collection/outputs.tf b/examples/gcp_project_deploy_infra_and_observe_collection/outputs.tf new file mode 100644 index 0000000..f920728 --- /dev/null +++ b/examples/gcp_project_deploy_infra_and_observe_collection/outputs.tf @@ -0,0 +1,17 @@ +output "project" { + description = "The Pub/Sub project of the subcription (to be passed to the Pub/Sub poller)" + value = module.observe_gcp_collection.project +} + +# To extract correct value - terraform output -json | jq -r '.subscription.value.name' +output "subscription" { + description = "The Pub/Sub subscription created by this module (to be passed to the Pub/Sub poller)" + value = module.observe_gcp_collection.subscription +} + +# To extract properly formatted string - terraform output -json | jq -r '.service_account_private_key.value' +output "service_account_private_key" { + description = "A service account key to be passed to the pollers for Pub/Sub and Cloud Monitoring" + value = base64decode(module.observe_gcp_collection.service_account_key.private_key) + sensitive = true +} \ No newline at end of file diff --git a/examples/gcp_project_deploy_infra_and_observe_collection/provider.tf b/examples/gcp_project_deploy_infra_and_observe_collection/provider.tf new file mode 100644 index 0000000..fc74f25 --- /dev/null +++ b/examples/gcp_project_deploy_infra_and_observe_collection/provider.tf @@ -0,0 +1,4 @@ +provider "google" { + project = var.project_id + region = var.region +} diff --git a/examples/gcp_project_deploy_infra_and_observe_collection/variables.tf b/examples/gcp_project_deploy_infra_and_observe_collection/variables.tf new file mode 100644 index 0000000..df2d746 --- /dev/null +++ b/examples/gcp_project_deploy_infra_and_observe_collection/variables.tf @@ -0,0 +1,58 @@ +variable "observe" { + type = object({ + customer_id = string + otel_datastream_token = string + host_datastream_token = string + domain = string + }) +} + +variable "project_id" { + type = string + description = "Project ID from GCP console" + # https://support.google.com/googleapi/answer/7014113?hl=en# +} + +variable "region" { + type = string + description = "GCP region to deploy sample env" +} + +variable "name_format" { + type = string + description = "Format string to use for GCP resources." + default = "observe-%s" +} + +variable "gcp_services" { + description = "Default metric service prefixes to poll" + type = list(string) + default = [ + "artifactregistry.googleapis.com", + "bigquery.googleapis.com", + "bigquerydatatransfer.googleapis.com", + "cloudapis.googleapis.com", + "cloudasset.googleapis.com", + "cloudbuild.googleapis.com", + "clouddebugger.googleapis.com", + "cloudfunctions.googleapis.com", + "cloudresourcemanager.googleapis.com", + "cloudscheduler.googleapis.com", + "cloudtrace.googleapis.com", + "compute.googleapis.com", + "container.googleapis.com", + "containerregistry.googleapis.com", + "iam.googleapis.com", + "logging.googleapis.com", + "monitoring.googleapis.com", + "pubsub.googleapis.com", + "run.googleapis.com", + "servicemanagement.googleapis.com", + "serviceusage.googleapis.com", + "storage.googleapis.com", + "redis.googleapis.com", + "memcache.googleapis.com", + "vpcaccess.googleapis.com", + "servicenetworking.googleapis.com" + ] +} diff --git a/function.tf b/function.tf index ee13967..54a06b1 100644 --- a/function.tf +++ b/function.tf @@ -38,18 +38,32 @@ resource "google_pubsub_topic_iam_member" "cloudfunction_pubsub" { member = "serviceAccount:${google_service_account.cloudfunction[0].email}" } +resource "google_storage_bucket" "this" { + name = "${var.name}-bucket" + location = "US" + + force_destroy = true +} + +resource "google_storage_bucket_iam_member" "bucket_iam" { + bucket = google_storage_bucket.this.name + role = "roles/storage.objectCreator" + member = "serviceAccount:${google_service_account.cloudfunction[0].email}" +} + resource "google_cloudfunctions_function" "this" { count = var.enable_function ? 1 : 0 - name = var.name + name = "${var.name}_assets_to_gcs" description = "Polls data from the Google Cloud API and sends to the Observe Pub/Sub topic." service_account_email = google_service_account.cloudfunction[0].email runtime = "python310" environment_variables = merge({ - "PARENT" = var.resource - "TOPIC_ID" = google_pubsub_topic.this.id - "VERSION" = "${var.function_bucket}/${var.function_object}" + "PARENT" = var.resource + "TOPIC_ID" = google_pubsub_topic.this.id + "VERSION" = "${var.function_bucket}/${var.function_object}" + "OUTPUT_BUCKET" = "gs://${google_storage_bucket.this.name}" }, var.function_disable_logging ? { "DISABLE_LOGGING" : "ok" } : {}) trigger_http = true @@ -61,11 +75,52 @@ resource "google_cloudfunctions_function" "this" { source_archive_bucket = var.function_bucket source_archive_object = var.function_object - entry_point = "main" + entry_point = "export_assets" + + labels = var.labels +} + +resource "google_cloudfunctions_function" "gcs_function" { + count = var.enable_function ? 1 : 0 + + name = "${var.name}_gcs_to_pubsub" + description = "Triggered by changes in the Google Cloud Storage bucket and sends data to the Observe Pub/Sub topic." + service_account_email = google_service_account.cloudfunction[0].email + + runtime = "python310" + environment_variables = merge({ + "PARENT" = var.resource + "TOPIC_ID" = google_pubsub_topic.this.id + "VERSION" = "${var.function_bucket}/${var.function_object}" + "OUTPUT_BUCKET" = "gs://${google_storage_bucket.this.name}" + }, var.function_disable_logging ? { "DISABLE_LOGGING" : "ok" } : {}) + + event_trigger { + event_type = "google.storage.object.finalize" + resource = google_storage_bucket.this.name + failure_policy { + retry = false + } + } + + available_memory_mb = var.function_available_memory_mb + timeout = var.function_timeout + max_instances = var.function_max_instances + + source_archive_bucket = var.function_bucket + source_archive_object = var.function_object + entry_point = "gcs_to_pubsub" # This should be the entry point of your Python function for GCS bucket events labels = var.labels } +resource "google_storage_bucket_iam_member" "gcs_function_bucket_iam" { + count = var.enable_function ? 1 : 0 + + bucket = google_storage_bucket.this.name + role = "roles/storage.objectViewer" + member = "serviceAccount:${google_service_account.cloudfunction[0].email}" +} resource "google_service_account" "cloud_scheduler" { count = var.enable_function ? 1 : 0 @@ -83,16 +138,20 @@ resource "google_cloudfunctions_function_iam_member" "cloud_scheduler" { } resource "google_cloud_scheduler_job" "this" { - count = var.enable_function ? 1 : 0 - - name = var.name + name = "${var.name}-job" description = "Triggers the Cloud Function" - schedule = var.function_schedule + schedule = var.function_schedule_frequency http_target { http_method = "POST" uri = google_cloudfunctions_function.this[0].https_trigger_url + headers = { + Content-Type = "application/json" + } + + body = base64encode("{}") + oidc_token { service_account_email = google_service_account.cloud_scheduler[0].email } diff --git a/main.tf b/main.tf index 109a065..26b86ef 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,3 @@ -# If updating this module, also update https://github.com/observeinc/deploymentmanager-google-collection -# The 2 modules should contain same stuff. - locals { resource_type = split("/", var.resource)[0] resource_id = split("/", var.resource)[1] @@ -15,7 +12,13 @@ locals { ) } -data "google_project" "this" {} +data "google_project" "this" { + project_id = local.resource_type == "projects" ? local.resource_id : null +} + +data "google_folder" "this" { + folder = local.resource_type == "folders" ? local.resource_id : null +} resource "google_pubsub_topic" "this" { name = var.name @@ -38,7 +41,7 @@ resource "google_pubsub_subscription" "this" { resource "google_logging_project_sink" "this" { count = local.resource_type == "projects" ? 1 : 0 name = var.name - project = local.resource_id + project = data.google_project.this.project_id destination = "pubsub.googleapis.com/${google_pubsub_topic.this.id}" filter = var.logging_filter @@ -59,7 +62,7 @@ resource "google_logging_folder_sink" "this" { count = local.resource_type == "folders" ? 1 : 0 name = var.name - folder = local.resource_id + folder = data.google_folder.this.folder_id destination = "pubsub.googleapis.com/${google_pubsub_topic.this.id}" filter = var.logging_filter include_children = var.folder_include_children @@ -77,7 +80,6 @@ resource "google_logging_folder_sink" "this" { } } - resource "google_logging_organization_sink" "this" { count = local.resource_type == "organizations" ? 1 : 0 @@ -99,8 +101,6 @@ resource "google_logging_organization_sink" "this" { } } - - resource "google_pubsub_topic_iam_member" "sink_pubsub" { topic = google_pubsub_topic.this.name role = "roles/pubsub.publisher" @@ -129,3 +129,23 @@ resource "google_project_iam_member" "poller" { resource "google_service_account_key" "poller" { service_account_id = google_service_account.poller.name } + +# Asset Feed Per Project + +# data "google_projects" "my_folder_projects" { +# count = local.resource_type == "folders" ? 1 : 0 +# filter = "parent.id:${data.google_project.this.folder_id} lifecycleState:ACTIVE" +# } + +# module "create_asset_feed_folder" { +# for_each = { +# for index, project in data.google_projects.my_folder_projects[0].projects : +# project.project_id => project if project.project_id != var.project_id +# } + +# source = "./modules/gcp_asset_feed" +# project_id = each.value.project_id +# topic_id = google_pubsub_topic.this.id +# feed_name = google_pubsub_topic.this.name +# } + diff --git a/modules/gcp_asset_feed/main.tf b/modules/gcp_asset_feed/main.tf new file mode 100644 index 0000000..be28bd6 --- /dev/null +++ b/modules/gcp_asset_feed/main.tf @@ -0,0 +1,38 @@ + +# Create a feed that sends notifications about network resource updates. +resource "google_cloud_asset_project_feed" "project_feed" { + #project = "projects/${var.project_id}" + project = var.project_id + #feed_id = "projects/${data.google_project.project.number}/feeds/${var.feed_name}" + feed_id = var.feed_name + content_type = "RESOURCE" + + asset_types = ["aiplatform.googleapis.com.*", "anthos.googleapis.com.*", "apigateway.googleapis.com.*", "apikeys.googleapis.com.*", "appengine.googleapis.com.*", "apps.k8s.io.*", "artifactregistry.googleapis.com.*", "assuredworkloads.googleapis.com.*", "batch.k8s.io.*", "beyondcorp.googleapis.com.*", "bigquery.googleapis.com.*", "bigquerymigration.googleapis.com.*", "bigtableadmin.googleapis.com.*", "cloudbilling.googleapis.com.*", "clouddeploy.googleapis.com.*", "cloudfunctions.googleapis.com.*", "cloudkms.googleapis.com.*", "cloudresourcemanager.googleapis.com.*", "composer.googleapis.com.*", "compute.googleapis.com.*", "connectors.googleapis.com.*", "container.googleapis.com.*", "containerregistry.googleapis.com.*", "dataflow.googleapis.com.*", "dataform.googleapis.com.*", "datafusion.googleapis.com.*", "datamigration.googleapis.com.*", "dataplex.googleapis.com.*", "dataproc.googleapis.com.*", "datastream.googleapis.com.*", "dialogflow.googleapis.com.*", "dlp.googleapis.com.*", "dns.googleapis.com.*", "documentai.googleapis.com.*", "domains.googleapis.com.*", "eventarc.googleapis.com.*", "extensions.k8s.io.*", "file.googleapis.com.*", "firestore.googleapis.com.*", "gameservices.googleapis.com.*", "gkebackup.googleapis.com.*", "gkehub.googleapis.com.*", "healthcare.googleapis.com.*", "iam.googleapis.com.*", "ids.googleapis.com.*", "k8s.io.*", "logging.googleapis.com.*", "managedidentities.googleapis.com.*", "memcache.googleapis.com.*", "metastore.googleapis.com.*", "monitoring.googleapis.com.*", "networkconnectivity.googleapis.com.*", "networking.k8s.io.*", "networkmanagement.googleapis.com.*", "networkservices.googleapis.com.*", "orgpolicy.googleapis.com.*", "osconfig.googleapis.com.*", "privateca.googleapis.com.*", "pubsub.googleapis.com.*", "rbac.authorization.k8s.io.*", "redis.googleapis.com.*", "run.googleapis.com.*", "secretmanager.googleapis.com.*", "servicedirectory.googleapis.com.*", "servicemanagement.googleapis.com.*", "serviceusage.googleapis.com.*", "spanner.googleapis.com.*", "speech.googleapis.com.*", "sqladmin.googleapis.com.*", "storage.googleapis.com.*", "tpu.googleapis.com.*", "transcoder.googleapis.com.*", "vpcaccess.googleapis.com.*", "workflows.googleapis.com.*"] + + feed_output_config { + pubsub_destination { + topic = var.topic_id + } + } + + # condition { + # expression = <<-EOT + # !temporal_asset.deleted && + # temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST + # EOT + # title = "created" + # description = "Send notifications on creation events" + # } +} + +# The topic where the resource change notifications will be sent. +# resource "google_pubsub_topic" "feed_output" { +# project = "joe-test-proj" +# name = "observe" +# } + +# Find the project number of the project whose identity will be used for sending +# the asset change notifications. +data "google_project" "project" { + project_id = var.project_id +} \ No newline at end of file diff --git a/modules/gcp_asset_feed/variables.tf b/modules/gcp_asset_feed/variables.tf new file mode 100644 index 0000000..6b96d45 --- /dev/null +++ b/modules/gcp_asset_feed/variables.tf @@ -0,0 +1,15 @@ +variable "project_id" { + type = string + description = "Project ID from GCP console" + # https://support.google.com/googleapi/answer/7014113?hl=en# +} + +variable "feed_name" { + type = string + description = "the topic name where the resources will be sent" +} + +variable "topic_id" { + type = string + description = "the topic name where the resources will be sent" +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/README.md b/modules/gcp_infrastructure/README.md new file mode 100644 index 0000000..8afc673 --- /dev/null +++ b/modules/gcp_infrastructure/README.md @@ -0,0 +1,128 @@ +# What is this +Contents of this folder have the terraform and other code needed to deploy sample infrastructure for all of the services in GCP. + +![Sample Infrastructure](./images/GCP_Sample_Infra.jpeg) + + +# How to deploy sample infrastructure + +!!!The Terraform code in sample_infrastructure assumes you have a GCP Project set up with proper permissions!!! +See "Sample project creation terraform" below for example + +KNOWN ISSUE - If you get the error "Error: Provider produced inconsistent final plan" referencing cloud scheduler change the local variable string in main.tf +``` +hack = "${module.function_bigquery.bucket_object.md5hash}=1234" +``` +main.tf file in this directory contains all the modules contained and will deploy all infrastructure contained. + +It is designed to be read from top to bottom and you can comment out everything and deploy modules one at a time working from top to bottom. + +Modules and their dependencies should be self-explanatory. + +If you comment out modules in main.tf look at corresponding values in output.tf. + +The collection folder contains terraform to deploy collection resources to GCP using either the local path or remote registry. + + +# Deploying sock-shop on GKE instance +The current code is here - https://github.com/observeinc/content-eng-sock-shop-temp/tree/main/sockshop + +Sock-shop deployment with OTEL instrumentation is under development and will change but there should be a link to deployable versions here + +# Sample project creation terraform +``` +locals { + services_to_enable = [ + "artifactregistry.googleapis.com", + "bigquery.googleapis.com", + "bigquerydatatransfer.googleapis.com", + "cloudapis.googleapis.com", + "cloudasset.googleapis.com", + "cloudbuild.googleapis.com", + "clouddebugger.googleapis.com", + "cloudfunctions.googleapis.com", + "cloudresourcemanager.googleapis.com", + "cloudscheduler.googleapis.com", + "cloudtrace.googleapis.com", + "compute.googleapis.com", + "container.googleapis.com", + "containerregistry.googleapis.com", + "iam.googleapis.com", + "logging.googleapis.com", + "monitoring.googleapis.com", + "pubsub.googleapis.com", + "run.googleapis.com", + "servicemanagement.googleapis.com", + "serviceusage.googleapis.com", + "storage.googleapis.com", + "redis.googleapis.com" + ] +} + +resource "google_project" "project" { + name = var.project_name + project_id = var.project_id + # omit folder id if not using + folder_id = var.folder_id + + billing_account = var.billing_account +} + + +resource "google_project_service" "project" { + for_each = { for value in local.services_to_enable : value => value } + project = var.project_id + service = each.value + + timeouts { + create = "30m" + update = "40m" + } + + disable_dependent_services = true +} + +resource "google_project_iam_binding" "project" { + project = google_project.project.project_id + role = "roles/owner" + + members = setunion([ + ], var.project_owner + ) +} + +variable "project_name" { + type = string +} + +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "org_id" { + type = string +} + +variable "folder_id" { + type = string +} + +variable "billing_account" { + type = string +} + +variable "project_owner" { + default = [] +} + +output "project" { + value = google_project.project +} + +output "project_id" { + value = var.project_id +} + +``` + diff --git a/modules/gcp_infrastructure/images/GCP_Sample_Infra.jpeg b/modules/gcp_infrastructure/images/GCP_Sample_Infra.jpeg new file mode 100644 index 0000000..8f54d89 Binary files /dev/null and b/modules/gcp_infrastructure/images/GCP_Sample_Infra.jpeg differ diff --git a/modules/gcp_infrastructure/main.tf b/modules/gcp_infrastructure/main.tf new file mode 100644 index 0000000..babaa6b --- /dev/null +++ b/modules/gcp_infrastructure/main.tf @@ -0,0 +1,428 @@ +locals { + name_format = var.name_format + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # There is a stupid bug that makes permissions for cloud scheduler not work right unless I change this when it has inconsitent plan + hack = "${module.function_bigquery.bucket_object.md5hash}=1234" +} + +#------------------------------------------------------------------------# +/* +Assumed that variables are set via you.auto.tfvars + +Example - +project_id = "YOURS" +region = "us-central1" +zone1 = "us-central1-a" +zone2 = "us-central1-b" +name_format = "YOURS-%s" +observe = { + customer_id = "YOURS" + datastream_token = "YOURS" + domain = "observe-staging.com" +} + +Modules are for each part of the GCP stack we have built services for + +Modules for each deployed serve are here - sample_infrastructure/service_modules + +Modules can be repeated as long as you chage names + +Function code is organized here - sample_infrastructure/python_scripts +-- All functions are designed to use otel collector and are triggered by cloud scheduler jobs + + +*/ +#------------------------------------------------------------------------# + + +#------------------------------------------------------------------------# +# Create a Compute Instance that Load Balancing can front +#------------------------------------------------------------------------# +module "compute" { + source = "./service_modules/compute" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "compute-%s") + observe = { + domain : var.observe.domain + install_linux_host_monitoring : true, + customer_id : var.observe.customer_id + datastream_token : var.observe.host_datastream_token + } + # use_branch_name = "main" + compute_instance_count = 1 + config_bucket_name = module.config_bucket.bucket_name +} + +module "config_bucket" { + source = "./service_modules/config_bucket" + project_id = var.project_id + # region = var.region + name_format = format(var.name_format, "config_bucket-%s") +} + +#------------------------------------------------------------------------# +# Create a Load Balancer +#------------------------------------------------------------------------# +module "loadbalancing" { + # depends_on = [module.project] + # count = local.modules_var["loadbalancing"].create == true ? 1 : 0 + source = "./service_modules/loadbalancing" + project_id = var.project_id + region = var.region + name_format = var.name_format + # these instances have to be in the same region as the load balancer target group + # using a filter in compute module to produce a list in the same region even though we produce instances in other regions + target_group_instances = module.compute.target_group_instances +} + +#------------------------------------------------------------------------# +# create a compute based otel collector pointed at observe +#------------------------------------------------------------------------# +module "compute_otel_collector" { + source = "./service_modules/compute_otel_collector" + project_id = var.project_id + # region = var.region + zone = "${var.region}-a" + name_format = format(var.name_format, "otel-%s") + observe = var.observe +} + +#------------------------------------------------------------------------# +# Create a big query dataset and tables +#------------------------------------------------------------------------# +# Important - tables expire based on dataset property see module for details +module "bigquery" { + source = "./service_modules/bigquery" + project_id = var.project_id + # region = var.region + name_format = local.name_format +} + +#------------------------------------------------------------------------# +# create function to read and write against big query +#------------------------------------------------------------------------# +module "function_bigquery" { + source = "./service_modules/cloud_function" + project_id = var.project_id + region = var.region + # zone = "${var.region}-a" + name_format = format(var.name_format, "bq-%s") + function_roles = [ + "roles/browser", # for viewing projects + "roles/bigquery.jobUser", + "roles/bigquery.dataViewer", + "roles/bigquery.dataEditor" + ] + environment_variables = { + CONSOLE_LOGGING = "TRUE" + COLLECTOR_LOGGING = "TRUE" + COLLECTOR_ENDPOINT = "http://${module.compute_otel_collector.gcp_ubuntu_box.compute_instances.UBUNTU_20_04_LTS_0.public_ip}:4317" + } + source_dir = "${path.module}/python_scripts/function_code/bigquery" + output_path = "${path.module}/python_scripts/function_code/bigquery/zip_files/bigquery_func_code.zip" +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job that writes to bigquery table +#------------------------------------------------------------------------# +module "cloud_scheduler_bigquery_write" { + depends_on = [ + module.function_bigquery + ] + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "bqwrite-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_bigquery.cloud_function_trigger + cloud_function_name = module.function_bigquery.cloud_function_name + body = base64encode(jsonencode({ + "method" : "write", + "biq_query_table" : module.bigquery.bigquery_selflink2 })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job that reads bigquery table +#------------------------------------------------------------------------# +module "cloud_scheduler_bigquery_read" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "bqread-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_bigquery.cloud_function_trigger + cloud_function_name = module.function_bigquery.cloud_function_name + body = base64encode(jsonencode({ + "method" : "read", + "biq_query_table" : module.bigquery.bigquery_selflink2 })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud sql instances +#------------------------------------------------------------------------# +module "cloudsql" { + source = "./service_modules/cloudsql" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "sql-%s") + database_filter = ["MYSQL_8_0", "POSTGRES_14"] # WARNING SQL SERVER IS EXPENSIVE "MYSQL_8_0", "POSTGRES_14", "SQLSERVER_2019_STANDARD"] +} + +#------------------------------------------------------------------------# +# Create function to read and write to mysql instance +#------------------------------------------------------------------------# +module "function_mysql" { + source = "./service_modules/cloud_function" + project_id = var.project_id + region = var.region + # zone = "${var.region}-a" + name_format = format(var.name_format, "mysql-%s") + function_roles = [ + "roles/browser", # for viewing projects + ] + + environment_variables = { + MYSQL_HOST = module.cloudsql.connection_string.MYSQL_8_0.host + MYSQL_DBNAME = module.cloudsql.connection_string.MYSQL_8_0.database_name + MYSQL_USER = module.cloudsql.connection_string.MYSQL_8_0.username + MYSQL_PASSWORD = module.cloudsql.connection_string.MYSQL_8_0.password + CONSOLE_LOGGING = "TRUE" + COLLECTOR_LOGGING = "TRUE" + COLLECTOR_ENDPOINT = "http://${module.compute_otel_collector.gcp_ubuntu_box.compute_instances.UBUNTU_20_04_LTS_0.public_ip}:4317" + } + source_dir = "${path.module}/python_scripts/function_code/mysql" + output_path = "${path.module}/python_scripts/function_code/mysql/zip_files/mysql_func_code.zip" +} + + +/* Local test for python in function +tf output -json | jq -r '.cloudsql.value.connection_string' +export COLLECTOR_ENDPOINT=http://146.148.79.73:4317; +export MYSQL_HOST=34.71.192.247; +export MYSQL_DBNAME=cloud_freak; +export MYSQL_USER=redfish; +export MYSQL_PASSWORD=G0ZKH8qI; +python3 main.py '{"method": "write"}' +*/ +#------------------------------------------------------------------------# +# Create cloud scheduler job to write to mysql instance +#------------------------------------------------------------------------# +module "cloud_scheduler_mysql_write" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "mysqlwrite-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_mysql.cloud_function_trigger + cloud_function_name = module.function_mysql.cloud_function_name + body = base64encode(jsonencode({ + "method" : "write" })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job to read from mysql instance +#------------------------------------------------------------------------# +module "cloud_scheduler_mysql_read" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "mysqlread-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_mysql.cloud_function_trigger + cloud_function_name = module.function_mysql.cloud_function_name + body = base64encode(jsonencode({ + "method" : "read" })) + md5hash = local.hack +} + +/* Local test for python in function +tf output -json | jq -r '.cloudsql.value.connection_string' +export COLLECTOR_ENDPOINT=http://146.148.79.73:4317; +export POSTGRES_HOST=34.173.99.224; +export POSTGRES_DBNAME=cloud_freak; +export POSTGRES_USER=mutt; +export POSTGRES_PASSWORD=IhYip5b9; +python3 main.py '{"method": "write"}' +*/ +#------------------------------------------------------------------------# +# Create function to read and write to postgres instance +#------------------------------------------------------------------------# +module "function_postgres" { + source = "./service_modules/cloud_function" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "postgres-%s") + function_roles = [ + "roles/browser", # for viewing projects + ] + + environment_variables = { + POSTGRES_HOST = module.cloudsql.connection_string.POSTGRES_14.host + POSTGRES_DBNAME = module.cloudsql.connection_string.POSTGRES_14.database_name + POSTGRES_USER = module.cloudsql.connection_string.POSTGRES_14.username + POSTGRES_PASSWORD = module.cloudsql.connection_string.POSTGRES_14.password + CONSOLE_LOGGING = "TRUE" + COLLECTOR_LOGGING = "TRUE" + COLLECTOR_ENDPOINT = "http://${module.compute_otel_collector.gcp_ubuntu_box.compute_instances.UBUNTU_20_04_LTS_0.public_ip}:4317" + } + source_dir = "${path.module}/python_scripts/function_code/postgres" + output_path = "${path.module}/python_scripts/function_code/postgres/zip_files/postgres_func_code.zip" +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job to write to postgres instance +#------------------------------------------------------------------------# +module "cloud_scheduler_postgres_write" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "pgwrite-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_postgres.cloud_function_trigger + cloud_function_name = module.function_postgres.cloud_function_name + body = base64encode(jsonencode({ + "method" : "write" })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job to read from postgres instance +#------------------------------------------------------------------------# +module "cloud_scheduler_postgres_read" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "pgread-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_postgres.cloud_function_trigger + cloud_function_name = module.function_postgres.cloud_function_name + body = base64encode(jsonencode({ + "method" : "read" })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create kubernetes cluster +#------------------------------------------------------------------------# +module "gke" { + source = "./service_modules/gke" + project_id = var.project_id + region = var.region + name_format = var.name_format + node_machine_type = "n1-standard-4" + gke_num_nodes = 1 +} + +#------------------------------------------------------------------------# +# Create container registry +#------------------------------------------------------------------------# +resource "google_artifact_registry_repository" "my_repo" { + location = var.region + project = var.project_id + repository_id = "sockshop-registry" + description = "sockshop docker repository" + format = "DOCKER" +} + +#------------------------------------------------------------------------# +# Create redis instance +#------------------------------------------------------------------------# +module "redis" { + source = "./service_modules/redis" + project_id = var.project_id + region = var.region + zone1 = var.zone1 + zone2 = var.zone2 + name_format = var.name_format +} + +#------------------------------------------------------------------------# +# Create vpc access connector for redis instance +#------------------------------------------------------------------------# +data "google_compute_network" "default" { + name = "default" + project = var.project_id +} +resource "google_vpc_access_connector" "connector" { + name = format(var.name_format, "redis-con") + ip_cidr_range = "10.0.2.0/28" + network = data.google_compute_network.default.name + project = var.project_id + region = var.region + machine_type = "e2-standard-4" +} + +#------------------------------------------------------------------------# +# Create function to read and write to redis instance +#------------------------------------------------------------------------# +module "function_redis" { + source = "./service_modules/cloud_function" + project_id = var.project_id + region = var.region + + name_format = format(var.name_format, "redis-%s") + function_roles = [ + "roles/browser", # for viewing projects + ] + + environment_variables = { + REDIS_HOST = module.redis.host + REDIS_PORT = module.redis.port + CONSOLE_LOGGING = "TRUE" + COLLECTOR_LOGGING = "TRUE" + COLLECTOR_ENDPOINT = "http://${module.compute_otel_collector.gcp_ubuntu_box.compute_instances.UBUNTU_20_04_LTS_0.public_ip}:4317" + } + + source_dir = "${path.module}/python_scripts/function_code/redis" + output_path = "${path.module}/python_scripts/function_code/postgres/zip_files/redis_func_code.zip" + vpc_connector_id = google_vpc_access_connector.connector.id +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job to write to redis instance +#------------------------------------------------------------------------# +module "cloud_scheduler_redis_write" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "redwrite-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_redis.cloud_function_trigger + cloud_function_name = module.function_redis.cloud_function_name + body = base64encode(jsonencode({ + "method" : "write" })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud scheduler job to read from postgres instance +#------------------------------------------------------------------------# +module "cloud_scheduler_redis_read" { + source = "./service_modules/cloud_scheduler" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "redread-%s") + schedule = "* * * * *" + cloud_function_uri = module.function_redis.cloud_function_trigger + cloud_function_name = module.function_redis.cloud_function_name + body = base64encode(jsonencode({ + "method" : "read" })) + md5hash = local.hack +} + +#------------------------------------------------------------------------# +# Create cloud run instance +#------------------------------------------------------------------------# +module "cloud_run" { + source = "./service_modules/cloud_run" + project_id = var.project_id + region = var.region + name_format = format(var.name_format, "redread-%s") + +} +# need to add Eventarc trigger service to projects diff --git a/modules/gcp_infrastructure/outputs.tf b/modules/gcp_infrastructure/outputs.tf new file mode 100644 index 0000000..1fc0731 --- /dev/null +++ b/modules/gcp_infrastructure/outputs.tf @@ -0,0 +1,80 @@ +output "bigquery" { + value = module.bigquery + sensitive = true +} +# endpoints for bigquery operations +# tf output -json | jq -r '.bigquery.value.bigquery_selflink' +# tf output -json | jq -r '.bigquery.value.bigquery_selflink2' + +output "compute_otel_collector" { + value = module.compute_otel_collector + sensitive = true +} +# tf output -json | jq -r '.compute_otel_collector.value.gcp_ubuntu_box.compute_instances' +# sudo journalctl -u otelcol + + +output "function_bigquery" { + value = module.function_bigquery + sensitive = true +} + +output "function_bigquery_write_payload" { + value = jsonencode({ + "method" : "write", + "biq_query_table" : module.bigquery.bigquery_selflink2 }) +} +# tf output -json | jq -r '.function_bigquery_write_payload.value' + +output "collector_endpoint" { + value = "http://${module.compute_otel_collector.gcp_ubuntu_box.compute_instances.UBUNTU_20_04_LTS_0.public_ip}:4317" + sensitive = true +} +# tf output -json | jq -r '.collector_endpoint.value' + +output "cloudsql" { + value = module.cloudsql + sensitive = true +} +# tf output -json | jq -r '.cloudsql.value.connection_string' + +output "function_mysql" { + value = module.function_mysql + sensitive = true +} +# tf output -json | jq -r '.function_mysql.value.cloud_function_trigger' + +output "function_postgres" { + value = module.function_postgres + sensitive = true +} +# tf output -json | jq -r '.function_postgres.value' + + + +output "gke" { + value = module.gke + sensitive = true +} +# tf output -json | jq -r '.gke.value' + +output "google_artifact_registry_repository" { + value = google_artifact_registry_repository.my_repo + sensitive = true +} +# tf output -json | jq -r '.google_artifact_registry_repository.value' + + +output "redis" { + value = module.redis + sensitive = true +} +# tf output -json | jq -r '.redis.value' + +output "function_redis" { + value = module.function_redis + sensitive = true +} +# tf output -json | jq -r '.function_redis.value' + + diff --git a/modules/gcp_infrastructure/providers.tf b/modules/gcp_infrastructure/providers.tf new file mode 100644 index 0000000..3a5dc9c --- /dev/null +++ b/modules/gcp_infrastructure/providers.tf @@ -0,0 +1,21 @@ +# PROVIDERS +terraform { + + required_providers { + google = { + source = "hashicorp/google" + version = "<= 4.67.0" + } + + archive = { + source = "hashicorp/archive" + version = ">= 2.2.0" + } + + random = { + source = "hashicorp/random" + version = ">= 3.4.3" + } + } + required_version = ">= 1.3.0" +} diff --git a/modules/gcp_infrastructure/python_scripts/flask_app/main.py b/modules/gcp_infrastructure/python_scripts/flask_app/main.py new file mode 100644 index 0000000..6141a03 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/flask_app/main.py @@ -0,0 +1,98 @@ +"""flask app for creating api""" +from subprocess import check_output +import urllib.request +import urllib.parse +import requests +import json +from flask import Flask, render_template, request +from google.cloud import bigquery +import mysql.connector +from mysql.connector import Error +import psycopg2 +from psycopg2.extras import RealDictCursor + +print("Flask App Statrtup") + + +def callurl(url): + """Call a url and return response""" + + try: + response = urllib.request.urlopen(url) + new_data = response.read() + + return new_data + # pylint: disable=broad-except; + except Exception as call_error: + return {"error": response} + + +app = Flask(__name__) + + +@app.route("/", methods=["GET", "POST"]) +def hello(): + """Simple HeathCheck""" + + return "Do you know what you are doing?" + + +@app.route("/bigquery_add_ip", methods=["POST"]) +def add_ip(): + """Call biqquery""" + print("called") + print(f"BigQuery version: {bigquery.__version__}") + + print(request.form["biq_query_table"]) + table_connection = request.form["biq_query_table"] + print(table_connection) + # example - "content-testpproj-stage-1.test_stg_dataset.test-stg-table" + + # ip_list = open("../bucket/ip/bigquery_addresses.json", encoding="utf-8") + # table_connections = json.load(ip_list) + + # result_dict = [] + + # # pylint: disable=too-many-nested-blocks; + # for key in table_connections: + + client = bigquery.Client() + + print("client") + insert_job = client.query( + f""" + insert into `{table_connection}` + (ip_address,resource_name, timestamp) + values ( + "test", "test", CURRENT_DATETIME() + ) + """ + ) + results = insert_job.result() + print(results) + + # query_job = client.query( + # f""" + # select permalink,state,timestamp + # from `{big_query_table}` + # order by timestamp desc + # limit 10 + # """ + # ) + # results = query_job.result() + # print("after") + + # for row in results: + # # print("{} : {} views".format(row.url, row.view_count)) + # print(row) + # result_dict.append( + # { + # "big_query_table": big_query_table, + # "permalink": row.permalink, + # "state": row.state, + # "timestamp": row.timestamp, + # } + # ) + # print(result_dict) + + return "OK" diff --git a/modules/gcp_infrastructure/python_scripts/flask_app/requirements.txt b/modules/gcp_infrastructure/python_scripts/flask_app/requirements.txt new file mode 100644 index 0000000..cde8199 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/flask_app/requirements.txt @@ -0,0 +1,21 @@ +cachetools==5.2.0 +certifi==2022.9.24 +charset-normalizer==2.1.1 +google-api-core==2.10.2 +google-auth==2.13.0 +google-cloud==0.34.0 +google-cloud-compute==1.6.1 +google-cloud-pubsub==2.13.10 +googleapis-common-protos==1.56.4 +grpc-google-iam-v1==0.12.4 +grpcio==1.50.0 +grpcio-status==1.50.0 +idna==3.4 +proto-plus==1.22.1 +protobuf==4.21.8 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +requests==2.28.1 +rsa==4.9 +six==1.16.0 +urllib3==1.26.12 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/bigquery/main.py b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/main.py new file mode 100644 index 0000000..d84e334 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/main.py @@ -0,0 +1,115 @@ +import redis +import json +import time +import os +import tracing +import traceback +import typing +import sys +from google.cloud import bigquery + + +# based on Luke's work here - https://github.com/observeinc/google-cloud-functions/blob/main/main.py +def main(request) -> typing.List[dict]: + """Call biqquery""" + my_trace = tracing.tracer + + res = [] + try: + print("called") + print(f"BigQuery version: {bigquery.__version__}") + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + biq_query_table = jstr["biq_query_table"] + print(f"method = {method}") + print(f"biq_query_table = {biq_query_table}") + # example - "content-testpproj-stage-1.test_stg_dataset.test-stg-table" + + with my_trace.start_as_current_span(f"{method}bigquery") as span: + span.set_attribute("BIQ_QUERY_TABLE", biq_query_table) + + except Exception as e: + print("ERROR") + print(e) + with my_trace.start_as_current_span("bigquery ERROR") as span: + span.set_attribute("ERROR", e) + print(repr(e)) + return repr(e), 500 + + client = bigquery.Client() + + if method == "error": + try: + raise ValueError("A very specific bad thing happened") + except Exception as e: + print(repr(e)) + return repr(e), 500 + + if method == "write": + + t = time.time() + ml = int(t * 1000) + + start_string = f""" +insert into `{biq_query_table}` +(id,name, timestamp) +values ( +"start", "start", CURRENT_DATETIME() +), + """ + # create a set of fake keys and values based on current time + range_num = 10 + for number in range(range_num): + part1 = f'("{ml}-{number}", "Name-{ml}-{number}", CURRENT_DATETIME())' + if number == (range_num - 1): + part2 = "" + else: + part2 = ",\n" + start_string = start_string + part1 + part2 + + print(start_string) + insert_job = client.query(start_string) + results = insert_job.result() + return "OK", 200 + + if method == "read": + query_job = client.query( + f""" + select count(*) + from `{biq_query_table}` + """ + ) + results = query_job.result() + + with my_trace.start_as_current_span(f"{method}bigquery") as span: + span.set_attribute("BIQ_QUERY_TABLE", biq_query_table) + span.set_attribute("results", results) + return "OK", 200 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + print("Need 1 args") + elif args == 2: + request = sys.argv[1] + else: + print("Need 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(request) + + +# '{"method": "write","biq_query_table": "content-eng-sample-infra.sample_infra_dataset.sample-infra-table-2",}' diff --git a/modules/gcp_infrastructure/python_scripts/function_code/bigquery/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/requirements.txt new file mode 100644 index 0000000..cb96860 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/requirements.txt @@ -0,0 +1,35 @@ +async-timeout==4.0.2 +backoff==2.2.1 +cachetools==5.3.0 +certifi==2022.12.7 +charset-normalizer==3.0.1 +Deprecated==1.2.13 +google-api-core==2.11.0 +google-auth==2.16.1 +google-cloud==0.34.0 +google-cloud-bigquery==3.5.0 +google-cloud-core==2.3.2 +google-crc32c==1.5.0 +google-resumable-media==2.4.1 +googleapis-common-protos==1.58.0 +grpcio==1.51.1 +grpcio-status==1.51.1 +idna==3.4 +opentelemetry-api==1.15.0 +opentelemetry-exporter-otlp-proto-grpc==1.15.0 +opentelemetry-proto==1.15.0 +opentelemetry-sdk==1.15.0 +opentelemetry-semantic-conventions==0.36b0 +packaging==23.0 +proto-plus==1.22.2 +protobuf==4.22.0 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +redis==4.4.2 +requests==2.28.2 +rsa==4.9 +six==1.16.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wrapt==1.14.1 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/bigquery/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/tracing.py new file mode 100644 index 0000000..69a5202 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/tracing.py @@ -0,0 +1,42 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource + +resource = Resource(attributes={SERVICE_NAME: "cloud_function_bigquery"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", "FALSE") +collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +provider = sdktrace.TracerProvider(resource=resource) + +print(f"console_logging = {console_logging}") + +print(f"collector_logging = {collector_logging}") + +if disable_logging is None: + if console_logging.upper() == "TRUE": + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging.upper() == "TRUE": + print("Collector Logging Enabled") + _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) + provider.add_span_processor(_processor) + + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/bigquery/zip_files/bigquery_func_code.zip b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/zip_files/bigquery_func_code.zip new file mode 100644 index 0000000..3670d27 Binary files /dev/null and b/modules/gcp_infrastructure/python_scripts/function_code/bigquery/zip_files/bigquery_func_code.zip differ diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/README.md b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/README.md new file mode 100644 index 0000000..37d9391 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/README.md @@ -0,0 +1,9 @@ +export OTEL_SERVICE_NAME=auto-instrument; +export OTEL_TRACES_EXPORTER=otlp_proto_http; +export OTEL_METRICS_EXPORTER=console; +export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=146.148.79.73:4317; +export MYSQL_HOST=34.71.192.247; +export MYSQL_DBNAME=cloud_freak; +export MYSQL_USER=redfish; +export MYSQL_PASSWORD=G0ZKH8qI; +opentelemetry-instrument python3 main.py '{"method": "write"}' \ No newline at end of file diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/main.py b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/main.py new file mode 100644 index 0000000..6334f4e --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/main.py @@ -0,0 +1,185 @@ +import typing +import sys +import mysql.connector +from mysql.connector import Error +import json +import tracing +import traceback +import os + +mysql_host = os.getenv("MYSQL_HOST") +mysql_dbname = os.getenv("MYSQL_DBNAME") +mysql_user = os.getenv("MYSQL_USER") +mysql_password = os.getenv("MYSQL_PASSWORD") + + +def main(request) -> typing.List[dict]: + """Call mysql instances""" + # my_trace = tracing.tracer + db_data = {"databases": [], "tables": [], "data": []} + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + + # pylint: disable=too-many-nested-blocks; + # with my_trace.start_as_current_span(f"{method}-mysql") as span: + # span.set_attribute("mysql_host", mysql_host) + # span.set_attribute("mysql_dbname", mysql_dbname) + + try: + print("called") + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + + # example - "content-testpproj-stage-1.test_stg_dataset.test-stg-table" + + except Exception as e: + print("ERROR") + print(e) + with my_trace.start_as_current_span("mysql ERROR") as span: + span.set_attribute("ERROR", e) + print(repr(e)) + return repr(e), 500 + + try: + connection = mysql.connector.connect( + host=mysql_host, + database=mysql_dbname, + user=mysql_user, + password=mysql_password, + ) + + if connection.is_connected(): + db_info = connection.get_server_info() + # with my_trace.start_as_current_span(f"connection-mysql") as span: + # span.add_event(f"Connected to MySQL Server version {db_info}") + # span.set_attribute("Connected to MySQL Server version ", db_info) + + print("Connected to MySQL Server version ", db_info) + cursor = connection.cursor(dictionary=True) + + cursor.execute("select database() as db;") + + for data_bases in cursor: + print(data_bases) + db_data["databases"].append( + { + "instance": mysql_dbname, + "host": mysql_host, + "database": data_bases["db"], + } + ) + + if method == "write": + # with my_trace.start_as_current_span(f"createtable-mysql") as span: + + cursor.execute( + """CREATE TABLE IF NOT EXISTS python_created( + task_id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + """ + ) + + # with my_trace.start_as_current_span( + # f"insert-table-mysql" + # ) as span: + sql = "insert into python_created(title,description) values(%s, %s)" + val = ("Python is doing this", "call to database") + rtn = cursor.execute(sql, val) + connection.commit() + # span.add_event("Success") + # span.set_attribute("Result", "Success") + return "SUCCESS", 200 + + if method == "read": + # with my_trace.start_as_current_span(f"readtables-mysql") as span: + cursor.execute( + "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'cloud_freak'" + ) + + for table in cursor: + print(table) + db_data["tables"].append( + {"instance": mysql_dbname, "table": table["TABLE_NAME"]} + ) + + cursor.execute( + "select count(*) as record_count from python_created" + ) + + for data in cursor: + print(data) + + # span.add_event("Read rows in python created table") + cursor.execute( + # pylint: disable=line-too-long; + "select DATE_FORMAT(max(python_created.created_at),'%d/%m/%Y %l:%i %p') as last_created, DATE_FORMAT(min(python_created.created_at),'%d/%m/%Y %l:%i %p') as first_created, cnt.record_count as record_count from python_created cross join (select count(*) as record_count from python_created) as cnt group by cnt.record_count" + ) + + myresult = cursor.fetchall() + + for data in myresult: + print(data) + db_data["data"].append( + { + "instance": mysql_dbname, + "row": { + "first_created": data["first_created"], + "last_created": data["last_created"], + "records": data["record_count"], + }, + } + ) + # span.add_event(str(db_data)) + return db_data, 200 + + except Error as call_error: + print("Error while connecting to MySQL", call_error) + print(repr(e)) + return repr(e), 500 + + finally: + if connection.is_connected(): + cursor.close() + connection.close() + print("MySQL connection is closed") + else: + print("not mysql") + + return "Finally OK", 200 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + print("Need 1 args") + elif args == 2: + request = sys.argv[1] + else: + print("Need 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(request) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/requirements.txt new file mode 100644 index 0000000..2140b32 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/requirements.txt @@ -0,0 +1,27 @@ +async-timeout==4.0.2 +backoff==2.2.1 +cachetools==5.3.0 +certifi==2022.12.7 +charset-normalizer==3.0.1 +Deprecated==1.2.13 +grpcio==1.51.1 +grpcio-status==1.51.1 +idna==3.4 +mysql-connector==2.2.9 +opentelemetry-api==1.15.0 +opentelemetry-exporter-otlp-proto-grpc==1.15.0 +opentelemetry-proto==1.15.0 +opentelemetry-sdk==1.15.0 +opentelemetry-semantic-conventions==0.36b0 +packaging==23.0 +proto-plus==1.22.2 +protobuf==4.22.0 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +requests==2.28.2 +rsa==4.9 +six==1.16.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wrapt==1.14.1 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/tracing.py new file mode 100644 index 0000000..a415953 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql-auto/tracing.py @@ -0,0 +1,42 @@ +# import os + +# from opentelemetry import trace +# from opentelemetry.sdk import trace as sdktrace +# from opentelemetry.sdk.trace import export + +# from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +# from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +# from opentelemetry.sdk.resources import SERVICE_NAME, Resource + +# resource = Resource(attributes={SERVICE_NAME: "cloud_function_mysql"}) + +# disable_logging = os.getenv("DISABLE_LOGGING") +# console_logging = os.getenv("CONSOLE_LOGGING", "TRUE") +# collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +# collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +# provider = sdktrace.TracerProvider(resource=resource) + +# print(f"console_logging = {console_logging}") + +# print(f"collector_logging = {collector_logging}") + +# if disable_logging is None: +# if console_logging.upper() == "TRUE": +# print("Console Logging Enabled") +# _processor2 = export.BatchSpanProcessor( +# # Set indent to none to avoid multi-line logs +# export.ConsoleSpanExporter( +# formatter=lambda s: s.to_json(indent=None) + "\n" +# ) +# ) +# provider.add_span_processor(_processor2) + +# if collector_logging.upper() == "TRUE": +# print("Collector Logging Enabled") +# _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) +# provider.add_span_processor(_processor) + +# trace.set_tracer_provider(provider) + +# tracer = trace.get_tracer(__name__) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql/main.py b/modules/gcp_infrastructure/python_scripts/function_code/mysql/main.py new file mode 100644 index 0000000..dadae7f --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql/main.py @@ -0,0 +1,192 @@ +import typing +import sys +import mysql.connector +from mysql.connector import Error +import json +import tracing +import traceback +import os + +from opentelemetry.instrumentation.mysql import MySQLInstrumentor + + +mysql_host = os.getenv("MYSQL_HOST") +mysql_dbname = os.getenv("MYSQL_DBNAME") +mysql_user = os.getenv("MYSQL_USER") +mysql_password = os.getenv("MYSQL_PASSWORD") + + +def main(request) -> typing.List[dict]: + """Call mysql instances""" + my_trace = tracing.tracer + db_data = {"databases": [], "tables": [], "data": []} + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + + # pylint: disable=too-many-nested-blocks; + with my_trace.start_as_current_span(f"{method}-mysql") as span: + span.set_attribute("mysql_host", mysql_host) + span.set_attribute("mysql_dbname", mysql_dbname) + + try: + print("called") + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + + # example - "content-testpproj-stage-1.test_stg_dataset.test-stg-table" + + except Exception as e: + print("ERROR") + print(e) + with my_trace.start_as_current_span("mysql ERROR") as span: + span.set_attribute("ERROR", e) + print(repr(e)) + return repr(e), 500 + + try: + connection = MySQLInstrumentor().instrument_connection( + mysql.connector.connect( + host=mysql_host, + database=mysql_dbname, + user=mysql_user, + password=mysql_password, + ) + ) + # MySQLInstrumentor().instrument_connection(connection, my_trace) + if connection.is_connected(): + db_info = connection.get_server_info() + with my_trace.start_as_current_span(f"connection-mysql") as span: + span.add_event(f"Connected to MySQL Server version {db_info}") + # span.set_attribute("Connected to MySQL Server version ", db_info) + + print("Connected to MySQL Server version ", db_info) + cursor = connection.cursor(dictionary=True) + + cursor.execute("select database() as db;") + + for data_bases in cursor: + print(data_bases) + db_data["databases"].append( + { + "instance": mysql_dbname, + "host": mysql_host, + "database": data_bases["db"], + } + ) + + if method == "write": + with my_trace.start_as_current_span(f"createtable-mysql") as span: + + cursor.execute( + """CREATE TABLE IF NOT EXISTS python_created( + task_id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + """ + ) + + with my_trace.start_as_current_span( + f"insert-table-mysql" + ) as span: + sql = "insert into python_created(title,description) values(%s, %s)" + val = ("Python is doing this", "call to database") + rtn = cursor.execute(sql, val) + connection.commit() + span.add_event("Success") + span.add_event("THIS SHOULD SHOW UP WRITE") + # span.set_attribute("Result", "Success") + return "SUCCESS", 200 + + if method == "read": + with my_trace.start_as_current_span(f"readtables-mysql") as span: + cursor.execute( + "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'cloud_freak'" + ) + + for table in cursor: + print(table) + db_data["tables"].append( + {"instance": mysql_dbname, "table": table["TABLE_NAME"]} + ) + + cursor.execute( + "select count(*) as record_count from python_created" + ) + + for data in cursor: + print(data) + + span.add_event("Read rows in python created table") + cursor.execute( + # pylint: disable=line-too-long; + "select DATE_FORMAT(max(python_created.created_at),'%d/%m/%Y %l:%i %p') as last_created, DATE_FORMAT(min(python_created.created_at),'%d/%m/%Y %l:%i %p') as first_created, cnt.record_count as record_count from python_created cross join (select count(*) as record_count from python_created) as cnt group by cnt.record_count" + ) + + myresult = cursor.fetchall() + + for data in myresult: + print(data) + db_data["data"].append( + { + "instance": mysql_dbname, + "row": { + "first_created": data["first_created"], + "last_created": data["last_created"], + "records": data["record_count"], + }, + } + ) + span.add_event(str(db_data)) + span.add_event("THIS SHOULD SHOW UP") + return db_data, 200 + + except Error as call_error: + print("Error while connecting to MySQL", call_error) + print(repr(e)) + return repr(e), 500 + + finally: + if connection.is_connected(): + cursor.close() + connection.close() + print("MySQL connection is closed") + else: + print("not mysql") + + return "Finally OK", 200 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + print("Need 1 args") + elif args == 2: + request = sys.argv[1] + else: + print("Need 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(request) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/mysql/requirements.txt new file mode 100644 index 0000000..10998e9 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql/requirements.txt @@ -0,0 +1,48 @@ +async-timeout==4.0.2 +backoff==2.2.1 +cachetools==5.3.0 +certifi==2022.12.7 +charset-normalizer==3.0.1 +Deprecated==1.2.13 +google-resumable-media==2.4.1 +googleapis-common-protos==1.58.0 +grpcio==1.51.1 +grpcio-status==1.51.1 +idna==3.4 +mysql-connector==2.2.9 +opentelemetry-api==1.16.0 +opentelemetry-distro==0.37b0 +opentelemetry-exporter-otlp==1.16.0 +opentelemetry-exporter-otlp-proto-grpc==1.16.0 +opentelemetry-exporter-otlp-proto-http==1.16.0 +opentelemetry-instrumentation==0.37b0 +opentelemetry-instrumentation-aws-lambda==0.37b0 +opentelemetry-instrumentation-dbapi==0.37b0 +opentelemetry-instrumentation-grpc==0.37b0 +opentelemetry-instrumentation-logging==0.37b0 +opentelemetry-instrumentation-mysql==0.37b0 +opentelemetry-instrumentation-redis==0.37b0 +opentelemetry-instrumentation-requests==0.37b0 +opentelemetry-instrumentation-sqlite3==0.37b0 +opentelemetry-instrumentation-urllib==0.37b0 +opentelemetry-instrumentation-urllib3==0.37b0 +opentelemetry-instrumentation-wsgi==0.37b0 +opentelemetry-propagator-aws-xray==1.0.1 +opentelemetry-proto==1.16.0 +opentelemetry-sdk==1.16.0 +opentelemetry-semantic-conventions==0.37b0 +opentelemetry-util-http==0.37b0 +packaging==23.0 +proto-plus==1.22.2 +protobuf==4.22.0 +psycopg2-binary==2.9.5 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +redis==4.4.2 +requests==2.28.2 +rsa==4.9 +six==1.16.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wrapt==1.14.1 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/mysql/tracing.py new file mode 100644 index 0000000..df33117 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/mysql/tracing.py @@ -0,0 +1,45 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource +from opentelemetry.instrumentation.mysql import MySQLInstrumentor + +MySQLInstrumentor().instrument() + +resource = Resource(attributes={SERVICE_NAME: "cloud_function_mysql"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", "TRUE") +collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +provider = sdktrace.TracerProvider(resource=resource) + +print(f"console_logging = {console_logging}") + +print(f"collector_logging = {collector_logging}") + +if disable_logging is None: + if console_logging.upper() == "TRUE": + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging.upper() == "TRUE": + print("Collector Logging Enabled") + _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) + provider.add_span_processor(_processor) + + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/mysql/zip_files/mysql_func_code.zip b/modules/gcp_infrastructure/python_scripts/function_code/mysql/zip_files/mysql_func_code.zip new file mode 100644 index 0000000..adbc9dc Binary files /dev/null and b/modules/gcp_infrastructure/python_scripts/function_code/mysql/zip_files/mysql_func_code.zip differ diff --git a/modules/gcp_infrastructure/python_scripts/function_code/postgres/main.py b/modules/gcp_infrastructure/python_scripts/function_code/postgres/main.py new file mode 100644 index 0000000..07802c2 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/postgres/main.py @@ -0,0 +1,181 @@ +import json +import tracing +import traceback +import os +import typing +import sys +import psycopg2 +from psycopg2.extras import RealDictCursor + + +postgres_host = os.getenv("POSTGRES_HOST") +postgres_dbname = os.getenv("POSTGRES_DBNAME") +postgres_user = os.getenv("POSTGRES_USER") +postgres_password = os.getenv("POSTGRES_PASSWORD") + + +def main(request) -> typing.List[dict]: + """Call postgres instances""" + my_trace = tracing.tracer + db_data = {"databases": [], "tables": [], "data": []} + + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + print(request) + jstr = json.loads(request) + + if is_str == False: + jstr = request.get_json() + + method = jstr["method"] + + with my_trace.start_as_current_span(f"{method}-postgres") as span: + span.set_attribute("postgres_host", postgres_host) + span.set_attribute("postgres_dbname", postgres_dbname) + + try: + # Connect to an existing database + connection = psycopg2.connect( + # pylint: disable=line-too-long; + f"dbname={postgres_dbname} user={postgres_user} host={postgres_host} password={postgres_password}" + ) + + if connection.closed == 0: + # Open a cursor to perform database operations + + cursor = connection.cursor(cursor_factory=RealDictCursor) + + cursor.execute("SHOW SERVER_VERSION;") + + postgres_server = "" + for server in cursor: + print("A") + postgres_server = server["server_version"] + print(postgres_server) + print("B") + + with my_trace.start_as_current_span(f"connection-postgres") as span: + span.set_attribute( + "Connected to Postgres Server version ", postgres_server + ) + print("C") + # print("Connected to MySQL Server version ", db_Info) + + # Execute a command: this creates a new table + + cursor.execute( + # pylint: disable=line-too-long; + "SELECT datname FROM pg_database WHERE datistemplate = false and datname not in('cloudsqladmin', 'postgres');" + ) + + for data_bases in cursor: + print(data_bases) + db_data["databases"].append( + { + "instance": postgres_dbname, + "host": postgres_host, + "database": data_bases["datname"], + } + ) + span.set_attribute("databases", str(db_data["databases"])) + if method == "write": + with my_trace.start_as_current_span( + f"createtable-postgres" + ) as span: + + cursor.execute( + """CREATE TABLE IF NOT EXISTS python_created( + task_id SERIAL PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + """ + ) + + with my_trace.start_as_current_span( + f"insert-table-postgres" + ) as span: + sql = "insert into python_created(title,description) values(%s, %s)" + val = ("Python is doing this", "call to database") + cursor.execute(sql, val) + connection.commit() + span.set_attribute("Result", "Success") + return "SUCCESS", 200 + + if method == "read": + cursor.execute( + # pylint: disable=line-too-long; + "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'public'" + ) + + for table in cursor: + print("table", table) + db_data["tables"].append( + { + "instance": postgres_dbname, + "table": table["table_name"], + } + ) + + cursor.execute( + "select count(*) as record_count from python_created" + ) + + for data in cursor: + print(data) + + cursor.execute( + # pylint: disable=line-too-long; + "select to_char(max(python_created.created_at),'DD/Mon/YYYY HH12:MI:SS') as last_created, to_char(min(python_created.created_at),'DD/Mon/YYYY HH12:MI:SS') as first_created, cnt.record_count as record_count from python_created cross join (select count(*) as record_count from python_created) as cnt group by cnt.record_count" + ) + + myresult = cursor.fetchall() + + for data in myresult: + print(data) + db_data["data"].append( + { + "instance": postgres_dbname, + "row": { + "first_created": data["first_created"], + "last_created": data["last_created"], + "records": data["record_count"], + }, + } + ) + + except Exception as call_error: + print("Error while connecting to POSTGRES", call_error) + with my_trace.start_as_current_span("mysql ERROR") as span: + span.set_attribute("ERROR", call_error) + print(repr(call_error)) + return repr(call_error), 500 + + finally: + if connection.closed == 0: + cursor.close() + connection.close() + print("POSTGRES connection is closed") + else: + print("not postgres") + # return db_Info + + return "Finally OK", 200 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + print("Need 1 args") + elif args == 2: + request = sys.argv[1] + else: + print("Need 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(request) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/postgres/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/postgres/requirements.txt new file mode 100644 index 0000000..3f47c87 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/postgres/requirements.txt @@ -0,0 +1,28 @@ +async-timeout==4.0.2 +backoff==2.2.1 +cachetools==5.3.0 +certifi==2022.12.7 +charset-normalizer==3.0.1 +Deprecated==1.2.13 +grpcio==1.51.1 +grpcio-status==1.51.1 +idna==3.4 +mysql-connector==2.2.9 +opentelemetry-api==1.15.0 +opentelemetry-exporter-otlp-proto-grpc==1.15.0 +opentelemetry-proto==1.15.0 +opentelemetry-sdk==1.15.0 +opentelemetry-semantic-conventions==0.36b0 +packaging==23.0 +proto-plus==1.22.2 +protobuf==4.22.0 +psycopg2-binary==2.9.5 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +requests==2.28.2 +rsa==4.9 +six==1.16.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wrapt==1.14.1 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/postgres/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/postgres/tracing.py new file mode 100644 index 0000000..b843a9a --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/postgres/tracing.py @@ -0,0 +1,42 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource + +resource = Resource(attributes={SERVICE_NAME: "cloud_function_postgres"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", "FALSE") +collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +provider = sdktrace.TracerProvider(resource=resource) + +print(f"console_logging = {console_logging}") + +print(f"collector_logging = {collector_logging}") + +if disable_logging is None: + if console_logging.upper() == "TRUE": + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging.upper() == "TRUE": + print("Collector Logging Enabled") + _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) + provider.add_span_processor(_processor) + + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/postgres_func_code.zip b/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/postgres_func_code.zip new file mode 100644 index 0000000..0eea50c Binary files /dev/null and b/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/postgres_func_code.zip differ diff --git a/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/redis_func_code.zip b/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/redis_func_code.zip new file mode 100644 index 0000000..9e3cfb6 Binary files /dev/null and b/modules/gcp_infrastructure/python_scripts/function_code/postgres/zip_files/redis_func_code.zip differ diff --git a/modules/gcp_infrastructure/python_scripts/function_code/redis/main.py b/modules/gcp_infrastructure/python_scripts/function_code/redis/main.py new file mode 100755 index 0000000..768c9d9 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/redis/main.py @@ -0,0 +1,129 @@ +import redis +import json +import time +import os +import tracing +import traceback +import typing +import sys + + +# https://github.com/redis/redis-py + +# Redis connection - read env variable or defaults to local host +# See sample_environment/python_scripts/README.md for how to enable port forwarding for local dev +redis_host = os.environ.get("REDIS_HOST", "localhost") +redis_port = int(os.environ.get("REDIS_PORT", 6379)) +redis_password = "" + +t = time.time() +ml = int(t * 1000) + +# based on Luke's work here - https://github.com/observeinc/google-cloud-functions/blob/main/main.py +def main(request) -> typing.List[dict]: + try: + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + method = request + + if is_str == False: + jstr = request.get_json() + method = jstr["method"] + + print(f"method = {method}") + print(f"REDIS_HOST: {redis_host}") + print(f"REDIS_PORT: {redis_port}") + except Exception as e: + print("Error processing request") + print(e) + return e + + with tracing.tracer.start_as_current_span(f"{method}_redis") as span: + span.set_attribute("REDIS_HOST", redis_host) + res = [] + range_int = 100 + # Create the Redis Connection object + try: + # The decode_repsonses flag here directs the client to convert the responses from Redis into Python strings + # using the default encoding utf-8. This is client specific. + r = redis.StrictRedis( + host=redis_host, + port=redis_port, + password=redis_password, + decode_responses=True, + ) + + except Exception as e: + print("Error in connecting to redis") + print(e) + return e + + try: + if method == "write": + input_data = [] + # create a set of fake keys and values based on current time + for number in range(range_int): + input_data.append( + {"id": f"{number}", "Name": f"Name-{ml}-{number}"} + ) + + # loop fake keys and write to redis + for elem in input_data: + # json_data = json.loads(elem) + # Set the message in Redis + key = int(elem["id"]) + # for response object + res.append( + { + "key": key, + "value": str(elem), + } + ) + # write to redis + expire = 30 if int(elem["id"]) < 50 else 90 + r.set(key, str(elem), ex=expire) + # print(f"{key} = {str(elem)}") + + span.set_attribute("num_keys", len(input_data)) + # span.set_attribute("method", str(request.body)) + + return "Ok", 200 + + if method == "read": + redis_keys = [] + # for key in r.scan_iter("*"): + # redis_keys.append(key) + # print(key) + for number in range(range_int): + redis_keys.append(key) + + values = r.mget(redis_keys) + for val in values: + print(val) + # print(datetime.datetime.now() - start_time) + + span.set_attribute("num_keys_read", len(values)) + + return "Ok", 200 + except Exception as e: + print("Error processing request") + print(e) + return e + return "Should not have reached here", 500 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + method = "write" + elif args == 2: + method = sys.argv[1] + else: + print("Need 0 or 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(method) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/redis/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/redis/requirements.txt new file mode 100644 index 0000000..9a1ceee --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/redis/requirements.txt @@ -0,0 +1,54 @@ +async-timeout==4.0.2 +backoff==2.2.1 +cachetools==5.3.0 +certifi==2022.12.7 +charset-normalizer==3.0.1 +Deprecated==1.2.13 +google-api-core==2.11.0 +google-auth==2.16.1 +google-cloud==0.34.0 +google-cloud-bigquery==3.5.0 +google-cloud-core==2.3.2 +google-crc32c==1.5.0 +google-resumable-media==2.4.1 +googleapis-common-protos==1.58.0 +grpcio==1.51.1 +grpcio-status==1.51.1 +idna==3.4 +mysql-connector==2.2.9 +opentelemetry-api==1.16.0 +opentelemetry-distro==0.37b0 +opentelemetry-exporter-otlp==1.16.0 +opentelemetry-exporter-otlp-proto-grpc==1.16.0 +opentelemetry-exporter-otlp-proto-http==1.16.0 +opentelemetry-instrumentation==0.37b0 +opentelemetry-instrumentation-aws-lambda==0.37b0 +opentelemetry-instrumentation-dbapi==0.37b0 +opentelemetry-instrumentation-grpc==0.37b0 +opentelemetry-instrumentation-logging==0.37b0 +opentelemetry-instrumentation-mysql==0.37b0 +opentelemetry-instrumentation-redis==0.37b0 +opentelemetry-instrumentation-requests==0.37b0 +opentelemetry-instrumentation-sqlite3==0.37b0 +opentelemetry-instrumentation-urllib==0.37b0 +opentelemetry-instrumentation-urllib3==0.37b0 +opentelemetry-instrumentation-wsgi==0.37b0 +opentelemetry-propagator-aws-xray==1.0.1 +opentelemetry-proto==1.16.0 +opentelemetry-sdk==1.16.0 +opentelemetry-semantic-conventions==0.37b0 +opentelemetry-util-http==0.37b0 +packaging==23.0 +proto-plus==1.22.2 +protobuf==4.22.0 +psycopg2-binary==2.9.5 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +python-dateutil==2.8.2 +redis==4.4.2 +requests==2.28.2 +rsa==4.9 +six==1.16.0 +typing_extensions==4.5.0 +urllib3==1.26.14 +wrapt==1.14.1 diff --git a/modules/gcp_infrastructure/python_scripts/function_code/redis/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/redis/tracing.py new file mode 100644 index 0000000..735a0b7 --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/redis/tracing.py @@ -0,0 +1,45 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource +from opentelemetry.instrumentation.redis import RedisInstrumentor + +resource = Resource(attributes={SERVICE_NAME: "cloud_function_redis"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", "TRUE") +collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +provider = sdktrace.TracerProvider(resource=resource) + +print(f"console_logging = {console_logging}") + +print(f"collector_logging = {collector_logging}") + +if disable_logging is None: + if console_logging.upper() == "TRUE": + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging.upper() == "TRUE": + print("Collector Logging Enabled") + _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) + provider.add_span_processor(_processor) + + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) + +RedisInstrumentor().instrument(tracer=tracer) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/samplw/main.py b/modules/gcp_infrastructure/python_scripts/function_code/samplw/main.py new file mode 100755 index 0000000..da6039a --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/samplw/main.py @@ -0,0 +1,126 @@ +import redis +import json +import time +import os +import tracing +import traceback +import typing +import sys + + +# https://github.com/redis/redis-py + +# Redis connection - read env variable or defaults to local host +# See sample_environment/python_scripts/README.md for how to enable port forwarding for local dev +redis_host = os.environ.get("REDIS_HOST", "localhost") +redis_port = int(os.environ.get("REDIS_PORT", 6379)) +redis_password = "" + +t = time.time() +ml = int(t * 1000) + +# based on Luke's work here - https://github.com/observeinc/google-cloud-functions/blob/main/main.py +def main(request) -> typing.List[dict]: + try: + is_str = isinstance(request, str) + if is_str == True: + print(is_str) + method = request + + if is_str == False: + jstr = request.get_json() + method = jstr["method"] + + print(f"method = {method}") + print(f"REDIS_HOST: {redis_host}") + print(f"REDIS_PORT: {redis_port}") + except Exception as e: + print("Error processing request") + print(e) + return e + + with tracing.tracer.start_as_current_span(f"{method}_redis") as span: + span.set_attribute("REDIS_HOST", redis_host) + res = [] + + # Create the Redis Connection object + try: + # The decode_repsonses flag here directs the client to convert the responses from Redis into Python strings + # using the default encoding utf-8. This is client specific. + r = redis.StrictRedis( + host=redis_host, + port=redis_port, + password=redis_password, + decode_responses=True, + ) + + except Exception as e: + print("Error in connecting to redis") + print(e) + return e, 500 + + try: + if method == "write": + input_data = [] + # create a set of fake keys and values based on current time + for number in range(100): + input_data.append( + {"id": f"{number}", "Name": f"Name-{ml}-{number}"} + ) + + # loop fake keys and write to redis + for elem in input_data: + # json_data = json.loads(elem) + # Set the message in Redis + key = ml + int(elem["id"]) + # for response object + res.append( + { + "key": key, + "value": str(elem), + } + ) + # write to redis + r.set(key, str(elem), ex=300) + # print(f"{key} = {str(elem)}") + + span.set_attribute("num_keys", len(input_data)) + # span.set_attribute("method", str(request.body)) + + return "Ok", 200 + + if method == "read": + redis_keys = [] + for key in r.scan_iter("*"): + redis_keys.append(key) + print(key) + + values = r.mget(redis_keys) + for val in values: + print(val) + # print(datetime.datetime.now() - start_time) + + span.set_attribute("num_keys_read", len(values)) + + return "Ok", 200 + except Exception as e: + print("Error processing request") + print(e) + return e, 500 + return "Should not have reached here", 500 + + +if __name__ == "__main__": + args = len(sys.argv) + + if args == 1: + method = "write" + elif args == 2: + method = sys.argv[1] + else: + print("Need 0 or 1 args") + exit() + + print(sys.argv) + print(f"args={args}") + main(method) diff --git a/modules/gcp_infrastructure/python_scripts/function_code/samplw/requirements.txt b/modules/gcp_infrastructure/python_scripts/function_code/samplw/requirements.txt new file mode 100644 index 0000000..ff541af --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/samplw/requirements.txt @@ -0,0 +1,5 @@ +redis==4.4.2 +opentelemetry-api==1.15.0 +opentelemetry-sdk==1.15.0 +opentelemetry-exporter-otlp-proto-grpc==1.15.0 +opentelemetry-proto==1.15.0 \ No newline at end of file diff --git a/modules/gcp_infrastructure/python_scripts/function_code/samplw/tracing.py b/modules/gcp_infrastructure/python_scripts/function_code/samplw/tracing.py new file mode 100644 index 0000000..47c440a --- /dev/null +++ b/modules/gcp_infrastructure/python_scripts/function_code/samplw/tracing.py @@ -0,0 +1,42 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource + +resource = Resource(attributes={SERVICE_NAME: "write_terraform"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", "FALSE") +collector_logging = os.getenv("COLLECTOR_LOGGING", "TRUE") +collector_endpoint = os.getenv("COLLECTOR_ENDPOINT", "http://localhost:4317") + +provider = sdktrace.TracerProvider(resource=resource) + +print(f"console_logging = {console_logging}") + +print(f"collector_logging = {collector_logging}") + + +if disable_logging is None: + if console_logging.upper() == "TRUE": + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging.upper() == "TRUE": + print("Collector Logging Enabled") + _processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=collector_endpoint)) + provider.add_span_processor(_processor) + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) diff --git a/modules/gcp_infrastructure/service_modules/bigquery/main.tf b/modules/gcp_infrastructure/service_modules/bigquery/main.tf new file mode 100644 index 0000000..101a709 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/bigquery/main.tf @@ -0,0 +1,110 @@ +locals { + # variables for string replacement in naming + str_f = "_" + str_r = "-" +} + +# creates a big query dataset +resource "google_bigquery_dataset" "default" { + project = var.project_id + dataset_id = replace(format(var.name_format, "dataset"), local.str_r, local.str_f) + friendly_name = format(var.name_format, "bq-sample-dataset") + description = "This is a test description" + location = "US" + default_table_expiration_ms = 432000000 + + labels = { + env = "default" + } +} + +resource "google_bigquery_table" "default" { + project = var.project_id + dataset_id = google_bigquery_dataset.default.dataset_id + table_id = format(var.name_format, "table") + + deletion_protection = false + + time_partitioning { + type = "DAY" + } + + labels = { + env = "default" + } + + schema = < + +1. Confirm the Cloud Shell is configured with your selected project: + + ```bash + gcloud config set project + ``` + +1. + +## Automated deployment + + +You'll now use a script to deploy the sample application. + +To use the script, you will need to set a number of values for the `gcloud` and `firebase` tools to reference. + +1. Configure the Project and Region variables. + + ```bash + export PROJECT_ID= + export REGION=us-central1 + ``` + +1. Deploy the application using the setup script: + + ```bash + bash setup.sh + ``` + +## View application + +Your application is now available at [https://.web.app](https://.web.app). + +See what you can now do with this application by [reading the docs][project-docs]. + +## Conclusion + + + +You're done! + +Here's what to do next: + +* Learn more about [what you can do with this website][project-docs] +* Learn about [Managing Infrastrcutre as Code](https://cloud.google.com/architecture/managing-infrastructure-as-code) + +[project-docs]: https://github.com/GoogleCloudPlatform/avocano/tree/main/docs diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/avocano-screenshot.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/avocano-screenshot.png new file mode 100644 index 0000000..e8b4cc7 Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/avocano-screenshot.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.eslintrc.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.eslintrc.js new file mode 100644 index 0000000..080061d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.eslintrc.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + env: { + browser: true, + es2021: true, + }, + parserOptions: { + ecmaVersion: 12, + sourceType: 'module', + }, + rules: { + 'no-console': 'off', + 'no-unexpected-token': 'off', + 'no-restricted-syntax': [ + 'error', + { + selector: + "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]", + message: 'Unexpected property on console object was called', + }, + ], + }, +}; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.gitignore b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.gitignore new file mode 100644 index 0000000..e063a96 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/.gitignore @@ -0,0 +1,27 @@ +## editors +/.idea +/.vscode + +## system files +.DS_Store + +## npm +/node_modules/ +/npm-debug.log + +## testing +/coverage/ + +## temp folders +/.tmp/ + +# build +/_site/ +/dist/ +/out-tsc/ + +storybook-static +custom-elements.json + +# firebase +.firebase/ \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/404.html b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/404.html new file mode 100644 index 0000000..bf7d69e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/404.html @@ -0,0 +1,30 @@ + + + + + + + + 🥑 Avocano + + + +

Oops, redirecting back to 🥑 Avocano homepage.

+

+ Please wait a moment to be redirected or click this link. +

+ + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/Dockerfile b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/Dockerfile new file mode 100644 index 0000000..63db738 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/Dockerfile @@ -0,0 +1,31 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This dockerfile is used when using Cloud Run Jobs-based client deployment +# May not be used in all cases. + +# Execute with "--build-arg PROJECT_ID=$PROJECT_ID" +ARG PROJECT_ID=YOURPROJECTID +FROM gcr.io/$PROJECT_ID/firebase + +# Override with "--build-arg AVOCANO_PURCHASE_MODE=cart" +ARG AVOCANO_PURCHASE_MODE="" + +COPY package*.json ./ +RUN npm i +COPY . ./ +RUN npm run build + +RUN npm install -g json +ENTRYPOINT ./docker-deploy.sh \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/README.md new file mode 100644 index 0000000..aa7d820 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/README.md @@ -0,0 +1,45 @@ +# Avocano Frontend + +This client app uses [Lit](https://lit.dev/) front-end and [open-wc](https://open-wc.org/) for project scaffolding. + +## Technologies + +- **Framework:** ⚙️ [Lit](https://lit.dev/) +- **Scaffolding:** 🏗️ [open-wc](https://open-wc.org/) +- **Bundler:** 🖇️ [Rollup](https://rollupjs.org/) +- **Hosting:** 🔥 [Firebase](https://firebase.google.com/) + +## Requirements + +Requires node 10 & npm 6 or higher, and a running [api server](../server/README.md#local-dev) + +## Develop App Locally + +Set API server: + +``` +# Deployed container +export API_URL=https://api-HASH-REGION.a.run.app/ + +# Locally running (already default in app) +export API_URL=http://localhost:8000 +``` + +Install, build, and start client. + +```bash +# Install app dependencies +npm i +# Bundle the app +npm run build +# Runs the app locally! +npm run start +``` + +Open your browser to `localhost:8000`. + +## Deployment + +This code is deployed directly in Cloud Build steps, as seen in the root [`cloudbuild.yaml`](/cloudbuild.yaml), and [`provisioning/client.cloudbuild.yaml`](/provisioning/client.cloudbuild.yaml). + +It can also be deployed by building an image [`provisioning/client-image.cloudbuild.yaml`](/provisioning/client-image.cloudbuild.yaml), and running as a Cloud Run job, which can be customised by environment variables (see [`docker-deploy.yaml`](docker-deploy.sh)) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/noimage.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/noimage.png new file mode 100644 index 0000000..7b62816 Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/noimage.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/oops-avocado.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/oops-avocado.png new file mode 100644 index 0000000..9ca30b2 Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/oops-avocado.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/shopping_cart.svg b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/shopping_cart.svg new file mode 100644 index 0000000..6d9e72b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/assets/shopping_cart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/docker-deploy.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/docker-deploy.sh new file mode 100755 index 0000000..ff60cc8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/docker-deploy.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Script to assist in Dockerfile-based deployments. +# 'json' was installed from npm in Dockerfile as a utility to assist in inline json file editing + +# any errors? exit immediately. +set -e + +echo "Deploying Firebase..." + +# escape if project_id not defined (mandatory, required later) +if [[ -z $PROJECT_ID ]]; then + echo "PROJECT_ID not defined. Cannot deploy. Exiting." + exit 1 +fi + +# if service name supplied, update firebase.json +if [[ -n $SERVICE_NAME ]]; then + echo "Supplied with service name $SERVICE_NAME. Updating config. " + json -I -f firebase.json -e "this.hosting.rewrites[0].run.serviceId='$SERVICE_NAME'" + UPDATED=true +fi + +# if region supplied, update firebase.json +if [[ -n $REGION ]]; then + echo "Supplied with region $REGION. Updating config. " + json -I -f firebase.json -e "this.hosting.rewrites[0].run.region='$REGION'" + UPDATED=true +fi + +# If anything was updated, then export the output. +if [[ -n $UPDATED ]]; then + echo "Deploying with the following updated config: " + cat firebase.json +fi + +firebase deploy --project $PROJECT_ID --only hosting \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/firebase.json b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/firebase.json new file mode 100644 index 0000000..aaa7233 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/firebase.json @@ -0,0 +1,15 @@ +{ + "hosting": { + "public": "dist", + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], + "rewrites": [ + { + "source": "/api/**", + "run": { + "serviceId": "server", + "region": "us-central1" + } + } + ] + } +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/index.html b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/index.html new file mode 100644 index 0000000..c5c7544 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/index.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + Avocano + + + + Loading store... + + + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package-lock.json b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package-lock.json new file mode 100644 index 0000000..b9f34c9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package-lock.json @@ -0,0 +1,11524 @@ +{ + "name": "avocano-app", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "avocano-app", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@material/mwc-button": "^0.27.0", + "@material/mwc-dialog": "^0.27.0", + "@material/mwc-list": "^0.27.0", + "@material/mwc-select": "^0.27.0", + "@material/mwc-textfield": "^0.27.0", + "@open-wc/building-rollup": "^2.0.1", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-replace": "^5.0.0", + "@web/dev-server": "^0.1.28", + "@web/dev-server-rollup": "^0.4.0", + "@web/rollup-plugin-html": "^1.10.1", + "@web/rollup-plugin-import-meta-assets": "^1.0.7", + "express": "^4.18.1", + "idb": "^7.1.1", + "lit": "^2.3.0", + "lit-element-router": "^2.0.3", + "replace": "^1.2.1", + "rollup": "^2.60.0", + "rollup-plugin-terser": "^7.0.2" + }, + "devDependencies": { + "@babel/preset-env": "^7.16.4", + "@custom-elements-manifest/analyzer": "^0.8.0", + "@open-wc/eslint-config": "^10.0.0", + "@open-wc/testing": "next", + "@web/test-runner": "^0.15.0", + "babel-plugin-template-html-minifier": "^4.1.0", + "deepmerge": "^4.2.2", + "eslint": "^8.0.0", + "eslint-config-prettier": "^8.3.0", + "husky": "^4.3.8", + "lint-staged": "^13.0.0", + "prettier": "^2.4.1", + "rimraf": "^4.0.0", + "sinon": "^15.0.3" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "dependencies": { + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.20.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.10.tgz", + "integrity": "sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.20.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", + "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.12", + "@babel/types": "^7.20.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/eslint-parser": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz", + "integrity": "sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==", + "dev": true, + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.11.0", + "eslint": "^7.5.0 || ^8.0.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", + "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", + "dependencies": { + "@babel/types": "^7.20.7", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", + "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", + "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", + "dependencies": { + "@babel/helper-explode-assignable-expression": "^7.18.6", + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "dependencies": { + "@babel/compat-data": "^7.20.5", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.20.12", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz", + "integrity": "sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-replace-supers": "^7.20.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/helper-split-export-declaration": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", + "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "regexpu-core": "^5.2.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz", + "integrity": "sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==", + "dependencies": { + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0-0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-explode-assignable-expression": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", + "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", + "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "dependencies": { + "@babel/template": "^7.18.10", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz", + "integrity": "sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw==", + "dependencies": { + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", + "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.20.2", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.10", + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", + "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", + "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", + "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-wrap-function": "^7.18.9", + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz", + "integrity": "sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-member-expression-to-functions": "^7.20.7", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", + "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "dependencies": { + "@babel/types": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", + "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "dependencies": { + "@babel/types": "^7.20.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", + "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", + "dependencies": { + "@babel/helper-function-name": "^7.19.0", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.20.5", + "@babel/types": "^7.20.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", + "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", + "dependencies": { + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.13", + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.13.tgz", + "integrity": "sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", + "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz", + "integrity": "sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", + "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", + "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-static-block": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz", + "integrity": "sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.20.7", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", + "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-namespace-from": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", + "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-json-strings": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", + "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", + "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", + "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", + "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", + "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", + "dependencies": { + "@babel/compat-data": "^7.20.5", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", + "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz", + "integrity": "sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-methods": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", + "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", + "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", + "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz", + "integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz", + "integrity": "sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz", + "integrity": "sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==", + "dependencies": { + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", + "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.11.tgz", + "integrity": "sha512-tA4N427a7fjf1P0/2I4ScsHGc5jcHPbb30xMbaTke2gxDuWpUfXDuX1FEymJwKk4tuGUvGcejAR6HdZVqmmPyw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz", + "integrity": "sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-optimise-call-expression": "^7.18.6", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-replace-supers": "^7.20.7", + "@babel/helper-split-export-declaration": "^7.18.6", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz", + "integrity": "sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/template": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz", + "integrity": "sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", + "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", + "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", + "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.18.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz", + "integrity": "sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", + "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", + "dependencies": { + "@babel/helper-compilation-targets": "^7.18.9", + "@babel/helper-function-name": "^7.18.9", + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", + "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", + "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz", + "integrity": "sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==", + "dependencies": { + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.11.tgz", + "integrity": "sha512-S8e1f7WQ7cimJQ51JkAaDrEtohVEitXjgCGAS2N8S31Y42E+kWwfSz83LYz57QdBm7q9diARVqanIaH2oVgQnw==", + "dependencies": { + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-simple-access": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz", + "integrity": "sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==", + "dependencies": { + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-validator-identifier": "^7.19.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", + "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", + "dependencies": { + "@babel/helper-module-transforms": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", + "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.20.5", + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", + "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", + "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/helper-replace-supers": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz", + "integrity": "sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", + "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", + "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "regenerator-transform": "^0.15.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", + "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.19.6.tgz", + "integrity": "sha512-PRH37lz4JU156lYFW1p8OxE5i7d6Sl/zV58ooyr+q1J1lnQPyg5tIiXlIwNVhJaY4W3TmOtdc8jqdXQcB1v5Yw==", + "dependencies": { + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-plugin-utils": "^7.19.0", + "babel-plugin-polyfill-corejs2": "^0.3.3", + "babel-plugin-polyfill-corejs3": "^0.6.0", + "babel-plugin-polyfill-regenerator": "^0.4.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", + "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz", + "integrity": "sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", + "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", + "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", + "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", + "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", + "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.20.2.tgz", + "integrity": "sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg==", + "dependencies": { + "@babel/compat-data": "^7.20.1", + "@babel/helper-compilation-targets": "^7.20.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-validator-option": "^7.18.6", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", + "@babel/plugin-proposal-async-generator-functions": "^7.20.1", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-proposal-class-static-block": "^7.18.6", + "@babel/plugin-proposal-dynamic-import": "^7.18.6", + "@babel/plugin-proposal-export-namespace-from": "^7.18.9", + "@babel/plugin-proposal-json-strings": "^7.18.6", + "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", + "@babel/plugin-proposal-numeric-separator": "^7.18.6", + "@babel/plugin-proposal-object-rest-spread": "^7.20.2", + "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", + "@babel/plugin-proposal-optional-chaining": "^7.18.9", + "@babel/plugin-proposal-private-methods": "^7.18.6", + "@babel/plugin-proposal-private-property-in-object": "^7.18.6", + "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.20.0", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.18.6", + "@babel/plugin-transform-async-to-generator": "^7.18.6", + "@babel/plugin-transform-block-scoped-functions": "^7.18.6", + "@babel/plugin-transform-block-scoping": "^7.20.2", + "@babel/plugin-transform-classes": "^7.20.2", + "@babel/plugin-transform-computed-properties": "^7.18.9", + "@babel/plugin-transform-destructuring": "^7.20.2", + "@babel/plugin-transform-dotall-regex": "^7.18.6", + "@babel/plugin-transform-duplicate-keys": "^7.18.9", + "@babel/plugin-transform-exponentiation-operator": "^7.18.6", + "@babel/plugin-transform-for-of": "^7.18.8", + "@babel/plugin-transform-function-name": "^7.18.9", + "@babel/plugin-transform-literals": "^7.18.9", + "@babel/plugin-transform-member-expression-literals": "^7.18.6", + "@babel/plugin-transform-modules-amd": "^7.19.6", + "@babel/plugin-transform-modules-commonjs": "^7.19.6", + "@babel/plugin-transform-modules-systemjs": "^7.19.6", + "@babel/plugin-transform-modules-umd": "^7.18.6", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.19.1", + "@babel/plugin-transform-new-target": "^7.18.6", + "@babel/plugin-transform-object-super": "^7.18.6", + "@babel/plugin-transform-parameters": "^7.20.1", + "@babel/plugin-transform-property-literals": "^7.18.6", + "@babel/plugin-transform-regenerator": "^7.18.6", + "@babel/plugin-transform-reserved-words": "^7.18.6", + "@babel/plugin-transform-shorthand-properties": "^7.18.6", + "@babel/plugin-transform-spread": "^7.19.0", + "@babel/plugin-transform-sticky-regex": "^7.18.6", + "@babel/plugin-transform-template-literals": "^7.18.9", + "@babel/plugin-transform-typeof-symbol": "^7.18.9", + "@babel/plugin-transform-unicode-escapes": "^7.18.10", + "@babel/plugin-transform-unicode-regex": "^7.18.6", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.20.2", + "babel-plugin-polyfill-corejs2": "^0.3.3", + "babel-plugin-polyfill-corejs3": "^0.6.0", + "babel-plugin-polyfill-regenerator": "^0.4.1", + "core-js-compat": "^3.25.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", + "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.13.tgz", + "integrity": "sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==", + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.20.13", + "@babel/types": "^7.20.7", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", + "dependencies": { + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@custom-elements-manifest/analyzer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@custom-elements-manifest/analyzer/-/analyzer-0.8.0.tgz", + "integrity": "sha512-w+OMAWW4x04eE6dpEInoVkk6ITEsQTsbx/jv7ofbl5QniXFiY5CFwWCVVAxCd3pTQbXd2Y9VxwefVJuGs/vNWw==", + "dev": true, + "dependencies": { + "@custom-elements-manifest/find-dependencies": "^0.0.5", + "@github/catalyst": "^1.6.0", + "@web/config-loader": "0.1.3", + "chokidar": "3.5.2", + "command-line-args": "5.1.2", + "comment-parser": "1.2.4", + "custom-elements-manifest": "1.0.0", + "debounce": "1.2.1", + "globby": "11.0.4", + "typescript": "~4.3.2" + }, + "bin": { + "cem": "cem.js", + "custom-elements-manifest": "cem.js" + } + }, + "node_modules/@custom-elements-manifest/analyzer/node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "dev": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/@custom-elements-manifest/analyzer/node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/@custom-elements-manifest/analyzer/node_modules/command-line-args": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.2.tgz", + "integrity": "sha512-fytTsbndLbl+pPWtS0CxLV3BEWw9wJayB8NnU2cbQqVPsNdYezQeT+uIQv009m+GShnMNyuoBrRo8DTmuTfSCA==", + "dev": true, + "dependencies": { + "array-back": "^6.1.2", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/@custom-elements-manifest/analyzer/node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@custom-elements-manifest/find-dependencies": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@custom-elements-manifest/find-dependencies/-/find-dependencies-0.0.5.tgz", + "integrity": "sha512-fKIMMZCDFSoL2ySUoz8knWgpV4jpb0lUXgLOvdZQMQFHxgxz1PqOJpUIypwvEVyKk3nEHRY4f10gNol02HjeCg==", + "dev": true, + "dependencies": { + "es-module-lexer": "^0.9.3" + } + }, + "node_modules/@custom-elements-manifest/find-dependencies/node_modules/es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true + }, + "node_modules/@eslint/eslintrc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", + "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", + "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@esm-bundle/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA==", + "dev": true, + "dependencies": { + "@types/chai": "^4.2.12" + } + }, + "node_modules/@github/catalyst": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@github/catalyst/-/catalyst-1.6.0.tgz", + "integrity": "sha512-u8A+DameixqpeyHzvnJWTGj+wfiskQOYHzSiJscCWVfMkIT3rxnbHMtGh3lMthaRY21nbUOK71WcsCnCrXhBJQ==", + "dev": true + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", + "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.0.0.tgz", + "integrity": "sha512-ic93MBXfApIFTrup4a70M/+ddD8xdt2zxxj9sRwHQzhS9ag/syqkD8JPdTXsc1gUy2K8TTirhlCqyTEM/sifNw==" + }, + "node_modules/@lit/reactive-element": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.1.tgz", + "integrity": "sha512-va15kYZr7KZNNPZdxONGQzpUr+4sxVu7V/VG7a8mRfPPXUyhEYj5RzXCQmGrlP3tAh0L3HHm5AjBMFYRqlM9SA==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.0.0" + } + }, + "node_modules/@material/animation": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/animation/-/animation-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-GBuR4VmcTQW1D0lPXEosf5Giho72LLbyGIydWGtaEUtLJoive/D9kFkwTN4Fsyt9Kkl7hbhs35vrNe6QkAH4/Q==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@material/base": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/base/-/base-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-UJKbXwZtkrA3sfQDmj8Zbw1Q3Tqtl6KdfVFws95Yf7TCUgTFzbZI/FSx1w7dVugQPOEnIBuZnzqZam/MtHkx4w==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@material/button": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/button/-/button-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-IPBAByKpQjrWNVmAWx5VCTCLnOw4ymbLsbHmBkLiDgcLPs1EtwYnKKIwQ+/t3bV02OShUdMiyboL8V/C0gMS1A==", + "dependencies": { + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/focus-ring": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/tokens": "14.0.0-canary.53b3cad2f.0", + "@material/touch-target": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/density": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/density/-/density-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-Eh/vZ3vVyqtpylg5Ci33qlgtToS4H1/ppd450Ib3tcdISIoodgijYY0w4XsRvrnZgbI/h/1STFdLxdzS0UNuFw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@material/dialog": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/dialog/-/dialog-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-yiG2nlVKTW0Ro3CF8Z/MVpTwSyG/8Kio3AaTUbeQdbjt5r692s4x5Yhd8m1IjEQKUeulY4CndvIbCUwZ8/G2PA==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/button": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/icon-button": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/tokens": "14.0.0-canary.53b3cad2f.0", + "@material/touch-target": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/dom": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/dom/-/dom-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-aR+rfncF6oi2ivdOlKSJI4UXwNzWV5rXM88MLDoSJF1D7lXxhAKhge+tMUBodWGV/q0+FnXLuVAa0WYTrKjo+A==", + "dependencies": { + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/elevation": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-3h+EkR588RMZ5TSNQ4UeXD1FOBnL3ABQix0DQIGwtNJCqSMoPndT/oJEFvwQbTkZNDbFIKN9p1Q7/KuFPVY8Pw==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/feature-targeting": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/feature-targeting/-/feature-targeting-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-fn7Af3PRyARtNeYqtjxXmE3Y/dCpnpQVWWys57MqiGR/nvc6qpgOfJ6rOdcu/MrOysOE/oebTUDmDnTmwpe9Hw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@material/floating-label": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/floating-label/-/floating-label-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-gHZUTTVKnP+Zjz4l9IT/G89NPmypn5FlTGLWKKqXbuQphr37rsKFR3Y80SJxULRyMDnAdKSxuZwiXLFKQz9KlA==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/focus-ring": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/focus-ring/-/focus-ring-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-exPX5VrjQimipBwgcFDGRiEE783sOBgpkFui59A6i6iGvS2UrLHlYY2E65fyyyQnD1f/rv4Po1OOnCesE1kulg==", + "dependencies": { + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0" + } + }, + "node_modules/@material/icon-button": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/icon-button/-/icon-button-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-BFdj3CP0JXHC/F2bDmpmzWhum4fkzIDgCCavvnpE/KcCbr0AaoSULRde+LtqvbdLIYW20cXhvjinIOlRhSOshA==", + "dependencies": { + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/focus-ring": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/touch-target": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/line-ripple": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/line-ripple/-/line-ripple-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-k8f8uuDwnSqZZ98CzbYtQVtxlp1ryUup9nd2uobo3kiqQNlQfXdGkVjuCXcla0OPiKFizNn7dS6Kl/j6L09XUA==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/list": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/list/-/list-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-mkMpltSKAYLBtFnTTCk/mQIDzwxF/VLh1gh59ehOtmRXt7FvTz83RoAa4tqe53hpVrbX4HoLDBu+vILhq/wkjw==", + "dependencies": { + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/menu": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/menu/-/menu-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-MmYKVrMIqOtP3TN4vdrrnQrS8P81+tMaA6bKiT9V79R1U6+mKsBYTzaLtLbzyem5vF8O0q7bSwyPwhWPtJr75Q==", + "dependencies": { + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/list": "14.0.0-canary.53b3cad2f.0", + "@material/menu-surface": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/menu-surface": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/menu-surface/-/menu-surface-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-IQWb/n15FpLnn+kHp0EqzLE+UoWSPumq3eze2QifiowvGb37bNFR9oSe7CaOzPMrHdkrZ5SBWnDU41wPZN5kOg==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/mwc-base": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-base/-/mwc-base-0.27.0.tgz", + "integrity": "sha512-oCWWtjbyQ52AaUbzINLGBKScIPyqhps2Y7c8t6Gu6fcFeDxhKXMV1Cqvtj/OMhtAt53XjHfD2XruWwYv3cYYUA==", + "dependencies": { + "@material/base": "=14.0.0-canary.53b3cad2f.0", + "@material/dom": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-button": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-button/-/mwc-button-0.27.0.tgz", + "integrity": "sha512-t5m2zfE93RNKHMjdsU67X6csFzuSG08VJKKvXVQ+BriGE3xBgzY5nZdmZXomFpaWjDENPAlyS4ppCFm6o+DILw==", + "dependencies": { + "@material/mwc-icon": "^0.27.0", + "@material/mwc-ripple": "^0.27.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-checkbox": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-checkbox/-/mwc-checkbox-0.27.0.tgz", + "integrity": "sha512-EY0iYZLwo8qaqMwR5da4fdn0xI0BZNAvKTcwoubYWpDDHlGxDcqwvjp/40ChGo3Q/zv8/4/A0Qp7cwapI82EkA==", + "dependencies": { + "@material/mwc-base": "^0.27.0", + "@material/mwc-ripple": "^0.27.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-dialog": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-dialog/-/mwc-dialog-0.27.0.tgz", + "integrity": "sha512-rkOEmCroVs0wBQbj87vH79SvSHHZ61QRCTUYsU2rHGZCvdzlmvHjWdoyKjJER6WwwM3rrT8xthfecmjICI28CA==", + "dependencies": { + "@material/dialog": "=14.0.0-canary.53b3cad2f.0", + "@material/dom": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/mwc-button": "^0.27.0", + "blocking-elements": "^0.1.0", + "lit": "^2.0.0", + "tslib": "^2.0.1", + "wicg-inert": "^3.0.0" + } + }, + "node_modules/@material/mwc-floating-label": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-floating-label/-/mwc-floating-label-0.27.0.tgz", + "integrity": "sha512-uLleloTxQ6dDShcZzqgqfC8otQY8DtGMO9HFQbAEncoFAWpAehcEonsuT/IUhMORN+c5un0P5WXwcZsInJb7og==", + "dependencies": { + "@material/floating-label": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-icon": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-icon/-/mwc-icon-0.27.0.tgz", + "integrity": "sha512-Sul44I37M9Ewynn0A9DjkEBrmll2VtNbth6Pxj7I1A/EAwEfaCrPvryyGqfIu1T2hTsRcaojzQx6QjF+B5QW9A==", + "dependencies": { + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-line-ripple": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-line-ripple/-/mwc-line-ripple-0.27.0.tgz", + "integrity": "sha512-n9Xpt5g3RJEl9rvk14OP6dUNJUtsJA46beTQiep7ppO7IPVFLC1v/5sPpUzfNPUBsclSPxdBuNlCxsgcIYueUw==", + "dependencies": { + "@material/line-ripple": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-list": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-list/-/mwc-list-0.27.0.tgz", + "integrity": "sha512-oAhNQsBuAOgF3ENOIY8PeWjXsl35HoYaUkl0ixBQk8jJP2HIEf+MdbS5688y/UXxFbSjr0m//LfwR5gauEashg==", + "dependencies": { + "@material/base": "=14.0.0-canary.53b3cad2f.0", + "@material/dom": "=14.0.0-canary.53b3cad2f.0", + "@material/list": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/mwc-checkbox": "^0.27.0", + "@material/mwc-radio": "^0.27.0", + "@material/mwc-ripple": "^0.27.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-menu": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-menu/-/mwc-menu-0.27.0.tgz", + "integrity": "sha512-K+L/t267ZGrlhjK/iSKUVZQKRMkWELArKVglfS5of93ALP4in0RGnj1sOG2u3IFI2F/mEZxRi+wr7HgNxpe0wA==", + "dependencies": { + "@material/menu": "=14.0.0-canary.53b3cad2f.0", + "@material/menu-surface": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/mwc-list": "^0.27.0", + "@material/shape": "=14.0.0-canary.53b3cad2f.0", + "@material/theme": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-notched-outline": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-notched-outline/-/mwc-notched-outline-0.27.0.tgz", + "integrity": "sha512-IlqfQVaEd1RAHqhOG0Xk5JhTDgBe/P9og0pnACglK6bPE0vUhYKwibJiHcr4ACTPtGWHO9o92aktR+7AIEAKtQ==", + "dependencies": { + "@material/mwc-base": "^0.27.0", + "@material/notched-outline": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-radio": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-radio/-/mwc-radio-0.27.0.tgz", + "integrity": "sha512-+rSO9a373BgyMgQOM0Z8vVkuieobBylPJ8qpltytM+yGPj8+n+MtwRZyg+ry3WwEjYYDMP6GxZPHwLgWs6lMpQ==", + "dependencies": { + "@material/mwc-base": "^0.27.0", + "@material/mwc-ripple": "^0.27.0", + "@material/radio": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-ripple": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-ripple/-/mwc-ripple-0.27.0.tgz", + "integrity": "sha512-by0O8d8g3Rd96/sUB8hxy6MrDx1QTstqOsA64vqypWd526hMTBGRik08jTNap5sVIyrN9Vq17jb4NJLWQLnNHQ==", + "dependencies": { + "@material/dom": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/ripple": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-select": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-select/-/mwc-select-0.27.0.tgz", + "integrity": "sha512-LTr2nl7gAYq8ung4eWfUz24mey4/K9vAlqJBo/uu6w0122C9X64szBS9kHAb87aD1oxLkxAJCDuv/wwlXV1i2w==", + "dependencies": { + "@material/dom": "=14.0.0-canary.53b3cad2f.0", + "@material/floating-label": "=14.0.0-canary.53b3cad2f.0", + "@material/line-ripple": "=14.0.0-canary.53b3cad2f.0", + "@material/list": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/mwc-floating-label": "^0.27.0", + "@material/mwc-icon": "^0.27.0", + "@material/mwc-line-ripple": "^0.27.0", + "@material/mwc-list": "^0.27.0", + "@material/mwc-menu": "^0.27.0", + "@material/mwc-notched-outline": "^0.27.0", + "@material/select": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/mwc-textfield": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@material/mwc-textfield/-/mwc-textfield-0.27.0.tgz", + "integrity": "sha512-4/OEeEVAWWQ1DzpjeMLYLsa9HMlifOPjAvi0681Yj1g/RYJs5ONZS80HZ8HOT+efAOlZDugshgM4gdNS3I0XFQ==", + "dependencies": { + "@material/floating-label": "=14.0.0-canary.53b3cad2f.0", + "@material/line-ripple": "=14.0.0-canary.53b3cad2f.0", + "@material/mwc-base": "^0.27.0", + "@material/mwc-floating-label": "^0.27.0", + "@material/mwc-line-ripple": "^0.27.0", + "@material/mwc-notched-outline": "^0.27.0", + "@material/textfield": "=14.0.0-canary.53b3cad2f.0", + "lit": "^2.0.0", + "tslib": "^2.0.1" + } + }, + "node_modules/@material/notched-outline": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/notched-outline/-/notched-outline-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-3ByiPOC/wWQmFKfgJS98kb5/6v92n7uIfJ6v6sryKJlJCJn39qfpGcCM5RpRIws1RET1s1zBJT2JDwYeu/hM5A==", + "dependencies": { + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/floating-label": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/radio": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/radio/-/radio-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-V/AgWEOuHFoh9d4Gq1rqBZnKSGtMLQNh23Bwrv0c1FhPqFvUpwt9jR3SVwhJk5gvQQWGy9p3iiGc9QCJ+0+P8Q==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/focus-ring": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/touch-target": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/ripple": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-6g2G62vd8DsMuIUSXlRrzb98qkZ4o8ZREknNwNP2zaLQEOkJ//4j9HaqDt98/3LIjUTY9UIVFTQENiMmlwKHYQ==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/rtl": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/rtl/-/rtl-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-f08LT0HSa0WYU+4Jz/tbm1TQ9Fcf2k+H6dPPYv0J1sZmX6hMgCEmNiUdUFLQFvszoXx2XrRi1/hIFjbz2e69Yg==", + "dependencies": { + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/select": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/select/-/select-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-fAiTaHZ1PIEmCUbufS+IZvsWO0hDxtbU8rOsbmSu1oupAboP7jSgOVgcCGdT9KY5WacrniIIMO6jZjhnvrC0Lg==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/elevation": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/floating-label": "14.0.0-canary.53b3cad2f.0", + "@material/line-ripple": "14.0.0-canary.53b3cad2f.0", + "@material/list": "14.0.0-canary.53b3cad2f.0", + "@material/menu": "14.0.0-canary.53b3cad2f.0", + "@material/menu-surface": "14.0.0-canary.53b3cad2f.0", + "@material/notched-outline": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/tokens": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/shape": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/shape/-/shape-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-RyjInLCNe+nI/ulKea0ZLHphXQDiDqYazS25SRn18g8Hoa5qGNaY5oOBncDXUYn3jm5oI5kFc9oif//kulkbjg==", + "dependencies": { + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/textfield": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/textfield/-/textfield-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-Pla9Tr94Is18o97E/mqHKdkR24rPES9atGm3BlXrNzyr5tu6+h++RBbxy7V6IExcfl0MX+v9Gyqz7sPZzFtwMA==", + "dependencies": { + "@material/animation": "14.0.0-canary.53b3cad2f.0", + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/density": "14.0.0-canary.53b3cad2f.0", + "@material/dom": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/floating-label": "14.0.0-canary.53b3cad2f.0", + "@material/line-ripple": "14.0.0-canary.53b3cad2f.0", + "@material/notched-outline": "14.0.0-canary.53b3cad2f.0", + "@material/ripple": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "@material/shape": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "@material/tokens": "14.0.0-canary.53b3cad2f.0", + "@material/typography": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/theme": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/theme/-/theme-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-S06XAevDCDWMe+GgsEpITMS07imUidzadNaTbJsqssFajBLr53QWVZsG84BpjXKXoYvyEJvb0hX5U0lq6ip9UQ==", + "dependencies": { + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/tokens": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/tokens/-/tokens-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-myHFB7vac8zErA3qgkqmV+kpE+i9JEwc/6Yf0MOumDSpylJGw28QikpNC6eAVBK2EmPQTaFn20mqUxyud8dGqw==", + "dependencies": { + "@material/elevation": "14.0.0-canary.53b3cad2f.0" + } + }, + "node_modules/@material/touch-target": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/touch-target/-/touch-target-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-d83e5vbqoLyL542yOTTp4TLVltddWiqbI/j1w/D9ipE30YKfe2EDN+CNJc32Zufh5IUfK41DsZdrN8fI9cL99A==", + "dependencies": { + "@material/base": "14.0.0-canary.53b3cad2f.0", + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/rtl": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@material/typography": { + "version": "14.0.0-canary.53b3cad2f.0", + "resolved": "https://registry.npmjs.org/@material/typography/-/typography-14.0.0-canary.53b3cad2f.0.tgz", + "integrity": "sha512-9J0k2fq7uyHsRzRqJDJLGmg3YzRpfRPtFDVeUH/xBcYoqpZE7wYw5Mb7s/l8eP626EtR7HhXhSPjvRTLA6NIJg==", + "dependencies": { + "@material/feature-targeting": "14.0.0-canary.53b3cad2f.0", + "@material/theme": "14.0.0-canary.53b3cad2f.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "dependencies": { + "eslint-scope": "5.1.1" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@open-wc/building-rollup": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@open-wc/building-rollup/-/building-rollup-2.2.1.tgz", + "integrity": "sha512-cQAgNg41ug6j0uV3NiwI7xtQyaYPoNVdpmsPwmU5sHKFEOWGy+9p1MM+deHbxAnff0HOHyeeNDYda1F2f4Y4kQ==", + "dependencies": { + "@babel/core": "^7.11.1", + "@babel/helpers": "^7.10.4", + "@babel/plugin-proposal-dynamic-import": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-transform-modules-systemjs": "^7.10.5", + "@babel/plugin-transform-runtime": "^7.11.0", + "@babel/preset-env": "^7.9.0", + "@open-wc/building-utils": "^2.20.1", + "@rollup/plugin-babel": "^5.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@web/rollup-plugin-html": "^1.7.0", + "@web/rollup-plugin-import-meta-assets": "^1.0.6", + "@web/rollup-plugin-polyfills-loader": "^1.1.0", + "babel-plugin-template-html-minifier": "^4.0.0", + "browserslist": "^4.16.5", + "deepmerge": "^4.2.2", + "magic-string": "^0.25.7", + "parse5": "^5.1.1", + "regenerator-runtime": "^0.13.7", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-workbox": "^6.0.0", + "terser": "^4.8.1" + }, + "peerDependencies": { + "rollup": "^2.11.0" + } + }, + "node_modules/@open-wc/building-rollup/node_modules/@rollup/plugin-babel": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", + "integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==", + "dependencies": { + "@babel/helper-module-imports": "^7.10.4", + "@rollup/pluginutils": "^3.1.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + } + } + }, + "node_modules/@open-wc/building-rollup/node_modules/@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^2.42.0" + } + }, + "node_modules/@open-wc/building-utils": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/@open-wc/building-utils/-/building-utils-2.21.0.tgz", + "integrity": "sha512-Kj3ZyZUbB1wMIKaOu2mbDraI33yk939q9epelVFhcczWCHDYl+jbOb1KHKiDcnH1i2JBengVN9rAVp6TXSHhXA==", + "dependencies": { + "@babel/core": "^7.11.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@webcomponents/shadycss": "^1.10.2", + "@webcomponents/webcomponentsjs": "^2.5.0", + "arrify": "^2.0.1", + "browserslist": "^4.16.5", + "chokidar": "^3.4.3", + "clean-css": "^5.3.1", + "clone": "^2.1.2", + "core-js-bundle": "^3.8.1", + "deepmerge": "^4.2.2", + "es-module-shims": "^1.4.1", + "html-minifier-terser": "^5.1.1", + "lru-cache": "^6.0.0", + "minimatch": "^3.0.4", + "parse5": "^5.1.1", + "path-is-inside": "^1.0.2", + "regenerator-runtime": "^0.13.7", + "resolve": "^1.19.0", + "rimraf": "^3.0.2", + "shady-css-scoped-element": "^0.0.2", + "systemjs": "^6.8.3", + "terser": "^4.8.1", + "valid-url": "^1.0.9", + "whatwg-fetch": "^3.5.0", + "whatwg-url": "^7.1.0" + } + }, + "node_modules/@open-wc/building-utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@open-wc/building-utils/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@open-wc/building-utils/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@open-wc/chai-dom-equals": { + "version": "0.12.36", + "resolved": "https://registry.npmjs.org/@open-wc/chai-dom-equals/-/chai-dom-equals-0.12.36.tgz", + "integrity": "sha512-Gt1fa37h4rtWPQGETSU4n1L678NmMi9KwHM1sH+JCGcz45rs8DBPx7MUVeGZ+HxRlbEI5t9LU2RGGv6xT2OlyA==", + "dev": true, + "dependencies": { + "@open-wc/semantic-dom-diff": "^0.13.16", + "@types/chai": "^4.1.7" + } + }, + "node_modules/@open-wc/chai-dom-equals/node_modules/@open-wc/semantic-dom-diff": { + "version": "0.13.21", + "resolved": "https://registry.npmjs.org/@open-wc/semantic-dom-diff/-/semantic-dom-diff-0.13.21.tgz", + "integrity": "sha512-BONpjHcGX2zFa9mfnwBCLEmlDsOHzT+j6Qt1yfK3MzFXFtAykfzFjAgaxPetu0YbBlCfXuMlfxI4vlRGCGMvFg==", + "dev": true + }, + "node_modules/@open-wc/dedupe-mixin": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@open-wc/dedupe-mixin/-/dedupe-mixin-1.3.1.tgz", + "integrity": "sha512-ukowSvzpZQDUH0Y3znJTsY88HkiGk3Khc0WGpIPhap1xlerieYi27QBg6wx/nTurpWfU6XXXsx9ocxDYCdtw0Q==", + "dev": true + }, + "node_modules/@open-wc/eslint-config": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@open-wc/eslint-config/-/eslint-config-10.0.0.tgz", + "integrity": "sha512-/TzYPzyVvFaxIE4C0k/NiDS+xHeZvHcUtZBT8xfAQ2g+i8ey3sPo073HVgvJ2LFDZsZytRn+fML+j9xZ0Lexzw==", + "dev": true, + "dependencies": { + "@babel/eslint-parser": "^7.19.1", + "@babel/plugin-syntax-import-assertions": "^7.20.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-html": "^7.1.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-import-exports-imports-resolver": "^1.0.1", + "eslint-plugin-lit": "^1.8.0", + "eslint-plugin-lit-a11y": "^2.4.0", + "eslint-plugin-no-only-tests": "^3.1.0", + "eslint-plugin-wc": "^1.2.0" + }, + "peerDependencies": { + "eslint": ">=7.6.0", + "eslint-plugin-html": "^7.1.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-lit": "^1.3.0", + "eslint-plugin-lit-a11y": "^2.4.0", + "eslint-plugin-no-only-tests": "^3.1.0", + "eslint-plugin-wc": "^1.2.0" + } + }, + "node_modules/@open-wc/scoped-elements": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@open-wc/scoped-elements/-/scoped-elements-2.1.4.tgz", + "integrity": "sha512-KX/bOkcDG9kbBDSmgsbpp40ZjEWxpWNrNRZZVSO0KqBygMfvfiEeVfP16uJp9YyWHi/PVZ/C0aUEgf8Pg1Eq7A==", + "dev": true, + "dependencies": { + "@lit/reactive-element": "^1.0.0", + "@open-wc/dedupe-mixin": "^1.3.0" + } + }, + "node_modules/@open-wc/semantic-dom-diff": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@open-wc/semantic-dom-diff/-/semantic-dom-diff-0.19.7.tgz", + "integrity": "sha512-ahwHb7arQXXnkIGCrOsM895FJQrU47VWZryCsSSzl5nB3tJKcJ8yjzQ3D/yqZn6v8atqOz61vaY05aNsqoz3oA==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.1", + "@web/test-runner-commands": "^0.6.1" + } + }, + "node_modules/@open-wc/testing": { + "version": "3.0.0-next.5", + "resolved": "https://registry.npmjs.org/@open-wc/testing/-/testing-3.0.0-next.5.tgz", + "integrity": "sha512-n2NrCGql3daWKOuyvdwKqdnm2ArOch+U7yIuvLZGTwtlMXlvZjOAln3CKZCWEmN5lXcgIAb5czeY7CzOmP8QWg==", + "dev": true, + "dependencies": { + "@esm-bundle/chai": "^4.3.4", + "@open-wc/chai-dom-equals": "^0.12.36", + "@open-wc/semantic-dom-diff": "^0.19.5-next.2", + "@open-wc/testing-helpers": "^2.0.0-next.2", + "@types/chai": "^4.2.11", + "@types/chai-dom": "^0.0.9", + "@types/sinon-chai": "^3.2.3", + "chai-a11y-axe": "^1.3.2-next.0" + } + }, + "node_modules/@open-wc/testing-helpers": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@open-wc/testing-helpers/-/testing-helpers-2.1.4.tgz", + "integrity": "sha512-iZJxxKI9jRgnPczm8p2jpuvBZ3DHYSLrBmhDfzs7ol8vXMNt+HluzM1j1TSU95MFVGnfaspvvt9fMbXKA7cNcA==", + "dev": true, + "dependencies": { + "@open-wc/scoped-elements": "^2.1.3", + "lit": "^2.0.0", + "lit-html": "^2.0.0" + } + }, + "node_modules/@rollup/plugin-babel": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.3.tgz", + "integrity": "sha512-fKImZKppa1A/gX73eg4JGo+8kQr/q1HBQaCGKECZ0v4YBBv3lFqi14+7xyApECzvkLTHCifx+7ntcrvtBIRcpg==", + "dependencies": { + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + }, + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-babel/node_modules/@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-babel/node_modules/@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" + }, + "node_modules/@rollup/plugin-babel/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", + "integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.2.0", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve/node_modules/@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve/node_modules/@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" + }, + "node_modules/@rollup/plugin-node-resolve/node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" + }, + "node_modules/@rollup/plugin-node-resolve/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/@rollup/plugin-replace": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz", + "integrity": "sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "magic-string": "^0.27.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-replace/node_modules/@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-replace/node_modules/@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" + }, + "node_modules/@rollup/plugin-replace/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/@rollup/plugin-replace/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==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", + "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0" + } + }, + "node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", + "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", + "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", + "dev": true + }, + "node_modules/@surma/rollup-plugin-off-main-thread": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz", + "integrity": "sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==", + "dependencies": { + "ejs": "^3.1.6", + "json5": "^2.2.0", + "magic-string": "^0.25.0", + "string.prototype.matchall": "^4.0.6" + } + }, + "node_modules/@types/accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/babel__code-frame": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz", + "integrity": "sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw==", + "dev": true + }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "dev": true + }, + "node_modules/@types/chai-dom": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@types/chai-dom/-/chai-dom-0.0.9.tgz", + "integrity": "sha512-jj4F2NJog2/GBYsyJ8+NvhnWUBbPY4MUAKLdPJE6+568rw12GGXvj0ycUuP5nndVrnJgozmJAoMTvxvjJATXWw==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/co-body": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/co-body/-/co-body-6.1.0.tgz", + "integrity": "sha512-3e0q2jyDAnx/DSZi0z2H0yoZ2wt5yRDZ+P7ymcMObvq0ufWRT4tsajyO+Q1VwVWiv9PRR4W3YEjEzBjeZlhF+w==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*" + } + }, + "node_modules/@types/command-line-args": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.0.tgz", + "integrity": "sha512-UuKzKpJJ/Ief6ufIaIzr3A/0XnluX7RvFgwkV89Yzvm77wCh1kFaFmqN8XEnGcN62EuHdedQjEMb8mYxFLGPyA==" + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/content-disposition": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz", + "integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==" + }, + "node_modules/@types/convert-source-map": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/convert-source-map/-/convert-source-map-1.5.2.tgz", + "integrity": "sha512-tHs++ZeXer40kCF2JpE51Hg7t4HPa18B1b1Dzy96S0eCw8QKECNMYMfwa1edK/x8yCN0r4e6ewvLcc5CsVGkdg==", + "dev": true + }, + "node_modules/@types/cookies": { + "version": "0.7.7", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz", + "integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==", + "dependencies": { + "@types/connect": "*", + "@types/express": "*", + "@types/keygrip": "*", + "@types/node": "*" + } + }, + "node_modules/@types/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-epMsEE85fi4lfmJUH/89/iV/LI+F5CvNIvmgs5g5jYFPfhO2S/ae8WSsLOKWdwtoaZw9Q2IhJ4tQ5tFCcS/4HA==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + }, + "node_modules/@types/express": { + "version": "4.17.16", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.16.tgz", + "integrity": "sha512-LkKpqRZ7zqXJuvoELakaFYuETHjZkSol8EV6cNnyishutDBCCdv6+dsKPbKkCcIk57qRphOLY5sEgClw1bO3gA==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.31", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.33", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", + "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/@types/http-assert": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz", + "integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==" + }, + "node_modules/@types/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@types/keygrip": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", + "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==" + }, + "node_modules/@types/koa": { + "version": "2.13.5", + "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.5.tgz", + "integrity": "sha512-HSUOdzKz3by4fnqagwthW/1w/yJspTgppyyalPVbgZf8jQWvdIXcVW5h2DGtw4zYntOaeRGx49r1hxoPWrD4aA==", + "dependencies": { + "@types/accepts": "*", + "@types/content-disposition": "*", + "@types/cookies": "*", + "@types/http-assert": "*", + "@types/http-errors": "*", + "@types/keygrip": "*", + "@types/koa-compose": "*", + "@types/node": "*" + } + }, + "node_modules/@types/koa-compose": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", + "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", + "dependencies": { + "@types/koa": "*" + } + }, + "node_modules/@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + }, + "node_modules/@types/mocha": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz", + "integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/parse5": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", + "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==" + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "node_modules/@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", + "dependencies": { + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/@types/sinon": { + "version": "10.0.13", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", + "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", + "dev": true, + "dependencies": { + "@types/sinonjs__fake-timers": "*" + } + }, + "node_modules/@types/sinon-chai": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.9.tgz", + "integrity": "sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ==", + "dev": true, + "dependencies": { + "@types/chai": "*", + "@types/sinon": "*" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", + "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", + "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@web/browser-logs": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@web/browser-logs/-/browser-logs-0.2.5.tgz", + "integrity": "sha512-Qxo1wY/L7yILQqg0jjAaueh+tzdORXnZtxQgWH23SsTCunz9iq9FvsZa8Q5XlpjnZ3vLIsFEuEsCMqFeohJnEg==", + "dev": true, + "dependencies": { + "errorstacks": "^2.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/config-loader": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@web/config-loader/-/config-loader-0.1.3.tgz", + "integrity": "sha512-XVKH79pk4d3EHRhofete8eAnqto1e8mCRAqPV00KLNFzCWSe8sWmLnqKCqkPNARC6nksMaGrATnA5sPDRllMpQ==", + "dependencies": { + "semver": "^7.3.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/config-loader/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/config-loader/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/config-loader/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@web/dev-server": { + "version": "0.1.35", + "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.1.35.tgz", + "integrity": "sha512-E7TSTSFdGPzhkiE3kIVt8i49gsiAYpJIZHzs1vJmVfdt8U4rsmhE+5roezxZo0hkEw4mNsqj9zCc4Dzqy/IFHg==", + "dependencies": { + "@babel/code-frame": "^7.12.11", + "@types/command-line-args": "^5.0.0", + "@web/config-loader": "^0.1.3", + "@web/dev-server-core": "^0.3.19", + "@web/dev-server-rollup": "^0.3.19", + "camelcase": "^6.2.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.1", + "debounce": "^1.2.0", + "deepmerge": "^4.2.2", + "ip": "^1.1.5", + "nanocolors": "^0.2.1", + "open": "^8.0.2", + "portfinder": "^1.0.32" + }, + "bin": { + "wds": "dist/bin.js", + "web-dev-server": "dist/bin.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/dev-server-core": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.3.19.tgz", + "integrity": "sha512-Q/Xt4RMVebLWvALofz1C0KvP8qHbzU1EmdIA2Y1WMPJwiFJFhPxdr75p9YxK32P2t0hGs6aqqS5zE0HW9wYzYA==", + "dependencies": { + "@types/koa": "^2.11.6", + "@types/ws": "^7.4.0", + "@web/parse5-utils": "^1.2.0", + "chokidar": "^3.4.3", + "clone": "^2.1.2", + "es-module-lexer": "^1.0.0", + "get-stream": "^6.0.0", + "is-stream": "^2.0.0", + "isbinaryfile": "^4.0.6", + "koa": "^2.13.0", + "koa-etag": "^4.0.0", + "koa-send": "^5.0.1", + "koa-static": "^5.0.0", + "lru-cache": "^6.0.0", + "mime-types": "^2.1.27", + "parse5": "^6.0.1", + "picomatch": "^2.2.2", + "ws": "^7.4.2" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/dev-server-core/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/dev-server-core/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/dev-server-core/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@web/dev-server-rollup": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@web/dev-server-rollup/-/dev-server-rollup-0.4.0.tgz", + "integrity": "sha512-0ZDwkSIctaJ8o2dslNvnHqrHuvj3YhO7lIdUY+luIk66aBnorBHAJAwWRK9vWRHLBM6OzMe+gLWMDaDu4ctqYA==", + "dependencies": { + "@rollup/plugin-node-resolve": "^13.0.4", + "@web/dev-server-core": "^0.4.0", + "nanocolors": "^0.2.1", + "parse5": "^6.0.1", + "rollup": "^2.67.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^2.42.0" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/@web/dev-server-core": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.4.0.tgz", + "integrity": "sha512-fuba+meLFo7at+wgH6tEhZYdQGK+mWNYRoaYcCCRstGC3Gb7d1vj3SjK1CyRVVen4n+LExvdUz9UTscIMZXg/w==", + "dependencies": { + "@types/koa": "^2.11.6", + "@types/ws": "^7.4.0", + "@web/parse5-utils": "^1.2.0", + "chokidar": "^3.4.3", + "clone": "^2.1.2", + "es-module-lexer": "^1.0.0", + "get-stream": "^6.0.0", + "is-stream": "^2.0.0", + "isbinaryfile": "^4.0.6", + "koa": "^2.13.0", + "koa-etag": "^4.0.0", + "koa-send": "^5.0.1", + "koa-static": "^5.0.0", + "lru-cache": "^6.0.0", + "mime-types": "^2.1.27", + "parse5": "^6.0.1", + "picomatch": "^2.2.2", + "ws": "^7.4.2" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/dev-server-rollup/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/dev-server-rollup/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@web/dev-server/node_modules/@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^2.42.0" + } + }, + "node_modules/@web/dev-server/node_modules/@web/dev-server-rollup": { + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/@web/dev-server-rollup/-/dev-server-rollup-0.3.21.tgz", + "integrity": "sha512-138t+vMFkegRip6Rtlz68Bo5rl984C9c2rLg3dWl9JEEJSQcWgA3iEwXYh4xTc52WjXnM3/LpboAjTYQOMyfrA==", + "dependencies": { + "@rollup/plugin-node-resolve": "^13.0.4", + "@web/dev-server-core": "^0.3.19", + "nanocolors": "^0.2.1", + "parse5": "^6.0.1", + "rollup": "^2.67.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/dev-server/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/dev-server/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/dev-server/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/dev-server/node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/parse5-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@web/parse5-utils/-/parse5-utils-1.3.0.tgz", + "integrity": "sha512-Pgkx3ECc8EgXSlS5EyrgzSOoUbM6P8OKS471HLAyvOBcP1NCBn0to4RN/OaKASGq8qa3j+lPX9H14uA5AHEnQg==", + "dependencies": { + "@types/parse5": "^6.0.1", + "parse5": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/parse5-utils/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/polyfills-loader": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@web/polyfills-loader/-/polyfills-loader-1.4.1.tgz", + "integrity": "sha512-3dGhkctHgMJpWQFWpS++ksiEA6F8kiKrY5Ia6F3Vu+oh5UlN+c7QG8WPKIcFR8M7Ec6EofO25JfBybiVUTZ+CQ==", + "dependencies": { + "@babel/core": "^7.12.10", + "@web/parse5-utils": "^1.3.0", + "@webcomponents/shadycss": "^1.11.0", + "@webcomponents/webcomponentsjs": "^2.5.0", + "abortcontroller-polyfill": "^1.5.0", + "construct-style-sheets-polyfill": "^3.0.5", + "core-js-bundle": "^3.8.1", + "dynamic-import-polyfill": "^0.1.1", + "es-module-shims": "^1.4.1", + "intersection-observer": "^0.12.0", + "parse5": "^6.0.1", + "regenerator-runtime": "^0.13.7", + "resize-observer-polyfill": "^1.5.1", + "shady-css-scoped-element": "^0.0.2", + "systemjs": "^6.8.1", + "terser": "^5.14.2", + "urlpattern-polyfill": "^6.0.2", + "whatwg-fetch": "^3.5.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/polyfills-loader/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/@web/polyfills-loader/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/polyfills-loader/node_modules/terser": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/rollup-plugin-html": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@web/rollup-plugin-html/-/rollup-plugin-html-1.11.0.tgz", + "integrity": "sha512-EqUcV5plGYTV/utdbX8g5t8Yq/z6VfFuQuPD39ckOQuRj7Rj6HD15FHwLHpFAWOR0+GrDnNzR74RvI4ipGm0qQ==", + "dependencies": { + "@web/parse5-utils": "^1.3.0", + "glob": "^7.1.6", + "html-minifier-terser": "^6.0.0", + "parse5": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/rollup-plugin-html/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@web/rollup-plugin-html/node_modules/html-minifier-terser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", + "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==", + "dependencies": { + "camel-case": "^4.1.2", + "clean-css": "^5.2.2", + "commander": "^8.3.0", + "he": "^1.2.0", + "param-case": "^3.0.4", + "relateurl": "^0.2.7", + "terser": "^5.10.0" + }, + "bin": { + "html-minifier-terser": "cli.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@web/rollup-plugin-html/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@web/rollup-plugin-html/node_modules/terser": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@web/rollup-plugin-html/node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/@web/rollup-plugin-import-meta-assets": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@web/rollup-plugin-import-meta-assets/-/rollup-plugin-import-meta-assets-1.0.7.tgz", + "integrity": "sha512-ft44CqITUkNd8stwNb4ZOvrZ8DlPifM821jplksmxRGetg5Lx684oFrpfQJ7mfkU/Sa7B3dI1mHTX0DE52eBwg==", + "dependencies": { + "@rollup/pluginutils": "^4.1.0", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@web/rollup-plugin-import-meta-assets/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@web/rollup-plugin-import-meta-assets/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/@web/rollup-plugin-polyfills-loader": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@web/rollup-plugin-polyfills-loader/-/rollup-plugin-polyfills-loader-1.3.1.tgz", + "integrity": "sha512-dV73QWsGMFkCGwgs2l6ADmDFtsEIduTJLSBL5wBHp5wZm1Sy4SQAEGTsDMRDX5cpAHRT9+sUnKLLREfBppuJbA==", + "dependencies": { + "@web/polyfills-loader": "^1.3.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@web/test-runner/-/test-runner-0.15.1.tgz", + "integrity": "sha512-61L4mvDSvs8Dp3TdKe7WHc8kxHndHlGheWiIFEMgbfetJua6MZ4jyPThISIHSEq3LdAv9key2aDIdmyzk0YJ6w==", + "dev": true, + "dependencies": { + "@web/browser-logs": "^0.2.2", + "@web/config-loader": "^0.1.3", + "@web/dev-server": "^0.1.35", + "@web/test-runner-chrome": "^0.11.0", + "@web/test-runner-commands": "^0.6.3", + "@web/test-runner-core": "^0.10.27", + "@web/test-runner-mocha": "^0.7.5", + "camelcase": "^6.2.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.1", + "convert-source-map": "^1.7.0", + "diff": "^5.0.0", + "globby": "^11.0.1", + "nanocolors": "^0.2.1", + "portfinder": "^1.0.32", + "source-map": "^0.7.3" + }, + "bin": { + "web-test-runner": "dist/bin.js", + "wtr": "dist/bin.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner-chrome": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@web/test-runner-chrome/-/test-runner-chrome-0.11.0.tgz", + "integrity": "sha512-3Eq8C1XEGmfq7iwUvXy0xXfI/fbJNIq2ImDKTVdnwT4+5uTt1i8UFZxZ0PLdkWrhXVtiWI6zcZK/2VBzsGyHBA==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.10.20", + "@web/test-runner-coverage-v8": "^0.5.0", + "chrome-launcher": "^0.15.0", + "puppeteer-core": "^13.1.3" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner-commands": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@web/test-runner-commands/-/test-runner-commands-0.6.5.tgz", + "integrity": "sha512-W+wLg10jEAJY9N6tNWqG1daKmAzxGmTbO/H9fFfcgOgdxdn+hHiR4r2/x1iylKbFLujHUQlnjNQeu2d6eDPFqg==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.10.27", + "mkdirp": "^1.0.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner-core": { + "version": "0.10.27", + "resolved": "https://registry.npmjs.org/@web/test-runner-core/-/test-runner-core-0.10.27.tgz", + "integrity": "sha512-ClV/hSxs4wDm/ANFfQOdRRFb/c0sYywC1QfUXG/nS4vTp3nnt7x7mjydtMGGLmvK9f6Zkubkc1aa+7ryfmVwNA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.11", + "@types/babel__code-frame": "^7.0.2", + "@types/co-body": "^6.1.0", + "@types/convert-source-map": "^1.5.1", + "@types/debounce": "^1.2.0", + "@types/istanbul-lib-coverage": "^2.0.3", + "@types/istanbul-reports": "^3.0.0", + "@web/browser-logs": "^0.2.1", + "@web/dev-server-core": "^0.3.18", + "chokidar": "^3.4.3", + "cli-cursor": "^3.1.0", + "co-body": "^6.1.0", + "convert-source-map": "^1.7.0", + "debounce": "^1.2.0", + "dependency-graph": "^0.11.0", + "globby": "^11.0.1", + "ip": "^1.1.5", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "log-update": "^4.0.0", + "nanocolors": "^0.2.1", + "nanoid": "^3.1.25", + "open": "^8.0.2", + "picomatch": "^2.2.2", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner-coverage-v8": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@web/test-runner-coverage-v8/-/test-runner-coverage-v8-0.5.0.tgz", + "integrity": "sha512-4eZs5K4JG7zqWEhVSO8utlscjbVScV7K6JVwoWWcObFTGAaBMbDVzwGRimyNSzvmfTdIO/Arze4CeUUfCl4iLQ==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.10.20", + "istanbul-lib-coverage": "^3.0.0", + "picomatch": "^2.2.2", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@web/test-runner-mocha": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@web/test-runner-mocha/-/test-runner-mocha-0.7.5.tgz", + "integrity": "sha512-12/OBq6efPCAvJpcz3XJs2OO5nHe7GtBibZ8Il1a0QtsGpRmuJ4/m1EF0Fj9f6KHg7JdpGo18A37oE+5hXjHwg==", + "dev": true, + "dependencies": { + "@types/mocha": "^8.2.0", + "@web/test-runner-core": "^0.10.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@webcomponents/shadycss": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webcomponents/shadycss/-/shadycss-1.11.1.tgz", + "integrity": "sha512-qSok/oMynEgS99wFY5fKT6cR1y64i01RkHGYOspkh2JQsLSM8pjciER+gu3fqTx589y/7LoSuyB5G9Rh7dyXaQ==" + }, + "node_modules/@webcomponents/webcomponentsjs": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.7.0.tgz", + "integrity": "sha512-j161Z9oiy8k74vchdrQGihfSp7QulrTclCUiPo0D7JF6/RjpXAmB0ThlTAFlSElkgqg0vdFgNAXaX9ZHZy25wQ==" + }, + "node_modules/abortcontroller-polyfill": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", + "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" + }, + "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==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/aria-query": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "dev": true, + "dependencies": { + "deep-equal": "^2.0.5" + } + }, + "node_modules/aria-query/node_modules/deep-equal": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", + "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.2", + "get-intrinsic": "^1.1.3", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aria-query/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "engines": { + "node": ">=6" + } + }, + "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==" + }, + "node_modules/array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axe-core": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz", + "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", + "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", + "dev": true + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz", + "integrity": "sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==", + "dependencies": { + "@babel/compat-data": "^7.17.7", + "@babel/helper-define-polyfill-provider": "^0.3.3", + "semver": "^6.1.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz", + "integrity": "sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.3", + "core-js-compat": "^3.25.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", + "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-template-html-minifier": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-template-html-minifier/-/babel-plugin-template-html-minifier-4.1.0.tgz", + "integrity": "sha512-fyuqn/SEPG68v+YUrBehOhQ81fxlu1A3YPATo3XXTNTsYsUFejRNNFTdQk5vkramMYy7/9XKIXIwsnB0VVvVTg==", + "dependencies": { + "clean-css": "^4.2.1", + "html-minifier-terser": "^5.0.0", + "is-builtin-module": "^3.0.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/babel-plugin-template-html-minifier/node_modules/clean-css": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", + "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/babel-plugin-template-html-minifier/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/blocking-elements": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/blocking-elements/-/blocking-elements-0.1.1.tgz", + "integrity": "sha512-/SLWbEzMoVIMZACCyhD/4Ya2M1PWP1qMKuiymowPcI+PdWDARqeARBjhj73kbUBCxEmTZCUu5TAqxtwUO9C1Ig==" + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "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.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", + "node-releases": "^2.0.6", + "update-browserslist-db": "^1.0.9" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "dependencies": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001447", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz", + "integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, + "node_modules/chai-a11y-axe": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/chai-a11y-axe/-/chai-a11y-axe-1.4.0.tgz", + "integrity": "sha512-m7J6DVAl1ePL2ifPKHmwQyHXdCZ+Qfv+qduh6ScqcDfBnJEzpV1K49TblujM45j1XciZOFeFNqMb2sShXMg/mw==", + "dev": true, + "dependencies": { + "axe-core": "^4.3.3" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/chrome-launcher": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.1.tgz", + "integrity": "sha512-UugC8u59/w2AyX5sHLZUHoxBAiSiunUhZa3zZwMH6zPVis0C3dDKiRWyUGIo14tTbZHGVviWxv3PQWZ7taZ4fg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "escape-string-regexp": "^4.0.0", + "is-wsl": "^2.2.0", + "lighthouse-logger": "^1.0.0" + }, + "bin": { + "print-chrome-path": "bin/print-chrome-path.js" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/chrome-launcher/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/clean-css": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz", + "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==", + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 10.0" + } + }, + "node_modules/clean-css/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/cliui/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==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/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==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/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==" + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/co-body": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.1.0.tgz", + "integrity": "sha512-m7pOT6CdLN7FuXUcpuz/8lfQ/L77x8SchHCF4G0RBTJO20Wzmhn5Sp4/5WsKy8OSpifBSUrmg83qEqaDHdyFuQ==", + "dev": true, + "dependencies": { + "inflation": "^2.0.0", + "qs": "^6.5.2", + "raw-body": "^2.3.3", + "type-is": "^1.6.16" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/comment-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", + "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/common-tags": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", + "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, + "node_modules/construct-style-sheets-polyfill": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/construct-style-sheets-polyfill/-/construct-style-sheets-polyfill-3.1.0.tgz", + "integrity": "sha512-HBLKP0chz8BAY6rBdzda11c3wAZeCZ+kIG4weVC2NM3AXzxx09nhe8t0SQNdloAvg5GLuHwq/0SPOOSPvtCcKw==" + }, + "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==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "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==" + }, + "node_modules/cookies": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", + "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", + "dependencies": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/core-js-bundle": { + "version": "3.27.2", + "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.27.2.tgz", + "integrity": "sha512-tFneTtwettzFntMIv4+p+E7SB0pgSWeuLSad9gp27MvSRxckGOGlx5EFIvS8JXODqVeaYKWqUAwQhyDZ8VqLnA==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat": { + "version": "3.27.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.27.2.tgz", + "integrity": "sha512-welaYuF7ZtbYKGrIy7y3eb40d37rG1FvzEOfe7hSLd2iD6duMDqUhRfSvCGyC46HhR6Y8JXXdZ2lnRUMkPBpvg==", + "dependencies": { + "browserslist": "^4.21.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dev": true, + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/custom-elements-manifest": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/custom-elements-manifest/-/custom-elements-manifest-1.0.0.tgz", + "integrity": "sha512-j59k0ExGCKA8T6Mzaq+7axc+KVHwpEphEERU7VZ99260npu/p/9kd+Db+I3cGKxHkM5y6q5gnlXn00mzRQkX2A==", + "dev": true + }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==" + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "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==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dependency-graph": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.11.0.tgz", + "integrity": "sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.981744", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.981744.tgz", + "integrity": "sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==", + "dev": true + }, + "node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/dom5": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dom5/-/dom5-3.0.1.tgz", + "integrity": "sha512-JPFiouQIr16VQ4dX6i0+Hpbg3H2bMKPmZ+WZgBOSSvOPx9QHwwY8sPzeM2baUtViESYto6wC2nuZOMC/6gulcA==", + "dev": true, + "dependencies": { + "@types/parse5": "^2.2.34", + "clone": "^2.1.0", + "parse5": "^4.0.0" + } + }, + "node_modules/dom5/node_modules/@types/parse5": { + "version": "2.2.34", + "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-2.2.34.tgz", + "integrity": "sha512-p3qOvaRsRpFyEmaS36RtLzpdxZZnmxGuT1GMgzkTtTJVFuEw7KFjGK83MFODpJExgX1bEzy9r0NYjMC3IMfi7w==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/dom5/node_modules/parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dynamic-import-polyfill": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dynamic-import-polyfill/-/dynamic-import-polyfill-0.1.1.tgz", + "integrity": "sha512-m953zv0w5oDagTItWm6Auhmk/pY7EiejaqiVbnzSS3HIjh1FCUeK7WzuaVtWPNs58A+/xpIE+/dVk6pKsrua8g==" + }, + "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", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/ejs": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.284", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", + "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==" + }, + "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/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/entities": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", + "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/errorstacks": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/errorstacks/-/errorstacks-2.4.0.tgz", + "integrity": "sha512-5ecWhU5gt0a5G05nmQcgCxP5HperSMxLDzvWlT5U+ZSKkuDK0rJ3dbCQny6/vSCIXjwrhwSecXBbw1alr295hQ==", + "dev": true + }, + "node_modules/es-abstract": { + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", + "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.3", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.4", + "is-array-buffer": "^3.0.1", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/es-module-lexer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.1.0.tgz", + "integrity": "sha512-fJg+1tiyEeS8figV+fPcPpm8WqJEflG3yPU0NOm5xMvrNkuiy7HzX/Ljng4Y0hAoiw4/3hQTCFYw+ub8+a2pRA==" + }, + "node_modules/es-module-shims": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/es-module-shims/-/es-module-shims-1.6.3.tgz", + "integrity": "sha512-+BQyPRZczeV9JH/17X1nu1GbD+SZvdPKD4Nrt2S61J94A2yc8DpWBlzv9KgF9cOXUZKifEShy8/qLelSVNo/rA==" + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "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==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", + "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^2.0.0", + "@eslint/js": "8.35.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-prettier": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", + "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-html": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-7.1.0.tgz", + "integrity": "sha512-fNLRraV/e6j8e3XYOC9xgND4j+U7b1Rq+OygMlLcMg+wI/IpVbF+ubQa3R78EjKB9njT6TQOlcK5rFKBVVtdfg==", + "dev": true, + "dependencies": { + "htmlparser2": "^8.0.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", + "has": "^1.0.3", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import-exports-imports-resolver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-exports-imports-resolver/-/eslint-plugin-import-exports-imports-resolver-1.0.1.tgz", + "integrity": "sha512-4Gqp25iQSS3k8o0/zKxymWbnDW8KIqkubrOOy67IU9Qmhmkq4AiuMXbjx9O9AhYG7Vl94ZQFBcpfwLaQkINv2w==", + "dev": true, + "dependencies": { + "resolve.exports": "^1.1.0", + "resolve.imports": "^1.2.6" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-lit": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-lit/-/eslint-plugin-lit-1.8.2.tgz", + "integrity": "sha512-4mOGcSRNEPMh7AN2F7Iy6no36nuFgyYOsnTRhFw1k8xyy1Zm6QOp788ywDvJqy+eelFbLPBhq20Qr55a887Dmw==", + "dev": true, + "dependencies": { + "parse5": "^6.0.1", + "parse5-htmlparser2-tree-adapter": "^6.0.1", + "requireindex": "^1.2.0" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "eslint": ">= 5" + } + }, + "node_modules/eslint-plugin-lit-a11y": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-lit-a11y/-/eslint-plugin-lit-a11y-2.4.0.tgz", + "integrity": "sha512-5RJJnouGqdKIvljf2RWjHBMalTxG/M8Hh7XJFkfdL6tLN0enuKQomp0YY3fXE8EiwGz+VOk3A91npJXVZJD5hA==", + "dev": true, + "dependencies": { + "aria-query": "^5.1.3", + "axe-core": "^4.3.3", + "axobject-query": "^2.2.0", + "dom5": "^3.0.1", + "emoji-regex": "^10.2.1", + "eslint-plugin-lit": "^1.6.0", + "eslint-rule-extender": "0.0.1", + "language-tags": "^1.0.5", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.1", + "requireindex": "~1.2.0" + }, + "peerDependencies": { + "eslint": ">= 5" + } + }, + "node_modules/eslint-plugin-lit-a11y/node_modules/emoji-regex": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz", + "integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==", + "dev": true + }, + "node_modules/eslint-plugin-lit/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "node_modules/eslint-plugin-no-only-tests": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz", + "integrity": "sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==", + "dev": true, + "engines": { + "node": ">=5.0.0" + } + }, + "node_modules/eslint-plugin-wc": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-wc/-/eslint-plugin-wc-1.4.0.tgz", + "integrity": "sha512-AmoKhJyBNcS3I+dbS/JTmRSq4REUvQ/JJCeWJezlK8gqTsdr5JD+EAvHldH/tVvU+l6qR2Tykga5hTINP9zS8A==", + "dev": true, + "dependencies": { + "is-valid-element-name": "^1.0.0", + "js-levenshtein-esm": "^1.2.0" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-rule-extender": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/eslint-rule-extender/-/eslint-rule-extender-0.0.1.tgz", + "integrity": "sha512-F0j1Twve3lamL3J0rRSVAynlp58sDPG39JFcQrM+u9Na7PmCgiPHNODh6YE9mduaGcsn3NBqbf6LZRj0cLr8Ng==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kaicataldo" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/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==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/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==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "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" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extract-zip/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/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==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "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/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-versions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", + "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "dev": true, + "dependencies": { + "semver-regex": "^3.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "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==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/html-minifier-terser": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", + "integrity": "sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg==", + "dependencies": { + "camel-case": "^4.1.1", + "clean-css": "^4.2.3", + "commander": "^4.1.1", + "he": "^1.2.0", + "param-case": "^3.0.3", + "relateurl": "^0.2.7", + "terser": "^4.6.3" + }, + "bin": { + "html-minifier-terser": "cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/html-minifier-terser/node_modules/clean-css": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", + "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/html-minifier-terser/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + } + }, + "node_modules/http-assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", + "dependencies": { + "deep-equal": "~1.0.1", + "http-errors": "~1.8.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-assert/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-assert/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-assert/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "engines": { + "node": ">= 0.6" + } + }, + "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==", + "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/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/husky": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", + "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^7.0.0", + "find-versions": "^4.0.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^5.0.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "husky-run": "bin/run.js", + "husky-upgrade": "lib/upgrader/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/husky" + } + }, + "node_modules/husky/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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/husky/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/husky/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==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/husky/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==", + "dev": true + }, + "node_modules/husky/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/husky/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=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==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/idb": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflation": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz", + "integrity": "sha512-m3xv4hJYR2oXw4o4Y5l6P5P16WYmazYof+el6Al3f+YlggGj6qT9kImBAnzDelRALnP5d3h4jGBPKzYCizjZZw==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", + "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/intersection-observer": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.12.2.tgz", + "integrity": "sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==" + }, + "node_modules/ip": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" + }, + "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==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", + "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-valid-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-element-name/-/is-valid-element-name-1.0.0.tgz", + "integrity": "sha512-GZITEJY2LkSjQfaIPBha7eyZv+ge0PhBR7KITeCCWvy7VBQrCUdFkvpI+HrAPQjVtVjy1LvlEkqQTHckoszruw==", + "dev": true, + "dependencies": { + "is-potential-custom-element-name": "^1.0.0" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, + "node_modules/isbinaryfile": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "engines": { + "node": ">= 8.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jake/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==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jake/node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "node_modules/jake/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jake/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==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jake/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==" + }, + "node_modules/jake/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jake/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-levenshtein-esm": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/js-levenshtein-esm/-/js-levenshtein-esm-1.2.0.tgz", + "integrity": "sha512-fzreKVq1eD7eGcQr7MtRpQH94f8gIfhdrc7yeih38xh684TNMK9v5aAu2wxfIRMk/GpAJRrzcirMAPIaSDaByQ==", + "dev": true + }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "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==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "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/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "node_modules/keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "dependencies": { + "tsscmp": "1.0.6" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.14.1.tgz", + "integrity": "sha512-USJFyZgi2l0wDgqkfD27gL4YGno7TfUkcmOe6UOLFOVuN+J7FwnNu4Dydl4CUQzraM1lBAiGed0M9OVJoT0Kqw==", + "dependencies": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.8.0", + "debug": "^4.3.2", + "delegates": "^1.0.0", + "depd": "^2.0.0", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^2.0.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + }, + "engines": { + "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4" + } + }, + "node_modules/koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==" + }, + "node_modules/koa-convert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/koa-etag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/koa-etag/-/koa-etag-4.0.0.tgz", + "integrity": "sha512-1cSdezCkBWlyuB9l6c/IFoe1ANCDdPBxkDkRiaIup40xpUub6U/wwRXoKBZw/O5BifX9OlqAjYnDyzM6+l+TAg==", + "dependencies": { + "etag": "^1.8.1" + } + }, + "node_modules/koa-send": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz", + "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==", + "dependencies": { + "debug": "^4.1.1", + "http-errors": "^1.7.3", + "resolve-path": "^1.4.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/koa-send/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-send/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-send/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-static": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", + "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", + "dependencies": { + "debug": "^3.1.0", + "koa-send": "^5.0.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa-static/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/koa/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa/node_modules/http-errors/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/language-subtag-registry": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", + "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==", + "dev": true + }, + "node_modules/language-tags": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.8.tgz", + "integrity": "sha512-aWAZwgPLS8hJ20lNPm9HNVs4inexz6S2sQa3wx/+ycuutMNE5/IfYxiWYBbi+9UWCQVaXYCOPUl6gFrPR7+jGg==", + "dev": true, + "dependencies": { + "language-subtag-registry": "^0.3.20" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lighthouse-logger": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.3.0.tgz", + "integrity": "sha512-BbqAKApLb9ywUli+0a+PcV04SyJ/N1q/8qgCNe6U97KbPCS1BTksEuHFLYdvc8DltuhfxIUBqDZsC0bBGtl3lA==", + "dev": true, + "dependencies": { + "debug": "^2.6.9", + "marky": "^1.2.2" + } + }, + "node_modules/lighthouse-logger/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lighthouse-logger/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/lilconfig": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz", + "integrity": "sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/lint-staged": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.1.2.tgz", + "integrity": "sha512-K9b4FPbWkpnupvK3WXZLbgu9pchUJ6N7TtVZjbaPsoizkqFUDkUReUL25xdrCljJs7uLUF3tZ7nVPeo/6lp+6w==", + "dev": true, + "dependencies": { + "cli-truncate": "^3.1.0", + "colorette": "^2.0.19", + "commander": "^9.4.1", + "debug": "^4.3.4", + "execa": "^6.1.0", + "lilconfig": "2.0.6", + "listr2": "^5.0.5", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-inspect": "^1.12.2", + "pidtree": "^0.6.0", + "string-argv": "^0.3.1", + "yaml": "^2.1.3" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/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/lint-staged/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/lint-staged/node_modules/cli-truncate": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/lint-staged/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/lint-staged/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/lint-staged/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/lint-staged/node_modules/yaml": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/listr2": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-5.0.7.tgz", + "integrity": "sha512-MD+qXHPmtivrHIDRwPYdfNkrzqDiuaKU/rfBcec3WMyMF3xylQj3jMq344OtvQxz7zaCFViRAeqlr2AFhPvXHw==", + "dev": true, + "dependencies": { + "cli-truncate": "^2.1.0", + "colorette": "^2.0.19", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.8.0", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } + } + }, + "node_modules/lit": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/lit/-/lit-2.6.1.tgz", + "integrity": "sha512-DT87LD64f8acR7uVp7kZfhLRrHkfC/N4BVzAtnw9Yg8087mbBJ//qedwdwX0kzDbxgPccWRW6mFwGbRQIxy0pw==", + "dependencies": { + "@lit/reactive-element": "^1.6.0", + "lit-element": "^3.2.0", + "lit-html": "^2.6.0" + } + }, + "node_modules/lit-element": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.2.2.tgz", + "integrity": "sha512-6ZgxBR9KNroqKb6+htkyBwD90XGRiqKDHVrW/Eh0EZ+l+iC+u+v+w3/BA5NGi4nizAVHGYvQBHUDuSmLjPp7NQ==", + "dependencies": { + "@lit/reactive-element": "^1.3.0", + "lit-html": "^2.2.0" + } + }, + "node_modules/lit-element-router": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lit-element-router/-/lit-element-router-2.0.3.tgz", + "integrity": "sha512-ASaFeB5E4hsd2LYH3keY3ImuaW1+Dc3BcjauTRZhVcYmEIYDkIs/ci7Vfv/SroHhbyQ5nF/nPFBcOFipYsGwXg==" + }, + "node_modules/lit-html": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.6.1.tgz", + "integrity": "sha512-Z3iw+E+3KKFn9t2YKNjsXNEu/LRLI98mtH/C6lnFg7kvaqPIzPn124Yd4eT/43lyqrejpc5Wb6BHq3fdv4S8Rw==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "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==" + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + }, + "node_modules/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/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==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-update/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==", + "dev": true + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marky": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/marky/-/marky-1.2.5.tgz", + "integrity": "sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==", + "dev": true + }, + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "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==", + "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==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/nanocolors": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.13.tgz", + "integrity": "sha512-0n3mSAQLPpGLV9ORXT5+C/D4mwew7Ebws69Hx4E2sgz2ZA5+32Q80B9tL8PbL7XHnRDiAxH/pnrUJ9a4fkTNTA==" + }, + "node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nise": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.4.tgz", + "integrity": "sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0", + "@sinonjs/fake-timers": "^10.0.2", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "node_modules/nise/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/nise/node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", + "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "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==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==" + }, + "node_modules/open": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", + "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true, + "bin": { + "opencollective-postinstall": "index.js" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-scurry": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.6.1.tgz", + "integrity": "sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==", + "dev": true, + "dependencies": { + "lru-cache": "^7.14.1", + "minipass": "^4.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pattern-key-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pattern-key-compare/-/pattern-key-compare-1.0.0.tgz", + "integrity": "sha512-7wi8a7OFmdx4Hx31+KY9kcD7gO+MWWupXtlAx7ANqoE8Pypl501FsDAPX2tSYLOuafED82A0Mv3lzeNfn82Jlg==", + "dev": true + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "dependencies": { + "semver-compare": "^1.0.0" + } + }, + "node_modules/portfinder": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", + "dependencies": { + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/portfinder/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/portfinder/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", + "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.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==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/puppeteer-core": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-13.7.0.tgz", + "integrity": "sha512-rXja4vcnAzFAP1OVLq/5dWNfwBGuzcOARJ6qGV7oAZhnLmVRU8G5MsdeQEAOy332ZhkIOnn9jp15R89LKHyp2Q==", + "dev": true, + "dependencies": { + "cross-fetch": "3.1.5", + "debug": "4.3.4", + "devtools-protocol": "0.0.981744", + "extract-zip": "2.0.1", + "https-proxy-agent": "5.0.1", + "pkg-dir": "4.2.0", + "progress": "2.0.3", + "proxy-from-env": "1.1.0", + "rimraf": "3.0.2", + "tar-fs": "2.1.1", + "unbzip2-stream": "1.4.3", + "ws": "8.5.0" + }, + "engines": { + "node": ">=10.18.1" + } + }, + "node_modules/puppeteer-core/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/puppeteer-core/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/puppeteer-core/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/puppeteer-core/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/puppeteer-core/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/puppeteer-core/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/puppeteer-core/node_modules/ws": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "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/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", + "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + }, + "node_modules/regenerator-transform": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/regexpu-core": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.2.tgz", + "integrity": "sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw==", + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsgen": "^0.7.1", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz", + "integrity": "sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==" + }, + "node_modules/regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/replace": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/replace/-/replace-1.2.2.tgz", + "integrity": "sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==", + "dependencies": { + "chalk": "2.4.2", + "minimatch": "3.0.5", + "yargs": "^15.3.1" + }, + "bin": { + "replace": "bin/replace.js", + "search": "bin/search.js" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/replace/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "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==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true, + "engines": { + "node": ">=0.10.5" + } + }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-path": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", + "integrity": "sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==", + "dependencies": { + "http-errors": "~1.6.2", + "path-is-absolute": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/resolve-path/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, + "node_modules/resolve-path/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "node_modules/resolve-path/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve.exports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz", + "integrity": "sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/resolve.imports": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/resolve.imports/-/resolve.imports-1.2.7.tgz", + "integrity": "sha512-q+UNv8vIE8wiB3BYjN9cAEtx17TnV6PoQSBWLCWaI9DDumevUifHY5ocKL4S5qcETHm++Gia3EdNJO81IW3PaQ==", + "dev": true, + "dependencies": { + "pattern-key-compare": "^1.0.0" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "dev": true + }, + "node_modules/rimraf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.3.0.tgz", + "integrity": "sha512-5qVDXPbByA1qSJEWMv1qAwKsoS22vVpsL2QyxCKBw4gf6XiFo1K3uRLY6uSOOBFDwnqAZtnbILqWKKlzh8bkGg==", + "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/rimraf/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" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.2.1.tgz", + "integrity": "sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^7.4.1", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", + "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", + "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0" + } + }, + "node_modules/rollup-plugin-terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/rollup-plugin-terser/node_modules/terser": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/rollup-plugin-workbox": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-workbox/-/rollup-plugin-workbox-6.2.0.tgz", + "integrity": "sha512-7v4X2uA88AGR69syAEMTrIW4+TQUid74zuQkFgTyCs8iuzBO6Dd9fB/P6eswmwd3J1F994c6eMHn7/hg3ZOvdw==", + "dependencies": { + "@rollup/plugin-node-resolve": "^11.0.1", + "@rollup/plugin-replace": "^3.0.0", + "pretty-bytes": "^5.5.0", + "rollup-plugin-terser": "^7.0.2", + "workbox-build": "^6.2.4" + } + }, + "node_modules/rollup-plugin-workbox/node_modules/@rollup/plugin-node-resolve": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", + "integrity": "sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/rollup-plugin-workbox/node_modules/@rollup/plugin-replace": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-3.1.0.tgz", + "integrity": "sha512-pA3XRUrSKybVYqmH5TqWNZpGxF+VV+1GrYchKgCNIj2vsSOX7CVm2RCtx8p2nrC7xvkziYyK+lSi74T93MU3YA==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", + "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.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" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "dev": true + }, + "node_modules/semver-regex": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", + "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "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/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "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==" + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shady-css-scoped-element": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/shady-css-scoped-element/-/shady-css-scoped-element-0.0.2.tgz", + "integrity": "sha512-Dqfl70x6JiwYDujd33ZTbtCK0t52E7+H2swdWQNSTzfsolSa6LJHnTpN4T9OpJJEq4bxuzHRLFO9RBcy/UfrMQ==" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/sinon": { + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.3.tgz", + "integrity": "sha512-si3geiRkeovP7Iel2O+qGL4NrO9vbMf3KsrJEi0ghP1l5aBkB5UxARea5j0FUsSqH3HLBh0dQPAyQ8fObRUqHw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^10.0.2", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.1.0", + "nise": "^5.1.4", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi/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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/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==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/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==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead" + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/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==" + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", + "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "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==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz", + "integrity": "sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw==", + "engines": { + "node": ">=10" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/systemjs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.13.0.tgz", + "integrity": "sha512-P3cgh2bpaPvAO2NE3uRp/n6hmk4xPX4DQf+UzTlCAycssKdqhp6hjw+ENWe+aUS7TogKRFtptMosTSFeC6R55g==" + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tempy": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-0.6.0.tgz", + "integrity": "sha512-G13vtMYPT/J8A4X2SjdtBTphZlrp1gKv6hZiOjw14RCWg6GbHuQBGtjlx75xLbYV/wEc0D7G5K4rxKP/cXk8Bw==", + "dependencies": { + "is-stream": "^2.0.0", + "temp-dir": "^2.0.0", + "type-fest": "^0.16.0", + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/terser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/terser/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "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==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, + "node_modules/tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", + "engines": { + "node": ">=0.6.x" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", + "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urlpattern-polyfill": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-6.0.2.tgz", + "integrity": "sha512-5vZjFlH9ofROmuWmXM9yj2wljYKgWstGwe8YTyiqM7hVum/g9LyCizPZtb3UqsuppVwety9QJmfc42VggLpTgg==", + "dependencies": { + "braces": "^3.0.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "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==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/valid-url": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", + "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" + }, + "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==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" + }, + "node_modules/whatwg-fetch": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" + }, + "node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" + }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wicg-inert": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/wicg-inert/-/wicg-inert-3.1.2.tgz", + "integrity": "sha512-Ba9tGNYxXwaqKEi9sJJvPMKuo063umUPsHN0JJsjrs2j8KDSzkWLMZGZ+MH1Jf1Fq4OWZ5HsESJID6nRza2ang==" + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/workbox-background-sync": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-6.5.4.tgz", + "integrity": "sha512-0r4INQZMyPky/lj4Ou98qxcThrETucOde+7mRGJl13MPJugQNKeZQOdIJe/1AchOP23cTqHcN/YVpD6r8E6I8g==", + "dependencies": { + "idb": "^7.0.1", + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-broadcast-update": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-broadcast-update/-/workbox-broadcast-update-6.5.4.tgz", + "integrity": "sha512-I/lBERoH1u3zyBosnpPEtcAVe5lwykx9Yg1k6f8/BGEPGaMMgZrwVrqL1uA9QZ1NGGFoyE6t9i7lBjOlDhFEEw==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-build": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-6.5.4.tgz", + "integrity": "sha512-kgRevLXEYvUW9WS4XoziYqZ8Q9j/2ziJYEtTrjdz5/L/cTUa2XfyMP2i7c3p34lgqJ03+mTiz13SdFef2POwbA==", + "dependencies": { + "@apideck/better-ajv-errors": "^0.3.1", + "@babel/core": "^7.11.1", + "@babel/preset-env": "^7.11.0", + "@babel/runtime": "^7.11.2", + "@rollup/plugin-babel": "^5.2.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "@rollup/plugin-replace": "^2.4.1", + "@surma/rollup-plugin-off-main-thread": "^2.2.3", + "ajv": "^8.6.0", + "common-tags": "^1.8.0", + "fast-json-stable-stringify": "^2.1.0", + "fs-extra": "^9.0.1", + "glob": "^7.1.6", + "lodash": "^4.17.20", + "pretty-bytes": "^5.3.0", + "rollup": "^2.43.1", + "rollup-plugin-terser": "^7.0.0", + "source-map": "^0.8.0-beta.0", + "stringify-object": "^3.3.0", + "strip-comments": "^2.0.1", + "tempy": "^0.6.0", + "upath": "^1.2.0", + "workbox-background-sync": "6.5.4", + "workbox-broadcast-update": "6.5.4", + "workbox-cacheable-response": "6.5.4", + "workbox-core": "6.5.4", + "workbox-expiration": "6.5.4", + "workbox-google-analytics": "6.5.4", + "workbox-navigation-preload": "6.5.4", + "workbox-precaching": "6.5.4", + "workbox-range-requests": "6.5.4", + "workbox-recipes": "6.5.4", + "workbox-routing": "6.5.4", + "workbox-strategies": "6.5.4", + "workbox-streams": "6.5.4", + "workbox-sw": "6.5.4", + "workbox-window": "6.5.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/workbox-build/node_modules/@apideck/better-ajv-errors": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.6.tgz", + "integrity": "sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==", + "dependencies": { + "json-schema": "^0.4.0", + "jsonpointer": "^5.0.0", + "leven": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "ajv": ">=8" + } + }, + "node_modules/workbox-build/node_modules/@rollup/plugin-babel": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", + "integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==", + "dependencies": { + "@babel/helper-module-imports": "^7.10.4", + "@rollup/pluginutils": "^3.1.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + } + } + }, + "node_modules/workbox-build/node_modules/@rollup/plugin-node-resolve": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", + "integrity": "sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/workbox-build/node_modules/@rollup/plugin-replace": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", + "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, + "node_modules/workbox-build/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/workbox-build/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/workbox-build/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/workbox-cacheable-response": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-cacheable-response/-/workbox-cacheable-response-6.5.4.tgz", + "integrity": "sha512-DCR9uD0Fqj8oB2TSWQEm1hbFs/85hXXoayVwFKLVuIuxwJaihBsLsp4y7J9bvZbqtPJ1KlCkmYVGQKrBU4KAug==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-core": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-core/-/workbox-core-6.5.4.tgz", + "integrity": "sha512-OXYb+m9wZm8GrORlV2vBbE5EC1FKu71GGp0H4rjmxmF4/HLbMCoTFws87M3dFwgpmg0v00K++PImpNQ6J5NQ6Q==" + }, + "node_modules/workbox-expiration": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-expiration/-/workbox-expiration-6.5.4.tgz", + "integrity": "sha512-jUP5qPOpH1nXtjGGh1fRBa1wJL2QlIb5mGpct3NzepjGG2uFFBn4iiEBiI9GUmfAFR2ApuRhDydjcRmYXddiEQ==", + "dependencies": { + "idb": "^7.0.1", + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-google-analytics": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-6.5.4.tgz", + "integrity": "sha512-8AU1WuaXsD49249Wq0B2zn4a/vvFfHkpcFfqAFHNHwln3jK9QUYmzdkKXGIZl9wyKNP+RRX30vcgcyWMcZ9VAg==", + "dependencies": { + "workbox-background-sync": "6.5.4", + "workbox-core": "6.5.4", + "workbox-routing": "6.5.4", + "workbox-strategies": "6.5.4" + } + }, + "node_modules/workbox-navigation-preload": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-navigation-preload/-/workbox-navigation-preload-6.5.4.tgz", + "integrity": "sha512-IIwf80eO3cr8h6XSQJF+Hxj26rg2RPFVUmJLUlM0+A2GzB4HFbQyKkrgD5y2d84g2IbJzP4B4j5dPBRzamHrng==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-precaching": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-precaching/-/workbox-precaching-6.5.4.tgz", + "integrity": "sha512-hSMezMsW6btKnxHB4bFy2Qfwey/8SYdGWvVIKFaUm8vJ4E53JAY+U2JwLTRD8wbLWoP6OVUdFlXsTdKu9yoLTg==", + "dependencies": { + "workbox-core": "6.5.4", + "workbox-routing": "6.5.4", + "workbox-strategies": "6.5.4" + } + }, + "node_modules/workbox-range-requests": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-range-requests/-/workbox-range-requests-6.5.4.tgz", + "integrity": "sha512-Je2qR1NXCFC8xVJ/Lux6saH6IrQGhMpDrPXWZWWS8n/RD+WZfKa6dSZwU+/QksfEadJEr/NfY+aP/CXFFK5JFg==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-recipes": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-recipes/-/workbox-recipes-6.5.4.tgz", + "integrity": "sha512-QZNO8Ez708NNwzLNEXTG4QYSKQ1ochzEtRLGaq+mr2PyoEIC1xFW7MrWxrONUxBFOByksds9Z4//lKAX8tHyUA==", + "dependencies": { + "workbox-cacheable-response": "6.5.4", + "workbox-core": "6.5.4", + "workbox-expiration": "6.5.4", + "workbox-precaching": "6.5.4", + "workbox-routing": "6.5.4", + "workbox-strategies": "6.5.4" + } + }, + "node_modules/workbox-routing": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-routing/-/workbox-routing-6.5.4.tgz", + "integrity": "sha512-apQswLsbrrOsBUWtr9Lf80F+P1sHnQdYodRo32SjiByYi36IDyL2r7BH1lJtFX8fwNHDa1QOVY74WKLLS6o5Pg==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-strategies": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-strategies/-/workbox-strategies-6.5.4.tgz", + "integrity": "sha512-DEtsxhx0LIYWkJBTQolRxG4EI0setTJkqR4m7r4YpBdxtWJH1Mbg01Cj8ZjNOO8etqfA3IZaOPHUxCs8cBsKLw==", + "dependencies": { + "workbox-core": "6.5.4" + } + }, + "node_modules/workbox-streams": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-streams/-/workbox-streams-6.5.4.tgz", + "integrity": "sha512-FXKVh87d2RFXkliAIheBojBELIPnWbQdyDvsH3t74Cwhg0fDheL1T8BqSM86hZvC0ZESLsznSYWw+Va+KVbUzg==", + "dependencies": { + "workbox-core": "6.5.4", + "workbox-routing": "6.5.4" + } + }, + "node_modules/workbox-sw": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-sw/-/workbox-sw-6.5.4.tgz", + "integrity": "sha512-vo2RQo7DILVRoH5LjGqw3nphavEjK4Qk+FenXeUsknKn14eCNedHOXWbmnvP4ipKhlE35pvJ4yl4YYf6YsJArA==" + }, + "node_modules/workbox-window": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/workbox-window/-/workbox-window-6.5.4.tgz", + "integrity": "sha512-HnLZJDwYBE+hpG25AQBO8RUWBJRaCsI9ksQJEp3aCOFCaG5kqaToAYXFRAHxzRluM2cQbGzdQF5rjKPWPA1fug==", + "dependencies": { + "@types/trusted-types": "^2.0.2", + "workbox-core": "6.5.4" + } + }, + "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==", + "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/wrap-ansi/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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/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==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/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==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-parser/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/ylru": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.3.2.tgz", + "integrity": "sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package.json b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package.json new file mode 100644 index 0000000..bf2dcbd --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/package.json @@ -0,0 +1,76 @@ +{ + "name": "avocano-app", + "description": "Avocano app", + "license": "MIT", + "author": "avocano-shell", + "version": "0.0.1", + "scripts": { + "lint": "eslint --ext .js . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore", + "format": "eslint --ext .js . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore", + "test": "web-test-runner 'test/**/*.test.js' --node-resolve", + "test:watch": "web-test-runner --watch", + "build": "rimraf dist && rollup -c rollup.config.js", + "start:build": "web-dev-server --root-dir dist --app-index index.html --open", + "start": "web-dev-server" + }, + "dependencies": { + "@material/mwc-button": "^0.27.0", + "@material/mwc-dialog": "^0.27.0", + "@material/mwc-list": "^0.27.0", + "@material/mwc-select": "^0.27.0", + "@material/mwc-textfield": "^0.27.0", + "@open-wc/building-rollup": "^2.0.1", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-replace": "^5.0.0", + "@web/dev-server": "^0.1.28", + "@web/dev-server-rollup": "^0.4.0", + "@web/rollup-plugin-html": "^1.10.1", + "@web/rollup-plugin-import-meta-assets": "^1.0.7", + "express": "^4.18.1", + "idb": "^7.1.1", + "lit": "^2.3.0", + "lit-element-router": "^2.0.3", + "replace": "^1.2.1", + "rollup": "^2.60.0", + "rollup-plugin-terser": "^7.0.2" + }, + "devDependencies": { + "@babel/preset-env": "^7.16.4", + "@custom-elements-manifest/analyzer": "^0.8.0", + "@open-wc/eslint-config": "^10.0.0", + "@open-wc/testing": "next", + "@web/test-runner": "^0.15.0", + "babel-plugin-template-html-minifier": "^4.1.0", + "deepmerge": "^4.2.2", + "eslint": "^8.0.0", + "eslint-config-prettier": "^8.3.0", + "husky": "^4.3.8", + "lint-staged": "^13.0.0", + "prettier": "^2.4.1", + "rimraf": "^4.0.0", + "sinon": "^15.0.3" + }, + "eslintConfig": { + "extends": [ + "@open-wc", + "prettier" + ] + }, + "prettier": { + "singleQuote": true, + "arrowParens": "avoid" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.js": [ + "eslint --fix", + "prettier --write" + ] + }, + "customElements": "custom-elements.json" +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/rollup.config.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/rollup.config.js new file mode 100644 index 0000000..0ba5a93 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/rollup.config.js @@ -0,0 +1,97 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import nodeResolve from '@rollup/plugin-node-resolve'; +import babel from '@rollup/plugin-babel'; +import html from '@web/rollup-plugin-html'; +import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets'; +import { terser } from 'rollup-plugin-terser'; +import replace from '@rollup/plugin-replace'; + +export default [ + { + input: '404.html', + output: { dir: 'dist' }, + plugins: [html()], + }, + { + input: 'index.html', + output: { + entryFileNames: '[hash].js', + chunkFileNames: '[hash].js', + assetFileNames: '[hash][extname]', + format: 'es', + dir: 'dist', + }, + preserveEntrySignatures: false, + + plugins: [ + /** Replace API URL with written API, linked to Firebase */ + replace({ + include: ['src/utils/config.js'], + preventAssignment: false, + __api_url__: '/api', // set in firebase.json + __purchase_mode__: process.env.AVOCANO_PURCHASE_MODE, + }), + /** Enable using HTML as rollup entrypoint */ + html({ + minify: true, + }), + /** Resolve bare module imports */ + nodeResolve(), + /** Minify JS */ + terser(), + /** Bundle assets references via import.meta.url */ + importMetaAssets(), + /** Compile JS to a lower language target */ + babel({ + babelHelpers: 'bundled', + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: [ + 'last 3 Chrome major versions', + 'last 3 Firefox major versions', + 'last 3 Edge major versions', + 'last 3 Safari major versions', + ], + modules: false, + bugfixes: true, + }, + ], + ], + plugins: [ + [ + require.resolve('babel-plugin-template-html-minifier'), + { + modules: { + lit: ['html', { name: 'css', encapsulation: 'style' }], + }, + failOnError: false, + strictCSS: true, + htmlMinifier: { + collapseWhitespace: true, + conservativeCollapse: true, + removeComments: true, + caseSensitive: true, + minifyCSS: true, + }, + }, + ], + ], + }), + ], + }, +]; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/avocano-shell.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/avocano-shell.js new file mode 100644 index 0000000..6cfb89b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/avocano-shell.js @@ -0,0 +1,165 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { router } from 'lit-element-router'; +import { getSiteConfig } from './utils/fetch.js'; +import { getConfig } from './utils/config.js'; +import cache from './utils/cache.js'; +import routes from './utils/routes.js'; +import styles from './styles/shell.js'; + +// Pages +import './pages/home.js'; +import './pages/checkout.js'; +import './pages/contact.js'; +import './pages/product.js'; +import './pages/product-list.js'; +import './pages/shipping.js'; +import './pages/not-found.js'; + +// Components +import './components/checkout-form.js'; +import './components/checkout-dialog.js'; +import './components/cart-item.js'; +import './components/product-item.js'; +import './components/header.js'; +import './components/footer.js'; +import './components/main.js'; + +// Material design +import '@material/mwc-button'; +import '@material/mwc-textfield'; +import '@material/mwc-select'; +import '@material/mwc-list'; +import '@material/mwc-dialog'; + +export class AvocanoShell extends router(LitElement) { + static get properties() { + return { + route: { type: String }, + params: { type: Object }, + }; + } + + static get routes() { + return routes; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.route = ''; + this.params = {}; + this.state = { + config: {}, + cart: [], + }; + + this.childUpdateRequest = this.childUpdateRequest.bind(this); + } + + async connectedCallback() { + super.connectedCallback(); + + const config = await getSiteConfig(); + + // Set django site config properties as + // global variables for our css to leverage + this.style.setProperty('--color-primary', config.color_primary); + this.style.setProperty('--color-secondary', config.color_secondary); + this.style.setProperty('--color-action', config.color_action); + this.style.setProperty('--color-action-text', config.color_action_text); + this.style.setProperty('--site-name-color', config.site_name_color); + this.style.setProperty('--site-name-font', config.site_name_font); + this.style.setProperty('--base-font', config.base_font); + + this.state.config = config; + + /* Dynamically pull fonts we require */ + if (window.WebFont) { + window.WebFont.load({ + google: { + families: [config.base_font, config.site_name_font], + }, + }); + } + + this.requestUpdate(); + } + + router(route, params) { + this.route = route; + this.params = params; + } + + async update(changed) { + this.state.cart = await cache.all(); + super.update(changed); + } + + async childUpdateRequest() { + this.state.cart = await cache.all(); + this.requestUpdate(); + } + + render() { + const { config } = this.state; + const { AVOCANO_PURCHASE_MODE } = getConfig(); + + return html` + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ ${AVOCANO_PURCHASE_MODE === 'cart' + ? html`
+ +
` + : ''} +
+ +
+
+ + `; + } +} + +customElements.define('avocano-shell', AvocanoShell); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/cart-item.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/cart-item.js new file mode 100644 index 0000000..01a7324 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/cart-item.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/cart-item.js'; + +const noimage = new URL('../../assets/noimage.png', import.meta.url).href; + +export class CartItem extends LitElement { + static get properties() { + return { + productItem: { type: Object }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.state = { + productItem: {}, + }; + } + + render() { + const { name, discount_price, count, image, description } = + this.productItem || {}; + + return html` +
+ cartItem?.id && this.navigate(`/products/${cartItem?.id}`)} + > +
+ Product Image +
+
+
${name}
+
${`Price: $${discount_price}`}
+
${`Count: ${count}`}
+
+
+ `; + } +} + +customElements.define('app-cart-item', CartItem); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-dialog.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-dialog.js new file mode 100644 index 0000000..7c32ffc --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-dialog.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/checkout-dialog.js'; + +class CheckoutDialog extends LitElement { + static properties() { + return { + onClose: { type: Function }, + isSuccess: { type: Boolean }, + errors: { type: Array }, + }; + } + + static get styles() { + return styles; + } + + render() { + const { isSuccess, onClose, errors } = this; + + return html` + + ${isSuccess + ? html`
+

Hooray! ⭐

+
We've successfully processed your purchase request.
+
(This is just a sample.)
+
` + : html`
+

Oh no! 😭

+
Unable to complete your checkout.
+
+
+ ${errors?.map( + e => html`
${e?.message || JSON.stringify(e)}
` + ) || ''} +
+
+
`} + + +
+ `; + } +} + +customElements.define('app-checkout-dialog', CheckoutDialog); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-form.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-form.js new file mode 100644 index 0000000..bb5e1be --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/checkout-form.js @@ -0,0 +1,124 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/checkout-form.js'; + +class CheckoutForm extends LitElement { + static properties() { + return { + onSubmit: { type: Function }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.state = { + disableSubmit: false, + openFormErrorDialog: false, + }; + + // Bind "this" component to functions + this.onSubmit = () => {}; + this.submitForm = this.submitForm.bind(this); + } + + toggleFormErrorDialog() { + this.state.openFormErrorDialog = !this.state.openFormErrorDialog; + this.requestUpdate(); + } + + isValidEmail(text) { + return /[^ @]*@[^ @]*/.test(text); + } + + async submitForm(event) { + event?.preventDefault(); + + // Disable submit while form is being sent + this.state.disableSubmit = true; + this.requestUpdate(); + + const form = new FormData(this.shadowRoot.querySelector('form') || {}); + const isValid = this.isValidEmail(form.get('email')); + + if (!isValid) { + this.toggleFormErrorDialog(); + } else { + await this.onSubmit(form); + // Waiting till callstack is empty to re-enable submit button + setTimeout(() => { + this.state.disableSubmit = false; + this.requestUpdate(); + }, 0); + } + } + + render() { + const { openFormErrorDialog, disableSubmit } = this.state; + + return html`
+
+
+ + + Credit + Collect + + ${disableSubmit + ? html`` + : html``} +
+
+ ${openFormErrorDialog + ? html` +
+ Please correctly format email (i.e foo@bar.com). +
+ +
` + : ''} +
`; + } +} + +customElements.define('app-checkout-form', CheckoutForm); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/footer.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/footer.js new file mode 100644 index 0000000..2e29dab --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/footer.js @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/footer.js'; +import './link.js'; + +export class Footer extends LitElement { + static get styles() { + return styles; + } + + render() { + return html` + + `; + } +} + +customElements.define('app-footer', Footer); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/header.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/header.js new file mode 100644 index 0000000..4282106 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/header.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { getConfig } from '../utils/config.js'; +import { getCartItemTotal } from '../helpers/checkout.js'; +import styles from './styles/header.js'; +import './link.js'; + +const cartIcon = new URL('../../assets/shopping_cart.svg', import.meta.url) + .href; + +export class Header extends LitElement { + static get properties() { + return { + headerTitle: { type: String }, + cart: { type: Array }, + }; + } + + static get styles() { + return styles; + } + + render() { + document.title = this.headerTitle; + const { AVOCANO_PURCHASE_MODE } = getConfig(); + + return html` +
+

${this.headerTitle || 'Simulatum'}

+ +
+ `; + } +} + +customElements.define('app-header', Header); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/link.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/link.js new file mode 100644 index 0000000..d17d88c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/link.js @@ -0,0 +1,49 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { navigator } from 'lit-element-router'; +import styles from './styles/link.js'; + +export class NavLink extends navigator(LitElement) { + static get properties() { + return { + href: { type: String }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.href = ''; + } + + onClick(event) { + event?.preventDefault(); + this.navigate(this.href); + } + + render() { + return html` + + + + `; + } +} + +customElements.define('app-link', NavLink); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/main.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/main.js new file mode 100644 index 0000000..87216b5 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/main.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { outlet } from 'lit-element-router'; +import styles from './styles/main.js'; + +class AppMain extends outlet(LitElement) { + static get styles() { + return styles; + } + + render() { + return html` `; + } +} + +customElements.define('app-main', AppMain); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/product-item.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/product-item.js new file mode 100644 index 0000000..cd2eac2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/product-item.js @@ -0,0 +1,326 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/product-item.js'; +import { buyProduct, getProductTestimonials } from '../utils/fetch.js'; +import cache from '../utils/cache.js'; +import { getConfig } from '../utils/config.js'; + +const noimage = new URL('../../assets/noimage.png', import.meta.url).href; +const oopsAvocado = new URL('../../assets/oops-avocado.png', import.meta.url) + .href; + +export class ProductItem extends LitElement { + static get properties() { + return { + productId: { type: Number }, + productItem: { type: Object }, + updateParent: { type: Function }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + + this.state = { + count: 0, + openDialog: false, + openCartDialog: false, + openSoldOutDialog: false, + testimonials: [], + productItem: {}, + }; + + // Initial default for updateParent + // Trigger parent components update lifecycle + this.updateParent = () => {}; + } + + /** + * Executes when component has initially loaded + * To read more about lifecycle methods: + * https://lit.dev/docs/v1/components/lifecycle/#updated + */ + async updated() { + let testimonials = []; + const { id, inventory_count } = this.productItem || {}; + + // Ensure we are retrieving current product testimonials + if (this.state.productItem?.id !== id) { + if (id) { + testimonials = await getProductTestimonials(id); + } + + this.state = { + count: inventory_count, + testimonials, + }; + + this.state.productItem = this.productItem; + this.requestUpdate(); + } + } + + /** + * Toggle the fake product dialog + */ + toggleDialog() { + this.state.openDialog = !this.state.openDialog; + this.requestUpdate(); + } + + /** + * Toggle the sold out product dialog + */ + toggleSoldOutDialog() { + this.state.openSoldOutDialog = !this.state.openSoldOutDialog; + this.requestUpdate(); + } + + /** + * Show the Add To Cart success dialog + */ + showCartDialog() { + this.state.openCartDialog = true; + // Updates "this" component + this.requestUpdate(); + // Updates parent shell level component + this.updateParent(); + } + + /** + * Close the Add To Cart success dialog + * and bubble up update cart total value + */ + hideCartDialog() { + this.state.openCartDialog = false; + this.requestUpdate(); + } + + /** + * 'Purchase' the product, but display to + * user that this is in fact a fake product + */ + async buyProduct(event) { + event?.preventDefault(); + + if (this.state.count > 0) { + await buyProduct(this.productItem?.id, () => { + this.state.count--; + // Open fake product dialog + this.toggleDialog(); + }); + } else { + // Open sold out dialog + this.toggleSoldOutDialog(); + } + } + + /** + * Add fake product to cart + */ + async addToCart(event) { + event?.preventDefault(); + + const { productItem } = this.state; + const result = await cache.get(productItem.name); + let count = result?.count ? result.count + 1 : 1; + + cache.set(productItem.name, { + ...productItem, + count, + }); + + this.showCartDialog(); + } + + render() { + const { AVOCANO_PURCHASE_MODE } = getConfig(); + const { + count, + testimonials, + openDialog, + openCartDialog, + openSoldOutDialog, + } = this.state; + + const { + name, + price, + discount_price, + discount_percent, + image, + description, + } = this.productItem || {}; + + return html` +
+
+
+ product logo +
+
+

${name}

+ ${discount_percent > 0 + ? html`
+
RRP $${price}
+
Now $${discount_price}
+
Save ${discount_percent}%
+
` + : html`
+
$${discount_price}
+
`} +
+ ${count > 0 ? `Only ${count} left!` : `Sold Out!`} +
+ ${count > 0 + ? AVOCANO_PURCHASE_MODE === 'cart' + ? html`Add to Cart` + : html`Buy` + : ''} +
+
+
${description}
+
+
+

Testimonials

+
+
+ ${testimonials?.length + ? testimonials.map( + (item, index) => + html` +
+
+
+ ${`★`.repeat(item.rating)}${`☆`.repeat( + 5 - item.rating + )} +
+
+ ${item.reviewer_name} from ${item.reviewer_location} +
+
${item.summary}
+
+ ${item.description} +
+
+
+ ` + ) + : html`

No testimonials ... yet

`} +
+
+ ${openCartDialog + ? html` + +
+
+

Wonderful news!

+
"${name}" has been added to your cart.
+ product logo +
+
+ +
+ ` + : ''} + ${openDialog + ? html` + +
+ +
+

Oops!

+
Sorry! This is not a real product.
+
+
+ There isn't such thing as a ${name}, at least in this + storefront. But thank you for your interest in this + product! +
+
+
+ +
+ ` + : ''} + ${openSoldOutDialog + ? html` + +
+
+

Sold out!

+
This is product is no longer available.
+
+ Lucas ipsum dolor sit amet solo sidious hutt jade wampa + darth leia yavin vader tatooine. Jawa yoda amidala wedge + chewbacca. Qui-gon jinn qui-gon hutt yavin mon solo anakin + hutt. Darth darth organa luke. Leia c-3po calamari lando + boba palpatine mandalore boba. +
+
+
+ +
+ ` + : ''} +
+ `; + } +} + +customElements.define('app-product-item', ProductItem); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/cart-item.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/cart-item.js new file mode 100644 index 0000000..86af28f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/cart-item.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + .itemTitle { + color: var(--color-secondary); + } + + .cartItem { + display: flex; + align-item: flex-start; + justify-content: space-around; + margin: 10px; + padding: 10px; + border-radius: 5px; + border: 1px solid lightgray; + background: white; + cursor: pointer; + } + + .cartItemContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin: 20px; + } + + .cartItemWrapper { + display: flex; + flex-direction: row; + } + + .cartImageWrapper { + display: flex; + margin: 15px 10px; + } + + .cartItemContent { + display: flex; + width: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-dialog.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-dialog.js new file mode 100644 index 0000000..6f08171 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-dialog.js @@ -0,0 +1,24 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + .errors { + color: red; + text-transform: uppercase; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-form.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-form.js new file mode 100644 index 0000000..cb68af4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/checkout-form.js @@ -0,0 +1,43 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + mwc-button { + --mdc-theme-primary: darkgray; + } + + .checkoutButton { + margin-top: 10px; + padding: 10px; + color: gray; + border-radius: 2px; + border: none; + cursor: pointer; + font-family: var(--mdc-typography-font-family, Roboto, sans-serif); + text-transform: uppercase; + font-size: 14px; + background-color: var(--color-action); + color: var(--color-action-text); + } + + .checkoutButton:disabled { + background-color: lightgray; + color: darkgray; + border-color: lightgray; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/footer.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/footer.js new file mode 100644 index 0000000..0352c25 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/footer.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + :host { + display: flex; + align-items: center; + justify-content: center; + font-size: 10px; + padding: 30px 0; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/header.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/header.js new file mode 100644 index 0000000..3dca529 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/header.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + :host { + font-family: var(--base-font), sans-serif; + width: 100%; + } + + .header { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 0 2em; + background-color: var(--color-primary); + background-image: linear-gradient(to right, white, var(--color-primary)); + } + + h1 { + font-family: var(--site-name-font), cursive; + font-size: 45px; + } + + h1 > a { + color: var(--site-name-color) !important; + } + + .header > h1 > a { + text-decoration: none; + } + + .header > h1 > a:active { + text-decoration: underline; + } + + .navigationBar { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + margin-bottom: 20px; + } + + .navigationPanel { + display: flex; + } + + .shoppingCartIcon { + width: auto; + height: 30px; + } + + .shoppingCartTotal { + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + background: floralwhite; + position: relative; + bottom: 23px; + left: 18px; + border: 2px solid black; + border-radius: 20px; + text-align: center; + height: 22px; + width: 22px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/link.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/link.js new file mode 100644 index 0000000..51a8a63 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/link.js @@ -0,0 +1,28 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + :host { + margin: 0 10px; + } + + a { + color: black; + text-decoration: none; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/main.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/main.js new file mode 100644 index 0000000..a5d1cd0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/main.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + :host { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + max-width: 1080px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/product-item.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/product-item.js new file mode 100644 index 0000000..00aea72 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/components/styles/product-item.js @@ -0,0 +1,175 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + .buyButton { + margin-top: 10px; + padding: 10px; + background-color: var(--color-action); + color: var(--color-action-text); + border-radius: 2px; + text-transform: uppercase; + text-decoration: none; + } + + .itemTitle { + color: var(--color-secondary); + } + + .productItem { + display: flex; + align-item: flex-start; + margin: 10px; + padding: 10px; + border-radius: 5px; + border: 1px solid lightgray; + background: white; + cursor: pointer; + } + + .productItemContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin: 20px; + } + + .productItemWrapper { + display: flex; + flex-direction: row; + } + + @media screen and (max-width: 600px) { + .productItemWrapper { + flex-direction: column; + } + } + + .productItemContent { + display: flex; + align-items: flex-start; + flex-direction: column; + justify-content: space-evenly; + margin: 30px; + } + + .testimonialsWrapper { + margin-top: 20px; + width: 100%; + } + + .testimonialsHeader { + padding: 10px; + text-align: left; + } + + .testimonialsContent { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background: #ededed; + } + + .testimonialsItem { + width: 100%; + border-bottom: 1px solid lightgrey; + } + + .testimonialItemContent { + display: flex; + justify-content: center; + flex-direction: column; + align-items: flex-start; + margin: 10px; + } + + .testimonialsContent { + text-align: left; + } + + .rating { + padding: 10px 0 10px 0; + color: orange; + } + + .reviewerDetails { + font-size: 90%; + } + + .reviewSummary { + font-weight: bold; + margin: 10px 0 10px 0; + } + + .reviewDescription { + font-size: 90%; + } + + .price { + display: flex; + flex-direction: column; + text-align: left; + } + + .retailPrice { + text-decoration: line-through; + margin-bottom: 10px; + color: grey; + } + + .discountPrice { + font-weight: bold; + font-size: 120%; + } + + .discountRate { + color: green; + } + + .dialogWrapper { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + } + + .productimageWrapper { + display: flex; + align-items: baseline; + justify-content: center; + border-radius: 10px; + background: #fff; + width: 300px; + height: 300px; + overflow: hidden; + margin: 30px; + } + + img.productimage { + height: auto; + width: 100%; + } + + img.oopsAvocado { + width: auto; + height: 200px; + padding: 10px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/helpers/checkout.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/helpers/checkout.js new file mode 100644 index 0000000..b50eb88 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/helpers/checkout.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const getCartTotal = cart => + Number.parseFloat( + cart?.reduce((acc, item) => (acc += item.count * item.discount_price), 0) || + 0 + ).toFixed(2); + +export const getCartItemTotal = cart => + cart?.reduce((acc, item) => (acc += item.count), 0) || 0; + +export const getCartPayload = cart => { + let result = cart?.reduce((acc, item) => { + acc?.push({ + id: item.id, + countRequested: item.count, + }); + return acc; + }, []); + + return result || []; +}; + +export default { getCartTotal, getCartPayload, getCartItemTotal }; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/checkout.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/checkout.js new file mode 100644 index 0000000..3ef8bb3 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/checkout.js @@ -0,0 +1,151 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { checkout } from '../utils/fetch.js'; +import styles from './styles/checkout.js'; +import cache from '../utils/cache.js'; +import { getCartTotal, getCartPayload } from '../helpers/checkout.js'; + +export class Checkout extends LitElement { + static get properties() { + return { + cart: { type: Array }, + updateParent: { type: Function }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.state = { + openSuccessDialog: false, + checkoutErrors: undefined, // Stating this explicity for page + }; + + // Bind "this" component to functions + this.onSubmit = this.onSubmit.bind(this); + this.toggleSuccessDialog = this.toggleSuccessDialog.bind(this); + this.setCheckoutErrors = this.setCheckoutErrors.bind(this); + + // Initial default for updateParent + // Trigger parent components update lifecycle + this.updateParent = () => {}; + } + + async clearCart(event) { + event?.preventDefault(); + // Clears idb instance + await cache.clear(); + // Updates parent shell level component + this.updateParent(); + } + + toggleSuccessDialog() { + this.state.openSuccessDialog = !this.state.openSuccessDialog; + this.requestUpdate(); + } + + setCheckoutErrors(errors) { + let checkoutErrors = Array.isArray(errors) + ? errors + : errors?.payment?.method || errors?.items; + this.state.checkoutErrors = Array.isArray(checkoutErrors) + ? checkoutErrors + : []; + this.requestUpdate(); + } + + async onSubmit(form) { + // Only process when form is filled out and there are items in cart + if (form && this.cart?.length) { + let items = getCartPayload(this.cart); + let response = await checkout({ + customer: { + email: form.get('email'), + }, + payment: { + method: form.get('type'), + }, + items, + }); + + if (response?.errors) { + this.setCheckoutErrors(response.errors); + } else { + this.clearCart(); + this.toggleSuccessDialog(); + } + } + } + + render() { + const { openSuccessDialog, checkoutErrors } = this.state; + + return html` +
+

Checkout

+
+
+

Cart

+ + ${this.cart?.length + ? this.cart.map( + item => + html`` + ) + : html`

No items in cart

`} + + ${this.cart?.length + ? html`` + : ''} +
+
+

Delivery

+ +
+ Cart Total: $${getCartTotal(this.cart)} +
+ + +
+
+ ${openSuccessDialog + ? html`` + : ''} + ${checkoutErrors + ? html` { + this.state.checkoutErrors = undefined; + this.requestUpdate(); + }} + >` + : ''} +
+ `; + } +} + +customElements.define('app-checkout', Checkout); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/contact.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/contact.js new file mode 100644 index 0000000..c20d38a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/contact.js @@ -0,0 +1,39 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/contact.js'; + +export class Contact extends LitElement { + static get styles() { + return styles; + } + + render() { + return html` +
+

Contact

+
+ This website was deployed from sample code in the + GoogleCloudPlatform/avocano + repo on GitHub. +
+
+ `; + } +} + +customElements.define('app-contact', Contact); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/home.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/home.js new file mode 100644 index 0000000..19e80f9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/home.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { getActiveProduct } from '../utils/fetch.js'; +import cache from '../utils/cache.js'; +import styles from './styles/home.js'; +import '../components/product-item.js'; + +export class Home extends LitElement { + constructor() { + super(); + this.title = 'Home'; + this.state = { + status: 'loading', + productItem: {}, + }; + } + + static get styles() { + return styles; + } + + async disconnectedCallback() { + super.disconnectedCallback(); + cache.deleteDB(); + } + + async firstUpdated() { + const productItem = await getActiveProduct(); + + this.state = { + ...this.state, + status: 'loaded', + productItem, + }; + + this.requestUpdate(); + } + + render() { + const { status, productItem } = this.state; + + return html` +
+ ${status === 'loading' + ? html`

loading...

` + : html``} +
+ `; + } +} + +customElements.define('app-home', Home); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/not-found.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/not-found.js new file mode 100644 index 0000000..ed3044e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/not-found.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/not-found.js'; + +export class NotFound extends LitElement { + static get styles() { + return styles; + } + + render() { + return html` +
+

Not Found

+
+ Please head back to the home page by clicking + this link. +
+
+ `; + } +} + +customElements.define('app-not-found', NotFound); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product-list.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product-list.js new file mode 100644 index 0000000..840ffb4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product-list.js @@ -0,0 +1,93 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { navigator } from 'lit-element-router'; +import { getProductList } from '../utils/fetch.js'; +import styles from './styles/product.js'; + +const noimage = new URL('../../assets/noimage.png', import.meta.url).href; + +export class ProductList extends navigator(LitElement) { + static get styles() { + return styles; + } + + constructor() { + super(); + this.title = 'Product List'; + this.state = { + status: 'loading', + products: [], + }; + } + + async firstUpdated(changed) { + super.firstUpdated(changed); + + let products = await getProductList(); + + this.state = { + status: 'loaded', + products, + }; + + if (this.state.status === 'loaded') { + this.requestUpdate(); + } + } + + render() { + return html` +
+

Product List

+
+ ${this.state.status === 'loading' + ? html`

loading...

` + : this.state.products.map( + item => + html` +
+ item.id && this.navigate(`/products/${item.id}`)} + > +
+ Product Image +
+
+
${item.name}
+
${`Price: $${item.discount_price}`}
+
+ ${item.inventory_count + ? `Available: ${item.inventory_count}` + : `Sold Out!`} +
+
+
+ ` + )} +
+
+ `; + } +} + +customElements.define('app-product-list', ProductList); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product.js new file mode 100644 index 0000000..119b617 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/product.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import { getProduct } from '../utils/fetch.js'; +import styles from './styles/product.js'; + +import '../components/product-item.js'; + +export class Product extends LitElement { + static get properties() { + return { + productId: { type: Number }, + updateParent: { type: Function }, + }; + } + + static get styles() { + return styles; + } + + constructor() { + super(); + this.state = { + status: 'loading', + productItem: {}, + }; + + // Initial value for updateParent + // Trigger parent components update lifecycle + this.updateParent = () => {}; + } + + async updated() { + const prevItem = this.state.productItem; + let productItem; + + // Fetch the product + if (this.productId) { + productItem = await getProduct(this.productId); + + this.state = { + ...this.state, + status: 'loaded', + productItem, + }; + + // Only update if the previously loaded product + // is different than the requested product + if (prevItem?.id !== this.productId) { + this.requestUpdate(); + } + } + } + + render() { + const { status, productItem } = this.state; + + return html` +
+ ${status === 'loading' + ? html`

loading...

` + : html``} +
+ `; + } +} + +customElements.define('app-product', Product); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/shipping.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/shipping.js new file mode 100644 index 0000000..bdcaf95 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/shipping.js @@ -0,0 +1,40 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { LitElement, html } from 'lit'; +import styles from './styles/shipping.js'; + +export class Shipping extends LitElement { + static get styles() { + return styles; + } + + render() { + return html` +
+

Shipping

+
+ This website ships no products, but this website was shipped through + Google Cloud automation. + Learn more. +
+
+ `; + } +} + +customElements.define('app-shipping', Shipping); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/checkout.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/checkout.js new file mode 100644 index 0000000..ee08c25 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/checkout.js @@ -0,0 +1,58 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + mwc-button { + --mdc-theme-primary: darkgray; + } + + h1.checkoutTitle { + color: var(--color-secondary); + } + + .checkoutContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + text-align: center; + margin: 20px; + } + + .checkoutWrapper { + display: flex; + justify-content: space-between; + width: 100%; + } + + .cartTotalWrapper { + padding: 10px; + } + + .checkoutPanel { + display: flex; + flex-direction: column; + border: 1px solid green; + border-radius: 5px; + padding: 20px; + margin: 10px; + width: 100%; + max-height: 350px; + overflow-y: scroll; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/contact.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/contact.js new file mode 100644 index 0000000..36fce7f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/contact.js @@ -0,0 +1,31 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + h1 { + color: var(--color-secondary); + } + + .contactContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin: 20px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/home.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/home.js new file mode 100644 index 0000000..3d05c76 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/home.js @@ -0,0 +1,25 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + .homeBase { + align-items: center; + justify-content: center; + text-align: center; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/not-found.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/not-found.js new file mode 100644 index 0000000..1ac050b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/not-found.js @@ -0,0 +1,31 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + h1 { + color: var(--color-secondary); + } + + .notFoundContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin: 20px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/product.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/product.js new file mode 100644 index 0000000..c61f02a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/product.js @@ -0,0 +1,89 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + h1.productTitle { + color: var(--color-secondary); + } + + .productBase { + display: flex; + align-items: center; + justify-content: center; + text-align: center; + } + + img.productimage { + height: auto; + width: 100%; + } + + .productItem { + display: flex; + align-item: flex-start; + margin: 10px; + padding: 10px; + border-radius: 5px; + border: 1px solid lightgray; + background: white; + cursor: pointer; + } + + .productimageWrapper { + display: flex; + align-items: baseline; + justify-content: center; + border-radius: 10px; + width: 150px; + height: 150px; + overflow: hidden; + margin-right: 20px; + } + + .productContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + text-align: center; + margin: 20px; + } + + .productWrapper { + display: flex; + flex-direction: column; + justify-content: space-between; + align-content: center; + width: 100%; + max-width: 500px; + margin: auto; + } + + .productItemContent { + display: flex; + justify-content: space-evenly; + flex-direction: column; + align-items: flex-start; + margin: 10px; + } + + .itemTitle { + font-weight: 600; + margin-bottom: 15px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/shipping.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/shipping.js new file mode 100644 index 0000000..7cf2770 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/pages/styles/shipping.js @@ -0,0 +1,31 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + h1 { + color: var(--color-secondary); + } + + .shippingContainer { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin: 20px; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/styles/shell.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/styles/shell.js new file mode 100644 index 0000000..a55e647 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/styles/shell.js @@ -0,0 +1,38 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { css } from 'lit'; + +const styles = css` + :host { + font-family: sans-serif; + font-family: var(--base-font); + font-size: 16px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + } + + h1 { + font-size: 45px; + color: purple; + } + + .route { + width: 100%; + } +`; + +export default styles; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/cache.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/cache.js new file mode 100644 index 0000000..1037abd --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/cache.js @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { openDB } from 'idb'; + +const dbName = 'avocano-demo'; +const storeName = 'avocart'; +const dbPromise = openDB(dbName, 1, { + upgrade(db) { + db.createObjectStore(storeName); + }, +}); + +async function get(key) { + return (await dbPromise).get(storeName, key); +} + +async function set(key, val) { + return (await dbPromise).put(storeName, val, key); +} + +async function del(key) { + return (await dbPromise).delete(storeName, key); +} + +async function clear() { + return (await dbPromise).clear(storeName); +} + +async function all() { + return (await dbPromise).getAll(storeName); +} + +async function deleteDB() { + return await deleteDB(dbName); +} + +export default { get, set, del, clear, all, deleteDB }; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/config.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/config.js new file mode 100644 index 0000000..2ba2e5a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/config.js @@ -0,0 +1,18 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const getConfig = () => ({ + API_URL: '__api_url__', + AVOCANO_PURCHASE_MODE: '__purchase_mode__', +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/fetch.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/fetch.js new file mode 100644 index 0000000..eb56c58 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/fetch.js @@ -0,0 +1,226 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { getConfig } from '../utils/config.js'; + +const baseRequest = { + credentials: 'include', +}; + +/** + * getProduct() + * + * Retrieves product at specified id defined from django api + * GET /product/{productId} + */ +export const getProduct = async productId => { + const { API_URL } = getConfig(); + let product; + + if (productId) { + try { + const response = await fetch(`${API_URL}/products/${productId}`, { + method: 'GET', + ...baseRequest, + }); + product = await response.json(); + } catch (error) { + console.error(error); + } + } else { + console.error('Error: id required'); + } + + return product; +}; + +/** + * getActiveProduct() + * + * Retrieves active product as defined from django api + * GET /active/product/ + */ +export const getActiveProduct = async () => { + const { API_URL } = getConfig(); + let activeProduct; + + try { + const response = await fetch(`${API_URL}/active/product/`, { + method: 'GET', + ...baseRequest, + }); + activeProduct = await response.json(); + } catch (error) { + console.error(error); + } + + return activeProduct; +}; + +/** + * buyProduct() + * + * Achieves "product" purchase as defined from django api + * POST /products/{productId}/purchase/ + */ +export const buyProduct = async (productId, callback) => { + const { API_URL } = getConfig(); + + if (productId) { + try { + await fetch(`${API_URL}/products/${productId}/purchase/`, { + method: 'POST', + ...baseRequest, + }); + callback && callback(); + } catch (error) { + console.error(error); + } + } else { + console.error('Error: id required'); + } +}; + +/** + * getProductTestimonials() + * + * Retrieves testimonials for product as defined from django api + * GET /testimonials/{productId} + */ +export const getProductTestimonials = async productId => { + const { API_URL } = getConfig(); + let testimonials = []; + + if (productId) { + try { + const response = await fetch( + `${API_URL}/testimonials/?product_id=${productId}`, + { + method: 'GET', + ...baseRequest, + } + ); + testimonials = response.json(); + } catch (error) { + console.error(error); + } + } else { + console.error('Error: id required'); + } + + return testimonials; +}; + +/** + * getProductList() + * + * Retrieves product list as defined from django api + * GET /products + */ +export const getProductList = async () => { + const { API_URL } = getConfig(); + let products; + + try { + const response = await fetch(`${API_URL}/products/`, { + method: 'GET', + ...baseRequest, + }); + products = await response.json(); + } catch (error) { + console.error(error); + } + + return products; +}; + +/** + * getCSRFToken() + * + * GET /csrf_token + */ +const getCSRFToken = async () => { + const { API_URL } = getConfig(); + let token; + + try { + const response = await fetch(`${API_URL}/csrf_token`, baseRequest); + token = (await response.json())?.csrfToken; + } catch (error) { + throw new Error(error); + } + + return token; +}; + +/** + * checkout() + * + * POST /checkout + */ +export const checkout = async payload => { + const { API_URL } = getConfig(); + let checkoutStatus; + let errors; + + if (payload?.items?.length) { + try { + // Retrieve csrf token from server + const csrfToken = await getCSRFToken(); + + // Submit form payload and pass back csrf token + const response = await fetch(`${API_URL}/checkout`, { + method: 'POST', + headers: { 'X-CSRFToken': csrfToken }, + body: JSON.stringify(payload), + ...baseRequest, + }); + checkoutStatus = await response.json(); + } catch (error) { + errors = [error]; + } + } else { + errors = [{ message: 'Insufficient information to process checkout.' }]; + } + + if (errors) { + console.error(errors); + checkoutStatus = { errors }; + } + + return checkoutStatus; +}; + +/** + * getSiteConfig() + * + * Retrieves site_config as defined from django api + * GET /active/site_config + */ +export const getSiteConfig = async () => { + const { API_URL } = getConfig(); + let config; + + try { + const response = await fetch(`${API_URL}/active/site_config/`, { + method: 'GET', + ...baseRequest, + }); + config = await response.json(); + } catch (error) { + console.error(error); + } + + return config; +}; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/routes.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/routes.js new file mode 100644 index 0000000..5680144 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/src/utils/routes.js @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const routes = [ + { + name: 'home', + pattern: '', + }, + { + name: 'product-list', + pattern: 'products', + }, + { + name: 'product', + pattern: 'products/:id', + }, + { + name: 'shipping', + pattern: 'shipping', + }, + { + name: 'contact', + pattern: 'contact', + }, + { + name: 'checkout', + pattern: 'checkout', + }, + { + name: 'not-found', + pattern: '*', + }, +]; + +export default routes; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/checkout.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/checkout.test.js new file mode 100644 index 0000000..32ddaf7 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/checkout.test.js @@ -0,0 +1,135 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; +import sinon from 'sinon'; + +import '../src/pages/checkout.js'; + +describe('Checkout', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders title element correctly', () => { + const titleElement = element.shadowRoot.querySelector( + '.checkoutContainer > .checkoutTitle' + ); + expect(titleElement).to.exist; + expect(titleElement.textContent).to.equal('Checkout'); + }); + + describe('renders cart panel: ', () => { + let parentElement; + + beforeEach(async () => { + parentElement = await fixture(html``); + }); + + it('renders title element correctly', () => { + const childElement = parentElement.shadowRoot.querySelector( + '.checkoutContainer > .checkoutWrapper >.checkoutPanel:first-child' + ); + + const titleElement = childElement.querySelector('h2'); + expect(titleElement).to.exist; + expect(titleElement.textContent).to.equal('Cart'); + }); + + it('empty state correctly', () => { + const childElement = parentElement.shadowRoot.querySelector( + '.checkoutContainer > .checkoutWrapper >.checkoutPanel:first-child' + ); + + const emptyListElement = childElement.querySelector('p'); + expect(emptyListElement).to.exist; + expect(emptyListElement.textContent).to.equal('No items in cart'); + + const clearBtnElement = childElement.querySelector('mwc-button'); + expect(clearBtnElement).to.not.exist; + }); + + it('stocked state correctly', async () => { + // Stub out cart + const mockCart = [ + { name: 'hello', count: 2, id: 2 }, + { name: 'world', count: 3, id: 1 }, + ]; + const cartStub = sinon.stub(parentElement, 'cart').value(mockCart); + const clearStub = sinon.stub(parentElement, 'clearCart'); + + // Updates checkout page with stubs + parentElement.requestUpdate(); + await parentElement.updateComplete; + + const childElement = parentElement.shadowRoot.querySelector( + '.checkoutContainer > .checkoutWrapper >.checkoutPanel:first-child' + ); + + const listElement = childElement.querySelector('app-cart-item'); + expect(listElement).to.exist; + expect(listElement.textContent).to.equal(''); + + const clearBtnElement = childElement.querySelector('mwc-button'); + expect(clearBtnElement).to.exist; + clearBtnElement.click(); + expect(clearStub).to.have.callCount(1); + }); + }); + + describe('renders delivery panel: ', () => { + let parentElement; + + beforeEach(async () => { + parentElement = await fixture(html``); + }); + + it('title element correctly', () => { + const childElement = parentElement.shadowRoot.querySelector( + '.checkoutContainer > .checkoutWrapper >.checkoutPanel:last-child' + ); + + const titleElement = childElement.querySelector('h2'); + expect(titleElement).to.exist; + expect(titleElement.textContent).to.equal('Delivery'); + }); + + it('form element correctly', async () => { + // Stub out cart + const mockCart = [ + { count: 1, id: 2, discount_price: 1 }, + { count: 1, id: 1, discount_price: 1 }, + ]; + const cartStub = sinon.stub(parentElement, 'cart').value(mockCart); + + // Updates checkout page with stubs + parentElement.requestUpdate(); + await parentElement.updateComplete; + + const childElement = parentElement.shadowRoot.querySelector( + '.checkoutContainer > .checkoutWrapper >.checkoutPanel:last-child' + ); + + const cartTotalElement = childElement.querySelector('.cartTotalWrapper'); + expect(cartTotalElement.textContent).to.contains('Cart Total:'); + expect(cartTotalElement.textContent).to.contains('2.00'); + + const formElement = childElement.querySelector('app-checkout-form'); + expect(formElement).to.exist; + }); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/contact.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/contact.test.js new file mode 100644 index 0000000..698fcab --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/contact.test.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; + +import '../src/pages/contact.js'; + +describe('Contact', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders main text element', () => { + const contactElement = element.shadowRoot.querySelector( + '.contactContainer > .contactWrapper' + ); + expect(contactElement).to.exist; + expect(contactElement.textContent).to.equal( + '\n This website was deployed from sample code in the\n GoogleCloudPlatform/avocano\n repo on GitHub.\n ' + ); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/home.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/home.test.js new file mode 100644 index 0000000..39d76e8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/home.test.js @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; + +import '../src/pages/home.js'; + +describe('Home', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders loading element', () => { + const loadingElement = element.shadowRoot.querySelector('.homeBase > p'); + + expect(loadingElement).to.exist; + expect(loadingElement.textContent).to.equal('loading...'); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product-list.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product-list.test.js new file mode 100644 index 0000000..8b4bb6d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product-list.test.js @@ -0,0 +1,35 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; + +import '../src/pages/product-list.js'; + +describe('ProductList', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders title element', () => { + const titleElement = element.shadowRoot.querySelector( + '.productContainer > h1' + ); + + expect(titleElement).to.exist; + expect(titleElement.textContent).to.equal('Product List'); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product.test.js new file mode 100644 index 0000000..5770016 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/product.test.js @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; + +import '../src/pages/product.js'; + +describe('Product', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders loading element', () => { + const loadingElement = element.shadowRoot.querySelector('.productBase > p'); + + expect(loadingElement).to.exist; + expect(loadingElement.textContent).to.equal('loading...'); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/shipping.test.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/shipping.test.js new file mode 100644 index 0000000..8562810 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/test/shipping.test.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { html } from 'lit'; +import { fixture, expect } from '@open-wc/testing'; + +import '../src/pages/shipping.js'; + +describe('Shipping', () => { + let element; + + beforeEach(async () => { + element = await fixture(html``); + }); + + it('renders main text element', () => { + const shippingElement = element.shadowRoot.querySelector( + '.shippingContainer > .shippingWrapper' + ); + expect(shippingElement).to.exist; + expect(shippingElement.textContent).to.equal( + '\n This website ships no products, but this website was shipped through\n Google Cloud automation.\n Learn more.\n ' + ); + }); +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-dev-server.config.mjs b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-dev-server.config.mjs new file mode 100644 index 0000000..3ec7973 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-dev-server.config.mjs @@ -0,0 +1,44 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import rollupReplace from '@rollup/plugin-replace'; +import { fromRollup } from '@web/dev-server-rollup'; + +const replace = fromRollup(rollupReplace); +const hmr = process.argv.includes('--hmr'); + +export default { + open: '/', + watch: !hmr, + port: 8081, + open: true, + rootDir: '.', + basePath: '/', + appIndex: 'index.html', + /** Resolve bare module imports */ + nodeResolve: { + exportConditions: ['browser', 'development'], + }, + devServer: { + historyApiFallback: true, + }, + plugins: [ + replace({ + include: ['src/utils/config.js'], + preventAssignment: false, + __api_url__: (process.env.API_URL || 'http://localhost:8000') + '/api', + __purchase_mode__: process.env.AVOCANO_PURCHASE_MODE, + }), + ], +}; diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-test-runner.config.mjs b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-test-runner.config.mjs new file mode 100644 index 0000000..49adce1 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/client/web-test-runner.config.mjs @@ -0,0 +1,35 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode']; + +export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({ + /** Test files to run */ + files: 'test/**/*.test.js', + + /** Resolve bare module imports */ + nodeResolve: { + exportConditions: ['browser', 'development'], + }, + + /** Filter out lit dev mode logs */ + filterBrowserLogs(log) { + for (const arg of log.args) { + if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) { + return false; + } + } + return true; + }, +}); diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/README.md new file mode 100644 index 0000000..1339bd1 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/README.md @@ -0,0 +1,11 @@ +# Avocano Documentation + +This documentation presumes you've successfully [deployed](../README.md#launch) the sample application. + +## Things to do in Avocano + +Depending on the persona you want to use, there are many things you can now do with this deployment. + +* [I want to use the website.](user) +* [I want to configure the Django application.](django) +* [I want to configure the Google Cloud project.](admin) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/README.md new file mode 100644 index 0000000..b6339c5 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/README.md @@ -0,0 +1,13 @@ +# Infrastructure Administration + +As a infrastructure administrator, I want to: + + * [manually setup Firebase against my project.](firebase-manual-setup.md) + * [have terraform deploy the latest version of my container.](terraform-latest.md) + * [have Django know it's own host URL for CSRF purposes.](django-self-csrf.md) + * [extend this example application.](extending-example.md) + * [verify changes to this application.](testing-changes.md) + * [perform management commands.](management-commands.md) + + +*Want more options? [Request some new docs!](https://github.com/GoogleCloudPlatform/avocano/issues/new/choose)* \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/django-self-csrf.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/django-self-csrf.md new file mode 100644 index 0000000..03da57d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/django-self-csrf.md @@ -0,0 +1,7 @@ +# Django self-determined URL for CSRF + +For Django's CSRF protections, you need to have Django know the host it's being served on. + +You can set this manually with environment variables, but you can also interrogate the [metadata server](https://cloud.google.com/run/docs/container-contract#metadata-server) and [environment variables](https://cloud.google.com/run/docs/container-contract#services-env-vars) available by default to determine this information. + +The implementation of this can be found in the [`get_service_url`](https://github.com/GoogleCloudPlatform/avocano/search?q=get_service_url) method. It also requires the service has [permissions to view it's own metadata](server_introspection). \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/extending-example.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/extending-example.md new file mode 100644 index 0000000..2ae035d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/extending-example.md @@ -0,0 +1,117 @@ +# Extending the example + +If you are wanting to extend this example application, there are some development steps you're going to need to take. + +## Forking the repo, and GitHub actions + +Please feel free to fork the repo, but know that there are GitHub Actions attached to the parent repo +that probably won't automatically work with your setup. + +To disable: + + * Go to your fork's Settings + * Go to Code and Automation > Actions > General + * Under "Actions permissions", select "Disable actions". + * Click **Save**. + +## Terraform needs a backend + +This sample opts to use a Cloud Storage bucket to store terraform state, rather than storing the files on your local machine. +This allows you to invoke Terraform from Cloud Build, Cloud Run jobs, or otherwise, and they all share +the same state. + +If you're running the examples in an environment outside of Cloud Shell, you'll need to be aware that +there was additional parameters added to the initialization of Terraform to store state in Cloud Storage, +rather than your local machine: + +``` +terraform init -backend-config="bucket=terraform-${PROJECT_ID}-avocano" +``` + +This is automatically included in any `terraform init` calls, so if you're calling this yourself, be sure to add it. + + +## Creating migrations + +When automatically generating Django migrations, you'll need to run these on your local machine so you can commit the +results to source. You will follow a fairly standard practice, but you'll provide blank default settings to Django, as these are normally expected in the deployment environment. + +1. Navigate to the `server` directory, and install the Python dependencies + + ```bash + cd server + pip install -r requirements.txt + ``` + +1. Generate the Django migration files: + + ```bash + SECRET_KEY="" DATABASE_URL="" python manage.py makemigrations + ``` + + _Ignore any "Engine not recognized from url" warnings._ + +1. Run the standard update process in Cloud Build: + + ```bash + gcloud builds submit + ``` + +1. Apply the database migrations using Cloud Run Jobs: + + ```bash + gcloud beta run jobs execute migrate + ``` + +Open the linked execution logs to see the output from this command. + +## Local testing + +If you need to run the application locally, such as for more complex development tasks, you will need to setup a proxy to the production database, and adjust your Django settings. + + +### Setup Cloud SQL Auth Proxy + +Follow the [Install instructions](https://cloud.google.com/sql/docs/postgres/sql-proxy#install) for your platform. + +Saving this into your `$PATH` is a useful administration step so you can take advantage of this executable in other projects. + +### Start Cloud SQL Auth Proxy + +In a new terminal, start the proxy: + +``` +cloud_sql_proxy -instances="${PROJECT_ID}:us-central1:psql"=tcp:5432 +``` + +This will redirect this Cloud SQL instance to localhost. Because of this, you'll need to change where Django knows your database to be. + +### Copy and edit settings + +1. Navigate to the server config: + + ``` + cd server + ``` + +1. Copy the Django settings from Secret Manager to your local `.env` file. + Note: this file is `.gitignore`d. + + ``` + gcloud secrets versions access latest --secret django_settings > .env + ``` + +1. Edit the `DATABASE_URL` line to replace the `cloudsql` config to `localhost`: + + ```diff + -DATABASE_URL="postgres://server:password@//cloudsql/yourproject:us-central1:psql/django" + +DATABASE_URL="postgres://server:password@localhost/django" + ``` + +1. Run your code on your local machine: + + ``` + python manage.py runserver + ``` + +From here, you can open localhost to see your code running against the production database. diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/firebase-manual-setup.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/firebase-manual-setup.md new file mode 100644 index 0000000..655fe02 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/firebase-manual-setup.md @@ -0,0 +1,15 @@ +# Setup Firebase Manually + +As an alternative to running `firebase projects:addfirebase`, you can setup Firebase manually through the Firebase Console. + +* In a new tab, open the [Firebase Console](https://console.firebase.google.com/). +* Click on the "Create Project" button + * Note: If you have previously created a Firebase project, this button will read "+ Add Project". +* Click on the "Enter your project name" field, and wait for the dropdown to populate with a list of your existing projects. +* Select the project you created earlier, and click **Continue**. +* Confirm the Firebase billing plan by clicking **Confirm plan**. +* Read the information about connecting Google Cloud and Firebase projects, and click **Continue**. +* Click the toggle to disable Google Analytics, and click **Add Firebase**. +* In the confirmation screen, click **Continue**. + +You can now return to the Interactive Walkthrough tutorial. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/management-commands.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/management-commands.md new file mode 100644 index 0000000..319c999 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/management-commands.md @@ -0,0 +1,102 @@ +# Management commands + +## Available Commands + +There are a number of [management commands](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/) available in this application. The help text for each can be retrieved by using `python manage.py` and checking each command under `[store]`: + + +### Create a new product + +Used by the setup process. + +``` +$ python manage.py create_new_product --help +usage: manage.py create_new_product [-h] [options] + +Creates new active product, deactivating existing active product + +options: + -h, --help show this help message and exit + --name NAME + --description DESCRIPTION + --price PRICE + --discount_percent DISCOUNT_PERCENT + --inventory_count INVENTORY_COUNT + --image IMAGE +``` + +### Create Site Config + +Allows for command-based site config updating. + +Not actively used, instead, `demo_config.yaml` is loaded as a fixture. + +``` +$ python manage.py create_site_config --help +usage: manage.py create_site_config [-h] [options] + +Create new active site config + +options: + -h, --help show this help message and exit + --color-primary COLOR_PRIMARY + --color-secondary COLOR_SECONDARY + --color-action COLOR_ACTION + --color-action-text COLOR_ACTION_TEXT + --site-name SITE_NAME + --site-name-color SITE_NAME_COLOR + --site-name-font SITE_NAME_FONT + --base-font BASE_FONT +``` + +### Generate testimonials + +Used by setup process. By default, it will generate testimonals on all products in the database. + + +``` +$ python manage.py generate_testimonials --help +usage: manage.py generate_testimonials [-h] [--product PRODUCT] [--count COUNT] + +Generates testimonials for products + +options: + -h, --help show this help message and exit + --product PRODUCT + --count COUNT +``` + +### Update inventory count + +Updates the inventory for the current active product + +``` +$ python manage.py update_inventory_count --help +usage: manage.py update_inventory_count [-h] [--add ADD] + +Updates the inventory count for the active product. + +options: + -h, --help show this help message and exit + --add ADD +``` + +## Running Commands + +These commands can be run adhoc by creating Cloud Run jobs referencing these commands. + +For example, your store gets 25 new pieces a day. You could setup a Cloud Run job that you can execute when you receive new stock. + +You'd run the `update_inventory_count` command, with a value of 25. + +To set this up, create a job that runs the command as you would in the command line. The reference to `launcher` is an implementation of buildpacks ([see details](https://cloud.google.com/blog/topics/developers-practitioners/running-database-migrations-cloud-run-jobs)) + +``` +gcloud beta run jobs create update_inventory \ + --image gcr.io/$PROJECT_ID/server \ + --region us-central1 \ + --command launcher \ + --args "python manage.py update_inventory_count --add 25" +``` + +Then, execute the job whenever you want to update the inventory. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/terraform-latest.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/terraform-latest.md new file mode 100644 index 0000000..c157502 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/terraform-latest.md @@ -0,0 +1,13 @@ +# Have Terraform use the latest container in deployment + +When using Terraform to provision Cloud Run services, you need to specify the image name. + +By default, if you don't declare a tag, you'll normally use the "latest" image, the newest image available. + +But since Terraform will be told "latest", and it detects the service is using "latest" from when it was deployed, not now, you'll get issues. + +In this case, this repo uses a [solution](https://github.com/hashicorp/terraform-provider-google/issues/6706#issuecomment-657039775) that sources the exact current "latest" by the sha as detected in the Container Registry. + +The Terraform uses the `docker` provider and [`registry_auth`](https://github.com/GoogleCloudPlatform/avocano/search?q=registry_auth) to talk to Container Registry, and [`google_container_registry_image`](https://github.com/GoogleCloudPlatform/avocano/search?q=google_container_registry_image`) to build the fully qualified image name to pass to Terraform. + +This way, the exact current latest image is passed to Terraform. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/testing-changes.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/testing-changes.md new file mode 100644 index 0000000..e76f514 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/admin/testing-changes.md @@ -0,0 +1,42 @@ +# Testing and verifying changes + +## GitHub Actions + +As with many GitHub projects, changes to this project are tested by GitHub actions. + +These are defined in [`/.github/workflows`](/.github/workflows), and apply to specific parts of the repo. For example, +client side linting only runs when changes in `client/` are made. + +## Cloud Build tests + +There are larger tests that may be appropriate to run before changes are merged. + +For these changes, there is a manual process to follow, as not all pull requests should trigger these tests. + +### Running `deploy-preview` on Pull Requests + +The `deploy-preview` Cloud Build trigger is setup against the repo in the `avocano-preview` project, and can be run against any branch on the repo (by a Google Cloud user clicking 'Run' and naming a branch.) However, it can't be run directly against pull requests (as the code needs to be in the repo itself.) + +_After_ a manual review of the changes in a pull request, an Avocano project maintainer can run `deploy-preview` with the following steps: + +1. Copy the pull request code into a new branch on the avocano repo, using the pull request user and their branch name as inputs + * This process is similar to the process for merging a pull request via the `git` cli. + * The user and branch name are found in the form `user:branch_name` in the head of any pull request ("user wants to merge N commits into GoogleCloudPlatform:main from user:branch") + +```bash +cd /path/to/GoogleCloudPlatform/avocano +git checkout -b ${USER}-${BRANCH_NAME} main +git pull git@github.com:${USER}/avocano.git ${BRANCH_NAME} +git push -u origin ${USER}-${BRANCH_NAME} +``` + +1. In Cloud Build, go to [Triggers](https://console.cloud.google.com/cloud-build/triggers?project=avocano-preview) and click "Run". +1. In the "Run trigger" side panel, enter the branch name just created. + * This should auto-populate after removing the default "main" value. +1. Populate the `_RUN_TESTS` variable (any value will do) to also run playwright tests. +1. Click **Run trigger**. + + +The trigger will run `cloudbuild.yaml` with the code in the pull request against the `avocano-preview` deployment, and the status of the check will be updated against the HEAD commit (which will also then show up against the pull request checks.) + +Ensure that after changes are merged that the branch is removed, to clear the branches and auto-complete for the next test. diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/README.md new file mode 100644 index 0000000..19661cd --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/README.md @@ -0,0 +1,11 @@ +# Application Administration + +As a Django administrator, I want to: + + * [log into the Django Admin.](login-django-admin.md) + * [update the product listing.](update-product-listing.md) + * [change the look and feel of the website.](update-site-config.md) + * [apply database migrations](apply-migrations.md) + + +*Want more options? [Request some new docs!](https://github.com/GoogleCloudPlatform/avocano/issues/new/choose)* \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/apply-migrations.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/apply-migrations.md new file mode 100644 index 0000000..8baec7a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/apply-migrations.md @@ -0,0 +1,26 @@ +# Applying database migrations + +If you want to apply database migrations, a convenience Cloud Run job has been created for you. + +To run migrations: + +``` +gcloud beta run jobs execute migrate \ + --region us-central1 --wait +``` + +To run migrations as part of the Cloud Build, add a step to the `cloudbuild.yaml` file: + +``` + - id: server migrate + name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + env: + - "CLOUDSDK_RUN_REGION=$_REGION" + script: gcloud beta run jobs execute migrate --wait +``` + +In this case, `CLOUDSDK_RUN_REGION` automatically sets the `--region` parameter for the `gcloud run` command. + +This step must be after the image push step, but can be before or after Terraform (the terraform step +updates the Cloud Run service to the latest image). If your database changes must be made **before** +the application is updated, put it before the terraform step. diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/login-django-admin.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/login-django-admin.md new file mode 100644 index 0000000..026f1f2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/login-django-admin.md @@ -0,0 +1,35 @@ +# Log into the Django Admin + +To log into the Django Admin, you'll need to get the URL of the API, and the django admin password. + +To get the service URL: + +* In a terminal, query your Cloud Run services: + + ```bash + gcloud run services list + ``` +* In the `api` listing, click the URL (it will be in the form `https://pi-projecthash-regioncode.a.run.app`. ) + +Open the URL in the browser. You will see two links, one to the API and one to the Admin. + +To get the django admin password: + +* In a terminal, query Secret Manager: + + ```bash + gcloud secrets versions access latest \ + --secret django_admin_password && echo "" + ``` + +**Note**: The password stored in Secret Manager has no new-line character, and if it was printed directly, your terminal prompt may be appended to the password. Using `echo ""` prevents this issue. + +To log into the Django admin: + + * Click the `/admin` link in the landing page of the service + * Login using: + * Username: `admin` + * Password: (the value from Secret Manager) + +You now have Django admin access. + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-product-listing.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-product-listing.md new file mode 100644 index 0000000..fa4c44a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-product-listing.md @@ -0,0 +1,7 @@ +# Update product listings + +Once you have [logged into the admin](login-django-admin.md), you can update product listings by going to the "Store > Products" page. + +You can update existing products by clicking their link, and updating the "Inventory count" field. + +You can add new products by clicking "+ Add Product". \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-site-config.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-site-config.md new file mode 100644 index 0000000..0bc7e9c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/django/update-site-config.md @@ -0,0 +1,12 @@ +# Update site config + +Once you have [logged into the admin](login-django-admin.md), you can update the site's look and feel by going to the "Store > Site Config" page. + +There will be one existing active site configuration that you can edit, or you can create a new configuration. + +You have the ability to adjust: + + * The base font used on the website. + * You can choose any font available in Google Fonts. Click the help text on the field for the full list. + * The font and colour of the website heading. + * Several colours used for banners, headings, and buttons on the site. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/README.md new file mode 100644 index 0000000..f11b99b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/README.md @@ -0,0 +1,8 @@ +# Website User + +As a website user, I want to: + + * [view and purchase products.](view-products.md) + + +*Want more options? [Request some new docs!](https://github.com/GoogleCloudPlatform/avocano/issues/new/choose)* \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/view-products.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/view-products.md new file mode 100644 index 0000000..e821e5f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/docs/user/view-products.md @@ -0,0 +1,16 @@ +# Viewing products + +*Descriptions presume a default deployment, with supplied demo data. Adjust if you have [customised](../django/update-product-listing.md) your setup.* + + +Head on over to your website (`PROJECTID.web.app`) and you will see a "Sparkly Avocado" available for purchase for a price. + +Click on the "Products" tab, (`PROJECTID.web.app/products`), and you'll see other products available, including a Pineapple Bee, Wooden Tiger, and Star Unicorn. + +# "Purchasing" Products + +If on any product listing you click "Buy", you'll be told "Oops! Sorry! This is not a real product." + +**This is expected**. This application isn't designed as a full retail store, merely an "April's Fools Day" "fake product" listing site. + +Yes, we wish there were such things as Sparkly Avocados, too. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/Dockerfile b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/Dockerfile new file mode 100644 index 0000000..c16feab --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/Dockerfile @@ -0,0 +1,6 @@ +# Execute with "--build-arg PROJECT_ID=$PROJECT_ID" +ARG PROJECT_ID=YOURPROJECTID +FROM grafana/k6 + +COPY avocano.js ./ +ENTRYPOINT k6 run avocano.js diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/avocano.js b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/avocano.js new file mode 100644 index 0000000..392204b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/loadtest/avocano.js @@ -0,0 +1,117 @@ +import { check } from 'k6'; +import http from 'k6/http'; + +export const options = { + scenarios: { + homepage: { + executor: 'constant-arrival-rate', + exec: 'homepage', + rate: 20, + timeUnit: '1s', + duration: '30m', + startTime: '5s', + gracefulStop: '60s', + preAllocatedVUs: 10, + maxVUs: 20, + }, + products: { + executor: 'constant-arrival-rate', + exec: 'products', + rate: 20, + timeUnit: '1s', + duration: '30m', + startTime: '5s', + gracefulStop: '60s', + preAllocatedVUs: 10, + maxVUs: 20, + }, + view_random_product: { + executor: 'constant-arrival-rate', + exec: 'view_random_product', + rate: 20, + timeUnit: '1s', + duration: '30m', + startTime: '5s', + gracefulStop: '60s', + preAllocatedVUs: 10, + maxVUs: 20, + }, + purchase_random_product: { + executor: 'constant-arrival-rate', + exec: 'purchase_random_product', + rate: 20, + timeUnit: '1s', + duration: '30m', + startTime: '5s', + gracefulStop: '60s', + preAllocatedVUs: 10, + maxVUs: 20, + }, + }, +}; + + +export function homepage() { + const res = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com`, { redirects: 10 }); + check(res, { + 'is status 200': (r) => r.status === 200 + }) +} + +export function products() { + const homepageResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com`, { redirects: 10 }); + check(homepageResponse, { + 'is status 200': (r) => r.status === 200 + }) + const productListResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products`, { redirects: 10 }); + check(productListResponse, { + 'is status 200': (r) => r.status === 200 + }) +} + +export function view_random_product() { + const homepageResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com`, { redirects: 10 }); + check(homepageResponse, { + 'is status 200': (r) => r.status === 200 + }) + + const productListResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products`, { redirects: 10 }); + check(productListResponse, { + 'is status 200': (r) => r.status === 200 + }) + + const products = productListResponse.json(); + const randomProductId = Math.floor(Math.random() * (products.length - 1 + 1)) + 1; + const viewProductResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products/${randomProductId}`, { redirects: 10 }); + check(viewProductResponse, { + 'is status 200': (r) => r.status === 200 + }) +} + +export function purchase_random_product() { + const homepageResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com`, { redirects: 10 }); + check(homepageResponse, { + 'is status 200': (r) => r.status === 200 + }) + //console.log(`HOMEPAGE: ${homepageResponse.body}`); + + const productListResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products`, { redirects: 10 }); + check(productListResponse, { + 'is status 200': (r) => r.status === 200 + }) + //console.log(`PRODUCT LIST: ${productListResponse.body}`); + + const products = productListResponse.json(); + const randomProductId = Math.floor(Math.random() * (products.length - 1 + 1)) + 1; + const viewProductResponse = http.get(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products/${randomProductId}`, { redirects: 10 }); + check(viewProductResponse, { + 'is status 200': (r) => r.status === 200 + }) + //console.log(`VIEW PRODUCT: ${viewProductResponse.body}`); + + const purchaseProductResponse = http.post(`https://${__ENV.PROJECT_ID}.firebaseapp.com/api/products/${randomProductId}/purchase`, { redirects: 10 }); + check(purchaseProductResponse, { + 'is status 200': (r) => r.status === 200 + }) + //console.log(`PURCHASE PRODUCT: ${purchaseProductResponse.body}`); +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/README.md new file mode 100644 index 0000000..c2cfea2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/README.md @@ -0,0 +1,7 @@ +# Provisioning + +This folder contains files used for provisioning the service: + +* `terraform/` contains the [Terraform](https://terraform.io) configurations. +* `automation` contains the scripts to test provisioning. +* `*.cloudbuild.yaml` are shorter versions of the main `/cloudbuild.yaml`. \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/.gitignore b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/.gitignore new file mode 100644 index 0000000..79d4dab --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/.gitignore @@ -0,0 +1,4 @@ +.terraform +.terraform.lock.hcl + +terraform.tfstate* \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/README.md new file mode 100644 index 0000000..a6d2a98 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/README.md @@ -0,0 +1 @@ +# Terraform files diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/apis.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/apis.tf new file mode 100644 index 0000000..12526d0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/apis.tf @@ -0,0 +1,23 @@ +# Google Cloud Services to enable + +locals { + services = [ + "run.googleapis.com", + "iam.googleapis.com", + "artifactregistry.googleapis.com", + "compute.googleapis.com", + "sql-component.googleapis.com", + "sqladmin.googleapis.com", + "cloudbuild.googleapis.com", + "secretmanager.googleapis.com", + "cloudresourcemanager.googleapis.com" + ] +} + +resource "google_project_service" "enabled" { + for_each = toset(local.services) + project = var.project_id + service = each.value + disable_dependent_services = true + disable_on_destroy = false +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/container.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/container.tf new file mode 100644 index 0000000..e2c2d98 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/container.tf @@ -0,0 +1,72 @@ + +# Use the docker registry providers to get accurate latest image information +# Allows Terraform to always update to the container image associated as "latest" without +# locking to the literal string "latest". +# https://github.com/hashicorp/terraform-provider-google/issues/6706#issuecomment-657039775 + +# +# Images are built in /cloudbuild.yaml +# + +# Registry +data "google_client_config" "default" {} + +locals { + # these match the values in /provisioning/deploy.cloudbuild.yaml + gcr_hostname = "gcr.io" + server_image = var.service_name + client_image = "client" + loadtest_image = "loadtest" + image_registry = "${local.gcr_hostname}/${var.project_id}" +} + + +# Authenticate to our container registry +provider "docker" { + registry_auth { + address = local.gcr_hostname + username = "oauth2accesstoken" + password = data.google_client_config.default.access_token + } +} + + +# Server +# Establish image name +data "docker_registry_image" "server" { + name = "${local.image_registry}/${local.server_image}" +} + +# Get exact image information +data "google_container_registry_image" "server" { + name = local.server_image + project = var.project_id + digest = data.docker_registry_image.server.sha256_digest +} + + +# Client +# Establish image name +data "docker_registry_image" "client" { + name = "${local.image_registry}/${local.client_image}" +} + +# Get exact image information +data "google_container_registry_image" "client" { + name = local.client_image + project = var.project_id + digest = data.docker_registry_image.client.sha256_digest +} + +# Loadtest +# Establish image name +data "docker_registry_image" "loadtest" { + name = "${local.image_registry}/${local.loadtest_image}" +} + +# Get exact image information +data "google_container_registry_image" "loadtest" { + name = local.loadtest_image + project = var.project_id + digest = data.docker_registry_image.loadtest.sha256_digest +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/database.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/database.tf new file mode 100644 index 0000000..26111eb --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/database.tf @@ -0,0 +1,37 @@ +# Cloud SQL Database + +## Instance + +resource "google_sql_database_instance" "postgres" { + name = var.instance_name + database_version = "POSTGRES_14" + project = var.project_id + region = var.region + deletion_protection = false + + settings { + tier = "db-custom-2-4096" # 2 CPU, 4GB Memory + } + depends_on = [google_project_service.enabled] + +} + +## Database +resource "google_sql_database" "database" { + name = var.database_name + instance = google_sql_database_instance.postgres.name +} + +## Database User +## Details used in Django config settings +# NOTE: users created this way automatically gain cloudsqladmin rights. +resource "google_sql_user" "django" { + name = var.database_username + instance = google_sql_database_instance.postgres.name + password = random_password.database_user_password.result + deletion_policy = "ABANDON" +} +resource "random_password" "database_user_password" { + length = 30 + special = false +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/firebase.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/firebase.tf new file mode 100644 index 0000000..b708042 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/firebase.tf @@ -0,0 +1,7 @@ +resource "google_firebase_project" "default" { + provider = google-beta + project = var.project_id + + depends_on = [google_project_service.enabled] +} + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/iam.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/iam.tf new file mode 100644 index 0000000..8ce38c6 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/iam.tf @@ -0,0 +1,50 @@ +# Service Accounts + +locals { + # Helpers for the clunky formatting of these values + automation_sa = "serviceAccount:${google_service_account.automation.email}" + server_sa = "serviceAccount:${google_service_account.server.email}" +} + +resource "google_service_account" "server" { + account_id = "api-backend" + display_name = "API Backend service account" + depends_on = [google_project_service.enabled] +} + +resource "google_service_account" "client" { + account_id = "client-frontend" + display_name = "Client Frontend service account" + depends_on = [google_project_service.enabled] +} + +resource "google_service_account" "automation" { + account_id = "automation" + display_name = "Automation service account" + depends_on = [google_project_service.enabled] +} + +# Both the server and Cloud Build can access the database +resource "google_project_iam_binding" "server_permissions" { + project = var.project_id + role = "roles/cloudsql.client" + members = [local.server_sa, local.automation_sa] + depends_on = [google_service_account.server, google_service_account.automation] +} + + +# Server needs introspection permissions +resource "google_project_iam_binding" "server_introspection" { + project = var.project_id + role = "roles/run.viewer" + members = [local.server_sa] + depends_on = [google_service_account.server] +} + +# Server needs to write to Cloud Trace +resource "google_project_iam_binding" "server_traceagent" { + project = var.project_id + role = "roles/cloudtrace.agent" + members = [local.server_sa] + depends_on = [google_service_account.server] +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_app.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_app.tf new file mode 100644 index 0000000..e1743a1 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_app.tf @@ -0,0 +1,114 @@ +resource "google_cloud_run_v2_job" "setup" { + + name = "setup" + location = var.region + launch_stage = "BETA" + + template { + template { + service_account = google_service_account.automation.email + containers { + image = data.google_container_registry_image.server.image_url + command = ["setup"] + env { + name = "DJANGO_ENV" + value_source { + secret_key_ref { + secret = google_secret_manager_secret.django_settings.secret_id + version = "latest" + } + } + } + env { + name = "ADMIN_PASSWORD" + value_source { + secret_key_ref { + secret = google_secret_manager_secret.django_admin_password.secret_id + version = "latest" + } + } + } + volume_mounts { + name = "cloudsql" + mount_path = "/cloudsql" + } + } + volumes { + name = "cloudsql" + cloud_sql_instance { + instances = [google_sql_database_instance.postgres.connection_name] + } + } + } + } + + depends_on = [ + google_secret_manager_secret_version.django_settings, + google_project_service.enabled + ] +} + +resource "google_cloud_run_v2_job" "migrate" { + + + name = "migrate" + location = var.region + launch_stage = "BETA" + + template { + template { + service_account = google_service_account.automation.email + containers { + image = data.google_container_registry_image.server.image_url + command = ["migrate"] + env { + name = "DJANGO_ENV" + value_source { + secret_key_ref { + secret = google_secret_manager_secret.django_settings.secret_id + version = "latest" + } + } + } + volume_mounts { + name = "cloudsql" + mount_path = "/cloudsql" + } + } + volumes { + name = "cloudsql" + cloud_sql_instance { + instances = [google_sql_database_instance.postgres.connection_name] + } + } + } + } + + depends_on = [ + google_secret_manager_secret_version.django_settings, + google_project_service.enabled + ] +} + + +resource "google_cloud_run_v2_job" "client" { + + name = "client" + location = var.region + launch_stage = "BETA" + + template { + template { + containers { + image = data.google_container_registry_image.client.image_url + command = ["firebase"] + args = ["deploy", "--project", var.project_id, "--only", "hosting"] + + } + } + } + + depends_on = [ + google_project_service.enabled + ] +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_loadtest.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_loadtest.tf new file mode 100644 index 0000000..76e4e8c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/jobs_loadtest.tf @@ -0,0 +1,63 @@ +locals { + load_test_region = "us-east1" +} + +resource "google_cloud_run_v2_job" "loadtest" { + name = "loadtest" + location = local.load_test_region + launch_stage = "BETA" + + template { + template { + containers { + image = data.google_container_registry_image.loadtest.image_url + env { + name = "PROJECT_ID" + value = var.project_id + } + } + timeout = "2700s" # 45 minutes, since the test runs for 30 minutes + } + task_count = 1 + } + depends_on = [ + google_cloud_run_v2_service.server + ] +} + +resource "google_service_account" "scheduler_sa" { + account_id = "avocano-loadtest-scheduler-sa" + description = "Cloud Scheduler service account; used to trigger scheduled Cloud Run jobs." + display_name = "avocano-loadtest-scheduler-sa" + depends_on = [ + google_cloud_run_v2_job.loadtest + ] +} + +resource "google_cloud_run_v2_job_iam_member" "invoker" { + project = var.project_id + location = local.load_test_region + name = google_cloud_run_v2_job.loadtest.name + role = "roles/run.invoker" + member = "serviceAccount:${google_service_account.scheduler_sa.email}" +} +resource "google_cloud_scheduler_job" "trigger_loadtest" { + name = "avocano-scheduled-loadtest" + description = "Invoke a Cloud Run container on a schedule." + schedule = "0 * * * *" + time_zone = "UTC" + attempt_deadline = "320s" + + retry_config { + retry_count = 1 + } + + http_target { + http_method = "POST" + uri = "https://${local.load_test_region}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${data.google_project.project.number}/jobs/${google_cloud_run_v2_job.loadtest.name}:run" + + oauth_token { + service_account_email = google_service_account.scheduler_sa.email + } + } +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/main.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/main.tf new file mode 100644 index 0000000..c7279a8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/main.tf @@ -0,0 +1,34 @@ +# Terraform + +terraform { + required_version = ">= 1.0.0" + required_providers { + google = { + source = "hashicorp/google" + version = ">=4.61.0" + } + docker = { + source = "kreuzwerker/docker" + version = ">=3.0.2" + } + google-beta = { + source = "hashicorp/google-beta" + version = ">=4.61.0" + } + random = { + source = "hashicorp/random" + version = ">=3.5.0" + } + } + backend "gcs" {} + # Bucket dynamically set in "terraform init" calls +} + +provider "google" { + project = var.project_id + region = var.region +} + +data "google_project" "project" { + project_id = var.project_id +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/outputs.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/outputs.tf new file mode 100644 index 0000000..7e6c2e5 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/outputs.tf @@ -0,0 +1,26 @@ +output "project_id" { + value = var.project_id +} + +output "region" { + value = var.region +} + +output "usage" { + sensitive = true + value = <<-EOF + + This deployment is now ready for use! + + https://${var.project_id}.web.app + + API Login: + + ${google_cloud_run_v2_service.server.uri}/admin + + Username: admin + Password: ${google_secret_manager_secret_version.django_admin_password.secret_data} + + EOF + +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/secrets.tf b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/secrets.tf new file mode 100644 index 0000000..210745f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/app-terraform/secrets.tf @@ -0,0 +1,56 @@ +# Secret Manager values + +## Django Admin Password +resource "random_password" "django_admin_password" { + length = 32 + special = false +} + +resource "google_secret_manager_secret" "django_admin_password" { + secret_id = "django_admin_password" + replication { + automatic = true + } + depends_on = [google_project_service.enabled] +} + +resource "google_secret_manager_secret_iam_binding" "django_admin_password" { + secret_id = google_secret_manager_secret.django_admin_password.id + role = "roles/secretmanager.secretAccessor" + members = [local.automation_sa] +} + +resource "google_secret_manager_secret_version" "django_admin_password" { + secret = google_secret_manager_secret.django_admin_password.id + secret_data = random_password.django_admin_password.result +} + +## Django Secret Key + +resource "random_password" "django_secret_key" { + special = false + length = 50 +} +resource "google_secret_manager_secret" "django_settings" { + secret_id = "django_settings" + replication { + automatic = true + } + depends_on = [google_project_service.enabled] +} + +## Django configuration settings +resource "google_secret_manager_secret_version" "django_settings" { + secret = google_secret_manager_secret.django_settings.id + secret_data = <&1 | grep -q 'BucketNotFoundException'; then + gsutil mb -p $PARENT_PROJECT $LOGS_BUCKET + + gsutil iam ch \ + serviceAccount:${DEFAULT_GCB}:roles/storage.objectAdmin \ + $LOGS_BUCKET +else + echo "Bucket $LOGS_BUCKET already exists. Skipping" +fi +stepdone + +stepdo "Grant access to default logs bucket" +DEFAULT_BUCKET=gs://${PARENT_PROJECT}_cloudbuild + +if gsutil ls $DEFAULT_BUCKET 2>&1 | grep -q 'BucketNotFoundException'; then + echo "Default Cloud Build log bucket not automatically created. Fixing." + gsutil mb -p $PARENT_PROJECT $DEFAULT_BUCKET +fi +gsutil iam ch \ + serviceAccount:${SA_EMAIL}:roles/storage.admin \ + $DEFAULT_BUCKET +stepdone + +stepdo "Grant roles to service account on project" +for role in storage.admin iam.serviceAccountUser; do + quiet gcloud projects add-iam-policy-binding $PARENT_PROJECT \ + --member serviceAccount:${SA_EMAIL} \ + --role roles/${role} +done +stepdone + +stepdo "Grant roles to service account on folder" +for role in billing.projectManager resourcemanager.projectCreator resourcemanager.projectDeleter resourcemanager.projectIamAdmin; do + quiet gcloud resource-manager folders add-iam-policy-binding $PARENT_FOLDER \ + --member serviceAccount:${SA_EMAIL} \ + --role roles/${role} +done +stepdone + +stepdo "Grant roles to service account on billing account" +for role in billing.user billing.viewer; do + quiet gcloud beta billing accounts add-iam-policy-binding $BILLING_ACCOUNT \ + --member serviceAccount:${SA_EMAIL} \ + --role roles/${role} +done +stepdone \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/bashhelpers.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/bashhelpers.sh new file mode 100644 index 0000000..0d992a0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/bashhelpers.sh @@ -0,0 +1,18 @@ + +# Bash helpers +function quiet { + $* > /dev/null 2>&1 +} + +stepdo() { + echo "→ ${1}..." +} + +# this will only capture the most recent return code, sadly. +stepdone(){ + statuscode=$? + msg="... done" + if [ $statuscode -ne 0 ]; then msg="❌ done, but non-zero return code ($statuscode)"; fi + echo $msg + echo " " +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cleanup.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cleanup.cloudbuild.yaml new file mode 100644 index 0000000..ab6ec85 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cleanup.cloudbuild.yaml @@ -0,0 +1,17 @@ + +steps: + - id: Cleanup any projects + name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' + entrypoint: /bin/bash + args: + - '-c' + - | + echo "List the projects" + gcloud projects list --filter parent=${_PARENT_FOLDER} --format "value(project_id)" + echo "Delete projects" + for project in $(gcloud projects list --filter parent=${_PARENT_FOLDER} --format "value(project_id)") + do gcloud projects delete $project --quiet + done + +logsBucket: ${PROJECT_ID}-buildlogs +serviceAccount: projects/${PROJECT_ID}/serviceAccounts/ci-serviceaccount@avocano-admin.iam.gserviceaccount.com \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cloudbuild.yaml new file mode 100644 index 0000000..f8503c1 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/cloudbuild.yaml @@ -0,0 +1,65 @@ +steps: + - id: "setup" + name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + entrypoint: /bin/bash + args: + - "-c" + - | + source ./provisioning/automation/project-setup.sh \ + -f ${_PARENT_FOLDER} \ + -p ${_CI_PROJECT} \ + -r ${_REGION} \ + -s ${_SA_NAME} + + - id: "provision" + name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + entrypoint: gcloud + args: + [ + "builds", + "submit", + "--config=$_CLOUDBUILD_CONFIG", + "--timeout=1500", + "--project=$_CI_PROJECT" + ] + + - id: "test" + name: python:3.11-slim + dir: provisioning + env: + - 'CI_PROJECT=$_CI_PROJECT' + script: | + #!/bin/bash + + python -m pip install -r test/requirements.txt + playwright install-deps + playwright install + python -m pytest + + + - id: "cleanup" + name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + env: ["KEEP_PROJECT=${_KEEP_PROJECT}"] + script: + #!/bin/bash + + if [ $KEEP_PROJECT = 'true' ]; then echo "Configuration says to keep project around. Not deleting."; exit 0; fi + + echo "Deleting project..." + gcloud projects delete ${_CI_PROJECT} --quiet; + +options: + dynamic_substitutions: true + machineType: "E2_HIGHCPU_8" + +logsBucket: ${PROJECT_ID}-buildlogs +serviceAccount: projects/${PROJECT_ID}/serviceAccounts/ci-serviceaccount@avocano-admin.iam.gserviceaccount.com + +substitutions: + _KEEP_PROJECT: "false" + _REGION: us-central1 + _SA_NAME: ci-serviceaccount + _CI_PROJECT: "avocano-ephemeral-${BUILD_ID:0:8}" + _CLOUDBUILD_CONFIG: provisioning/automation/deploy.cloudbuild.yaml + +timeout: "1500s" diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/deploy.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/deploy.cloudbuild.yaml new file mode 100644 index 0000000..3c06bd2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/deploy.cloudbuild.yaml @@ -0,0 +1,9 @@ +steps: + + # designed to be called against the child project, + # to kickstart the build within the scope of that project. + - id: "deploy" + name: "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + script: | + #!/bin/bash + bash setup.sh \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/project-setup.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/project-setup.sh new file mode 100644 index 0000000..a7c11b2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/automation/project-setup.sh @@ -0,0 +1,92 @@ +#!/bin/bash +set -e +source provisioning/automation/bashhelpers.sh + +PARENT_PROJECT=$(gcloud config get-value project) + +while getopts f:p:r:s: flag; do + case "${flag}" in + f) PARENT_FOLDER=${OPTARG} ;; + p) CI_PROJECT=${OPTARG} ;; + r) REGION=${OPTARG} ;; + s) SA_NAME=${OPTARG} ;; + esac +done + + +if [[ -z $PARENT_FOLDER ]]; then + export PARENT_FOLDER=$(gcloud projects describe ${PARENT_PROJECT} --format="value(parent.id)") + echo "🔍 Found folder ${PARENT_FOLDER} from ${PARENT_PROJECT}" +else + echo "📦 Using provided folder $PARENT_FOLDER" +fi + +if [[ -z $CI_PROJECT ]]; then + CI_PROJECT_PREFIX=avocano-test + RANDOM_IDENTIFIER=$((RANDOM % 999999)) + CI_PROJECT=$(printf "%s-%06d" $CI_PROJECT_PREFIX $RANDOM_IDENTIFIER)-${TEST_TYPE:=manual} +fi + +if [[ -z $REGION ]]; then + REGION=us-central1 +fi + +SA_EMAIL=$(gcloud iam service-accounts list --project ${PARENT_PROJECT} --filter $SA_NAME --format 'value(email)') +TF_STATE_BUCKET=${CI_PROJECT}-tfstate + +echo "🚀 Running setup using $TEST_TYPE on $CI_PROJECT in $REGION with $SA_EMAIL" + +if gcloud projects list --filter $CI_PROJECT | grep -q "$CI_PROJECT"; then + echo "🔁 Reusing ${CI_PROJECT}" +else + stepdo "🔨 create CI project $CI_PROJECT in folder $PARENT_FOLDER" + gcloud projects create ${CI_PROJECT} --folder ${PARENT_FOLDER} + stepdone + + stepdo "assign IAM policies to service account" + for role in cloudbuild.builds.editor iam.serviceAccountTokenCreator iam.serviceAccountUser billing.projectManager; do + quiet gcloud projects add-iam-policy-binding $CI_PROJECT \ + --member serviceAccount:${SA_EMAIL} \ + --role roles/${role} + done + stepdone + + stepdo "setup billing" + BILLING_ACCOUNT=$(gcloud beta billing projects describe ${PARENT_PROJECT} --format="value(billingAccountName)" || sed -e 's/.*\///g') + gcloud beta billing projects link ${CI_PROJECT} \ + --billing-account=${BILLING_ACCOUNT} --verbosity debug + stepdone + + stepdo "enable services on ci project" + gcloud services enable --project $CI_PROJECT \ + cloudresourcemanager.googleapis.com \ + containerregistry.googleapis.com \ + cloudbuild.googleapis.com \ + cloudbilling.googleapis.com \ + iam.googleapis.com \ + firebase.googleapis.com + stepdone + + stepdo "assign IAM owner role to Cloud Build service account" + CI_PROJECTNUMBER=$(gcloud projects describe ${CI_PROJECT} --format='value(projectNumber)') + CLOUDBUILD_SA=$CI_PROJECTNUMBER@cloudbuild.gserviceaccount.com + quiet gcloud projects add-iam-policy-binding $CI_PROJECT \ + --member serviceAccount:${CLOUDBUILD_SA} \ + --role roles/owner + stepdone + + stepdo "assign Log Bucket writer to Cloud Build service account" + LOGS_BUCKET=gs://${PARENT_PROJECT}-buildlogs + gsutil iam ch \ + serviceAccount:${CLOUDBUILD_SA}:roles/storage.admin \ + $LOGS_BUCKET + stepdone + + stepdo "setup Terraform bucket" + gsutil mb -p ${CI_PROJECT} gs://$TF_STATE_BUCKET + echo "Created $TF_STATE_BUCKET bucket" + + echo "" + echo "✅ Project '${CI_PROJECT}' is now ready to use." + echo "" +fi \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client-image.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client-image.cloudbuild.yaml new file mode 100644 index 0000000..749e1e3 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client-image.cloudbuild.yaml @@ -0,0 +1,42 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build client code into container +# Used for Cloud Run Job-based deployment strategies + +steps: + - id: build + name: "gcr.io/cloud-builders/docker" + dir: client + args: + [ + "build", + "--build-arg", + "PROJECT_ID=$PROJECT_ID", + "--build-arg", + "AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE", + "-t", + "gcr.io/$PROJECT_ID/$_IMAGE_NAME", + ".", + ] + +images: + - gcr.io/$PROJECT_ID/$_IMAGE_NAME + +substitutions: + _IMAGE_NAME: client + _PURCHASE_MODE: "" + +options: + dynamic_substitutions: true diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client.cloudbuild.yaml new file mode 100644 index 0000000..8615408 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/client.cloudbuild.yaml @@ -0,0 +1,33 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Only run client/firebase updates. + +steps: + - id: client-deploy + name: gcr.io/$PROJECT_ID/firebase + env: + - AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE + dir: client + entrypoint: "/bin/bash" + args: + - "-c" + - |- + + npm i + npm run build + firebase deploy --project $PROJECT_ID --only hosting + +substitutions: + _PURCHASE_MODE: "" \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/deploy.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/deploy.cloudbuild.yaml new file mode 100644 index 0000000..37ac60f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/deploy.cloudbuild.yaml @@ -0,0 +1,64 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +steps: + - id: server build + name: gcr.io/k8s-skaffold/pack + entrypoint: pack + args: + - build + - gcr.io/$PROJECT_ID/server + - --builder=gcr.io/buildpacks/builder:v1 + - --path=server/ + + # Because this image is immediately used in the next step, this action must happen now. + - id: server push + name: gcr.io/cloud-builders/docker + args: + - push + - gcr.io/$PROJECT_ID/server + + - id: terraform + name: hashicorp/terraform + dir: provisioning/app-terraform + env: + - PROJECT_ID=$PROJECT_ID + - REGION=$_REGION + script: | + #!/bin/sh + + terraform init -backend-config="bucket=terraform-${PROJECT_ID}-avocano" + terraform apply -auto-approve -no-color \ + -var project_id=${PROJECT_ID} \ + -var region=${REGION} + + # Only since the client is also node-based can the firebase image can be used for this step. + - id: client deploy + name: gcr.io/$PROJECT_ID/firebase + dir: client + env: + - PROJECT_ID=$PROJECT_ID + - AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE + script: | + #!/bin/bash + + npm i + npm run build + firebase deploy --project $PROJECT_ID --only hosting + +timeout: 1800s + +substitutions: + _REGION: us-central1 + _PURCHASE_MODE: "" diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/destroy.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/destroy.cloudbuild.yaml new file mode 100644 index 0000000..949fcfe --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/destroy.cloudbuild.yaml @@ -0,0 +1,33 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +steps: + - id: app-terraform destroy + name: hashicorp/terraform + dir: provisioning/app-terraform + env: + - PROJECT_ID=$PROJECT_ID + - REGION=$_REGION + script: | + #!/bin/sh + + terraform init -backend-config="bucket=terraform-${PROJECT_ID}-avocano" + terraform destroy -auto-approve -no-color \ + -var project_id=${PROJECT_ID} \ + -var region=${REGION} + +timeout: 1800s + +substitutions: + _REGION: us-central1 diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/firebase-builder.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/firebase-builder.cloudbuild.yaml new file mode 100644 index 0000000..190cae0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/firebase-builder.cloudbuild.yaml @@ -0,0 +1,33 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Create a firebase container from the cloudbuild setup. +# Should only be required once per project. + +steps: + - id: clone + name: gcr.io/cloud-builders/git + args: + [ + "clone", + "https://github.com/GoogleCloudPlatform/cloud-builders-community", + ] + + - id: build + dir: cloud-builders-community/firebase + name: gcr.io/cloud-builders/docker + args: ["build", "-t", "gcr.io/$PROJECT_ID/firebase", "."] + +images: + - gcr.io/$PROJECT_ID/firebase diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/loadtest.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/loadtest.cloudbuild.yaml new file mode 100644 index 0000000..9b37d58 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/loadtest.cloudbuild.yaml @@ -0,0 +1,39 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build client code into container +# Used for Cloud Run Job-based deployment strategies + +steps: + - id: build loadtest image + name: "gcr.io/cloud-builders/docker" + dir: loadtest + args: + [ + "build", + "--build-arg", + "PROJECT_ID=$PROJECT_ID", + "-t", + "gcr.io/$PROJECT_ID/$_IMAGE_NAME", + ".", + ] + +images: + - gcr.io/$PROJECT_ID/$_IMAGE_NAME + +substitutions: + _IMAGE_NAME: loadtest + +options: + dynamic_substitutions: true diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.cloudbuild.yaml new file mode 100644 index 0000000..b125c39 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.cloudbuild.yaml @@ -0,0 +1,34 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build the new image. Doesn't deploy. See server.update.sh for complete process. + +steps: + - id: server build + name: gcr.io/k8s-skaffold/pack + entrypoint: pack + args: + - build + - gcr.io/$PROJECT_ID/$_IMAGE_NAME + - --builder=gcr.io/buildpacks/builder:v1 + - --path=server/ + +images: + - gcr.io/$PROJECT_ID/$_IMAGE_NAME + +substitutions: + _IMAGE_NAME: server + +options: + dynamic_substitutions: true diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.update.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.update.sh new file mode 100755 index 0000000..2f2c3b6 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/server.update.sh @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## Update server and database migrations + +export PROJECT_ID=${PROJECT_ID:=$(gcloud config get project)} +export REGION=${REGION:=us-centra1} +export SERVICE_NAME=server + +# Build server image +gcloud builds submit --config provisioning/server.cloudbuild.yaml + +# Apply Terraform (updates server) +gcloud builds submit --config provisioning/terraform.cloudbuild.yaml + +# Run database migration job +gcloud beta run jobs execute migrate --region $REGION diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/tagged-images.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/tagged-images.cloudbuild.yaml new file mode 100644 index 0000000..955114c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/tagged-images.cloudbuild.yaml @@ -0,0 +1,52 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build containers with tags. +# Must be used with Cloud Build's "Push new tag" Events + +steps: + - id: client build + name: "gcr.io/cloud-builders/docker" + dir: client + args: + - build + - --build-arg + - PROJECT_ID=$PROJECT_ID + - --build-arg + - AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE + - "-t" + - gcr.io/$PROJECT_ID/$_CLIENT_IMAGE_NAME:$TAG_NAME + - "." + + - id: server build + name: gcr.io/k8s-skaffold/pack + entrypoint: pack + args: + - build + - gcr.io/$PROJECT_ID/$_SERVER_IMAGE_NAME:$TAG_NAME + - --builder=gcr.io/buildpacks/builder:v1 + - --path=server/ + + +images: + - gcr.io/$PROJECT_ID/$_CLIENT_IMAGE_NAME:$TAG_NAME + - gcr.io/$PROJECT_ID/$_SERVER_IMAGE_NAME:$TAG_NAME + +substitutions: + _CLIENT_IMAGE_NAME: client + _SERVER_IMAGE_NAME: server + _PURCHASE_MODE: "" + +options: + dynamic_substitutions: true diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/terraform.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/terraform.cloudbuild.yaml new file mode 100644 index 0000000..ae3b06a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/terraform.cloudbuild.yaml @@ -0,0 +1,35 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Only run Terraform. Useful for re-asserting state. + +steps: + - id: terraform + name: hashicorp/terraform + dir: provisioning/app-terraform + env: + - PROJECT_ID=$PROJECT_ID + - REGION=$_REGION + script: | + #!/bin/sh + + terraform init -backend-config="bucket=terraform-${PROJECT_ID}-avocano" + terraform apply -auto-approve -no-color \ + -var project_id=${PROJECT_ID} \ + -var region=${REGION} + +timeout: 1800s + +substitutions: + _REGION: us-central1 \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test-deployment.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test-deployment.yaml new file mode 100644 index 0000000..72888d4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test-deployment.yaml @@ -0,0 +1,38 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build client code into container +# Used for Cloud Run Job-based deployment strategies + +steps: + - id: "test deployment" + name: python:3.11-slim + dir: provisioning + env: + - AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE + - PROJECT_ID=$PROJECT_ID + - REGION=$_REGION + script: | + #!/bin/bash + python -m pip install -r test/requirements.txt + playwright install-deps + playwright install + python -m pytest + + +substitutions: + _REGION: us-central1 + _PURCHASE_MODE: "" + + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/README.md new file mode 100644 index 0000000..ce61d2e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/README.md @@ -0,0 +1,50 @@ +# Provisioning Tests + +These tests are designed to be run against a deployment. + +They are either run against the current project, or a defined project (using the `CI_PROJECT` value) + + +## Test scope + +These tests use [playwright](https://playwright.dev/), and automate the clicking of website buttons to test client deployments. + +There are also other tests, see `test/` for details. + +## Local dev + +Install the dependencies + +``` +python -m pip install -r test/requirements.txt +playwright install-deps +playwright install +``` + +Then run the tests: + +``` +python -m pytest +``` + + +`googleapiclient.discovery` requires authentication, so you may need to setup a dedicated service account: + +``` +gcloud iam service-accounts create robot-account \ + --display-name "Robot account" + +# permissions on parent +gcloud projects add-iam-policy-binding ${PROJECT_ID} \ + --member serviceAccount:robot-account@${PROJECT_ID}.iam.gserviceaccount.com \ + --role roles/owner + +# permissions on child. +gcloud projects add-iam-policy-binding ${CI_PROJECT} \ + --member serviceAccount:robot-account@${PROJECT_ID}.iam.gserviceaccount.com \ + --role roles/owner + +gcloud iam service-accounts keys create ~/robot-account-key.json \ + --iam-account robot-account@${PROJECT_ID}.iam.gserviceaccount.com +export GOOGLE_APPLICATION_CREDENTIALS=~/robot-account-key.json +``` diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/__init__.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/client_test.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/client_test.py new file mode 100644 index 0000000..6679c1a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/client_test.py @@ -0,0 +1,127 @@ +import os +import re + +import httpx +import pytest +from playwright.sync_api import Page, expect + +httpclient = httpx.Client(timeout=15, follow_redirects=True) + +purchase_mode = os.environ.get("AVOCANO_PURCHASE_MODE", "") + + +def test_client_response(firebase_url): + response = httpclient.get(firebase_url) + + assert response.status_code == 200 + assert "🥑" in response.text + + +def test_client_content(firebase_url, page: Page): + page.goto(firebase_url, wait_until="networkidle") + + expect(page).to_have_title(re.compile("Avocano")) + + page_elements = [ + "Sparkly Avocado", + "Products", + "Shipping", + "Contact", + "Testimonials", + ] + for element in page_elements: + expect(page.locator("body")).to_contain_text(element) + + +def test_client_interaction(firebase_url, page: Page): + page.goto(firebase_url, wait_until="networkidle") + + expect(page).to_have_title(re.compile("Avocano")) + + def get_inventory(): + inventory = page.locator(".inventory").inner_text() + assert "Only" in inventory + inventory_count = re.findall(r"Only ([0-9]*) left!", inventory)[0] + assert inventory_count is not None + inventory_count = int(inventory_count) + assert inventory_count > 0 + return inventory_count + + original_inventory = get_inventory() + + if purchase_mode == "cart": + page.get_by_role("link", name="Add to Cart").click() + expect(page.locator(".dialogWrapper")).to_have_text( + re.compile("Wonderful news!") + ) + page.get_by_role("button").click() + + # Inventory not yet taken + new_inventory = get_inventory() + assert original_inventory == new_inventory + + else: + page.get_by_role("link", name="Buy").click() + expect(page.locator(".dialogWrapper")).to_have_text(re.compile("Oops!")) + page.get_by_role("button").click() + new_inventory = get_inventory() + assert original_inventory - 1 == new_inventory + + +@pytest.mark.skipif(purchase_mode != "cart", reason="Test on Cart mode only") +def test_cart_interaction(firebase_url, page: Page): + page.goto(firebase_url, wait_until="networkidle") + + expect(page).to_have_title(re.compile("Avocano")) + + def get_inventory(): + inventory = page.locator(".inventory").inner_text() + assert "Only" in inventory + inventory_count = re.findall(r"Only ([0-9]*) left!", inventory)[0] + assert inventory_count is not None + inventory_count = int(inventory_count) + assert inventory_count > 0 + return inventory_count + + original_inventory = get_inventory() + + expect(page).to_have_title(re.compile("Avocano")) + page.get_by_role("link", name="Add to Cart").click() + + expect(page.locator(".dialogWrapper")).to_have_text(re.compile("Wonderful news!")) + page.get_by_role("button", name="close").click() + + page.goto(firebase_url, wait_until="networkidle") + expect(page.locator(".shoppingCart")).to_have_text(re.compile("1")) + + # Confirm inventory stock + new_inventory = get_inventory() + assert original_inventory == new_inventory + + page.get_by_role("link", name="checkout").click() + + page_elements = ["Checkout", "Cart", "Delivery"] + for element in page_elements: + expect(page.locator("body")).to_contain_text(element) + + # Try checkout + page.get_by_label("Enter your email").fill("foo@bar.com") + + page.get_by_role("combobox", name="Payment Type*").click() + page.get_by_role("option", name="Credit").click() + page.get_by_role("button", name="purchase").click() + + # Expect failure + expect(page.locator(".dialogWrapper")).to_have_text(re.compile("Oh no!")) + page.get_by_role("button", name="close").click() + + # Actually checkout + page.get_by_role("combobox", name="Payment Type*").click() + page.get_by_role("option", name="Collect").click() + page.get_by_role("button", name="purchase").click() + expect(page.locator(".dialogWrapper")).to_have_text(re.compile("Hooray!")) + + # Confirm updated inventory + page.goto(firebase_url, wait_until="networkidle") + new_inventory = get_inventory() + assert original_inventory - 1 == new_inventory diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/conftest.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/conftest.py new file mode 100644 index 0000000..04eba37 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/conftest.py @@ -0,0 +1,61 @@ +import pytest +import os +import google.auth +from google.cloud import secretmanager +from googleapiclient.discovery import build + + +@pytest.fixture() +def service_name(): + return "server" # from provisioning/app-terraform/variables.tf + + +@pytest.fixture() +def django_admin_user(): + return "admin" # from server/store/migrations/0001_create_superuser.py + + +@pytest.fixture() +def django_admin_secret_name(): + return "django_admin_password" # from provisioning/app-terraform/secrets.tf + + +@pytest.fixture +def project_id(): + project = os.environ.get("CI_PROJECT") + if not project: + _, project = google.auth.default() + return project + + +@pytest.fixture +def region(): + return os.environ.get("REGION", "us-central1") + + +@pytest.fixture +def firebase_url(project_id): + return f"https://{project_id}.web.app" + + +@pytest.fixture +def cloudrun_service(project_id, region, service_name): + run_api = build("run", "v1") + service_fqn = f"projects/{project_id}/locations/{region}/services/{service_name}" + return run_api.projects().locations().services().get(name=service_fqn).execute() + + +@pytest.fixture +def cloudrun_url(cloudrun_service): + return cloudrun_service["status"]["address"]["url"] + + +@pytest.fixture +def django_admin_password(project_id, django_admin_secret_name): + secret_client = secretmanager.SecretManagerServiceClient() + + secret_fqn = ( + f"projects/{project_id}/secrets/{django_admin_secret_name}/versions/latest" + ) + payload = secret_client.access_secret_version(name=secret_fqn).payload + return payload.data.decode("UTF-8") diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/requirements.txt b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/requirements.txt new file mode 100644 index 0000000..5e8899b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/requirements.txt @@ -0,0 +1,6 @@ +pytest +google-api-python-client +httpx +google-api-core +google-cloud-secret-manager +pytest-playwright \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/server_test.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/server_test.py new file mode 100644 index 0000000..4fc16ed --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/server_test.py @@ -0,0 +1,62 @@ +import httpx + +httpclient = httpx.Client(timeout=15, follow_redirects=True) + + +def test_server_exists(cloudrun_service, service_name): + assert cloudrun_service is not None + assert cloudrun_service["metadata"]["name"] == service_name + + +def test_server_index(cloudrun_url): + response = httpclient.get(cloudrun_url) + assert response.status_code == 200 + assert "✨🥑✨" in response.text + + +def test_server_admin(cloudrun_url): + response = httpclient.get(cloudrun_url + "/admin", follow_redirects=True) + assert response.status_code == 200 + assert "Django administration" in response.text + + +def test_server_admin_csrf(cloudrun_url, django_admin_user, django_admin_password): + with httpx.Client( + headers={"Referer": cloudrun_url}, follow_redirects=True, timeout=30 + ) as client: + login_url = cloudrun_url + "/admin/login/?next=/admin/" + + client.get(login_url) # for cookies + response = client.post( + login_url, + data={ + "username": django_admin_user, + "password": django_admin_password, + "csrfmiddlewaretoken": client.cookies["csrftoken"], + }, + ) + + assert not response.is_error + assert "Site administration" in response.text + + +def test_server_api_content(cloudrun_url): + response = httpclient.get(cloudrun_url + "/api/") + assert response.status_code == 200 + assert response.json() is not None + + base_json = response.json() + + for endpoint in [ + "products", + "active/product", + "testimonials", + "site_config", + "active/site_config", + ]: + endpoint_url = base_json[endpoint] + response = httpclient.get(endpoint_url) + assert len(response.json()) > 0 + + + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/test.cloudbuild.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/test.cloudbuild.yaml new file mode 100644 index 0000000..cd9b549 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/provisioning/test/test.cloudbuild.yaml @@ -0,0 +1,17 @@ +steps: + + # Only run tests against the current project + - id: "test" + name: python:3.10-slim + env: + - AVOCANO_PURCHASE_MODE=$_PURCHASE_MODE + dir: provisioning + script: | + #!/bin/bash + python -m pip install -r test/requirements.txt + playwright install-deps + playwright install + python -m pytest + +substitutions: + _PURCHASE_MODE: "" diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/renovate.json b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/renovate.json new file mode 100644 index 0000000..3e481cf --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/renovate.json @@ -0,0 +1,32 @@ +{ + "extends": [ + "config:base", + ":disableDependencyDashboard", + ":prConcurrentLimitNone" + ], + "rangeStrategy": "auto", + "packageRules": [ + { + "paths": [ + "client/" + ], + "pinVersions": false, + "rebaseStalePrs": true, + "lockFileMaintenance": { + "enabled": true, + "recreateClosed": true + } + }, + { + "description": "Playright dependencies must be kept in sync", + "groupName": "Playwright", + "matchPackageNames": ["playwright", "@playwright/test", "mcr.microsoft.com/playwright"] + }, + { + "description": "Python OpenTelemetry dependencies must be kept in sync", + "groupName": "OpenTelemetry", + "matchLanguages": ["python"], + "matchPackagePrefixes": ["opentelemetry-"] + } + ] +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.env.local b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.env.local new file mode 100644 index 0000000..dc6f75f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.env.local @@ -0,0 +1,4 @@ +DATABASE_URL=sqlite:///db.sqlite3 +SECRET_KEY=avocado +ADMIN_PASSWORD=password +DEBUG=true \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.gitignore b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.gitignore new file mode 100644 index 0000000..8d944d9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/.gitignore @@ -0,0 +1,9 @@ +__pycache__/ +/static/ +/media/ + +.env +db.sqlite3 + +venv/ +.pytest_cache \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/Procfile b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/Procfile new file mode 100644 index 0000000..61542b2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/Procfile @@ -0,0 +1,4 @@ +web: opentelemetry-instrument gunicorn --bind 0.0.0.0:$PORT --workers 1 avocano_api.wsgi:application +migrate: python3 manage.py migrate && python3 manage.py collectstatic --noinput --clear + +setup: bash scripts/prime_database.sh diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/README.md b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/README.md new file mode 100644 index 0000000..5e95d6a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/README.md @@ -0,0 +1,24 @@ +# Avocano API Server + +Powered by Django REST Framework. + +## Local dev + +``` +# Create virtualenv +python -m venv venv +source venv/bin/activate + +# Copy template env +cp .env.local .env + +# Install dependencies +pip install -r requirements.txt + +# Prime database with migrations, fixture data +bash scripts/prime_database.sh + +# Run local server +python manage.py runserver +``` + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/__init__.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/asgi.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/asgi.py new file mode 100644 index 0000000..09a1d66 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/asgi.py @@ -0,0 +1,23 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "avocano_api.settings") + +application = get_asgi_application() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/cloudrun_helpers.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/cloudrun_helpers.py new file mode 100644 index 0000000..3c57341 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/cloudrun_helpers.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import logging +import os + +import google.auth +import httpx +from googleapiclient.discovery import build as google_api +from googleapiclient.errors import HttpError as GAPIHTTPError + +## Dynamically determine the Cloud Run Service URL + +# Interrogates the metadata service to determine the URL of itself. +# Requires the Cloud Run service account have run.services.get permissions. + +# Removes the need to provide the service URL as an enviroment variable to +# pass onto CSRF settings for trusted domain permissions. + +# Will only work if the service is running Cloud Run, and will quickly error +# at the first point of issue trying to contact the metadata server. + + +class MetadataError(Exception): + def __init__(self, message): + self.message = message + super().__init__(self.message) + + +def _project_id(): + """Use the Google Auth helper (via the metadata service) to get the Google Cloud Project""" + try: + _, project = google.auth.default() + except google.auth.exceptions.DefaultCredentialsError: + raise MetadataError("Could not automatically determine credentials") + if not project: + raise MetadataError("Could not determine project from credentials.") + return project + + +def _region(): + """Use the local metadata service to get the region""" + try: + resp = httpx.get( + "http://metadata.google.internal/computeMetadata/v1/instance/region", + headers={"Metadata-Flavor": "Google"}, + ) + return resp.text.split("/")[-1] + except httpx.RequestError as e: + raise MetadataError(f"Could not determine region. Error: {e}") + + +def _service_name(): + service = os.environ.get("K_SERVICE") + if not service: + raise MetadataError("Did not find K_SERVICE. Are you running in Cloud Run?") + return service + + +def _service_url(project, region, service): + try: + run_api = google_api("run", "v2") + fqname = f"projects/{project}/locations/{region}/services/{service}" + service = run_api.projects().locations().services().get(name=fqname).execute() + return service["uri"] + except (GAPIHTTPError, KeyError) as e: + raise MetadataError(f"Could not determine service url. Error: {e}") + + +def get_service_url(): + return _service_url(_project_id(), _region(), _service_name()) + + +def get_project_id(): + return _project_id() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/healthchecks.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/healthchecks.py new file mode 100644 index 0000000..5cb4400 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/healthchecks.py @@ -0,0 +1,37 @@ + +import logging +from django.http import HttpResponse, HttpResponseServerError + +class HealthCheckMiddleware(object): + """Django middleware to answer health checks. + + Responds to /healthy and /ready + """ + def __init__(self, get_response) -> None: + self.get_response = get_response + + def __call__(self, request): + if request.method == "GET": + if request.path == "/healthy": + return self.healthy(request) + if request.path == "/ready": + return self.dbcheck(request) + return self.get_response(request) + + def healthy(self, request): + return HttpResponse("ok") + + def dbcheck(self, request) -> HttpResponse: + try: + import django.db as ddb + dbconn = ddb.connections[ddb.DEFAULT_DB_ALIAS] + c = dbconn.cursor() + c.execute('SELECT 1;') + row = c.fetchone() + if row == None: + raise Exception("db: invalid response") + except Exception as e: + logging.exception(e) + return HttpResponseServerError("db: failed health check") + return HttpResponse("ok") + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/settings.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/settings.py new file mode 100644 index 0000000..8330b8e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/settings.py @@ -0,0 +1,186 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import io +import os +from pathlib import Path +from urllib.parse import urlparse + +import environ + +from .cloudrun_helpers import MetadataError, get_service_url, get_project_id + +BASE_DIR = Path(__file__).resolve().parent.parent + +# Load settings from local .env, mounted .env, or envvar. +env = environ.Env() +env.read_env(BASE_DIR / ".env") +env.read_env("/settings/.env") +env.read_env(io.StringIO(os.environ.get("DJANGO_ENV", None))) + +SECRET_KEY = env("SECRET_KEY") +DEBUG = env("DEBUG", default=False) + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "store", + "colorfield", + "corsheaders", + "rest_framework", + "django_filters", + "drf_spectacular", +] + +MIDDLEWARE = [ + "avocano_api.healthchecks.HealthCheckMiddleware", + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "avocano_api.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + +# Used for local dev, and cloud-run-proxy +local_host = "http://localhost:8080" + +# Used for Cloud Shell dev with Web Preview +cloudshell_host = "https://*.cloudshell.dev" + +CLOUDRUN_SERVICE_URL = env("CLOUDRUN_SERVICE_URL", default=None) + +# If the Cloud Run service isn't defined, try dynamically retrieving it. +if not CLOUDRUN_SERVICE_URL: + try: + CLOUDRUN_SERVICE_URL = get_service_url() + except MetadataError: + pass + +if CLOUDRUN_SERVICE_URL: + ALLOWED_HOSTS = [urlparse(CLOUDRUN_SERVICE_URL).netloc, "127.0.0.1"] + + # Firebase hosting has multiple default URLs, so add those as well. + project_id = get_project_id() + firebase_hosts = [ + f"https://{project_id}.web.app", + f"https://{project_id}.firebaseapp.com", + ] + + CSRF_TRUSTED_ORIGINS = [CLOUDRUN_SERVICE_URL, local_host] + firebase_hosts + SECURE_SSL_REDIRECT = True + SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") +else: + ALLOWED_HOSTS = ["*"] + CSRF_TRUSTED_ORIGINS = [local_host, cloudshell_host] + +CORS_ORIGIN_ALLOW_ALL = True + + +WSGI_APPLICATION = "avocano_api.wsgi.application" + + +# Database +# https://docs.djangoproject.com/en/stable/ref/settings/#databases + +# Use django-environ to parse the connection string +DATABASES = {"default": env.db()} + +# If the flag as been set, configure to use proxy +if env("USE_CLOUD_SQL_AUTH_PROXY", default=None): + DATABASES["default"]["HOST"] = "127.0.0.1" + DATABASES["default"]["PORT"] = 5432 + + +# Password validation +# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + + +# Internationalization + +LANGUAGE_CODE = "en-us" +TIME_ZONE = "UTC" +USE_I18N = True +USE_TZ = True + +# Default primary key field type +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" + +# Django REST Framework +REST_FRAMEWORK = { + # Any exposed endpoints can be accessed by any client that has access to the API itself. + "DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.AllowAny"], + # For automatic OpenAPI schema. + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", +} + + +# Static files (CSS, JavaScript, Images) +STATIC_URL = "/static/" +MEDIA_URL = "/media/" + +# Use Cloud Storage if configured, otherwise use local storage. +if GS_BUCKET_NAME := env("GS_BUCKET_NAME", default=None): + GS_DEFAULT_ACL = "publicRead" + DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" + STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +else: + DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage" + STATIC_ROOT = os.path.join(BASE_DIR, STATIC_URL.replace("/", "")) + MEDIA_ROOT = os.path.join(BASE_DIR, MEDIA_URL.replace("/", "")) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/urls.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/urls.py new file mode 100644 index 0000000..8071984 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/urls.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.conf import settings +from django.contrib import admin +from django.urls import include, path, re_path +from django.views.static import serve + +from avocano_api.views import index + +urlpatterns = [ + path("", index, name="index"), + path("api/", include("store.urls")), + path("admin/", admin.site.urls), +] + + +if settings.DEBUG: + urlpatterns += [ + re_path( + r"^media/(?P.*)$", + serve, + {"document_root": settings.MEDIA_ROOT, "show_indexes": True}, + ) + ] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/views.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/views.py new file mode 100644 index 0000000..62ff585 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/views.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.http import HttpResponse + + +def index(request): + return HttpResponse( + """ + + +

✨🥑✨

+ + + """ + ) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/wsgi.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/wsgi.py new file mode 100644 index 0000000..b087f6d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/avocano_api/wsgi.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "avocano_api.settings") + +application = get_wsgi_application() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/manage.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/manage.py new file mode 100755 index 0000000..a2a39b9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/manage.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "avocano_api.settings") + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/requirements.txt b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/requirements.txt new file mode 100644 index 0000000..dee8d0f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/requirements.txt @@ -0,0 +1,32 @@ +django + +djangorestframework +django-filter +django-colorfield +django-cors-headers + +drf-spectacular + +django-environ +django-storages[google] + +psycopg2-binary + +gunicorn + +google-api-python-client +google-auth + +pyyaml +model_bakery +Faker +httpx + +opentelemetry-api +opentelemetry-sdk +opentelemetry-distro +opentelemetry-exporter-gcp-trace +opentelemetry-instrumentation +opentelemetry-resourcedetector-gcp +opentelemetry-semantic-conventions +opentelemetry-instrumentation-django diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/scripts/prime_database.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/scripts/prime_database.sh new file mode 100644 index 0000000..3f1b47c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/scripts/prime_database.sh @@ -0,0 +1,61 @@ +#!/bin/bash -eu +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script should be run first time the server is deployed to prime the database. + +# Run migrations and static. +python3 manage.py migrate +python3 manage.py collectstatic --noinput --clear + +# Load configurations +python3 manage.py loaddata demo_config.yaml + +# Create products through management commands. +ls store/fixtures/media + +python3 manage.py create_new_product \ + --name "Pineapple Bee" \ + --image "store/fixtures/media/pineapple-bee.png" \ + --description "This lil guy is buzzing with excitement, ready to lead the next disco samba!" \ + --price "25.00" \ + --discount 17 \ + --inventory_count 27 + +python3 manage.py create_new_product \ + --name "Wooden Tiger" \ + --image "store/fixtures/media/log-tiger.png" \ + --description "Hand-carved from oak, this king of the jungle will bring joy to children young and old." \ + --price "7.49" \ + --inventory_count 4 + +python3 manage.py create_new_product \ + --name "Star Unicorn" \ + --image "store/fixtures/media/unicorn-star.png" \ + --description "This inflatable unicorn will bring delight to your next family gathering." \ + --price "12.49" \ + --inventory_count 71 + +# Last added entry is the active product +python3 manage.py create_new_product \ + --name "Sparkly Avocado" \ + --image "store/fixtures/media/avocado-star.png" \ + --description "Never before has an avocado been as sparkly. Sure to be a star ingredient in your next salad." \ + --price "2.99" \ + --discount "14" \ + --inventory_count 42 + +# Generate some random testimonials +python3 manage.py generate_testimonials \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/__init__.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/admin.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/admin.py new file mode 100644 index 0000000..8901a51 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/admin.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.contrib import admin +from django.utils.html import format_html + +from store.models import Product, SiteConfig, Testimonial, Transaction + + +@admin.register(Product) +class ProductAdmin(admin.ModelAdmin): + list_display = ( + "name", + "description", + "price", + "discount", + "inventory_count", + "active", + ) + + # Display preview of image in admin + def image_tag(self, obj): + return format_html(''.format(obj.image.url)) + + image_tag.short_description = "Product Image Preview" + readonly_fields = ["image_tag"] + + # Formatted discount display for admin list + def discount(self, obj): + return f"{obj.discount_percent}%" + + +@admin.register(Transaction) +class TransactionAdmin(admin.ModelAdmin): + list_display = ("datetime", "product_id") + + +@admin.register(Testimonial) +class TransactionAdmin(admin.ModelAdmin): + list_display = ( + "product_id", + "reviewer_name", + "reviewer_location", + "rating", + "summary", + ) + + +@admin.register(SiteConfig) +class SiteConfigAdmin(admin.ModelAdmin): + list_display = ("site_name", "active") + fieldsets = ( + (None, {"fields": ("active", "base_font")}), + ("Site Header", {"fields": ("site_name", "site_name_color", "site_name_font")}), + ( + "Colors", + { + "fields": ( + "color_primary", + "color_secondary", + "color_action", + "color_action_text", + ) + }, + ), + ) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/apps.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/apps.py new file mode 100644 index 0000000..bde3fc4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/apps.py @@ -0,0 +1,23 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.apps import AppConfig + + +class StoreConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "store" diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/demo_config.yaml b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/demo_config.yaml new file mode 100644 index 0000000..a193b34 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/demo_config.yaml @@ -0,0 +1,26 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- model: store.siteconfig + pk: 1 + fields: + active: true + site_name: Avocano + site_name_color: '#767E46' + site_name_font: Indie Flower + color_primary: '#B2B43F' + color_secondary: '#865B53' + color_action: '#FFD64F' + color_action_text: '#000000' + base_font: Merriweather diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/avocado-star.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/avocado-star.png new file mode 100644 index 0000000..5b9ae47 Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/avocado-star.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/log-tiger.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/log-tiger.png new file mode 100644 index 0000000..fa1e5ef Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/log-tiger.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/pineapple-bee.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/pineapple-bee.png new file mode 100644 index 0000000..8b183e3 Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/pineapple-bee.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/unicorn-star.png b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/unicorn-star.png new file mode 100644 index 0000000..3b545ba Binary files /dev/null and b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/fixtures/media/unicorn-star.png differ diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_new_product.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_new_product.py new file mode 100644 index 0000000..442f3e1 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_new_product.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pathlib +from django.core.management.base import BaseCommand, CommandParser + +from store.models import Product + + +class Command(BaseCommand): + help = "Creates new active product, deactivating existing active product" + + def add_arguments(self, parser: CommandParser) -> None: + + parser.add_argument("--name", default="Name", type=str) + parser.add_argument("--description", default="Description", type=str) + parser.add_argument("--price", default="0", type=float) + parser.add_argument("--discount_percent", default="0", type=int) + parser.add_argument("--inventory_count", default="0", type=int) + parser.add_argument("--image", type=str) + + def handle(self, *args, **options): + # Deacivate any existing active products + Product.objects.filter(active=True).update(active=False) + + product = Product.objects.create( + name=options["name"], + description=options["description"], + price=options["price"], + active=True, + discount_percent=options["discount_percent"], + inventory_count=options["inventory_count"], + ) + + if options["image"]: + image = open(options["image"], "rb") + file_ext = pathlib.Path(options["image"]).suffix + product.image.save(str(product.id) + "_image" + file_ext, image) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_site_config.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_site_config.py new file mode 100644 index 0000000..3f543ca --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/create_site_config.py @@ -0,0 +1,58 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.core.management.base import BaseCommand, CommandParser + +from store.models import SiteConfig + + +class Command(BaseCommand): + help = "Create new active site config" + + def add_arguments(self, parser: CommandParser) -> None: + parser.add_argument("--color-primary", type=str) + parser.add_argument("--color-secondary", type=str) + parser.add_argument("--color-action", type=str) + parser.add_argument("--color-action-text", type=str) + parser.add_argument("--site-name", type=str) + parser.add_argument("--site-name-color", type=str) + parser.add_argument("--site-name-font", type=str) + parser.add_argument("--base-font", type=str) + + def handle(self, *args, **options): + + # Deacivate any existing active site configs + SiteConfig.objects.filter(active=True).update(active=False) + + product = SiteConfig.objects.create( + active=True, + site_name=options["site_name"], + color_primary=options["color_primary"] + or SiteConfig._meta.get_field("color_primary").get_default(), + color_secondary=options["color_secondary"] + or SiteConfig._meta.get_field("color_secondary").get_default(), + color_action=options["color_action"] + or SiteConfig._meta.get_field("color_action").get_default(), + color_action_text=options["color_action_text"] + or SiteConfig._meta.get_field("color_action_text").get_default(), + site_name_color=options["site_name_color"] + or SiteConfig._meta.get_field("site_name_color").get_default(), + site_name_font=options["site_name_font"] + or SiteConfig._meta.get_field("site_name_font").get_default(), + base_font=options["base_font"] + or SiteConfig._meta.get_field("base_font").get_default(), + ) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/generate_testimonials.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/generate_testimonials.py new file mode 100644 index 0000000..4ce67d7 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/generate_testimonials.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from random import randint + +from django.core.management.base import BaseCommand, CommandParser +from faker import Faker +from store.models import Product, Testimonial + + +class Command(BaseCommand): + help = "Generates testimonials for products" + + def add_arguments(self, parser: CommandParser) -> None: + parser.add_argument("--product", type=int) + parser.add_argument("--count", type=int) + + def handle(self, *args, **options): + count = options["count"] or 5 + if options["product"]: + products = Product.objects.filter(pk=options["product"]) + else: + products = Product.objects.all() # Populate all products if not specified. + + fake = Faker(["en_AU", "fr_FR", "pt_PT"]) + + for p in products: + for _ in range(count): + + t = Testimonial( + product_id=p, + reviewer_name=fake.first_name(), + reviewer_location=f"{fake.city()}, {fake.country()}", + rating=randint(1, 5), + summary=" ".join(fake.words(3)) + "!", + description=fake.paragraph(nb_sentences=3), + ) + t.save() + + print(f"Generated {count} testimonals across {len(products)} products.") diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/update_inventory_count.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/update_inventory_count.py new file mode 100644 index 0000000..cc00f7c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/management/commands/update_inventory_count.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.core.management.base import BaseCommand, CommandParser + +from store.models import Product + + +class Command(BaseCommand): + help = "Updates the inventory count for the active product. " + + def add_arguments(self, parser: CommandParser) -> None: + parser.add_argument("--add", type=int) + + def handle(self, *args, **options): + add = options["add"] or 10 + product = Product.objects.filter(active=True).last() + product.inventory_count += add + product.save() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0001_create_superuser.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0001_create_superuser.py new file mode 100644 index 0000000..d2eb7c7 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0001_create_superuser.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +from django.contrib.auth.models import User +from django.db import migrations + + +def createsuperuser(apps, schema_editor): + admin_password = os.environ["ADMIN_PASSWORD"] + User.objects.create_superuser("admin", password=admin_password) + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [migrations.RunPython(createsuperuser)] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0002_initial.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0002_initial.py new file mode 100644 index 0000000..000f9d0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0002_initial.py @@ -0,0 +1,185 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import colorfield.fields +import django.core.validators +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("store", "0001_create_superuser"), + ] + + operations = [ + migrations.CreateModel( + name="Product", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=64)), + ("image", models.ImageField(blank=True, null=True, upload_to="photos")), + ("description", models.CharField(max_length=1000)), + ("price", models.DecimalField(decimal_places=2, max_digits=10)), + ("active", models.BooleanField()), + ("discount_percent", models.IntegerField()), + ("inventory_count", models.IntegerField()), + ], + ), + migrations.CreateModel( + name="Transaction", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("datetime", models.DateTimeField()), + ("unit_price", models.DecimalField(decimal_places=2, max_digits=10)), + ( + "product_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="store.product" + ), + ), + ], + ), + migrations.CreateModel( + name="Testimonial", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("reviewer_name", models.CharField(max_length=64)), + ( + "rating", + models.IntegerField( + default=5, + validators=[ + django.core.validators.MinValueValidator(1), + django.core.validators.MaxValueValidator(5), + ], + ), + ), + ("summary", models.CharField(max_length=1000)), + ("description", models.CharField(max_length=5000)), + ( + "product_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="store.product" + ), + ), + ("reviewer_location", models.CharField(default="asdf", max_length=100)), + ], + ), + migrations.CreateModel( + name="SiteConfig", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "color_primary", + colorfield.fields.ColorField( + default="#C200C2", + help_text="For the site banner gradient", + image_field=None, + max_length=18, + samples=None, + ), + ), + ( + "color_secondary", + colorfield.fields.ColorField( + default="#BE0000", + help_text="For headings", + image_field=None, + max_length=18, + samples=None, + ), + ), + ("site_name", models.CharField(default="Simulatum", max_length=200)), + ( + "site_name_font", + models.CharField( + default="Pacifico", + help_text="Any valid Google Font name. Dynamically loaded at runtime.", + max_length=100, + ), + ), + ( + "base_font", + models.CharField( + default="Tahoma", + help_text="Any valid Google Font name. Dynamically loaded at runtime.", + max_length=100, + ), + ), + ("active", models.BooleanField(default=True)), + ( + "color_action", + colorfield.fields.ColorField( + default="#00AFAF", + help_text="Fill for buttons", + image_field=None, + max_length=18, + samples=None, + ), + ), + ( + "site_name_color", + colorfield.fields.ColorField( + default="#0D8645", image_field=None, max_length=18, samples=None + ), + ), + ( + "color_action_text", + colorfield.fields.ColorField( + default="#000000", + help_text="Text for buttons", + image_field=None, + max_length=18, + samples=None, + ), + ), + ], + ), + ] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0003_alter_testimonial_reviewer_location.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0003_alter_testimonial_reviewer_location.py new file mode 100644 index 0000000..3935d77 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0003_alter_testimonial_reviewer_location.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.3 on 2022-11-14 02:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("store", "0002_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="testimonial", + name="reviewer_location", + field=models.CharField(max_length=100), + ), + ] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0004_alter_siteconfig_base_font_and_more.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0004_alter_siteconfig_base_font_and_more.py new file mode 100644 index 0000000..a6e373e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/0004_alter_siteconfig_base_font_and_more.py @@ -0,0 +1,31 @@ +# Generated by Django 4.1.1 on 2022-11-20 22:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("store", "0003_alter_testimonial_reviewer_location"), + ] + + operations = [ + migrations.AlterField( + model_name="siteconfig", + name="base_font", + field=models.CharField( + default="Tahoma", + help_text="Any valid Google Font name. Dynamically loaded at runtime.", + max_length=100, + ), + ), + migrations.AlterField( + model_name="siteconfig", + name="site_name_font", + field=models.CharField( + default="Pacifico", + help_text="Any valid Google Font name. Dynamically loaded at runtime.", + max_length=100, + ), + ), + ] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/__init__.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/models.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/models.py new file mode 100644 index 0000000..ebcc932 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/models.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from decimal import Decimal + +from colorfield.fields import ColorField +from django.core.validators import MaxValueValidator, MinValueValidator +from django.db import models + + +class Product(models.Model): + name = models.CharField(max_length=64) + image = models.ImageField(upload_to="photos", blank=True, null=True) + description = models.CharField(max_length=1000) + price = models.DecimalField(decimal_places=2, max_digits=10) + active = models.BooleanField() + discount_percent = models.IntegerField() + inventory_count = models.IntegerField() + + @property + def discount_saving(self): + return Decimal(round(float(self.price) * (self.discount_percent / 100), 2)) + + @property + def discount_price(self): + return "{0:.2f}".format(self.price - self.discount_saving) + + def __str__(self): + return self.name + + ## If product is active, set all other products as inactive + def save(self, *args, **kwargs): + if self.active: + qs = type(self).objects.filter(active=True) + if self.pk: + qs = qs.exclude(pk=self.pk) + qs.update(active=False) + + super(Product, self).save(*args, **kwargs) + + +class Testimonial(models.Model): + product_id = models.ForeignKey(Product, on_delete=models.CASCADE) + reviewer_name = models.CharField(max_length=64) + reviewer_location = models.CharField(max_length=100) + rating = models.IntegerField( + default=5, validators=[MinValueValidator(1), MaxValueValidator(5)] + ) + summary = models.CharField(max_length=1000) + description = models.CharField(max_length=5000) + + def __str__(self): + return f"{self.rating} star review on {self.product_id.name} from {self.reviewer_name}" + + +class Transaction(models.Model): + datetime = models.DateTimeField() + product_id = models.ForeignKey(Product, on_delete=models.CASCADE) + unit_price = models.DecimalField(decimal_places=2, max_digits=10) + + def __str__(self): + return f"{self.datetime} - {self.product_id}" + + +def google_font_help(): + return "Any valid Google Font name. Dynamically loaded at runtime." + + +class SiteConfig(models.Model): + active = models.BooleanField(default=True) + color_primary = ColorField( + default="#C200C2", help_text="For the site banner gradient" + ) + color_secondary = ColorField(default="#BE0000", help_text="For headings") + color_action = ColorField(default="#00AFAF", help_text="Fill for buttons") + color_action_text = ColorField(default="#000000", help_text="Text for buttons") + site_name = models.CharField(max_length=200, default="Simulatum") + site_name_color = ColorField(default="#0D8645") + site_name_font = models.CharField( + max_length=100, default="Pacifico", help_text=google_font_help() + ) + base_font = models.CharField( + max_length=100, default="Tahoma", help_text=google_font_help() + ) + + def __str__(self): + return f"{self.site_name} configuration" + + ## Only allow one active SiteConfig + def save(self, *args, **kwargs): + if self.active: + qs = type(self).objects.filter(active=True) + if self.pk: + qs = qs.exclude(pk=self.pk) + qs.update(active=False) + + super(SiteConfig, self).save(*args, **kwargs) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/serializers.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/serializers.py new file mode 100644 index 0000000..ec5a39a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/serializers.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from rest_framework import serializers, status +from rest_framework.exceptions import ValidationError, APIException +from django.http import JsonResponse +from store.models import Product, SiteConfig, Testimonial + + +class ProductSerializer(serializers.ModelSerializer): + class Meta: + model = Product + fields = [ + "id", + "name", + "description", + "price", + "discount_price", + "active", + "discount_percent", + "discount_saving", + "inventory_count", + "image", + ] + + +class TestimonialSerializer(serializers.ModelSerializer): + class Meta: + model = Testimonial + fields = [ + "id", + "product_id", + "reviewer_name", + "reviewer_location", + "rating", + "summary", + "description", + ] + + +class SiteConfigSerializer(serializers.ModelSerializer): + class Meta: + model = SiteConfig + fields = [ + "active", + "color_primary", + "color_secondary", + "color_action", + "color_action_text", + "site_name", + "site_name_font", + "site_name_color", + "base_font", + ] + + +class CartPaymentSerializer(serializers.Serializer): + method = serializers.ChoiceField(choices=["collect"]) + + +class CartCustomerSerializer(serializers.Serializer): + email = serializers.EmailField() + + +class CartItemSerializer(serializers.Serializer): + id = serializers.IntegerField() + countRequested = serializers.IntegerField(required=True) + countFulfilled = serializers.IntegerField(required=False) + + def validate(self, data): + try: + product = Product.objects.get(pk=data["id"]) + except Product.DoesNotExist: + raise serializers.ValidationError(detail={"status": "product_not_found"}) + + requested = data["countRequested"] + if product.inventory_count < requested: + data["countFulfilled"] = product.inventory_count + raise serializers.ValidationError( + detail={"status": "insufficient_product", "items": data} + ) + else: + data["countFulfilled"] = requested + return data + + +class CartSerializer(serializers.Serializer): + customer = CartCustomerSerializer(required=True) + payment = CartPaymentSerializer(required=True) + items = CartItemSerializer(many=True) + + +class CheckoutSerializer(serializers.Serializer): + items = CartItemSerializer(many=True) + status = serializers.CharField() diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/tests.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/tests.py new file mode 100644 index 0000000..1c70b5d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/tests.py @@ -0,0 +1,171 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import json +from decimal import Decimal + +from django.contrib.auth.models import User +from django.test import TransactionTestCase +from model_bakery import baker +from rest_framework.reverse import reverse +from rest_framework.test import APIClient, APIRequestFactory +from store.serializers import ProductSerializer, CartSerializer +from store.models import Product + +client = APIClient() +factory = APIRequestFactory() + + +class DecimalEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, Decimal): + return float(obj) + return json.JSONEncoder.default(self, obj) + + +def create_product(obj): + payload = ProductSerializer(obj).data + user = User.objects.create_superuser(username="test", password="test") + client.force_login(user) + + response = client.post( + reverse("product-list"), + json.dumps(payload, cls=DecimalEncoder), + content_type="application/json", + ) + return response + + +class AvocanoUnitTest(TransactionTestCase): + def test_basic_post(self): + response = create_product(baker.prepare("store.Product")) + + self.assertEqual(response.status_code, 201) + + +class CartSerializerErrorsTest(TransactionTestCase): + def test_bad_email(self): + cart = CartSerializer(data={"customer": {"email": "foo"}}) + assert not cart.is_valid() + assert "customer" in set(cart.errors) + + def test_bad_payment(self): + cart = CartSerializer(data={"payment": {"method": "foo"}}) + assert not cart.is_valid() + assert "payment" in set(cart.errors) + assert "method" in set(cart.errors["payment"]) + + def test_bad_credit(self): + cart = CartSerializer(data={"payment": {"method": "credit"}}) + assert not cart.is_valid() + + assert "payment" in set(cart.errors) + assert "method" in set(cart.errors["payment"]) + + +class CartRequestTest(TransactionTestCase): + + def setUp(self): + Product.objects.create( + id=1, + name="test", + discount_percent=0, + inventory_count=4, + price=1, + active=False, + ) + + def test_cart_product(self): + data = { + "payment": {"method": "collect"}, + "customer": {"email": "foo@bar.com"}, + "items": [{"id": 1, "countRequested": 1}], + } + cart = CartSerializer(data=data) + assert cart.is_valid() + assert len(cart.errors) == 0 + + response = client.post( + reverse("checkout"), + json.dumps(data), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 200) + + def test_cart_invalid_payment(self): + data = { + "payment": {"method": "credit"}, + "customer": {"email": "foo@bar.com"}, + "items": [{"id": 1, "countRequested": 1}], + } + + response = client.post( + reverse("checkout"), + json.dumps(data), + content_type="application/json", + ) + self.assertEqual(response.status_code, 501) + self.assertEqual(response.json()["status"], "invalid_choice") + + + def test_cart_invalid_email(self): + data = { + "payment": {"method": "collect"}, + "customer": {"email": "foo"}, + "items": [{"id": 1, "countRequested": 1}], + } + + response = client.post( + reverse("checkout"), + json.dumps(data), + content_type="application/json", + ) + self.assertEqual(response.status_code, 400) + self.assertEqual(response.json()["status"], "validation_error") + + + def test_cart_insufficient_inventory(self): + data = { + "payment": {"method": "collect"}, + "customer": {"email": "foo@bar.com"}, + "items": [{"id": 1, "countRequested": 100}], + } + + response = client.post( + reverse("checkout"), + json.dumps(data), + content_type="application/json", + ) + self.assertEqual(response.status_code, 400) + self.assertEqual(response.json()["status"], "insufficient_product") + + + def test_cart_invalid_inventory(self): + data = { + "payment": {"method": "collect"}, + "customer": {"email": "foo@bar.com"}, + "items": [{"id": 111111, "countRequested": 1}], + } + + response = client.post( + reverse("checkout"), + json.dumps(data), + content_type="application/json", + ) + self.assertEqual(response.status_code, 400) + self.assertEqual(response.json()["status"], "product_not_found") \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/urls.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/urls.py new file mode 100644 index 0000000..349dc90 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/urls.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from django.urls import include, path +from . import views +from rest_framework.routers import DefaultRouter + +from store import views + +router = DefaultRouter() + +router.get_api_root_view().cls.__name__ = "Avocano Server" +router.get_api_root_view().cls.__doc__ = ( + "This is the Django REST Framework API, serving all endpoints." +) + +router.register(r"products", views.ProductViewSet, basename="product") +router.register( + r"active/product", views.ActiveProductViewSet, basename="active_product" +) +router.register(r"testimonials", views.TestimonialViewSet, basename="testimonial") +router.register(r"site_config", views.SiteConfigViewSet, basename="site_config") +router.register( + r"active/site_config", views.ActiveSiteConfigViewSet, basename="active_siteconfig" +) + +urlpatterns = [ + path("", include(router.urls)), + path("checkout", views.checkout, name="checkout"), + path("csrf_token", views.csrf_token, name="csrf_token"), + path("api-auth/", include("rest_framework.urls")), +] diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/views.py b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/views.py new file mode 100644 index 0000000..c4f0459 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/server/store/views.py @@ -0,0 +1,154 @@ +#!/usr/bin/python +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import json + +from django.http import JsonResponse +from django.shortcuts import get_object_or_404 +from django.utils import timezone +from django.views.decorators.csrf import ensure_csrf_cookie, csrf_exempt +from django.middleware.csrf import get_token +from django.views.decorators.http import require_http_methods +from django_filters.rest_framework import DjangoFilterBackend +from drf_spectacular.utils import extend_schema +from rest_framework import status, viewsets +from rest_framework.decorators import action +from rest_framework.exceptions import APIException +from rest_framework.response import Response +from store.models import Product, SiteConfig, Testimonial, Transaction +from store.serializers import ( + ProductSerializer, + SiteConfigSerializer, + TestimonialSerializer, + CartSerializer, + CheckoutSerializer, +) + + +class ProductPurchaseException(APIException): + status_code = 405 + default_detail = { + "code": status_code, + "message": "Unable to complete purchase - no inventory", + } + + +class ProductViewSet(viewsets.ModelViewSet): + queryset = Product.objects.all() + serializer_class = ProductSerializer + + class ProductPurchaseException(APIException): + status_code = 405 + default_detail = { + "code": status_code, + "message": "Unable to complete purchase - no inventory", + } + + @action(detail=True, methods=["get", "post"]) + def purchase(self, request, pk): + product = get_object_or_404(Product, id=pk) + if product.inventory_count > 0: + product.inventory_count -= 1 + product.save() + Transaction.objects.create( + datetime=timezone.now(), product_id=product, unit_price=product.price + ) + else: + raise ProductPurchaseException() + + serializer = ProductSerializer(product) + return Response(serializer.data) + + +class ActiveProductViewSet(viewsets.ViewSet): + @extend_schema(request=None, responses=ProductSerializer) + def list(self, request, formatting=None): + active_product = Product.objects.get(active=True) + serializer = ProductSerializer(active_product, context={"request": request}) + return Response(serializer.data) + + +class TestimonialViewSet(viewsets.ModelViewSet): + queryset = Testimonial.objects.order_by("-rating").all() + serializer_class = TestimonialSerializer + filter_backends = [DjangoFilterBackend] + filterset_fields = ["product_id"] + + +class SiteConfigViewSet(viewsets.ModelViewSet): + queryset = SiteConfig.objects.all() + serializer_class = SiteConfigSerializer + + +class ActiveSiteConfigViewSet(viewsets.ViewSet): + @extend_schema(responses=SiteConfigSerializer) + def list(self, request, formatting=None): + active = SiteConfig.objects.get(active=True) + serializer = SiteConfigSerializer(active) + return Response(serializer.data) + + +@ensure_csrf_cookie +@require_http_methods(["POST"]) +def checkout(request): + def lift_item_status(data): + status = "" + for item in data["items"]: + if "status" in item: + for i in item["status"]: + status = str(i) + + return status + + serializer = CartSerializer(data=json.loads(request.body)) + + if not serializer.is_valid(): + status_code = 400 + status = "validation_error" + if "payment" in serializer.errors: + status_code = 501 + status = serializer.errors["payment"]["method"][0].code + if "items" in serializer.errors: + status = lift_item_status(serializer.errors) + return JsonResponse( + {"status": status, "errors": serializer.errors}, status=status_code + ) + + cart = serializer.validated_data + + items = [] + for item in cart["items"]: + product = get_object_or_404(Product, id=item["id"]) + count = item["countRequested"] + + product.inventory_count -= count + product.save() + for _ in range(count): + Transaction.objects.create( + datetime=timezone.now(), product_id=product, unit_price=product.price + ) + items.append( + {"id": product.id, "countRequested": count, "countFulfilled": count} + ) + + response = CheckoutSerializer(data={"status": "complete", "items": items}) + response.is_valid() + return JsonResponse(response.data) + + +def csrf_token(request): + return JsonResponse({"csrfToken": get_token(request)}) diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/avocano/setup.sh b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/setup.sh new file mode 100755 index 0000000..7f5f989 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/avocano/setup.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## This script automates some basic setup for new projects, +## then runs Cloud Build, Terraform, and initial deployment. +## +## For updates, just run `gcloud builds submit` + +# Make sure the script stops if any command fails +set -e + +# Some commands are noisy, so make them quiet. +function quiet { + $* >/dev/null 2>&1 +} + +function deploy { + echo "Configuring active project and region..." + export PROJECT_ID=${PROJECT_ID:=$(gcloud config get project)} + export REGION=${REGION:=us-central1} # default us-central1 region if not defined + export PROJECTNUM=$(gcloud projects describe ${PROJECT_ID} --format='value(projectNumber)') + + echo "Enabling required service APIs..." + gcloud services enable \ + firebase.googleapis.com \ + cloudresourcemanager.googleapis.com \ + cloudbuild.googleapis.com \ + iam.googleapis.com \ + --project=$PROJECT_ID + + echo "Running setup.sh against ${PROJECT_ID} in ${REGION}" + + echo "Setup Firebase Builder" + gcloud builds submit --config provisioning/firebase-builder.cloudbuild.yaml --no-source + + echo "Build client image" + gcloud builds submit --config provisioning/client-image.cloudbuild.yaml + + echo "Build load test image" + gcloud builds submit --config provisioning/loadtest.cloudbuild.yaml + + echo "Configuring Terraform" + export TFSTATE_BUCKET=terraform-${PROJECT_ID}-avocano + gsutil mb gs://$TFSTATE_BUCKET || true + + echo "Granting Cloud Build permissions" + export CLOUDBUILD_SA="$(gcloud projects describe $PROJECT_ID \ + --format 'value(projectNumber)')@cloudbuild.gserviceaccount.com" + quiet gcloud projects add-iam-policy-binding $PROJECT_ID \ + --member serviceAccount:$CLOUDBUILD_SA --role roles/owner + quiet gsutil iam ch \ + serviceAccount:${CLOUDBUILD_SA}:roles/storage.admin \ + gs://$TFSTATE_BUCKET + + echo "Running Cloud Build for the Application" + gcloud builds submit --config provisioning/deploy.cloudbuild.yaml --substitutions _REGION=${REGION} + + echo "Setting up database" + gcloud beta run jobs execute setup --wait --region $REGION + + echo "Runing UI tests" + gcloud builds submit --config provisioning/test-deployment.yaml --substitutions _REGION="${REGION}" + + echo "Website now available at https://${PROJECT_ID}.firebaseapp.com" +} + +function destroy { + echo "Configuring active project and region..." + export PROJECT_ID=${PROJECT_ID:=$(gcloud config get project)} + export REGION=${REGION:=us-central1} # default us-central1 region if not defined + export PROJECTNUM=$(gcloud projects describe ${PROJECT_ID} --format='value(projectNumber)') + + echo "Terminating any running loadtest jobs from us-east1" + gcloud beta run jobs executions list \ + --region us-east1 \ + --job loadtest \ + --format json | jq -r '.[] | select(.status.completionTime | . == null) | objects | .metadata.name' | + xargs -I {} gcloud beta run jobs executions delete --region us-east1 "{}" --quiet + + echo "Configuring Terraform" + export TFSTATE_BUCKET=terraform-${PROJECT_ID}-avocano + gsutil mb gs://$TFSTATE_BUCKET || true + + echo "Granting Cloud Build permissions" + export CLOUDBUILD_SA="$(gcloud projects describe $PROJECT_ID --format 'value(projectNumber)')@cloudbuild.gserviceaccount.com" + gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$CLOUDBUILD_SA --role roles/owner + gsutil iam ch serviceAccount:${CLOUDBUILD_SA}:roles/storage.admin gs://$TFSTATE_BUCKET + + echo "Destroying TF resources against ${PROJECT_ID} in ${REGION}" + gcloud builds submit --config provisioning/destroy.cloudbuild.yaml --substitutions _REGION=${REGION} +} + +function usage() { + echo "Usage: ./setup.sh [deploy|destroy]" + exit 1 +} + +[[ $# -eq 0 ]] && usage + +# Invoke is_file_exits +if [ "$1" = "deploy" ]; then + deploy +elif [ "$1" = "destroy" ]; then + destroy +else + usage +fi diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/main.tf b/modules/gcp_infrastructure/service_modules/cloud_run/main.tf new file mode 100644 index 0000000..2c6124b --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/main.tf @@ -0,0 +1,68 @@ +data "google_iam_policy" "noauth" { + binding { + role = "roles/run.invoker" + members = [ + "allUsers", + ] + } +} + +resource "google_cloud_run_service_iam_policy" "noauth" { + location = google_cloud_run_service.fake_service_client.location + project = google_cloud_run_service.fake_service_client.project + service = google_cloud_run_service.fake_service_client.name + + policy_data = data.google_iam_policy.noauth.policy_data +} + + +resource "google_cloud_run_service" "fake_service_client" { + name = format(var.name_format, "test-cloudrun-srv") + project = var.project_id + location = var.region + + template { + spec { + containers { + image = "nicholasjackson/fake-service:v0.25.1" + ports { + container_port = 9090 + } + env { + name = "NAME" + value = "client" + } + env { + name = "MESSAGE" + value = "Hello world from server!" + } + env { + name = "TIMING_90_PERCENTILE" + value = "10s" + } + env { + name = "ERROR_RATE" + value = "0.25" + } + } + } + } + traffic { + percent = 100 + latest_revision = true + } +} + +resource "null_resource" "execute_loadtest" { + provisioner "local-exec" { + interpreter = ["bash", "-exc"] + command = "ab -n 5000 -c 10 ${google_cloud_run_service.fake_service_client.status[0].url}/" + } + triggers = { + always_run = var.always_run_load_tests ? timestamp() : false + } + + depends_on = [ + google_cloud_run_service.fake_service_client + ] +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/outputs.tf b/modules/gcp_infrastructure/service_modules/cloud_run/outputs.tf new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/outputs.tf @@ -0,0 +1 @@ + diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/variables.tf b/modules/gcp_infrastructure/service_modules/cloud_run/variables.tf new file mode 100644 index 0000000..ab76097 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/variables.tf @@ -0,0 +1,20 @@ +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +variable "region" { + type = string + description = "GCP region to deploy sample env" +} + +variable "name_format" { + type = string + description = "Format string to use for infra names." +} + +variable "always_run_load_tests" { + type = bool + description = "Configures whether to run a load test in every deploy of this resource" + default = false +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_run/versions.tf b/modules/gcp_infrastructure/service_modules/cloud_run/versions.tf new file mode 100644 index 0000000..99c5463 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_run/versions.tf @@ -0,0 +1,20 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + archive = { + source = "hashicorp/archive" + version = ">=2.3.0" + } + null = { + source = "hashicorp/null" + version = ">=3.2.1" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/cloud_scheduler/main.tf b/modules/gcp_infrastructure/service_modules/cloud_scheduler/main.tf new file mode 100644 index 0000000..a8fd6d8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_scheduler/main.tf @@ -0,0 +1,48 @@ +# create a cloud scheduler to call function on regular interval +resource "google_cloud_scheduler_job" "i" { + region = var.region + project = var.project_id + name = format(var.name_format, "job") + description = "Triggers a Cloud Function" + schedule = var.schedule + + http_target { + http_method = "POST" + uri = var.cloud_function_uri + body = var.body + headers = { + "Content-Type" = "application/json" + } + + oidc_token { + service_account_email = google_service_account.cloud_scheduler.email + } + } +} + +# create a service account for cloud scheduler +resource "google_service_account" "cloud_scheduler" { + project = var.project_id + account_id = format(var.name_format, "sched") + description = "Allows the Cloud Scheduler job to trigger a Cloud Function" +} + +# add service account to role +resource "google_cloudfunctions_function_iam_member" "invoker" { + project = var.project_id + region = var.region + cloud_function = var.cloud_function_name + + role = "roles/cloudfunctions.invoker" + member = "serviceAccount:${google_service_account.cloud_scheduler.email}" + + lifecycle { + replace_triggered_by = [ + null_resource.trigger + ] + } +} + +resource "null_resource" "trigger" { + triggers = { "dahash" = var.md5hash } +} diff --git a/modules/gcp_infrastructure/service_modules/cloud_scheduler/outputs.tf b/modules/gcp_infrastructure/service_modules/cloud_scheduler/outputs.tf new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_scheduler/outputs.tf @@ -0,0 +1 @@ + diff --git a/modules/gcp_infrastructure/service_modules/cloud_scheduler/variables.tf b/modules/gcp_infrastructure/service_modules/cloud_scheduler/variables.tf new file mode 100644 index 0000000..e5e2bf0 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_scheduler/variables.tf @@ -0,0 +1,42 @@ +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +variable "region" { + type = string + description = "GCP region to deploy sample env" +} + +variable "name_format" { + type = string + description = "Format string to use for infra names." +} + +variable "schedule" { + type = string + description = "Cron job string" + default = "*/2 * * * *" +} + +variable "cloud_function_uri" { + type = string + description = "Function uri" +} + +variable "cloud_function_name" { + type = string + description = "Function name" +} + +variable "body" { + type = string + description = "base64encode(jsonencode({ \"method\" : \"write\" })" +} + +variable "md5hash" { + type = string + description = "triggers lifecycle" +} + + diff --git a/modules/gcp_infrastructure/service_modules/cloud_scheduler/versions.tf b/modules/gcp_infrastructure/service_modules/cloud_scheduler/versions.tf new file mode 100644 index 0000000..ff6e62d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloud_scheduler/versions.tf @@ -0,0 +1,16 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + null = { + source = "hashicorp/null" + version = ">= 3.2.1" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/cloudsql/main.tf b/modules/gcp_infrastructure/service_modules/cloudsql/main.tf new file mode 100644 index 0000000..ac77589 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloudsql/main.tf @@ -0,0 +1,152 @@ + +locals { + databases = { for key, value in var.database_values : key => value if contains(var.database_filter, key) } + + # database_set = flatten([ + # for set in var.instance_set : [ + # for key, value in local.databases : { + # "${key}_${set}" : value + # } + # ] + # ]) + + # database_set = flatten([ + # for i in range(0, var.database_instance_count) : { + # for key, value in local.databases : + # "${key}_${i}" => value + + # } + # ]) + + # database_map = zipmap( + # flatten( + # [for item in local.database_set : keys(item)] + # ), + # flatten( + # [for item in local.database_set : values(item)] + # ) + # ) +} + + + +resource "random_pet" "user_name" { + for_each = local.databases + keepers = { + databases = each.key + } + length = 1 +} + +resource "random_pet" "server_name" { + for_each = local.databases + keepers = { + databases = each.value.recreate + } + length = 1 +} + +resource "random_password" "password" { + for_each = local.databases + keepers = { + databases = each.key + } + length = 8 + special = false +} + +resource "random_integer" "this" { + min = 100 + max = 999 + keepers = { + # Generate a new integer each time we switch + listener_arn = var.random_int_keeper + } +} + +locals { + str_f = "_" + str_r = "-" +} + +resource "google_sql_database_instance" "instances" { + for_each = local.databases + + name = format(var.name_format, "instance-${lower(replace(each.key, local.str_f, local.str_r))}-${random_pet.server_name[each.key].id}-${random_integer.this.result}") + database_version = each.value.version + region = var.region + project = var.project_id + deletion_protection = each.value.deletion_protection + root_password = random_password.password[each.key].result + settings { + # Second-generation instance tiers are based on the machine + # type. See argument reference below. + tier = each.value.tier + + dynamic "database_flags" { + for_each = each.value.db_flags + content { + name = database_flags.key + value = database_flags.value + } + } + ip_configuration { + # Add optional authorized networks + # Update to match the customer's networks + authorized_networks { + name = format(var.name_format, "test") + value = "0.0.0.0/0" + } + } + + user_labels = { + created_by = "terraform" + use = "testing" + version = "1" + } + } + +} + +resource "google_sql_database" "instances" { + for_each = local.databases + project = var.project_id + name = each.value.database + instance = google_sql_database_instance.instances[each.key].name +} + +resource "google_sql_user" "users" { + for_each = local.databases + project = var.project_id + name = random_pet.user_name[each.key].id + instance = google_sql_database_instance.instances[each.key].name + password = random_password.password[each.key].result + deletion_policy = "ABANDON" +} + +# locals { +# db_var = flatten([for key, value in google_sql_database_instance.instances : +# { +# db = key +# host = value.public_ip_address +# username = google_sql_user.users[key].name +# password = google_sql_user.users[key].password +# database_name = local.databases[key].database +# } +# ]) +# } + +# resource "local_file" "db" { +# content = jsonencode(local.db_var) +# filename = "${dirname(path.module)}/compute/bucket/ip/db_addresses.json" +# } + +# resource "google_storage_bucket_object" "db_ips" { + +# depends_on = [local_file.db] + +# name = "ip/db_addresses.json" +# bucket = var.config_bucket_name +# source = "${dirname(path.module)}/compute/bucket/ip/db_addresses.json" +# content_type = "text/plain; charset=utf-8" +# } diff --git a/modules/gcp_infrastructure/service_modules/cloudsql/outputs.tf b/modules/gcp_infrastructure/service_modules/cloudsql/outputs.tf new file mode 100644 index 0000000..d1cba84 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloudsql/outputs.tf @@ -0,0 +1,33 @@ +output "connection_string" { + value = { for key, value in google_sql_database_instance.instances : key => + { + host = value.public_ip_address + username = google_sql_user.users[key].name + password = google_sql_user.users[key].password + database_name = local.databases[key].database + } } + sensitive = true +} + +output "cloudsql_instance_names" { + value = { for key, value in google_sql_database_instance.instances : key => + { + database_name = value.name + } } +} + +# output "database_map" { +# value = local.database_map +# } + +output "database_list" { + value = flatten([for key, value in google_sql_database_instance.instances : + { + db = key + host = value.public_ip_address + username = google_sql_user.users[key].name + password = google_sql_user.users[key].password + database_name = local.databases[key].database + } + ]) +} diff --git a/modules/gcp_infrastructure/service_modules/cloudsql/variables.tf b/modules/gcp_infrastructure/service_modules/cloudsql/variables.tf new file mode 100644 index 0000000..c4542c9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloudsql/variables.tf @@ -0,0 +1,95 @@ + +variable "database_filter" { + type = list(any) + description = "list of database platforms to filter" + default = ["MYSQL_8_0", "POSTGRES_14"] + # default = ["MYSQL_8_0", "POSTGRES_14", "SQLSERVER_2019_STANDARD"] +} + +variable "database_values" { + type = map(any) + description = "list of database platforms to filter" + default = { + MYSQL_8_0 = { + version = "MYSQL_8_0" + recreate = "changetorecreate_12" + root_user = null + deletion_protection = false + tier = "db-f1-micro" + db_flags = { + log_output = "FILE" + general_log = "ON" + cloudsql_mysql_audit = "ON" + } + + database = "cloud_freak" + } + + POSTGRES_14 = { + version = "POSTGRES_14" + recreate = "changetorecreate_12" + root_user = null + deletion_protection = false + tier = "db-custom-1-3840" + + # https://cloud.google.com/sql/docs/postgres/pg-audit + #https://kb.objectrocket.com/postgresql/how-to-run-an-sql-file-in-postgres-846 + # https://hub.docker.com/_/postgres + db_flags = { + "cloudsql.enable_pgaudit" = "on" + "pgaudit.log" = "all" + } + + database = "cloud_freak" + + } + + SQLSERVER_2019_STANDARD = { + version = "SQLSERVER_2019_STANDARD" + recreate = "changetorecreate_12" + root_user = "sqlserver" + deletion_protection = false + tier = "db-custom-2-7680" + + # https://cloud.google.com/sql/docs/postgres/pg-audit + #https://kb.objectrocket.com/postgresql/how-to-run-an-sql-file-in-postgres-846 + # https://hub.docker.com/_/postgres + db_flags = { + } + + database = "cloud_freak" + } + + } + +} + +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "region" { + type = string + description = "GCP region to deploy to" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "name prefix" +} + +# variable "database_instance_count" { +# default = 2 +# } + +variable "random_int_keeper" { + default = 1 + type = number + description = "random number" +} + +# variable "config_bucket_name" { +# type = string +# } diff --git a/modules/gcp_infrastructure/service_modules/cloudsql/versions.tf b/modules/gcp_infrastructure/service_modules/cloudsql/versions.tf new file mode 100644 index 0000000..027eaf9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/cloudsql/versions.tf @@ -0,0 +1,15 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + + random = { + source = "hashicorp/random" + version = ">= 3.4.3" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/compute/ansible/test.yml b/modules/gcp_infrastructure/service_modules/compute/ansible/test.yml new file mode 100644 index 0000000..1de1f05 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/ansible/test.yml @@ -0,0 +1,10 @@ +--- +- name: Let's copy our executable script to remote location, execute script and get result back. + remote_user: root + sudo: yes + hosts: crunchify-group + tasks: + - name: Transfer executable script script + copy: src=/opt/ashah/crunchify-script.sh dest=/opt/ashah mode=0777 + - name: Execute the script + command: sh /opt/ashah/crunchify-script.sh \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/bucket.tf b/modules/gcp_infrastructure/service_modules/compute/bucket.tf new file mode 100644 index 0000000..256a320 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/bucket.tf @@ -0,0 +1,66 @@ +# resource "random_id" "bucket_prefix" { +# byte_length = 8 +# } + +# # Bucket for files to transfer to compute instances +# resource "google_storage_bucket" "bucket" { +# name = format(var.name_format, "${random_id.bucket_prefix.hex}-compute-source") # Every bucket name must be globally unique +# location = "US" +# uniform_bucket_level_access = true +# project = var.project_id +# force_destroy = true +# } + +# list of files to upload +locals { + list_of_files = [ + { source : "flask/main.py", name : "flask/main.py" }, + { source : "flask/templates/home.html", name : "flask/templates/home.html" }, + ] +} + +# upload list of files +resource "google_storage_bucket_object" "object" { + for_each = { for key, value in local.list_of_files : key => value } + + name = each.value.name + bucket = var.config_bucket_name + source = "${path.module}/${each.value.source}" # Add path to the zipped function source code +} + +# create file in bucket +resource "google_storage_bucket_object" "object_script" { + + name = "flask/some.sh" + bucket = var.config_bucket_name + content = <<-EOF +#!/bin/bash +echo "Executing linux host config" +if systemctl is-active --quiet telegraf && systemctl is-active --quiet osqueryd && systemctl is-active --quiet td-agent-bit; +then +echo "service running" +else +curl "https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh" | bash -s -- --customer_id "${var.observe.customer_id}" --ingest_token "${var.observe.datastream_token}" --observe_host_name "https://${var.observe.customer_id}.collect.${var.observe.domain}/" --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP +fi +EOF +} + +resource "google_storage_bucket_object" "ips" { + depends_on = [local_file.ip] + + name = "ip/ip_addresses.json" + bucket = var.config_bucket_name + source = "${path.module}/bucket/ip/ip_addresses.json" + content_type = "text/plain; charset=utf-8" +} + +locals { + ip_var = { for key, value in google_compute_instance.instances : + key => value.network_interface[0].network_ip + } +} + +resource "local_file" "ip" { + content = jsonencode(local.ip_var) + filename = "${path.module}/bucket/ip/ip_addresses.json" +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/bucket/ip/bigquery_addresses.json b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/bigquery_addresses.json new file mode 100755 index 0000000..630abe9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/bigquery_addresses.json @@ -0,0 +1 @@ +[{"bigquery_table":"content-eng-joe.joe_dataset.joe-table"}] \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/bucket/ip/db_addresses.json b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/db_addresses.json new file mode 100755 index 0000000..036597a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/db_addresses.json @@ -0,0 +1 @@ +[{"database_name":"cloud_freak","db":"MYSQL_8_0_0","host":"34.69.210.108","password":"","username":"chicken"},{"database_name":"cloud_freak","db":"POSTGRES_14_0","host":"34.170.207.155","password":"","username":"tarpon"}] \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/bucket/ip/ip_addresses.json b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/ip_addresses.json new file mode 100755 index 0000000..42ff87a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/ip_addresses.json @@ -0,0 +1 @@ +{"UBUNTU_20_04_LTS_0":"10.128.0.5"} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/bucket/ip/k8s_addresses.json b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/k8s_addresses.json new file mode 100644 index 0000000..be9b8e9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/bucket/ip/k8s_addresses.json @@ -0,0 +1,5 @@ +[ + { + "ip": "35.233.167.213" + } +] \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/README.md b/modules/gcp_infrastructure/service_modules/compute/flask/README.md new file mode 100644 index 0000000..1481919 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/README.md @@ -0,0 +1,15 @@ +debug mode python3 main.py + +pip3 freeze > requirements.txt + +python3 -m venv env + +source testenv/bin/activate + +source env/bin/deactivate + +pip3 install -r requirements.txt + + +flask --app main.py run -p 8000 + diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/main.py b/modules/gcp_infrastructure/service_modules/compute/flask/main.py new file mode 100644 index 0000000..3c4733e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/main.py @@ -0,0 +1,521 @@ +"""flask app for creating api""" +from subprocess import check_output +import urllib.request +import urllib.parse +import requests +import json +import secrets, string +from flask import Flask, render_template +from google.cloud import bigquery +import mysql.connector +from mysql.connector import Error +import psycopg2 +from psycopg2.extras import RealDictCursor + +print("Stuff") + +def generateRandomPassword(): + letters = string.ascii_letters + digits = string.digits + alphabet = letters + digits + pwd_length = 12 + pwd = '' + for i in range(pwd_length): + pwd += ''.join(secrets.choice(alphabet)) + + return pwd + +def callurl(url): + """Call a url and return response""" + + try: + response = urllib.request.urlopen(url) + new_data = response.read() + + return new_data + # pylint: disable=broad-except; + except Exception as call_error: + return {"error": response} + + +app = Flask(__name__) + +###################################################### +###################################################### +###################################################### + + +@app.route("/k8s") +def k8_call(): + """Make call to all of ip addresses in file""" + ip_list = open("../bucket/ip/k8s_addresses.json", encoding="utf-8") + checkout_payload = { + "email": "someone@example.com", + "street_address": "1600 Amphitheatre Parkway", + "zip_code": "94043", + "city": "Mountain View", + "state": "CA", + "country": "United States", + "credit_card_number": "4432-8015-6152-0454", + "credit_card_expiration_month": "1", + "credit_card_expiration_year": "2023", + "credit_card_cvv": "672", + } + + cart_loads = [ + {"product_id": "9SIQT8TOJO", "quantity": 1}, + {"product_id": "66VCHSJNUP", "quantity": 1}, + {"product_id": "1YMWWN1N4O", "quantity": 1}, + {"product_id": "L9ECAV7KIM", "quantity": 1}, + {"product_id": "2ZYFJ3GM2N", "quantity": 1}, + {"product_id": "0PUK6V6EV0", "quantity": 1}, + {"product_id": "LS4PSXUNUM", "quantity": 1}, + {"product_id": "9SIQT8TOJO", "quantity": 1}, + {"product_id": "6E92ZMYYFZ", "quantity": 1}, + ] + try: + ips = json.load(ip_list) + + data = "" + for key in ips: + session = requests.Session() + data = session.get(f"http://{key['ip']}", timeout=30) + + for item in cart_loads: + data = session.post(f"http://{key['ip']}/cart", data=item, timeout=30) + + data = session.post( + f"http://{key['ip']}/cart/checkout", data=checkout_payload, timeout=30 + ) + + return data.text + + # pylint: disable=broad-except; + except Exception as call_error: + # return {"error": call_error}t + print(call_error) + return "splat" + + +###################################################### +###################################################### +###################################################### + + +@app.route("/") +def hello(): + """Simple HeathCheck""" + + return "Hello, World!" + + +###################################################### +###################################################### +###################################################### + + +@app.route("/500") +def fivehundred(): + """Produce 500 error""" + return "Tragedy", 500 + + +###################################################### +###################################################### +###################################################### + + +@app.route("/home") +def index(): + """Default Index""" + return render_template("home.html") + + +###################################################### +###################################################### +###################################################### + + +@app.route("/observe") +def get_shell_script_output_using_check_output(): + """Call linux host script setup""" + stdout = check_output(["./some.sh"]).decode("utf-8") + return stdout + + +###################################################### +###################################################### +###################################################### + + +@app.route("/observeall") +def call_observe(): + """Make call to all of ip addresses in file""" + ip_list = open("../bucket/ip/ip_addresses.json", encoding="utf-8") + + # returns JSON object as + # a dictionary + data = json.load(ip_list) + + data.keys() + call_data = {"url1": [], "url2": [], "url3": []} + for key in data.keys(): + print("key-", key) + url2 = f"http://{data[key]}:8080/observe" + + print(data[key]) + + new_data2 = callurl(url2) + + call_data["url2"].append({"url": url2, "response": new_data2}) + + print(new_data2) + # dict = json.loads(data) + + return call_data + + +###################################################### +###################################################### +###################################################### + + +@app.route("/file") +def file(): + """Make call to all of ip addresses in file""" + ip_list = open("../bucket/ip/ip_addresses.json", encoding="utf-8") + + # returns JSON object as + # a dictionary + data = json.load(ip_list) + + data.keys() + call_data = {"url1": [], "url2": [], "url3": [], "url4": []} + for key in data.keys(): + print("key-", key) + url1 = f"http://{data[key]}:8080" + url2 = f"http://{data[key]}:8080/mysql" + url3 = f"http://{data[key]}:8080/postgres" + url4 = f"http://{data[key]}:8080/bigquery" + url5 = f"http://{data[key]}:8080/k8s" + + print(data[key]) + + new_data = callurl(url1) + new_data2 = callurl(url2) + new_data3 = callurl(url3) + new_data4 = callurl(url4) + new_data5 = callurl(url5) + + call_data["url1"].append({"url": url1, "response": new_data}) + call_data["url2"].append({"url": url2, "response": new_data2}) + call_data["url3"].append({"url": url3, "response": new_data3}) + call_data["url4"].append({"url": url4, "response": new_data4}) + call_data["url5"].append({"url": url5, "response": new_data5}) + + print(new_data) + # dict = json.loads(data) + + return call_data + + +###################################################### +###################################################### +###################################################### + + +@app.route("/bigquery") +def query(): + """Call biqquery""" + print("called") + print(f"BigQuery version: {bigquery.__version__}") + + ip_list = open("../bucket/ip/bigquery_addresses.json", encoding="utf-8") + table_connections = json.load(ip_list) + + result_dict = [] + + # pylint: disable=too-many-nested-blocks; + for key in table_connections: + + client = bigquery.Client() + + big_query_table = key["bigquery_table"] + # "content-testpproj-stage-1.test_stg_dataset.test-stg-table" + + print("client") + query_job = client.query( + f""" + insert into `{big_query_table}` + (permalink,state, timestamp) + values ( + "test", "test", CURRENT_DATETIME() + ) + """ + ) + print("before") + + query_job = client.query( + f""" + select permalink,state,timestamp + from `{big_query_table}` + order by timestamp desc + limit 10 + """ + ) + results = query_job.result() + print("after") + + for row in results: + # print("{} : {} views".format(row.url, row.view_count)) + print(row) + result_dict.append( + { + "big_query_table": big_query_table, + "permalink": row.permalink, + "state": row.state, + "timestamp": row.timestamp, + } + ) + print(result_dict) + + return result_dict + + +###################################################### +###################################################### +###################################################### + + +@app.route("/mysql") +def mysql_call(): + """Call mysql instances""" + db_data = {"databases": [], "tables": [], "data": []} + + ip_list = open("../bucket/ip/db_addresses.json", encoding="utf-8") + db_connections = json.load(ip_list) + # pylint: disable=too-many-nested-blocks; + for key in db_connections: + if "MYSQL" in key["db"]: + print("key-", key["db"]) + + try: + connection = mysql.connector.connect( + host=key["host"], + database=key["database_name"], + user=key["username"], + #password=key["password"], + password=generateRandomPassword() + ) + + if connection.is_connected(): + db_info = connection.get_server_info() + + print("Connected to MySQL Server version ", db_info) + cursor = connection.cursor(dictionary=True) + + cursor.execute("select database() as db;") + + for data_bases in cursor: + print(data_bases) + db_data["databases"].append( + { + "instance": key["db"], + "host": key["host"], + "database": data_bases["db"], + } + ) + + cursor.execute( + """CREATE TABLE IF NOT EXISTS python_created( + task_id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + """ + ) + + cursor.execute( + "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'cloud_freak'" + ) + + for table in cursor: + print(table) + db_data["tables"].append( + {"instance": key["db"], "table": table["TABLE_NAME"]} + ) + + sql = "insert into python_created(title,description) values(%s, %s)" + val = ("Python is doing this", "call to database") + cursor.execute(sql, val) + connection.commit() + + cursor.execute( + "select count(*) as record_count from python_created" + ) + + for data in cursor: + print(data) + + cursor.execute( + # pylint: disable=line-too-long; + "select DATE_FORMAT(max(python_created.created_at),'%d/%m/%Y %l:%i %p') as last_created, DATE_FORMAT(min(python_created.created_at),'%d/%m/%Y %l:%i %p') as first_created, cnt.record_count as record_count from python_created cross join (select count(*) as record_count from python_created) as cnt group by cnt.record_count" + ) + + myresult = cursor.fetchall() + + for data in myresult: + print(data) + db_data["data"].append( + { + "instance": key["db"], + "row": { + "first_created": data["first_created"], + "last_created": data["last_created"], + "records": data["record_count"], + }, + } + ) + + except Error as call_error: + print("Error while connecting to MySQL", call_error) + return "call flamed" + + finally: + if connection.is_connected(): + cursor.close() + connection.close() + print("MySQL connection is closed") + else: + print("not mysql") + # return db_Info + + return db_data + + +###################################################### +###################################################### +###################################################### + + +@app.route("/postgres") +def postgres_call(): + """Call postgres instances""" + db_data = {"databases": [], "tables": [], "data": []} + + ip_list = open("../bucket/ip/db_addresses.json", encoding="utf-8") + db_connections = json.load(ip_list) + + for key in db_connections: + if "POSTGRES" in key["db"]: + print("key-", key["db"]) + + try: + + # Connect to an existing database + connection = psycopg2.connect( + # pylint: disable=line-too-long; + #f"dbname={key['database_name']} user={key['username']} host={key['host']} password={key['password']}" + f"dbname={key['database_name']} user={key['username']} host={key['host']} password={generateRandomPassword()}" + ) + + if connection.closed == 0: + # Open a cursor to perform database operations + + cursor = connection.cursor(cursor_factory=RealDictCursor) + + cursor.execute("SHOW SERVER_VERSION;") + + # print("Connected to MySQL Server version ", db_Info) + + for server in cursor: + print(server) + # Execute a command: this creates a new table + + cursor.execute( + # pylint: disable=line-too-long; + "SELECT datname FROM pg_database WHERE datistemplate = false and datname not in('cloudsqladmin', 'postgres');" + ) + + for data_bases in cursor: + print(data_bases) + db_data["databases"].append( + { + "instance": key["db"], + "host": key["host"], + "database": data_bases["datname"], + } + ) + + cursor.execute( + """CREATE TABLE IF NOT EXISTS python_created( + task_id SERIAL PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + """ + ) + + cursor.execute( + # pylint: disable=line-too-long; + "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'public'" + ) + + for table in cursor: + print("table", table) + db_data["tables"].append( + {"instance": key["db"], "table": table["table_name"]} + ) + + sql = "insert into python_created(title,description) values(%s, %s)" + val = ("Python is doing this", "call to database") + cursor.execute(sql, val) + connection.commit() + + cursor.execute( + "select count(*) as record_count from python_created" + ) + + for data in cursor: + print(data) + + cursor.execute( + # pylint: disable=line-too-long; + "select to_char(max(python_created.created_at),'DD/Mon/YYYY HH12:MI:SS') as last_created, to_char(min(python_created.created_at),'DD/Mon/YYYY HH12:MI:SS') as first_created, cnt.record_count as record_count from python_created cross join (select count(*) as record_count from python_created) as cnt group by cnt.record_count" + ) + + myresult = cursor.fetchall() + + for data in myresult: + print(data) + db_data["data"].append( + { + "instance": key["db"], + "row": { + "first_created": data["first_created"], + "last_created": data["last_created"], + "records": data["record_count"], + }, + } + ) + + except Error as call_error: + print("Error while connecting to POSTGRES", call_error) + return "call flamed" + + finally: + if connection.closed == 0: + cursor.close() + connection.close() + print("POSTGRES connection is closed") + else: + print("not postgres") + # return db_Info + + return db_data + + +if __name__ == "__main__": + app.run(debug=True) diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/requirements.txt b/modules/gcp_infrastructure/service_modules/compute/flask/requirements.txt new file mode 100644 index 0000000..cde8199 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/requirements.txt @@ -0,0 +1,21 @@ +cachetools==5.2.0 +certifi==2022.9.24 +charset-normalizer==2.1.1 +google-api-core==2.10.2 +google-auth==2.13.0 +google-cloud==0.34.0 +google-cloud-compute==1.6.1 +google-cloud-pubsub==2.13.10 +googleapis-common-protos==1.56.4 +grpc-google-iam-v1==0.12.4 +grpcio==1.50.0 +grpcio-status==1.50.0 +idna==3.4 +proto-plus==1.22.1 +protobuf==4.21.8 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +requests==2.28.1 +rsa==4.9 +six==1.16.0 +urllib3==1.26.12 diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/some.sh b/modules/gcp_infrastructure/service_modules/compute/flask/some.sh new file mode 100755 index 0000000..02e7aac --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/some.sh @@ -0,0 +1,4 @@ +#!/bin/bash +echo "hi from shell script" +echo "hello from shell script" + diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/templates/home.html b/modules/gcp_infrastructure/service_modules/compute/flask/templates/home.html new file mode 100644 index 0000000..a5cdf8d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/templates/home.html @@ -0,0 +1,25 @@ + + + + + + + + RUNNING FLASK ON GCE + + + + +
+
+

FLASK APPLICATION RUNNING ON GCE

+

Conventionally, Flask looks for view files in a folder with specific name. For the same reason we + need to create a folder with the `templates` name and add our view files. In the `templates` folder, + create a new file and name it `home.html`. This file contains the code snippets rendered on the + homepage of our application. +

+
+
+ + + \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/test.py b/modules/gcp_infrastructure/service_modules/compute/flask/test.py new file mode 100644 index 0000000..6b3f906 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/test.py @@ -0,0 +1,28 @@ +from google.cloud import bigquery +admin_project_id = "terraflood-345116" +client = bigquery.Client(project=admin_project_id) + +print("client") +print(f"BigQuery version: {bigquery.__version__}") +result_dict = [] + +query_job = client.query( + """ + SELECT + CONCAT( + 'https://stackoverflow.com/questions/', + CAST(id as STRING)) as url, + view_count + FROM `bigquery-public-data.stackoverflow.posts_questions` + WHERE tags like '%google-bigquery%' + ORDER BY view_count DESC + LIMIT 10""" +) +print("before") +results = query_job.result() +print("after") + +for row in results: + result_dict.append({"url": row.url, "count": row.view_count}) + +print(result_dict) diff --git a/modules/gcp_infrastructure/service_modules/compute/flask/ubuntu_flaskservice.service b/modules/gcp_infrastructure/service_modules/compute/flask/ubuntu_flaskservice.service new file mode 100644 index 0000000..3284256 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/flask/ubuntu_flaskservice.service @@ -0,0 +1,13 @@ +[Unit] +Description=Flask api application +After=network.target + +[Service] +Environment="FLASK_APP=main.py" +User=ubuntu +WorkingDirectory=/home/ubuntu/flask +ExecStart=flask -p 8000 +Restart=always + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/main.tf b/modules/gcp_infrastructure/service_modules/compute/main.tf new file mode 100644 index 0000000..b61b88c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/main.tf @@ -0,0 +1,206 @@ +locals { + + # https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts + # version = [Image project]/[Image family] + # ex - version = "ubuntu-os-cloud/ubuntu-2004-lts" + + # list of compute instance objects to create using filter to pick which ones + compute_instances = { for key, value in var.compute_values : + key => value if contains(var.compute_filter, key) } + + # multiply instances by count variable and create map of instances to create + compute_set = flatten([ + for i in range(0, var.compute_instance_count) : [ + for key, value in local.compute_instances : { + "${key}_${i}" : value + } + ] + ]) + + # flatten list of maps into single map + compute_map = zipmap( + flatten( + [for item in local.compute_set : keys(item)] + ), + flatten( + [for item in local.compute_set : values(item)] + ) + ) + + # list of map keys for comparison + compute_map_keys = keys(local.compute_map) + + target_group_instances = keys({ for key, value in local.compute_map : key => value if index(local.compute_map_keys, key) < 15 }) + + # for output value + script_map = { for key, value in local.compute_map : key => + var.observe.install_linux_host_monitoring == true ? "sleep ${value.wait}; curl \"https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh\" | bash -s -- --customer_id \"${var.observe.customer_id}\" --ingest_token \"${var.observe.datastream_token}\" --observe_host_name https://${var.observe.customer_id}.collect.${var.observe.domain}/ --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP" : "ls;" + } + + # For dynamic access config block in instance + # access_config = { + # "0" = [] + # "1" = [{}] + # } + +} + +resource "google_service_account" "compute" { + account_id = format(var.name_format, "sa") + display_name = "Service Account for compute resources" + project = var.project_id +} + +resource "google_project_iam_member" "compute" { + for_each = toset([ + "roles/compute.admin", + "roles/osconfig.osPolicyAssignmentAdmin", + "roles/logging.logWriter", + "roles/monitoring.metricWriter", + "roles/storage.objectAdmin", + "roles/bigquery.admin" + ]) + + project = var.project_id + role = each.key + member = "serviceAccount:${google_service_account.compute.email}" +} + +resource "google_compute_instance" "instances" { + + depends_on = [ + google_compute_firewall.fw_rules, + google_compute_router_nat.nat, + google_storage_bucket_object.object_script + ] + # instance for each value in map + for_each = local.compute_map + + name = format(var.name_format, "instance-${lower(replace(each.key, local.str_f, local.str_r))}") + project = var.project_id + machine_type = each.value.machine_type + zone = contains(local.target_group_instances, each.key) ? "${var.region}-${var.zone}" : index(local.compute_map_keys, each.key) < 39 ? "us-east1-b" : index(local.compute_map_keys, each.key) < 59 ? "us-central1-b" : "us-south1-a" + description = each.value.description + + tags = ["externalssh", "content", "arthur", "network-lb-tag"] + + boot_disk { + initialize_params { + image = each.value.version + } + } + + # Local SSD disk + # scratch_disk { + # interface = "SCSI" + # } + + network_interface { + network = "default" + + # Dynamically creates a public ip address if instance first item in map + dynamic "access_config" { + for_each = each.key == local.compute_map_keys[0] ? [1] : [] + content { + network_tier = "PREMIUM" + } + } + } + + metadata = { + ssh-keys = "${each.value.default_user}:${file(var.public_key_path)}" + google-monitoring-enabled = true + } + + metadata_startup_script = templatefile("${path.module}/${each.value.user_data_file}", { + CUSTOMER_ID = var.observe.customer_id + INGEST_TOKEN = var.observe.datastream_token + DOMAIN = var.observe.domain + BUCKET_NAME = var.config_bucket_name + }) + + service_account { + # Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles. + email = google_service_account.compute.email + scopes = ["cloud-platform"] + } + + labels = { + team = "content" + creator = "module" + } + + # provisioner "remote-exec" { + # inline = [ + # "mkdir /home/ubuntu/flask" + # ] + + # connection { + # type = "ssh" + # user = each.value.default_user + # private_key = file(var.private_key_path) + # host = self.network_interface[0].access_config[0].nat_ip + # timeout = "120s" + # } + # } + + # python app + # provisioner "file" { + # source = "${path.module}/flask/main.py" + # destination = "/home/${each.value.default_user}/flask/main.py" + # connection { + # type = "ssh" + # user = each.value.default_user + # private_key = file(var.private_key_path) + # host = self.network_interface[0].access_config[0].nat_ip + # timeout = "120s" + # } + # } + # # python app + # provisioner "file" { + # source = "${path.module}/flask/templates" + # destination = "/home/${each.value.default_user}/flask" + # connection { + # type = "ssh" + # user = each.value.default_user + # private_key = file(var.private_key_path) + # host = self.network_interface[0].access_config[0].nat_ip + # timeout = "120s" + # } + # } + # provisioner "remote-exec" { + # inline = [ + # var.observe.install_linux_host_monitoring == true ? "sleep ${each.value.wait}; curl \"https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh\" | bash -s -- --customer_id \"${var.observe.customer_id}\" --ingest_token \"${var.observe.datastream_token}\" --observe_host_name https://${var.observe.customer_id}.collect.${var.observe.domain}/ --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP" : "ls;" + # ] + + # connection { + # type = "ssh" + # user = each.value.default_user + # private_key = file(var.private_key_path) + # host = self.network_interface[0].access_config[0].nat_ip + # timeout = "120s" + # } + # } + + +} + +locals { + str_f = "_" + str_r = "-" +} +resource "google_compute_firewall" "fw_rules" { + for_each = local.compute_map + name = format(var.name_format, "${lower(replace(each.key, local.str_f, local.str_r))}-fw") + network = "default" + project = var.project_id + + allow { + protocol = "tcp" + ports = ["22", "80", "8080"] + } + + source_ranges = ["0.0.0.0/0"] + target_tags = ["externalssh"] +} + diff --git a/modules/gcp_infrastructure/service_modules/compute/network.tf b/modules/gcp_infrastructure/service_modules/compute/network.tf new file mode 100644 index 0000000..6d48fdf --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/network.tf @@ -0,0 +1,44 @@ +# add nat so private instance can reach internet for package downloads +data "google_compute_network" "default" { + name = "default" + project = var.project_id +} + +# data "google_compute_subnetwork" "uswest1" { +# for_each = local.regions +# project = var.project_id +# name = "default" +# region = each.value +# } + +locals { + regions = { for key, value in distinct([var.region, "us-central1", "us-east1"]) : key => value } +} + +resource "google_compute_router" "router" { + for_each = local.regions + project = var.project_id + name = format(var.name_format, "${each.value}-nat-router") + region = each.value + network = data.google_compute_network.default.id + + bgp { + asn = 64514 + } +} + + +resource "google_compute_router_nat" "nat" { + for_each = local.regions + project = var.project_id + name = format(var.name_format, "my-router-nat") + router = google_compute_router.router[each.key].name + region = each.value + nat_ip_allocate_option = "AUTO_ONLY" + source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES" + + log_config { + enable = true + filter = "ERRORS_ONLY" + } +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/outputs.tf b/modules/gcp_infrastructure/service_modules/compute/outputs.tf new file mode 100644 index 0000000..eeb89a7 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/outputs.tf @@ -0,0 +1,42 @@ +output "compute_instances" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => { + name = value.name + public_ip = length(value.network_interface[0].access_config) == 0 ? "" : value.network_interface[0].access_config[0].nat_ip + public_ssh_link = length(value.network_interface[0].access_config) == 0 ? "" : "ssh -i ~/.ssh/id_rsa_ec2 ${local.compute_map[key].default_user}@${value.network_interface[0].access_config[0].nat_ip}" + public_vm_key_file_create = "vi ~/.ssh/id_rsa_ec2" + private_ssh_link = "ssh -i ~/.ssh/id_rsa_ec2 ${local.compute_map[key].default_user}@${value.network_interface[0].network_ip}" + # user_data = value.metadata_startup_script + default_user = local.compute_map[key].default_user + host_script = "curl \"https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh\" | bash -s -- --customer_id \"${var.observe.customer_id}\" --ingest_token \"${var.observe.datastream_token}\" --observe_host_name https://${var.observe.customer_id}.collect.${var.observe.domain}/ --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP" + } + # key => value + } +} + +output "user_data" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => { + user_data = value.metadata_startup_script + } + } +} + +output "target_group_instances" { + value = flatten([for key, value in google_compute_instance.instances : + value.self_link if contains(local.target_group_instances, key)]) +} + +output "script_map" { + value = local.script_map +} + +output "compute_value" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => value + } +} + diff --git a/modules/gcp_infrastructure/service_modules/compute/rhel_user_data.sh b/modules/gcp_infrastructure/service_modules/compute/rhel_user_data.sh new file mode 100644 index 0000000..44172f8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/rhel_user_data.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# to check logs of build look here +# /var/log/cloud-init.log and +# /var/log/cloud-init-output.log +echo "RHEL OS" + +sudo yum update -y + +sudo yum install curl -y + +sudo yum install wget -y + +sudo yum install ca-certificates -y + +sudo yum install stress-ng -y + +sudo yum install apache2 -y + +sudo service apache2 restart + +echo "

Web Server: ${HOSTNAME}

" | sudo tee /var/www/html/index.html diff --git a/modules/gcp_infrastructure/service_modules/compute/ubuntu_user_data.sh b/modules/gcp_infrastructure/service_modules/compute/ubuntu_user_data.sh new file mode 100644 index 0000000..b85cb9f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/ubuntu_user_data.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# to check logs of build look here +# /var/log/cloud-init.log and +# /var/log/cloud-init-output.log + +echo "UBUNTU OS" + +### Updates and installs +sudo apt-get update -y + +##### HTTP +sudo apt-get install wget curl -y +sudo apt install ca-certificates -y + +## For mounting storage bucket as drive +export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` + +echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list + +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + +sudo apt-get update + +sudo apt-get install gcsfuse + +# need to execute as user or flames +sudo -u ubuntu bash -c 'mkdir /home/ubuntu/bucket' + +sudo -u ubuntu bash -c 'mkdir /home/ubuntu/flask' + +# mount bucket as directory in ubuntu home +sudo -u ubuntu bash -c 'gcsfuse --implicit-dirs ${BUCKET_NAME} /home/ubuntu/bucket' + +sudo -u ubuntu bash -c 'cp -a /home/ubuntu/bucket/flask/. /home/ubuntu/flask/' + +sudo chmod 777 /home/ubuntu/flask/some.sh + +# python install +sudo apt install python3-pip -y + +pip install flask + +pip install google-cloud-bigquery + +pip install mysql-connector-python + +pip install psycopg2-binary + +# define service for flask app +sudo tee /etc/systemd/system/flaskapi.service <Web Server: $${HOSTNAME} +EOF \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/variables.tf b/modules/gcp_infrastructure/service_modules/compute/variables.tf new file mode 100644 index 0000000..3f9a0d4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/variables.tf @@ -0,0 +1,137 @@ +variable "observe" { + description = "variables for agent config" + type = object({ + domain = string, + customer_id = string, + datastream_token = string, + install_linux_host_monitoring = bool + }) + default = { + domain : "observe-staging.com", + install_linux_host_monitoring : true, + customer_id : null, + datastream_token : null + } +} + +variable "public_key_path" { + description = "Public key path" + nullable = true + default = "~/.ssh/id_rsa_ec2.pub" + type = string +} + +# variable "private_key_path" { +# description = "Private key path" +# nullable = false +# default = "~/.ssh/id_rsa_ec2" +# type = string +# } + +# variable "use_branch_name" { +# default = "main" +# description = "git repository branch to use" +# type = string +# } + +variable "compute_values" { + description = "variable for what compute instances to create" + type = map(any) + default = { + #https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts + UBUNTU_22_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-2204-lts" + machine_type = "e2-medium" + description = "Ubuntu 22_04 LTS" + default_user = "ubuntu" + zone = "us-west1-b" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + + UBUNTU_20_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-2004-lts" + machine_type = "e2-micro" + description = "Ubuntu 20_04 LTS" + default_user = "ubuntu" + zone = "us-west1-b" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + + # UBUNTU_18_04_LTS = { + # recreate = "changethistorecreate1" + # version = "ubuntu-os-cloud/ubuntu-1804-lts" + # machine_type = "e2-medium" + # description = "Ubuntu 18_04 LTS" + # default_user = "ubuntu" + # zone = "us-west1-b" + # wait = "120" + # user_data_file = "ubuntu_user_data.sh" + # } + + # RHEL_8 = { + # recreate = "changethistorecreate1" + # version = "rhel-cloud/rhel-8" + # machine_type = "e2-medium" + # description = "Red Hat Enterprise Linux 8" + # default_user = "redhat" + # zone = "us-west1-b" + # wait = "300" + # user_data_file = "rhel_user_data.sh" + # } + + # CENTOS_8 = { + # recreate = "changethistorecreate1" + # version = "centos-cloud/centos-stream-8" + # machine_type = "e2-medium" + # description = "CentOS Stream 8" + # default_user = "centos" + # zone = "us-west1-b" + # wait = "120" + # user_data_file = "rhel_user_data.sh" + # } + } +} + +variable "compute_filter" { + type = list(any) + description = "list of compute instances to filter" + default = ["UBUNTU_20_04_LTS"] + # default = ["UBUNTU_18_04_LTS", "UBUNTU_20_04_LTS", "RHEL_8"] +} + +variable "zone" { + type = string + default = "a" + description = "zone to deploy to" +} + +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +variable "region" { + type = string + description = "GCP region to deploy sample env" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "Name format" +} + +variable "compute_instance_count" { + type = number + default = 2 + description = "Number of compute instances to instantiate" +} + +variable "config_bucket_name" { + type = string + description = "The name of the configuration bucket" +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/compute/versions.tf b/modules/gcp_infrastructure/service_modules/compute/versions.tf new file mode 100644 index 0000000..8b83577 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute/versions.tf @@ -0,0 +1,15 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + + local = { + source = "hashicorp/local" + version = ">= 2.3.0" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/compute_otel_collector/main.tf b/modules/gcp_infrastructure/service_modules/compute_otel_collector/main.tf new file mode 100644 index 0000000..30d7966 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute_otel_collector/main.tf @@ -0,0 +1,85 @@ +module "gcp_ubuntu_box" { + source = "../helper_modules/gcp/compute_ubuntu_attached_bucket" + # region = var.region + zone = var.zone + project_id = var.project_id + name_format = var.name_format + compute_values = { + UBUNTU_20_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-2004-lts" + machine_type = "e2-standard-2" + description = "Ubuntu 20_04 LTS" + default_user = "ubuntu" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + } + compute_filter = ["UBUNTU_20_04_LTS"] + open_ports = ["22", "4317", "4318"] + + + # https://opentelemetry.io/docs/collector/getting-started/#deb-installation + metadata_startup_script = <<-EOF + +echo " +receivers: + otlp: + protocols: + grpc: + http: + +processors: + batch: + +exporters: + logging: + logLevel: debug + otlphttp: + endpoint: "https://collect.${var.observe.domain}/v1/otel" + headers: + 'Authorization': 'Bearer ${var.observe.customer_id} ${var.observe.otel_datastream_token}' + prometheusremotewrite: + endpoint: "https://collect.${var.observe.domain}/v1/prometheus" + headers: + 'Authorization': 'Bearer ${var.observe.customer_id} ${var.observe.otel_datastream_token}' + +extensions: + health_check: + pprof: + zpages: + +service: + extensions: [health_check,pprof,zpages] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [otlphttp] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [prometheusremotewrite] + logs: + receivers: [otlp] + processors: [batch] + exporters: [logging] + " > /home/ubuntu/otel-collector-config.yaml + +sudo apt-get -y install wget systemctl + +wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.69.0/otelcol_0.69.0_linux_amd64.deb + +sudo dpkg -i otelcol_0.69.0_linux_amd64.deb + +sudo mv /etc/otelcol/config.yaml /etc/otelcol/config.yaml.OLD + +sudo cp /home/ubuntu/otel-collector-config.yaml /etc/otelcol/config.yaml + +sudo systemctl restart otelcol + +# Install host app monitoring +curl https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh | bash -s -- --customer_id ${var.observe.customer_id} --ingest_token "${var.observe.host_datastream_token}" --observe_host_name https://${var.observe.customer_id}.collect.${var.observe.domain}/ --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup compute_host_app_sample_env + + EOF +} diff --git a/modules/gcp_infrastructure/service_modules/compute_otel_collector/outputs.tf b/modules/gcp_infrastructure/service_modules/compute_otel_collector/outputs.tf new file mode 100644 index 0000000..ba84ebd --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute_otel_collector/outputs.tf @@ -0,0 +1,9 @@ +output "gcp_ubuntu_box" { + value = module.gcp_ubuntu_box +} + +output "gcp_ubuntu_box_curl_host_mon" { + value = <<-EOF +curl https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh | bash -s -- --customer_id ${var.observe.customer_id} --ingest_token "${var.observe.host_datastream_token}" --observe_host_name https://${var.observe.customer_id}.collect.observeinc.com/ --config_files_clean TRUE --ec2metadata TRUE --datacenter GCP --appgroup compute_host_app_sample_env``` +EOF +} diff --git a/modules/gcp_infrastructure/service_modules/compute_otel_collector/variables.tf b/modules/gcp_infrastructure/service_modules/compute_otel_collector/variables.tf new file mode 100644 index 0000000..2fcd1c8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute_otel_collector/variables.tf @@ -0,0 +1,37 @@ +variable "project_id" { + type = string + description = "First project I want to create provider for" +} + +# variable "region" { +# type = string +# description = "First region I want to create provider for" +# } + + +variable "zone" { + type = string + description = "First region I want to create provider for" +} + +variable "name_format" { + type = string + description = "Name format" + default = "test1-%s" +} + +variable "observe" { + type = object({ + domain = optional(string) + customer_id = optional(string) + otel_datastream_token = optional(string) + host_datastream_token = optional(string) + }) + default = { + domain = "YOURS" + customer_id = "YOURS" + otel_datastream_token = "YOURS" + host_datastream_token = "YOURS" + } + description = "observe environment datastream connection details" +} diff --git a/modules/gcp_infrastructure/service_modules/compute_otel_collector/versions.tf b/modules/gcp_infrastructure/service_modules/compute_otel_collector/versions.tf new file mode 100644 index 0000000..ff6e62d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/compute_otel_collector/versions.tf @@ -0,0 +1,16 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + null = { + source = "hashicorp/null" + version = ">= 3.2.1" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/config_bucket/main.tf b/modules/gcp_infrastructure/service_modules/config_bucket/main.tf new file mode 100644 index 0000000..8cd2981 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/config_bucket/main.tf @@ -0,0 +1,12 @@ +resource "random_id" "bucket_prefix" { + byte_length = 8 +} + +# Bucket for files to transfer to compute instances +resource "google_storage_bucket" "bucket" { + name = format(var.name_format, "${random_id.bucket_prefix.hex}-compute-source") # Every bucket name must be globally unique + location = "US" + uniform_bucket_level_access = true + project = var.project_id + force_destroy = true +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/config_bucket/outputs.tf b/modules/gcp_infrastructure/service_modules/config_bucket/outputs.tf new file mode 100644 index 0000000..8ff6165 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/config_bucket/outputs.tf @@ -0,0 +1,3 @@ +output "bucket_name" { + value = google_storage_bucket.bucket.name +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/config_bucket/variables.tf b/modules/gcp_infrastructure/service_modules/config_bucket/variables.tf new file mode 100644 index 0000000..6cc10d7 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/config_bucket/variables.tf @@ -0,0 +1,15 @@ +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +# variable "region" { +# type = string +# description = "GCP region to deploy sample env" +# } + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "Name format" +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/config_bucket/versions.tf b/modules/gcp_infrastructure/service_modules/config_bucket/versions.tf new file mode 100644 index 0000000..eddb42a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/config_bucket/versions.tf @@ -0,0 +1,17 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + + random = { + source = "hashicorp/random" + version = ">= 3.5.0" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/gke/README.md b/modules/gcp_infrastructure/service_modules/gke/README.md new file mode 100644 index 0000000..c2899db --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/README.md @@ -0,0 +1,52 @@ + +## Make sure you can interact with GKE cluster install auth plugin +gcloud components install gke-gcloud-auth-plugin + +## Get credentials - stores locally so kubectl will work +gcloud container clusters get-credentials test-stg-gke --region us-west1 + + +### Sample commands +kubectl get namespace + +kubectl get pods + +## Google supplied sample app + +https://github.com/GoogleCloudPlatform/microservices-demo + +## To install using kubectl +kubectl apply -f ./release/kubernetes-manifests.yaml + +## Install Observe collector +export OBSERVE_CUSTOMER=[YOURS]\ +export OBSERVE_TOKEN=[YOURS] \ +export OBSERVE_COLLECTOR_HOST=[YOURS] \ +kubectl apply -k https://github.com/observeinc/manifests/stack && \ + kubectl -n observe create secret generic credentials \ + --from-literal=OBSERVE_CUSTOMER=$OBSERVE_CUSTOMER \ + --from-literal=OBSERVE_TOKEN=$OBSERVE_TOKEN \ + --from-literal=OBSERVE_COLLECTOR_HOST=$OBSERVE_COLLECTOR_HOST + +kubectl annotate namespace observe observeinc.com/cluster-name="gcp-cost-test-cluster1" + +kubectl annotate namespace observe eksClusterArn="gcp-cost-test-cluster1" + +kubectl annotate namespace observe observeinc.com/cluster-name="arn:aws:eks:us-west-2:384876807807:cluster/arthur-k8s-test-1" + +kubectl annotate namespace observe observeinc.com/gks-cluster-="43915b45797b41b1a34306bbd51c7e180b77f77f7fd3407ab7f340e2b83cd87f" + +## If you need to overwrite +kubectl annotate --overwrite=true namespace observe observeinc.com/cluster-name="//container.googleapis.com/projects/content-testpproj-stage-1/locations/us-west1/clusters/test-stg-gke" + +### SUPER IMPORTANT - You must annotate kube-system namespace in order for link through to other resources like node +kubectl annotate --overwrite=true namespace kube-system observeinc.com/cluster-name="//container.googleapis.com/projects/content-testpproj-stage-1/locations/us-west1/clusters/test-stg-gke" + +## Add persistent volume +https://cloud.google.com/kubernetes-engine/docs/concepts/persistent-volumes + +kubectl apply -f pvc-pod-demo.yaml +## Reference +https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + +https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/gke/main.tf b/modules/gcp_infrastructure/service_modules/gke/main.tf new file mode 100644 index 0000000..1b9feda --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/main.tf @@ -0,0 +1,100 @@ +locals { + +} + +# GKE cluster +resource "google_container_cluster" "primary" { + project = var.project_id + name = format(var.name_format, "gke") + location = var.region + + # We can't create a cluster with no node pool defined, but we want to only use + # separately managed node pools. So we create the smallest possible default + # node pool and immediately delete it. + remove_default_node_pool = true + initial_node_count = 1 + + network = data.google_compute_network.default.name + subnetwork = data.google_compute_subnetwork.default.name + + ip_allocation_policy { + cluster_ipv4_cidr_block = "10.0.8.0/21" + services_ipv4_cidr_block = "10.0.16.0/22" + } +} + +# # Separately Managed Node Pool +resource "google_container_node_pool" "primary_nodes" { + project = var.project_id + name = "${google_container_cluster.primary.name}-node-pool" + location = var.region + cluster = google_container_cluster.primary.name + node_count = var.gke_num_nodes + + node_config { + # oauth_scopes = [ + # "https://www.googleapis.com/auth/cloud-platform" + # ] + + labels = { + env = var.project_id + } + + # preemptible = true + machine_type = var.node_machine_type + tags = ["gke-node", "${var.project_id}-gke"] + metadata = { + disable-legacy-endpoints = "true" + } + } +} + + + + +data "google_compute_network" "default" { + name = "default" + project = var.project_id +} + +data "google_compute_subnetwork" "default" { + name = "default" + region = var.region + project = var.project_id +} + +# resource "google_compute_subnetwork" "subnet" { +# project = var.project_id +# name = format(var.name_format, "gke-subnet") +# region = var.region +# network = data.google_compute_network.default.name +# ip_cidr_range = "10.0.0.0/18" +# } + + +# # Kubernetes provider +# # The Terraform Kubernetes Provider configuration below is used as a learning reference only. +# # It references the variables and resources provisioned in this file. +# # We recommend you put this in another file -- so you can have a more modular configuration. +# # https://learn.hashicorp.com/terraform/kubernetes/provision-gke-cluster#optional-configure-terraform-kubernetes-provider +# # To learn how to schedule deployments and services using the provider, go here: https://learn.hashicorp.com/tutorials/terraform/kubernetes-provider. + +# provider "kubernetes" { +# load_config_file = "false" + +# host = google_container_cluster.primary.endpoint +# username = var.gke_username +# password = var.gke_password + +# client_certificate = google_container_cluster.primary.master_auth.0.client_certificate +# client_key = google_container_cluster.primary.master_auth.0.client_key +# cluster_ca_certificate = google_container_cluster.primary.master_auth.0.cluster_ca_certificate +# } + +# resource "google_storage_bucket_object" "ips" { + +# name = "ip/k8s_addresses.json" +# bucket = var.config_bucket_name +# source = "${dirname(path.module)}/compute/bucket/ip/k8s_addresses.json" +# content_type = "text/plain; charset=utf-8" +# } diff --git a/modules/gcp_infrastructure/service_modules/gke/outputs.tf b/modules/gcp_infrastructure/service_modules/gke/outputs.tf new file mode 100644 index 0000000..defde7d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/outputs.tf @@ -0,0 +1,22 @@ +output "cluster_name" { + value = google_container_cluster.primary.name +} + +output "gcloud_set_cluster" { + value = "gcloud container clusters get-credentials ${google_container_cluster.primary.name} --zone ${google_container_cluster.primary.location}" +} + +output "ip_address" { + value = google_container_cluster.primary.endpoint +} + +output "sockshop_commands" { + value = { + dir = "cd /Users/arthur/content_eng/content-eng-tools/microservices-otel/microservices-demo/deploy/kubernetes" + apply_socksshop = "kubectl apply -k sockshop-k8s-demo" + apply_ingress = "kubectl apply -f ingress/ingress_gke.yaml" + describe_ingress = "kubectl describe ingress --namespace=sock-shop" + notion = "https://www.notion.so/observeinc/Multi-Cloud-K8-Environment-Setup-52d435d52556480f95bcb32de0a7b60d#befae42f8a9647989f0abd0787025c8b" + id = google_container_cluster.primary.id + } +} diff --git a/modules/gcp_infrastructure/service_modules/gke/variables.tf b/modules/gcp_infrastructure/service_modules/gke/variables.tf new file mode 100644 index 0000000..3d42ec9 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/variables.tf @@ -0,0 +1,41 @@ +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "region" { + type = string + description = "GCP region to deploy to" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "name prefix for resources" +} + +# variable "config_bucket_name" { +# type = string +# } + +# variable "gke_username" { +# default = "" +# description = "gke username" +# } + +# variable "gke_password" { +# default = "" +# description = "gke password" +# } + +variable "gke_num_nodes" { + type = number + default = 1 + description = "number of gke nodes" +} + +variable "node_machine_type" { + type = string + default = "n1-standard-1" + description = "machine type for nodes" +} diff --git a/modules/gcp_infrastructure/service_modules/gke/versions.tf b/modules/gcp_infrastructure/service_modules/gke/versions.tf new file mode 100644 index 0000000..dac3760 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/versions.tf @@ -0,0 +1,12 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/gke/yaml/pvc-pod-demo.yaml b/modules/gcp_infrastructure/service_modules/gke/yaml/pvc-pod-demo.yaml new file mode 100644 index 0000000..fda884a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/gke/yaml/pvc-pod-demo.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-demo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 30Gi + storageClassName: standard-rwo +--- +kind: Pod +apiVersion: v1 +metadata: + name: pod-demo +spec: + volumes: + - name: pvc-demo-vol + persistentVolumeClaim: + claimName: pvc-demo + containers: + - name: pod-demo + image: nginx + resources: + limits: + cpu: 10m + memory: 80Mi + requests: + cpu: 10m + memory: 80Mi + ports: + - containerPort: 80 + name: "http-server" + volumeMounts: + - mountPath: "/usr/share/nginx/html" + name: pvc-demo-vol \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/bucket.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/bucket.tf new file mode 100644 index 0000000..10ae228 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/bucket.tf @@ -0,0 +1,67 @@ +resource "random_id" "bucket_prefix" { + byte_length = 8 +} + +# Bucket for files to transfer to compute instances +resource "google_storage_bucket" "bucket" { + name = format(var.name_format, "${random_id.bucket_prefix.hex}-compute-source") # Every bucket name must be globally unique + location = "US" + uniform_bucket_level_access = true + project = var.project_id + force_destroy = true +} + +# list of files to upload +locals { + list_of_files = [ + { source : "stuff_for_s3/README.md", name : "README.md" }, + ] + + bucket_name = google_storage_bucket.bucket.name +} + +# upload list of files +resource "google_storage_bucket_object" "object" { + for_each = { for key, value in local.list_of_files : key => value } + + name = each.value.name + bucket = local.bucket_name + source = "${path.module}/${each.value.source}" # Add path to the zipped function source code +} + +# create file in bucket +# resource "google_storage_bucket_object" "object_script" { + +# name = "flask/some.sh" +# bucket = var.config_bucket_name +# content = <<-EOF +# #!/bin/bash +# echo "Executing linux host config" +# if systemctl is-active --quiet telegraf && systemctl is-active --quiet osqueryd && systemctl is-active --quiet td-agent-bit; +# then +# echo "service running" +# else +# curl "https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh" | bash -s -- --customer_id "${var.observe.customer_id}" --ingest_token "${var.observe.datastream_token}" --observe_host_name "https://${var.observe.customer_id}.collect.${var.observe.domain}/" --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP +# fi +# EOF +# } + +# resource "google_storage_bucket_object" "ips" { +# depends_on = [local_file.ip] + +# name = "ip/ip_addresses.json" +# bucket = var.config_bucket_name +# source = "${path.module}/bucket/ip/ip_addresses.json" +# content_type = "text/plain; charset=utf-8" +# } + +# locals { +# ip_var = { for key, value in google_compute_instance.instances : +# key => "${value.network_interface[0].network_ip}" +# } +# } + +# resource "local_file" "ip" { +# content = jsonencode(local.ip_var) +# filename = "${path.module}/bucket/ip/ip_addresses.json" +# } \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/main.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/main.tf new file mode 100644 index 0000000..74f6342 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/main.tf @@ -0,0 +1,160 @@ +locals { + + # https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts + # version = [Image project]/[Image family] + # ex - version = "ubuntu-os-cloud/ubuntu-2004-lts" + + # list of compute instance objects to create using filter to pick which ones + compute_instances = { for key, value in var.compute_values : + key => value if contains(var.compute_filter, key) } + + # multiply instances by count variable and create map of instances to create + compute_set = flatten([ + for i in range(0, var.compute_instance_count) : [ + for key, value in local.compute_instances : { + "${key}_${i}" : value + } + ] + ]) + + # flatten list of maps into single map + compute_map = zipmap( + flatten( + [for item in local.compute_set : keys(item)] + ), + flatten( + [for item in local.compute_set : values(item)] + ) + ) + + # list of map keys for comparison + compute_map_keys = keys(local.compute_map) + + target_group_instances = keys({ for key, value in local.compute_map : key => value if index(local.compute_map_keys, key) < 15 }) + + # for output value + # script_map = { for key, value in local.compute_map : key => + # var.observe.install_linux_host_monitoring == true ? "sleep ${value.wait}; curl \"https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/main/observe_configure_script.sh\" | bash -s -- --customer_id \"${var.observe.customer_id}\" --ingest_token \"${var.observe.datastream_token}\" --observe_host_name https://${var.observe.customer_id}.collect.${var.observe.domain}/ --config_files_clean TRUE --ec2metadata FALSE --datacenter GCP --appgroup MY_APP_GROUP" : "ls;" + # } + + # For dynamic access config block in instance + # access_config = { + # "0" = [] + # "1" = [{}] + # } + +} + +resource "google_service_account" "compute" { + account_id = format(var.name_format, "sa") + display_name = "Service Account for compute resources" + project = var.project_id +} + +resource "google_project_iam_member" "compute" { + for_each = toset([ + "roles/compute.admin", + # "roles/osconfig.osPolicyAssignmentAdmin", + # "roles/logging.logWriter", + # "roles/monitoring.metricWriter", + "roles/storage.objectAdmin", + "roles/bigquery.admin" + ]) + + project = var.project_id + role = each.key + member = "serviceAccount:${google_service_account.compute.email}" +} + +resource "google_compute_instance" "instances" { + + depends_on = [ + google_compute_firewall.fw_rules, + # google_compute_router_nat.nat, + # google_storage_bucket_object.object_script + ] + # instance for each value in map + for_each = local.compute_map + + name = format(var.name_format, "instance-${lower(replace(each.key, local.str_f, local.str_r))}") + project = var.project_id + machine_type = each.value.machine_type + # zone = contains(local.target_group_instances, each.key) ? "${var.region}-${var.zone}" : index(local.compute_map_keys, each.key) < 39 ? "us-east1-b" : index(local.compute_map_keys, each.key) < 59 ? "us-central1-b" : "us-south1-a" + zone = var.zone + description = each.value.description + + tags = ["externalssh", "content", "arthur"] + + boot_disk { + initialize_params { + image = each.value.version + } + } + + # Local SSD disk + # scratch_disk { + # interface = "SCSI" + # } + + network_interface { + network = "default" + + # Dynamically creates a public ip address if instance first item in map + dynamic "access_config" { + for_each = each.key == local.compute_map_keys[0] ? [1] : [] + content { + network_tier = "PREMIUM" + } + } + } + + metadata = { + ssh-keys = "${each.value.default_user}:${file(var.public_key_path)}" + # google-monitoring-enabled = true + } + + metadata_startup_script = templatefile("${path.module}/${each.value.user_data_file}", { + # CUSTOMER_ID = var.observe.customer_id + # INGEST_TOKEN = var.observe.datastream_token + # DOMAIN = var.observe.domain + BUCKET_NAME = local.bucket_name + append_script = var.metadata_startup_script == null ? "" : var.metadata_startup_script + }) + + service_account { + # Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles. + email = google_service_account.compute.email + scopes = ["cloud-platform"] + } + + labels = { + team = "content" + creator = "module" + } + +} + +locals { + str_f = "_" + str_r = "-" +} +resource "google_compute_firewall" "fw_rules" { + for_each = local.compute_map + name = format(var.name_format, "${lower(replace(each.key, local.str_f, local.str_r))}-fw") + network = "default" + project = var.project_id + + allow { + protocol = "tcp" + ports = var.open_ports + } + + allow { + protocol = "udp" + ports = var.open_ports_udp + } + + source_ranges = var.source_ranges + target_tags = ["externalssh"] +} + diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/network.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/network.tf new file mode 100644 index 0000000..6468984 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/network.tf @@ -0,0 +1,44 @@ +# add nat so private instance can reach internet for package downloads +# data "google_compute_network" "default" { +# name = "default" +# project = var.project_id +# } + +# data "google_compute_subnetwork" "uswest1" { +# for_each = local.regions +# project = var.project_id +# name = "default" +# region = each.value +# } + +# locals { +# regions = { for key, value in distinct([var.region, "us-central1", "us-east1"]) : key => value } +# } + +# resource "google_compute_router" "router" { +# for_each = local.regions +# project = var.project_id +# name = format(var.name_format, "${each.value}-nat-router") +# region = each.value +# network = data.google_compute_network.default.id + +# bgp { +# asn = 64514 +# } +# } + + +# resource "google_compute_router_nat" "nat" { +# for_each = local.regions +# project = var.project_id +# name = format(var.name_format, "my-router-nat") +# router = google_compute_router.router[each.key].name +# region = each.value +# nat_ip_allocate_option = "AUTO_ONLY" +# source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES" + +# log_config { +# enable = true +# filter = "ERRORS_ONLY" +# } +# } \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/outputs.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/outputs.tf new file mode 100644 index 0000000..cbf3104 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/outputs.tf @@ -0,0 +1,47 @@ +output "compute_instances" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => { + name = value.name + private_ip = value.network_interface[0].network_ip + public_ip = length(value.network_interface[0].access_config) == 0 ? "" : value.network_interface[0].access_config[0].nat_ip + public_ssh_link = length(value.network_interface[0].access_config) == 0 ? "" : "ssh -i ~/.ssh/id_rsa_ec2 ${local.compute_map[key].default_user}@${value.network_interface[0].access_config[0].nat_ip}" + public_vm_key_file_create = "vi ~/.ssh/id_rsa_ec2" + private_ssh_link = "ssh -i ~/.ssh/id_rsa_ec2 ${local.compute_map[key].default_user}@${value.network_interface[0].network_ip}" + # user_data = value.metadata_startup_script + default_user = local.compute_map[key].default_user + + } + # key => value + } +} + +output "user_data" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => { + user_data = value.metadata_startup_script + } + } +} + +output "target_group_instances" { + value = flatten([for key, value in google_compute_instance.instances : + value.self_link if contains(local.target_group_instances, key)]) +} + +# output "script_map" { +# value = local.script_map +# } + +output "compute_value" { + sensitive = true + value = { for key, value in google_compute_instance.instances : + key => value + } +} + +output "bucket_name" { + value = google_storage_bucket.bucket.name +} + diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/rhel_user_data.sh b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/rhel_user_data.sh new file mode 100644 index 0000000..332ffa4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/rhel_user_data.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# to check logs of build look here +# /var/log/cloud-init.log and +# /var/log/cloud-init-output.log +echo "RHEL OS" + +sudo yum update -y + +sudo yum install curl -y + +sudo yum install wget -y + +sudo yum install ca-certificates -y + +sudo yum install stress-ng -y + +sudo yum install apache2 -y + +sudo service apache2 restart + +echo "

Web Server: ${HOSTNAME}

" | sudo tee /var/www/html/index.html + +${append_script} diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/stuff_for_s3/README.md b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/stuff_for_s3/README.md new file mode 100644 index 0000000..31edce6 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/stuff_for_s3/README.md @@ -0,0 +1 @@ +# Proof \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/ubuntu_user_data.sh b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/ubuntu_user_data.sh new file mode 100644 index 0000000..c9dbe46 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/ubuntu_user_data.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# to check logs of build look here +# /var/log/cloud-init.log and +# /var/log/cloud-init-output.log + +echo "UBUNTU OS" + +### Updates and installs +sudo apt-get update -y + +##### HTTP +sudo apt-get install wget curl -y +sudo apt install ca-certificates -y + +## For mounting storage bucket as drive +export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` + +echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list + +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + +sudo apt-get update + +sudo apt-get install gcsfuse + +# need to execute as user or flames +sudo -u ubuntu bash -c 'mkdir /home/ubuntu/bucket' + +# sudo -u ubuntu bash -c 'mkdir /home/ubuntu/flask' + +# mount bucket as directory in ubuntu home +sudo -u ubuntu bash -c 'gcsfuse --implicit-dirs ${BUCKET_NAME} /home/ubuntu/bucket' + +# sudo -u ubuntu bash -c 'cp -a /home/ubuntu/bucket/flask/. /home/ubuntu/flask/' + +# sudo chmod 777 /home/ubuntu/flask/some.sh + +# python install +sudo apt install python3-pip -y + +${append_script} +# pip install flask + +# pip install google-cloud-bigquery + +# pip install mysql-connector-python + +# pip install psycopg2-binary + +# # define service for flask app +# sudo tee /etc/systemd/system/flaskapi.service <Web Server: $${HOSTNAME} +# EOF \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/variables.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/variables.tf new file mode 100644 index 0000000..114d59d --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/variables.tf @@ -0,0 +1,161 @@ +# variable "observe" { +# description = "variables for agent config" +# type = object({ +# domain = string, +# customer_id = string, +# datastream_token = string, +# install_linux_host_monitoring = bool +# }) +# default = { +# domain : "observe-staging.com", +# install_linux_host_monitoring : true, +# customer_id : null, +# datastream_token : null +# } +# } + +variable "public_key_path" { + description = "Public key path" + nullable = true + default = "~/.ssh/id_rsa_ec2.pub" + type = string +} + +# tflint-ignore: terraform_unused_declarations +variable "private_key_path" { + description = "Private key path" + nullable = false + default = "~/.ssh/id_rsa_ec2" + type = string +} + +# variable "use_branch_name" { +# default = "main" +# description = "git repository branch to use" +# type = string +# } + +variable "compute_values" { + description = "variable for what compute instances to create" + type = map(any) + default = { + #https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts + UBUNTU_22_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-2204-lts" + machine_type = "e2-medium" + description = "Ubuntu 22_04 LTS" + default_user = "ubuntu" + zone = "us-west1-b" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + + UBUNTU_20_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-2004-lts" + machine_type = "e2-micro" + description = "Ubuntu 20_04 LTS" + default_user = "ubuntu" + zone = "us-west1-b" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + + UBUNTU_18_04_LTS = { + recreate = "changethistorecreate1" + version = "ubuntu-os-cloud/ubuntu-1804-lts" + machine_type = "e2-medium" + description = "Ubuntu 18_04 LTS" + default_user = "ubuntu" + zone = "us-west1-b" + wait = "120" + user_data_file = "ubuntu_user_data.sh" + } + + RHEL_8 = { + recreate = "changethistorecreate1" + version = "rhel-cloud/rhel-8" + machine_type = "e2-medium" + description = "Red Hat Enterprise Linux 8" + default_user = "redhat" + zone = "us-west1-b" + wait = "300" + user_data_file = "rhel_user_data.sh" + } + + CENTOS_8 = { + recreate = "changethistorecreate1" + version = "centos-cloud/centos-stream-8" + machine_type = "e2-medium" + description = "CentOS Stream 8" + default_user = "centos" + zone = "us-west1-b" + wait = "120" + user_data_file = "rhel_user_data.sh" + } + } +} + +variable "compute_filter" { + type = list(any) + description = "list of compute instances to filter" + default = ["UBUNTU_20_04_LTS"] + # default = ["UBUNTU_18_04_LTS", "UBUNTU_20_04_LTS", "RHEL_8"] +} + +variable "zone" { + type = string + default = "a" + description = "zone to deploy to" +} + +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +# variable "region" { +# type = string +# description = "GCP region to deploy to" +# } + +variable "name_format" { + type = string + default = "arthur-util-%s" + description = "name prefix" +} + +variable "compute_instance_count" { + default = 1 + type = number + description = "compute_instance_count" +} + +# variable "config_bucket_name" { +# type = string +# } + +variable "open_ports" { + default = ["22", "80", "8080"] + type = list(string) + description = "list of open ports" +} + +variable "open_ports_udp" { + default = [] + type = list(string) + description = "list of open udp ports" +} + +variable "source_ranges" { + default = ["0.0.0.0/0"] + type = list(string) + description = "list of ips allowed to access - defaults to wide open" +} + +variable "metadata_startup_script" { + default = null + type = string + description = "content to append to base startup script" +} diff --git a/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/versions.tf b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/versions.tf new file mode 100644 index 0000000..e8623ff --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/helper_modules/gcp/compute_ubuntu_attached_bucket/versions.tf @@ -0,0 +1,17 @@ + + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + + random = { + source = "hashicorp/random" + version = ">= 3.4.3" + } + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/main.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/main.tf new file mode 100644 index 0000000..cc1bcfb --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/main.tf @@ -0,0 +1,24 @@ +locals { + +} + +resource "google_compute_global_address" "my_ip" { + name = format(var.name_format, "static-load-balancer") + project = var.project_id +} + +module "http_load_balancer" { + source = "./modules/http" + project_id = var.project_id + name_format = var.name_format + target_group_instances = var.target_group_instances + region = var.region +} + +module "network_load_balancer" { + source = "./modules/network" + project_id = var.project_id + name_format = var.name_format + target_group_instances = var.target_group_instances + region = var.region +} diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/main.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/main.tf new file mode 100644 index 0000000..06b4235 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/main.tf @@ -0,0 +1,129 @@ + +# used to forward traffic to the correct load balancer for HTTP load balancing +resource "google_compute_global_forwarding_rule" "global_forwarding_rule" { + name = format(var.name_format, "global-forwarding-rule") + project = var.project_id + target = google_compute_target_http_proxy.target_http_proxy.self_link + port_range = "80" +} + +resource "google_compute_global_forwarding_rule" "global_forwarding_rule_8080" { + name = format(var.name_format, "global-forwarding-rule2") + project = var.project_id + target = google_compute_target_http_proxy.target_http_proxy2.self_link + port_range = "8080" +} + +# used by one or more global forwarding rule to route incoming HTTP requests to a URL map +resource "google_compute_target_http_proxy" "target_http_proxy" { + name = format(var.name_format, "proxy") + project = var.project_id + url_map = google_compute_url_map.url_map.self_link +} + +# used by one or more global forwarding rule to route incoming HTTP requests to a URL map +resource "google_compute_target_http_proxy" "target_http_proxy2" { + name = format(var.name_format, "proxy2") + project = var.project_id + url_map = google_compute_url_map.url_map2.self_link +} + +# determine whether instances are responsive and able to do work +resource "google_compute_health_check" "healthcheck" { + project = var.project_id + name = format(var.name_format, "healthcheck") + timeout_sec = 5 + check_interval_sec = 5 + http_health_check { + port = 80 + } + log_config { + enable = true + } +} + +resource "google_compute_health_check" "healthcheck_8080" { + project = var.project_id + name = format(var.name_format, "healthcheck-8080") + timeout_sec = 5 + check_interval_sec = 5 + http_health_check { + port = 8080 + } +} + +resource "google_compute_url_map" "url_map2" { + name = format(var.name_format, "load-balancer2") + project = var.project_id + default_service = google_compute_backend_service.backend_service_flask.self_link +} +# used to route requests to a backend service based on rules that you define for the host and path of an incoming URL +resource "google_compute_url_map" "url_map" { + name = format(var.name_format, "load-balancer") + project = var.project_id + default_service = google_compute_backend_service.backend_service_apache.self_link +} + + +# creates a group of dissimilar virtual machine instances +resource "google_compute_instance_group" "web_private_group" { + project = var.project_id + name = format(var.name_format, "vm-group") + description = "Web servers instance group" + zone = "${var.region}-a" + + instances = var.target_group_instances + + named_port { + name = "http" + port = "80" + } + + named_port { + name = "flask" + port = "8080" + } +} + +# resource "google_compute_backend_service" "backend_service" { +# name = format(var.name_format, "backend-service") +# project = var.project_id +# port_name = "http" +# protocol = "HTTP" +# health_checks = ["${google_compute_health_check.healthcheck.self_link}"] + +# backend { +# group = google_compute_instance_group.web_private_group.self_link +# balancing_mode = "RATE" +# max_rate_per_instance = 5 +# } +# } + +# defines a group of virtual machines that will serve traffic for load balancing +resource "google_compute_backend_service" "backend_service_apache" { + name = format(var.name_format, "backend-service-apache") + project = var.project_id + port_name = "http" + protocol = "HTTP" + health_checks = [google_compute_health_check.healthcheck.self_link] + + backend { + group = google_compute_instance_group.web_private_group.self_link + balancing_mode = "RATE" + max_rate_per_instance = 5 + } +} + +resource "google_compute_backend_service" "backend_service_flask" { + name = format(var.name_format, "backend-service-flask") + project = var.project_id + port_name = "flask" + protocol = "HTTP" + health_checks = [google_compute_health_check.healthcheck_8080.self_link] + + backend { + group = google_compute_instance_group.web_private_group.self_link + balancing_mode = "RATE" + max_rate_per_instance = 5 + } +} diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/outputs.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/outputs.tf new file mode 100644 index 0000000..27a9665 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/outputs.tf @@ -0,0 +1,7 @@ +output "http_load_balancer_ip_address" { + value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address +} + +output "http_load_balancer_ip_address_8080" { + value = google_compute_global_forwarding_rule.global_forwarding_rule_8080.ip_address +} diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/providers.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/providers.tf new file mode 100644 index 0000000..5a8319a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/providers.tf @@ -0,0 +1,13 @@ +terraform { + + required_providers { + google = { + source = "hashicorp/google" + # version = "<= 4.37.0" + version = ">= 4.37.0" + } + + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/variables.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/variables.tf new file mode 100644 index 0000000..d921071 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/http/variables.tf @@ -0,0 +1,21 @@ +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "region" { + type = string + description = "GCP region to deploy to" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "name prefix" +} + +variable "target_group_instances" { + default = [] + description = "target_group_instances" + type = list(any) +} diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/main.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/main.tf new file mode 100644 index 0000000..8c0d3a4 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/main.tf @@ -0,0 +1,83 @@ +# ------------------------------------------------------------------------------ +# CREATE FORWARDING RULE +# ------------------------------------------------------------------------------ + +resource "google_compute_forwarding_rule" "default" { + # provider = google-beta + project = var.project_id + region = var.region + name = format(var.name_format, "forwarding-rule") + target = google_compute_target_pool.default.self_link + load_balancing_scheme = "EXTERNAL" + port_range = var.port_range + ip_address = var.ip_address + ip_protocol = var.protocol + + labels = var.custom_labels +} + +# ------------------------------------------------------------------------------ +# CREATE TARGET POOL +# ------------------------------------------------------------------------------ + +resource "google_compute_target_pool" "default" { + # provider = google-beta + project = var.project_id + name = format(var.name_format, "tp") + region = var.region + session_affinity = var.session_affinity + + instances = var.target_group_instances + + health_checks = google_compute_http_health_check.default[*].name +} + +# ------------------------------------------------------------------------------ +# CREATE HEALTH CHECK +# ------------------------------------------------------------------------------ + +resource "google_compute_http_health_check" "default" { + count = var.enable_health_check ? 1 : 0 + + # provider = google-beta + project = var.project_id + name = format(var.name_format, "hc") + request_path = var.health_check_path + port = var.health_check_port + check_interval_sec = var.health_check_interval + healthy_threshold = var.health_check_healthy_threshold + unhealthy_threshold = var.health_check_unhealthy_threshold + timeout_sec = var.health_check_timeout + +} + +# ------------------------------------------------------------------------------ +# CREATE FIREWALL FOR THE HEALTH CHECKS +# ------------------------------------------------------------------------------ + +# Health check firewall allows ingress tcp traffic from the health check IP addresses +resource "google_compute_firewall" "health_check" { + count = var.enable_health_check ? 1 : 0 + + # provider = google-beta + project = var.network_project == null ? var.project_id : var.network_project + name = format(var.name_format, "hc-fw") + network = var.network + + log_config { + metadata = "INCLUDE_ALL_METADATA" + } + + allow { + protocol = "tcp" + ports = [var.health_check_port] + } + + # These IP ranges are required for health checks + source_ranges = ["209.85.152.0/22", "209.85.204.0/22", "35.191.0.0/16"] + + # Target tags define the instances to which the rule applies + target_tags = var.firewall_target_tags + +} + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/outputs.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/outputs.tf new file mode 100644 index 0000000..4d44056 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/outputs.tf @@ -0,0 +1,3 @@ +output "network_load_balancer_ip_address" { + value = google_compute_forwarding_rule.default.ip_address +} diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/providers.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/providers.tf new file mode 100644 index 0000000..c6a1592 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/providers.tf @@ -0,0 +1,12 @@ +terraform { + + required_providers { + google = { + source = "hashicorp/google" + version = ">= 4.37.0" + } + + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/variables.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/variables.tf new file mode 100644 index 0000000..af1cfe8 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/modules/network/variables.tf @@ -0,0 +1,120 @@ +# --------------------------------------------------------------------------------------------------------------------- +# REQUIRED PARAMETERS +# These variables are expected to be passed in by the operator +# --------------------------------------------------------------------------------------------------------------------- + +variable "project_id" { + description = "The project ID to create the resources in." + type = string +} + +variable "region" { + description = "All resources will be launched in this region." + type = string +} + +variable "name_format" { + description = "Name for the load balancer forwarding rule and prefix for supporting resources." + type = string +} + +# --------------------------------------------------------------------------------------------------------------------- +# OPTIONAL MODULE PARAMETERS +# These variables have defaults, but may be overridden by the operator. +# --------------------------------------------------------------------------------------------------------------------- + +variable "network" { + description = "Self link of the VPC network in which to deploy the resources." + type = string + default = "default" +} + +variable "protocol" { + description = "The protocol for the backend and frontend forwarding rule. TCP or UDP." + type = string + default = "TCP" +} + +variable "ip_address" { + description = "IP address of the load balancer. If empty, an IP address will be automatically assigned." + type = string + default = null +} + +variable "port_range" { + description = "Only packets addressed to ports in the specified range will be forwarded to target. If empty, all packets will be forwarded." + type = string + default = "1-65535" +} + +variable "enable_health_check" { + description = "Flag to indicate if health check is enabled. If set to true, a firewall rule allowing health check probes is also created." + type = bool + default = true +} + +variable "health_check_port" { + description = "The TCP port number for the HTTP health check request." + type = number + default = 80 +} + +variable "health_check_healthy_threshold" { + description = "A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2." + type = number + default = 2 +} + +variable "health_check_unhealthy_threshold" { + description = "A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2." + type = number + default = 2 +} + +variable "health_check_interval" { + description = "How often (in seconds) to send a health check. Default is 5." + type = number + default = 5 +} + +variable "health_check_timeout" { + description = "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for 'health_check_timeout' to have greater value than 'health_check_interval'" + type = number + default = 5 +} + +variable "health_check_path" { + description = "The request path of the HTTP health check request. The default value is '/'." + type = string + default = "/" +} + +variable "firewall_target_tags" { + description = "List of target tags for the health check firewall rule." + type = list(string) + default = [] +} + +variable "network_project" { + description = "The name of the GCP Project where the network is located. Useful when using networks shared between projects. If empty, var.project will be used." + type = string + default = null +} + +variable "session_affinity" { + description = "The session affinity for the backends, e.g.: NONE, CLIENT_IP. Default is `NONE`." + type = string + default = "NONE" +} + +variable "target_group_instances" { + description = "List of self links to instances in the pool. Note that the instances need not exist at the time of target pool creation." + type = list(string) + default = [] +} + +variable "custom_labels" { + description = "A map of custom labels to apply to the resources. The key is the label name and the value is the label value." + type = map(string) + default = {} +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/outputs.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/outputs.tf new file mode 100644 index 0000000..bd42ddc --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/outputs.tf @@ -0,0 +1,42 @@ +output "http_load_balancer_ip" { + value = google_compute_global_address.my_ip +} + +output "http_load_balancer_ip_address" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = module.http_load_balancer.http_load_balancer_ip_address +} + +output "http_curl_load_balancer_ip_address" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = "curl -m1 ${module.http_load_balancer.http_load_balancer_ip_address}" +} + +output "http_curl_load_balance_ip_address_8080" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = "curl -m1 ${module.http_load_balancer.http_load_balancer_ip_address_8080}" +} + +output "network_load_balancer_ip" { + value = google_compute_global_address.my_ip +} + +output "network_load_balancer_ip_address" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = module.network_load_balancer.network_load_balancer_ip_address +} + +output "network_curl_load_balancer_ip_address" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = "curl -m1 ${module.network_load_balancer.network_load_balancer_ip_address}" +} + +output "load_balancer_list" { + # value = google_compute_global_forwarding_rule.global_forwarding_rule.ip_address + value = [ + { port = "80", address = "http://${module.network_load_balancer.network_load_balancer_ip_address}" }, + { port = "8080", address = "http://${module.http_load_balancer.http_load_balancer_ip_address_8080}" }, + { port = "80", address = "http://${module.http_load_balancer.http_load_balancer_ip_address}" }] +} + + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/providers.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/providers.tf new file mode 100644 index 0000000..5a8319a --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/providers.tf @@ -0,0 +1,13 @@ +terraform { + + required_providers { + google = { + source = "hashicorp/google" + # version = "<= 4.37.0" + version = ">= 4.37.0" + } + + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/loadbalancing/variables.tf b/modules/gcp_infrastructure/service_modules/loadbalancing/variables.tf new file mode 100644 index 0000000..6469635 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/loadbalancing/variables.tf @@ -0,0 +1,31 @@ +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "region" { + type = string + description = "GCP region to deploy to" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "name prefix" +} + +# variable "compute_instance_count" { +# default = 2 +# description = "compute_instance_count" +# } + +variable "target_group_instances" { + default = [] + description = "target_group_instances" + type = list(any) +} + +# variable "function_name" { +# type = string +# description = "function name" +# } diff --git a/modules/gcp_infrastructure/service_modules/redis/main.tf b/modules/gcp_infrastructure/service_modules/redis/main.tf new file mode 100644 index 0000000..6181600 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/main.tf @@ -0,0 +1,107 @@ +# You can't access redis via public ip - following commands allow you to port forward to vm on google cloud + +/* +REDIS_INTERNAL_IP=$(terraform output -json redis_host | jq -r '.') +REDIS_LOCATION_ID=$(terraform output -json redis_location_id | jq -r '.') +MY_COMPUTE_NAME=$(echo "$USER-redis-port-forwarder") +gcloud_create_instance="gcloud compute instances create ${MY_COMPUTE_NAME} --machine-type=f1-micro --zone=${REDIS_LOCATION_ID}" +gcloud_delete_instance="gcloud compute instances delete ${MY_COMPUTE_NAME} --zone=${REDIS_LOCATION_ID}" +gcloud_port_forward="gcloud compute ssh ${MY_COMPUTE_NAME} --zone=${REDIS_LOCATION_ID} -- -N -L 6379:${REDIS_INTERNAL_IP}:6379" +eval "$gcloud_create_instance" +eval "$gcloud_port_forward" + +# cleanup +eval "$gcloud_delete_instance" +*/ + +# https://cloud.google.com/memorystore/docs/redis/connect-redis-instance#connecting_from_a_local_machine_with_port_forwarding + + + + + +# resource "google_vpc_access_connector" "connector" { +# name = "redis-vpc-con" +# ip_cidr_range = "10.0.1.0/28" +# network = data.google_compute_network.default.name +# region = local.region +# } + + +resource "google_redis_instance" "cache" { + name = format(var.name_format, "ha-memory-cache") + tier = "STANDARD_HA" + memory_size_gb = 1 + project = var.project_id + region = var.region + # read_replicas_mode = "READ_REPLICAS_ENABLED" + + location_id = var.zone1 + alternative_location_id = var.zone2 + + redis_version = "REDIS_4_0" + display_name = "Terraform Test Instance" + + labels = { + my_key = "sample_env" + other_key = "redis_app" + } +} + +# resource "google_redis_instance" "cache_standard" { +# name = "memory-cache" +# tier = "BASIC" +# memory_size_gb = 1 +# project = local.project +# region = local.region2 + +# location_id = "${local.region2}-a" +# # alternative_location_id = "${local.region2}-c" + +# # authorized_network = data.google_compute_network.redis-network.id + +# redis_version = "REDIS_4_0" +# display_name = "Terraform Test Instance Standard" +# # reserved_ip_range = "192.168.0.0/29" + +# labels = { +# my_key = "arthur_test" +# other_key = "redis_app" +# } + +# } + +# resource "google_memcache_instance" "instance" { +# name = "tf-memcache-instance" +# # authorized_network = google_service_networking_connection.private_service_connection.network +# project = local.project +# region = local.region +# node_config { +# cpu_count = 1 +# memory_size_mb = 1024 +# } +# node_count = 3 +# memcache_version = "MEMCACHE_1_5" +# display_name = "Terraform Memcache" +# labels = { +# my_key = "arthur_test" +# other_key = "memcache_app" +# } + +# } +resource "google_project_iam_audit_config" "redis" { + project = var.project_id + service = "redis.googleapis.com" + audit_log_config { + log_type = "DATA_READ" + } + # audit_log_config { + # log_type = "DATA_READ" + # exempted_members = [ + # "user:joebloggs@hashicorp.com", + # ] + # } +} + + + diff --git a/modules/gcp_infrastructure/service_modules/redis/outputs.tf b/modules/gcp_infrastructure/service_modules/redis/outputs.tf new file mode 100644 index 0000000..6cd6c8c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/outputs.tf @@ -0,0 +1,11 @@ +output "port" { + value = google_redis_instance.cache.port +} + +output "host" { + value = google_redis_instance.cache.host +} + +output "location_id" { + value = google_redis_instance.cache.location_id +} diff --git a/modules/gcp_infrastructure/service_modules/redis/providers.tf b/modules/gcp_infrastructure/service_modules/redis/providers.tf new file mode 100644 index 0000000..57d8b5f --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/providers.tf @@ -0,0 +1,12 @@ +terraform { + + required_providers { + google = { + source = "hashicorp/google" + version = "<= 4.67.0" + } + + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/redis/tracing.py b/modules/gcp_infrastructure/service_modules/redis/tracing.py new file mode 100644 index 0000000..c4720a2 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/tracing.py @@ -0,0 +1,41 @@ +import os + +from opentelemetry import trace +from opentelemetry.sdk import trace as sdktrace +from opentelemetry.sdk.trace import export + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource +from opentelemetry.instrumentation.redis import RedisInstrumentor + +resource = Resource(attributes={SERVICE_NAME: "write_terraform"}) + +disable_logging = os.getenv("DISABLE_LOGGING") +console_logging = os.getenv("CONSOLE_LOGGING", False) +collector_logging = os.getenv("COLLECTOR_LOGGING", True) + +provider = sdktrace.TracerProvider(resource=resource) + +if disable_logging is None: + if console_logging == True: + print("Console Logging Enabled") + _processor2 = export.BatchSpanProcessor( + # Set indent to none to avoid multi-line logs + export.ConsoleSpanExporter( + formatter=lambda s: s.to_json(indent=None) + "\n" + ) + ) + provider.add_span_processor(_processor2) + + if collector_logging == True: + print("Collector Logging Enabled") + _processor = BatchSpanProcessor( + OTLPSpanExporter(endpoint="http://146.148.79.73:4317") + ) + provider.add_span_processor(_processor) + trace.set_tracer_provider(provider) + +tracer = trace.get_tracer(__name__) + +RedisInstrumentor().instrument(tracer=tracer) diff --git a/modules/gcp_infrastructure/service_modules/redis/variables.tf b/modules/gcp_infrastructure/service_modules/redis/variables.tf new file mode 100644 index 0000000..09a74de --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/variables.tf @@ -0,0 +1,25 @@ +variable "project_id" { + type = string + description = "GCP project to deploy to" +} + +variable "region" { + type = string + description = "GCP region to deploy to" +} + +variable "zone1" { + type = string + description = "GCP primary zone to deploy to" +} + +variable "zone2" { + type = string + description = "GCP alt zone to deploy to" +} + +variable "name_format" { + type = string + default = "gcp-test-%s" + description = "prefix for resources" +} diff --git a/modules/gcp_infrastructure/service_modules/redis/write_terraform_cache.py b/modules/gcp_infrastructure/service_modules/redis/write_terraform_cache.py new file mode 100755 index 0000000..803087e --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/redis/write_terraform_cache.py @@ -0,0 +1,643 @@ +#!/usr/bin/env python3 + +# ./write_terraform.py 41144592 ../service/compute/computeDashboard.tf + +# ./write_terraform.py 41145294 ../service/cloudsql/cloudSQLDashboard.tf + +# ./write_terraform.py 41144640 ../projectsDashboard.tf + +# ./write_terraform.py -d 41144640 -e hagrid-staging -n projectsDashboard.tf -c "/Users/Hagrid/github.com/content-eng-tools/auto-magical-dashboard/config.ini" +# ^ useful for aliasing like so: tfdash="/Users/Hagrid/github.com/content-eng-tools/auto-magical-dashboard/write_terraform.py -e hagrid-staging -c \"/Users/Hagrid/github.com/content-eng-tools/auto-magical-dashboard/config.ini\" -d" +# ^ with this alias, all you type is `tfdash 123456 -n myfancydash.tf` from any terminal + +# see https://github.com/observeinc/content-eng-tools/blob/main/engage_datasets/config/configfile.ini for example config file + +"""This file is for converting json produced by getTerraform GraphQL method""" + +import json +import sys +import os +import configparser +import re +import subprocess +import argparse +import logging + +import redis +import tracing +import traceback +import typing +import time + +try: + import requests +except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", "requests"]) + import requests +try: + from gql import gql, Client + from gql.transport.requests import RequestsHTTPTransport +except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", "gql"]) + subprocess.check_call([sys.executable, "-m", "pip", "install", "requests-toolbelt"]) + from gql import gql, Client + from gql.transport.requests import RequestsHTTPTransport + +redis_host = os.environ.get("REDIS_HOST", "localhost") +redis_port = int(os.environ.get("REDIS_PORT", 6379)) +redis_password = "" + +try: + # The decode_repsonses flag here directs the client to convert the responses from Redis into Python strings + # using the default encoding utf-8. This is client specific. + r = redis.StrictRedis( + host=redis_host, + port=redis_port, + password=redis_password, + decode_responses=True, + ) + + +except Exception as e: + print("Error in connecting to redis") + print(e) + # return e + +############################################################################### +############################################################################### + + +def getObserveConfig(config, environment, my_trace): + """Fetches config file""" + with my_trace.start_as_current_span("getObserveConfig") as child: + child.set_attribute("config_path", args.config_path) + # Set your Observe environment details in config\configfile.ini + configuration = configparser.ConfigParser() + configuration.read(args.config_path) + observe_configuration = configuration[environment] + + return observe_configuration[config] + + +############################################################################### +############################################################################### + + +def get_bearer_token(my_trace): + """Gets bearer token for login""" + with my_trace.start_as_current_span("get_bearer_token") as child: + child.set_attribute("domain", domain) + child.set_attribute("customer_id", customer_id) + + url = f"https://{customer_id}.{domain}.com/v1/login" + user_email = getObserveConfig("user_email", ENVIRONMENT, my_trace) + user_password = getObserveConfig("user_password", ENVIRONMENT, my_trace) + + message = '{"user_email":"$user_email$","user_password":"$user_password$"}' + + tokens_to_replace = { + "$user_email$": user_email, + "$user_password$": user_password, + } + + for key, value in tokens_to_replace.items(): + message = message.replace(key, value) + + header = { + "Content-Type": "application/json", + } + + response = json.loads( + requests.post(url, data=message, headers=header, timeout=10).text + ) + bear_toke = response["access_key"] + return bear_toke + + +############################################################################### +############################################################################### + + +def get_ids(file_name, my_trace): + """gets unique set of ids that need to be replaced in terraform def""" + with my_trace.start_as_current_span("get_ids") as child: + child.set_attribute("file_name", file_name) + my_list = [] + lines = [] + # read file + with open(file_name, "r", encoding="utf-8") as fp: + # read and store all lines into list + lines = fp.readlines() + + for _, line in enumerate(lines): + if "datasetId" in line or "keyForDatasetId" in line: + my_list = my_list + re.findall('"([^"]*)"', line) + + # convert to dict to eliminate duplicate values and then back to list + my_list = list(dict.fromkeys(my_list)) + + return my_list + + +############################################################################### +############################################################################### + + +def get_dashboard_terraform(dashboard_id, output_file_name, my_trace): + """get dashboard terraform from graphql""" + with my_trace.start_as_current_span("get_dashboard_terraform") as child: + params = {"dashboard_id": f"{dashboard_id}"} + paramskey = f"dashboardtf-{str(params)}" + dashboard_cache_hit = r.get(str(paramskey)) + + child.set_attribute("paramskey", paramskey) + + if dashboard_cache_hit is not None: + print(f"Dashboard Terraform Cache Hit") + child.set_attribute("cache_hit", "true") + file_string = dashboard_cache_hit + else: + child.set_attribute("cache_hit", "false") + toke = BEARERTOKEN + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + # Create a GraphQL client using the defined transport + client = Client( + transport=RequestsHTTPTransport( + url=META_URL, + retries=3, + headers={"Authorization": f"""Bearer {customer_id} {toke}"""}, + ), + fetch_schema_from_transport=True, + ) + + # Provide a GraphQL query + query = gql( + """ + query terraform($dashboard_id: ObjectId!) { + getTerraform( id:$dashboard_id, type: Dashboard){ + resource + } + } + """ + ) + + # Execute the query on the transport + try: + result = client.execute(query, variable_values=params) + file_string = result["getTerraform"]["resource"] + print("caching dashboard string") + r.set(paramskey, str(result["getTerraform"]["resource"]), ex=key_expiry) + except Exception as e: + print(str(e)) + + original_stdout = sys.stdout + + # write results to file + with open(output_file_name, "w", encoding="utf-8") as outfile: + sys.stdout = outfile # Change the standard output to the file we created. + # pylint: disable=unsubscriptable-object; + print(file_string) + sys.stdout = original_stdout # + + +############################################################################### +############################################################################### + + +def get_dashboard_name(dashboard_id, my_trace): + """get dashboard terraform from graphql""" + with my_trace.start_as_current_span("get_dashboard_name") as child: + params = { + "dashboard_id": f"{dashboard_id}", + } + + paramskey = f"dashboardname-{str(params)}" + + child.set_attribute("paramskey", paramskey) + + cache_hit = r.get(str(paramskey)) + + if cache_hit is not None: + print(f"Dashboard Name Cache Hit - {cache_hit}") + child.set_attribute("cache_hit", "true") + return cache_hit + else: + child.set_attribute("cache_hit", "false") + toke = BEARERTOKEN + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + # Create a GraphQL client using the defined transport + client = Client( + transport=RequestsHTTPTransport( + url=META_URL, + retries=3, + headers={"Authorization": f"""Bearer {customer_id} {toke}"""}, + ), + fetch_schema_from_transport=True, + ) + + # Provide a GraphQL query + query = gql( + """ + query dashboard($dashboard_id: ObjectId!){ + dashboard(id:$dashboard_id){ + name + } + } + """ + ) + + params = { + "dashboard_id": f"{dashboard_id}", + } + # Execute the query on the transport + result = client.execute(query, variable_values=params) + # pylint: disable=unsubscriptable-object; + print("caching dashboard name") + r.set(str(paramskey), result["dashboard"]["name"], ex=key_expiry) + return result["dashboard"]["name"] + + +############################################################################### +############################################################################### + + +def get_dataset_terraform(dataset_id, my_trace): + """get dashboard terraform from graphql""" + with my_trace.start_as_current_span("get_dataset_terraform") as child: + params = { + "dataset_id": f"{dataset_id}", + } + paramskey = f"datasettf-{str(params)}" + + child.set_attribute("paramskey", paramskey) + + dataset_cache_hit = r.get(str(paramskey)) + + if dataset_cache_hit is not None: + print(f"Dataset Terrafom Cache Hit") + child.set_attribute("cache_hit", "true") + return json.loads(dataset_cache_hit) + else: + child.set_attribute("cache_hit", "false") + toke = BEARERTOKEN + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + # Create a GraphQL client using the defined transport + client = Client( + transport=RequestsHTTPTransport( + url=META_URL, + retries=3, + headers={"Authorization": f"""Bearer {customer_id} {toke}"""}, + ), + fetch_schema_from_transport=True, + ) + + # Provide a GraphQL query + query = gql( + """ + query dataset ($dataset_id: ObjectId!){ + getTerraform(id:$dataset_id, type: Dataset) { + dataSource + importName + } + } + """ + ) + + # Execute the query on the transport + # print(params) + # print(len(params["dataset_id"])) + if len(params["dataset_id"]) == 8: + try: + + result = client.execute(query, variable_values=params) + print("caching dataset string") + r.set(paramskey, json.dumps(result), ex=key_expiry) + + return result + except: + return None + else: + return None + + +############################################################################### +############################################################################### + + +def get_dashboard_ids(my_trace): + with my_trace.start_as_current_span("get_dashboard_ids") as child: + params = {"terms": {"workspaceId": [f"{WORKSPACE_ID}"], "name": "GCP/"}} + paramskey = f"dashboardids-{str(params)}" + + child.set_attribute("paramskey", paramskey) + + dashboard_id_cache_hit = r.get(str(paramskey)) + + if dashboard_id_cache_hit is not None: + print(f"Dashboard IDs Cache Hit") + child.set_attribute("cache_hit", "true") + return json.loads(dashboard_id_cache_hit) + else: + child.set_attribute("cache_hit", "false") + toke = BEARERTOKEN + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + # Create a GraphQL client using the defined transport + client = Client( + transport=RequestsHTTPTransport( + url=META_URL, + retries=3, + headers={"Authorization": f"""Bearer {customer_id} {toke}"""}, + ), + fetch_schema_from_transport=True, + ) + + # Provide a GraphQL query + query = gql( + """ + query DashboardSearch($terms: DWSearchInput!, $maxCount: Int64) { + dashboardSearch(terms: $terms, maxCount: $maxCount) { + dashboards { + dashboard { + ...DashboardSummary + } + } + } + } + + fragment DashboardSummary on Dashboard { + ...WorkspaceEntity + } + + fragment WorkspaceEntity on WorkspaceObject { + id + name + } + """ + ) + + # Execute the query on the transport + result = client.execute(query, variable_values=params) + print("caching dashboard ids") + r.set( + paramskey, + json.dumps(result["dashboardSearch"]["dashboards"]), + ex=key_expiry, + ) + + return result["dashboardSearch"]["dashboards"] + + +######################################################################### +######################################################################### +def write_dashboard(my_trace): + """Used to write terraform file""" + # pylint: disable=invalid-name; + + with my_trace.start_as_current_span("write_dashboard_function") as child: + + child.set_attribute("REDIS_HOST", redis_host) + child.set_attribute("REDIS_PORT", redis_port) + + TMP_FILE_NAME = f"""{OUTPUTFILENAME_BASE}_tmp""" + + db_ids = get_dashboard_ids(my_trace) + + for dashboard in db_ids: + print(dashboard["dashboard"]["id"]) + DASHBOARD_ID = dashboard["dashboard"]["id"] + OUTPUTFILENAME = OUTPUTFILENAME_BASE.replace(".tf", f"{DASHBOARD_ID}.tf") + # writes to temp file + get_dashboard_terraform(DASHBOARD_ID, TMP_FILE_NAME, my_trace) + + DASHBOARD_NAME = get_dashboard_name(DASHBOARD_ID, my_trace) + + # gets list of unique dataset ids to replace + ids_to_replace = get_ids(TMP_FILE_NAME, my_trace) + + # dict for stuff we are replacing + stuff_to_replace_dict = {"datasets": []} + + # each dataset id + for dataset_id in ids_to_replace: + # get dataset terraform + result = get_dataset_terraform(dataset_id, my_trace) + + if result is not None: + dataset_obj = {} + + dataset_obj["dataset_id"] = dataset_id + # pylint: disable=unsubscriptable-object; + dataset_obj["variable_name"] = result["getTerraform"]["importName"] + print(result["getTerraform"]["importName"]) + # pylint: disable=unsubscriptable-object; + dataset_obj["terraform"] = result["getTerraform"]["dataSource"] + + stuff_to_replace_dict["datasets"].append(dataset_obj) + + original_stdout = sys.stdout + + # local to write to file + locals_def = [] + locals_def.append("locals {") + locals_def.append("workspace = var.workspace.oid") + locals_def.append( + f"""dashboard_name = format(var.name_format, "{DASHBOARD_NAME}")""" + ) + + workspace_oid = None + + for line in stuff_to_replace_dict["datasets"]: + # local variable name + variable_name = line["variable_name"] + # add to list to write to file + locals_def.append( + f"""{variable_name} = resource.observe_dataset.{variable_name}.id""" + ) + # get worspace and name for replacement with variables + workspace_oid = re.findall( + 'workspace[^"]*("[^"]*")', line["terraform"] + )[0] + name = re.findall('name[^"]*("[^"]*")', line["terraform"])[0] + + # replace + line["terraform"] = line["terraform"].replace( + workspace_oid, + f"local.workspace \n depends_on = [ resource.observe_dataset.{variable_name}]", + ) + line["terraform"] = line["terraform"].replace( + name, f"""format(var.name_format, {name})""" + ) + locals_def.append("}") + + # write everything to final terraform file + with open(OUTPUTFILENAME, "w", encoding="utf-8") as outfile: + sys.stdout = ( + outfile # Change the standard output to the file we created. + ) + + # write local variable definitions + for local_line in locals_def: + print(local_line) + + sys.stdout = original_stdout # + + dashboard_lines = [] + + # read dashboard temp file into lines + with open(TMP_FILE_NAME, "r", encoding="utf-8") as fp: + # read an store all lines into list + dashboard_lines = fp.readlines() + + # replace dataset ids with variable and write to file + with open(OUTPUTFILENAME, "a", encoding="utf-8") as fp: + + for _, line in enumerate(dashboard_lines): + + for dataset_line in stuff_to_replace_dict["datasets"]: + # pylint: disable=line-too-long; + line = line.replace( + '"{0}"'.format(dataset_line["dataset_id"]), + "local.{0}".format(dataset_line["variable_name"]), + ) + + if workspace_oid is not None: + line = line.replace(workspace_oid, "local.workspace") + + line = line.replace(DASHBOARD_NAME, "${local.dashboard_name}") + + fp.write(line) + if 'resource "observe_dashboard"' in line: + fp.write("description = local.dashboard_description\n") + + os.remove(TMP_FILE_NAME) + + terraform_command = f"terraform fmt {OUTPUTFILENAME}" + os.system(terraform_command) + + +######################################################################### +######################################################################### +parser = argparse.ArgumentParser(description="Observe UI to Terraform Object script") +parser.add_argument( + "-d", + dest="dash_id", + action="store", + required=False, + help="integer ID for dashboard", +) + +parser.add_argument( + "-w", + dest="workspace_id", + action="store", + required=True, + help="integer ID for workspace", +) + +parser.add_argument( + "-o", + dest="otel_trace_name", + action="store", + required=True, + help="trace name for OTEL", +) + +parser.add_argument( + "-e", + dest="env", + action="store", + help="name of environment set in config.ini file in brackets", +) +parser.add_argument( + "-n", + dest="output_name", + action="store", + help="(Optional) file name to output to. Default is output.tf", +) +parser.add_argument( + "-t", + dest="bearer_token", + action="store", + help="(Optional) Bearer token for authorization. Useful for SSO accounts", +) +parser.add_argument( + "-v", + dest="is_debug", + default=False, + action="store_true", + help="(Optional) Enable debug logging", +) +parser.add_argument( + "-c", + dest="config_path", + default="config.ini", + action="store", + help="(Optional) Set path to config.ini. E.g, /Users/Hagrid/github.com/content-eng-tools/auto-magical-dashboard/config.ini", +) +args = parser.parse_args() + +if args.is_debug: + logging.basicConfig(level=logging.DEBUG) + +TRACE_NAME = args.otel_trace_name +my_trace = tracing.tracer +# looper = [] +# looper.append({"key_expiry": 600, "wait": 30}) +key_expiry = 180 +for i in range(1, 10): + time.sleep((10 % i) * 10) + print((10 % i) * 10) + + with my_trace.start_as_current_span(f"write_dashboard_{TRACE_NAME}"): + ENVIRONMENT = args.env + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + domain = getObserveConfig("domain", ENVIRONMENT, my_trace) + OUTPUTFILENAME_BASE = args.output_name if args.output_name else "output.tf" + BEARERTOKEN = ( + args.bearer_token if args.bearer_token else get_bearer_token(my_trace) + ) + + DASHBOARD_ID = args.dash_id + WORKSPACE_ID = args.workspace_id + + customer_id = getObserveConfig("customer_id", ENVIRONMENT, my_trace) + domain = getObserveConfig("domain", ENVIRONMENT, my_trace) + META_URL = f"https://{customer_id}.{domain}.com/v1/meta" + + print("dashboard id:", DASHBOARD_ID) + print("file name:", OUTPUTFILENAME_BASE) + + print("workspace id:", WORKSPACE_ID) + print("otel trace name:", TRACE_NAME) + + OUTPUT_EXISTS = os.path.exists(OUTPUTFILENAME_BASE) + + write_dashboard(my_trace) + # for thing in span: + # print(thing) +# pylint: disable=pointless-string-statement; +""" +query terraform { + getTerraform( id:"41143378", type: Dashboard){ + resource + } + } + + python3 writeTerraform.py db.json + + grep -rh "datasetId" --include \*.tf | sed -e $'s/,/\\\n/g' | sed -e 's/[[:space:]]//g' | sort | uniq | sed -e 's/"datasetId"://g' + + query datasets { + datasetSearch(labelMatches:["GCP/Compute"]){ + dataset { + id + name + kind + label + workspaceId + } + } + } + + sed -i '' "s:41143354:"\${local.COMPUTE_INSTANCE}":g" *.tf +""" diff --git a/modules/gcp_infrastructure/service_modules/storage/main.tf b/modules/gcp_infrastructure/service_modules/storage/main.tf new file mode 100644 index 0000000..fa0b6cd --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/storage/main.tf @@ -0,0 +1,32 @@ +locals { + buckets = flatten([ + for i in range(0, var.bucket_count) : [ + { + bucket_name : format(var.name_format, "bucket-${random_id.bucket_prefix[i].hex}-${i}") + } + ] + ]) +} + +resource "random_id" "bucket_prefix" { + count = var.bucket_count + byte_length = 8 +} + +resource "google_storage_bucket" "bucket" { + for_each = { for key, value in local.buckets : key => value } + name = each.value.bucket_name # Every bucket name must be globally unique + location = "US" + uniform_bucket_level_access = true + project = var.project_id + force_destroy = var.force_destroy +} + +resource "google_storage_bucket_iam_binding" "landing_page_iam_binding" { + for_each = google_storage_bucket.bucket + bucket = each.value.name + role = "roles/storage.objectAdmin" + members = [ + "allUsers" + ] +} \ No newline at end of file diff --git a/modules/gcp_infrastructure/service_modules/storage/outputs.tf b/modules/gcp_infrastructure/service_modules/storage/outputs.tf new file mode 100644 index 0000000..394b46c --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/storage/outputs.tf @@ -0,0 +1,4 @@ +output "bucket" { + value = { for key, value in local.buckets : google_storage_bucket.bucket[key].name => google_storage_bucket.bucket[key] + } +} diff --git a/modules/gcp_infrastructure/service_modules/storage/providers.tf b/modules/gcp_infrastructure/service_modules/storage/providers.tf new file mode 100644 index 0000000..2635150 --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/storage/providers.tf @@ -0,0 +1,17 @@ +terraform { + + required_providers { + google = { + source = "hashicorp/google" + version = "<= 4.37.0" + } + + random = { + source = "hashicorp/random" + version = "3.4.3" + } + + } + required_version = ">= 1.3.0" +} + diff --git a/modules/gcp_infrastructure/service_modules/storage/variables.tf b/modules/gcp_infrastructure/service_modules/storage/variables.tf new file mode 100644 index 0000000..b83c0df --- /dev/null +++ b/modules/gcp_infrastructure/service_modules/storage/variables.tf @@ -0,0 +1,27 @@ +variable "project_id" { + type = string + description = "First project I want to create provider for" +} + +# variable "region" { +# type = string +# description = "First region I want to create provider for" +# } + +variable "name_format" { + type = string + description = "Name format" + default = "test1-%s" +} + +variable "bucket_count" { + type = number + default = 2 + description = "buckets to create" +} + +variable "force_destroy" { + type = bool + default = true + description = "force destroy bucket" +} diff --git a/modules/gcp_infrastructure/variables.tf b/modules/gcp_infrastructure/variables.tf new file mode 100644 index 0000000..13c7192 --- /dev/null +++ b/modules/gcp_infrastructure/variables.tf @@ -0,0 +1,35 @@ +variable "project_id" { + type = string + description = "GCP project to deploy sample env" +} + +variable "region" { + type = string + description = "GCP region to deploy sample env" +} + +variable "zone1" { + type = string + description = "GCP zone" +} + +variable "zone2" { + type = string + description = "GCP alternate zone" +} + +variable "name_format" { + type = string + description = "Format string to use for infra names." +} + +variable "observe" { + type = object({ + domain = optional(string) + customer_id = optional(string) + otel_datastream_token = optional(string) + host_datastream_token = optional(string) + }) + default = null + description = "Object with Observe credentials" +} diff --git a/modules/gcp_project/main.tf b/modules/gcp_project/main.tf new file mode 100644 index 0000000..de8567b --- /dev/null +++ b/modules/gcp_project/main.tf @@ -0,0 +1,76 @@ +locals { + services_to_enable = [ + "artifactregistry.googleapis.com", + "bigquery.googleapis.com", + "bigquerydatatransfer.googleapis.com", + "cloudapis.googleapis.com", + "cloudasset.googleapis.com", + "cloudbuild.googleapis.com", + "clouddebugger.googleapis.com", + "cloudfunctions.googleapis.com", + "cloudresourcemanager.googleapis.com", + "cloudscheduler.googleapis.com", + "cloudtrace.googleapis.com", + "compute.googleapis.com", + "container.googleapis.com", + "containerregistry.googleapis.com", + "iam.googleapis.com", + "logging.googleapis.com", + "monitoring.googleapis.com", + "pubsub.googleapis.com", + "run.googleapis.com", + "servicemanagement.googleapis.com", + "serviceusage.googleapis.com", + "storage.googleapis.com", + "redis.googleapis.com", + "memcache.googleapis.com", + "vpcaccess.googleapis.com", + "servicenetworking.googleapis.com" + ] +} + +resource "google_project" "project" { + name = var.project_name + project_id = var.project_id + #folder_id = "437079763664" + folder_id = var.folder_id + + billing_account = var.billing_account +} + + +resource "google_project_service" "project" { + for_each = { for value in local.services_to_enable : value => value } + project = var.project_id + service = each.value + + timeouts { + create = "30m" + update = "40m" + } + + disable_dependent_services = true + depends_on = [google_project.project] +} + +resource "google_project_iam_binding" "project" { + project = google_project.project.project_id + role = "roles/owner" + + members = setunion([ + ], var.project_owners + ) + + depends_on = [google_project.project] +} + +resource "google_project_iam_binding" "project_editor" { + project = google_project.project.project_id + role = "roles/editor" + + members = setunion([ + ], var.project_editors + ) + + depends_on = [google_project.project] +} diff --git a/modules/gcp_project/outputs.tf b/modules/gcp_project/outputs.tf new file mode 100644 index 0000000..c6926ed --- /dev/null +++ b/modules/gcp_project/outputs.tf @@ -0,0 +1,7 @@ +output "project" { + value = google_project.project +} + +output "project_id" { + value = var.project_id +} \ No newline at end of file diff --git a/modules/gcp_project/variables.tf b/modules/gcp_project/variables.tf new file mode 100644 index 0000000..bb287af --- /dev/null +++ b/modules/gcp_project/variables.tf @@ -0,0 +1,29 @@ +variable "org_id" { + type = string +} + +variable "folder_id" { + type = string +} + +variable "project_id" { + type = string +} + +variable "project_name" { + type = string +} + +variable "billing_account" { + type = string +} + +variable "project_owners" { + type = list(string) + default = [] +} + +variable "project_editors" { + type = list(string) + default = [] +} diff --git a/modules/gcp_project_services/main.tf b/modules/gcp_project_services/main.tf new file mode 100644 index 0000000..3d0e9a0 --- /dev/null +++ b/modules/gcp_project_services/main.tf @@ -0,0 +1,16 @@ + +locals { + services_to_enable = var.services_to_enable +} + +resource "google_project_service" "project" { + for_each = { for value in local.services_to_enable : value => value } + project = var.project_id + service = each.value + + timeouts { + create = "2m" + update = "2m" + } + disable_dependent_services = true +} diff --git a/modules/gcp_project_services/output.tf b/modules/gcp_project_services/output.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/gcp_project_services/variables.tf b/modules/gcp_project_services/variables.tf new file mode 100644 index 0000000..c375100 --- /dev/null +++ b/modules/gcp_project_services/variables.tf @@ -0,0 +1,14 @@ +variable "services_to_enable" { + description = "List of Google API Services to enable" + type = list(string) +} + +# variable "service_to_enable" { +# description = "Google API Services to enable" +# type = string +# } + +variable "project_id" { + type = string + description = "GCP project_id" +} \ No newline at end of file diff --git a/modules/observe_metrics_poller/main.tf b/modules/observe_metrics_poller/main.tf new file mode 100644 index 0000000..5293471 --- /dev/null +++ b/modules/observe_metrics_poller/main.tf @@ -0,0 +1,12 @@ +module "monitoring_poller" { + source = "./monitoring" + workspace = var.workspace + datastream = var.datastream + name = format(var.name_format, "metrics") + description = "terraform only poller" + project = var.project_id + #service_account_private_key_json = base64decode(module.observe_gcp_collection.service_account_key.private_key) + service_account_private_key_json = var.service_account_private_key_json + + include_metric_type_prefixes = var.metric_prefixes +} diff --git a/modules/observe_metrics_poller/monitoring/README.md b/modules/observe_metrics_poller/monitoring/README.md new file mode 100644 index 0000000..cae61a0 --- /dev/null +++ b/modules/observe_metrics_poller/monitoring/README.md @@ -0,0 +1,6 @@ +Before setting up this [poller](https://docs.observeinc.com/en/latest/content/common-topics/ObserveGlossary.html) you +typically should follow the [GCP App installation prerequisites](https://docs.observeinc.com/en/latest/content/integrations/gcp/gcp.html#installation) to collect your GCP project data. + +The GCP Monitoring poller periodically fetches metrics for a GCP project. + +You will need a service account private key in Json format to set up this poller. diff --git a/modules/observe_metrics_poller/monitoring/main.tf b/modules/observe_metrics_poller/monitoring/main.tf new file mode 100644 index 0000000..e0f3a72 --- /dev/null +++ b/modules/observe_metrics_poller/monitoring/main.tf @@ -0,0 +1,15 @@ +resource "observe_poller" "gcp_monitoring" { + workspace = var.workspace.oid + name = var.name + interval = var.interval_duration + + datastream = var.datastream.oid + + gcp_monitoring { + project_id = var.project + json_key = var.service_account_private_key_json + + include_metric_type_prefixes = var.include_metric_type_prefixes + exclude_metric_type_prefixes = var.exclude_metric_type_prefixes + } +} \ No newline at end of file diff --git a/modules/observe_metrics_poller/monitoring/metadata.yaml b/modules/observe_metrics_poller/monitoring/metadata.yaml new file mode 100644 index 0000000..b04d26f --- /dev/null +++ b/modules/observe_metrics_poller/monitoring/metadata.yaml @@ -0,0 +1,5 @@ +name: monitoring poller +description: Onboard metrics for a GCP project +kind: poller +requiredvariables: +- datastream diff --git a/modules/observe_metrics_poller/monitoring/outputs.tf b/modules/observe_metrics_poller/monitoring/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/observe_metrics_poller/monitoring/variables.tf b/modules/observe_metrics_poller/monitoring/variables.tf new file mode 100644 index 0000000..bfd4028 --- /dev/null +++ b/modules/observe_metrics_poller/monitoring/variables.tf @@ -0,0 +1,88 @@ + +variable "name" { + type = string + description = "Poller name. Should be unique per datastream." + default = "Monitoring" +} + +# tflint-ignore: terraform_unused_declarations +variable "description" { + type = string + description = "Short description meant for other humans" + default = "GCP Poller for Google Cloud Monitoring" +} + +variable "workspace" { + type = object({ oid = string }) + description = "Workspace to apply module to." +} + +variable "datastream" { + type = object({ + oid = string + }) + description = <<-EOF + Datastream to derive resources from. + EOF +} + +variable "project" { + type = string + description = "GCP Project ID" +} + +variable "service_account_private_key_json" { + sensitive = true + type = string + description = <<-EOF + A GCP Service Account should include the following roles: Monitoring Viewer (roles/monitoring.viewer), + Cloud Asset Viewer (roles/cloudasset.viewer), and Browser (roles/browser). + + Please enter the entire JSON string of your service account. + EOF +} + +variable "interval_duration" { + type = string + default = "5m0s" + description = <<-EOF + How frequently to poll for metrics from Google Cloud Monitoring. Minimum value is 1m0s. + EOF +} + +variable "include_metric_type_prefixes" { + type = list(string) + default = [ + "cloudfunctions.googleapis.com/", + "cloudsql.googleapis.com/", + "compute.googleapis.com/", + "iam.googleapis.com/", + "logging.googleapis.com/", + "monitoring.googleapis.com/", + "pubsub.googleapis.com/", + "serviceruntime.googleapis.com/", + "storage.googleapis.com/", + "bigquery.googleapis.com/", + "loadbalancing.googleapis.com", + "kubernetes.io/", + "redis.googleapis.com", + "memcache.googleapis.com", + "vpcaccess.googleapis.com" + ] + description = <<-EOF + Metrics with these Metric Types with these prefixes will be fetched. + + See https://cloud.google.com/monitoring/api/metrics_gcp for a list of Metric Types. + EOF +} + +variable "exclude_metric_type_prefixes" { + type = list(string) + default = [] + description = <<-EOF + Metrics with these Metric Types with these prefixes will not be fetched. This + variable takes precendence over "metrics_poller_include_metric_type_prefixes". + + See https://cloud.google.com/monitoring/api/metrics_gcp for a list of Metric Types. + EOF +} diff --git a/modules/observe_metrics_poller/monitoring/versions.tf b/modules/observe_metrics_poller/monitoring/versions.tf new file mode 100644 index 0000000..a39b2ae --- /dev/null +++ b/modules/observe_metrics_poller/monitoring/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + observe = { + source = "terraform.observeinc.com/observeinc/observe" + version = "~>0.13" + } + } + required_version = ">= 1.3.0" +} diff --git a/modules/observe_metrics_poller/outputs.tf b/modules/observe_metrics_poller/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/observe_metrics_poller/variables.tf b/modules/observe_metrics_poller/variables.tf new file mode 100644 index 0000000..e243258 --- /dev/null +++ b/modules/observe_metrics_poller/variables.tf @@ -0,0 +1,49 @@ +variable "workspace" { + type = object({ oid = string, id = string }) + description = "Workspace to apply module to." +} + +variable "datastream" { + type = object({ + oid = string + }) + description = <<-EOF + Datastream to derive resources from. + EOF +} + +variable "project_id" { + type = string + description = "GCP project_id" +} + +variable "name_format" { + type = string + description = "Format string to use for infra names." +} + +variable "service_account_private_key_json" { + type = string + description = "The GCP Service Accont Key to authenticate polling the API" +} + +variable "metric_prefixes" { + description = "Default metric prefixes to poll" + type = list(string) + default = [ + "cloudfunctions.googleapis.com", + "cloudasset.googleapis.com", + "logging.googleapis.com", + "iam.googleapis.com", + "monitoring.googleapis.com", + "pubsub.googleapis.com", + "storage.googleapis.com", + "sql-component.googleapis.com", + "compute.googleapis.com", + "serviceusage.googleapis.com", + "servicenetworking.googleapis.com", + "container.googleapis.com", + "redis.googleapis.com", + "run.googleapis.com" + ] +} \ No newline at end of file diff --git a/modules/observe_pubsub_poller/README.md b/modules/observe_pubsub_poller/README.md new file mode 100644 index 0000000..15d1c88 --- /dev/null +++ b/modules/observe_pubsub_poller/README.md @@ -0,0 +1,10 @@ +Before setting up this [poller](https://docs.observeinc.com/en/latest/content/common-topics/ObserveGlossary.html) you +typically should follow the [GCP App installation prerequisites](https://docs.observeinc.com/en/latest/content/integrations/gcp/gcp.html#installation) to collect your GCP data. + +This poller can also be used to ingest custom data from any pull-based Pub/Sub topic. +It is a useful, lower-cost way to get large amounts of data from GCP into Observe. + +The GCP Pub/Sub poller periodically fetches messages from a pull-based Pub/Sub subscription. + +You will need the name of the Pub/Sub subscription and a service account private key in Json format to set up this poller. +The service account should have permission to read messages from the subscription. diff --git a/modules/observe_pubsub_poller/main.tf b/modules/observe_pubsub_poller/main.tf new file mode 100644 index 0000000..79eb85c --- /dev/null +++ b/modules/observe_pubsub_poller/main.tf @@ -0,0 +1,12 @@ +resource "observe_poller" "pubsub_poller" { + workspace = var.workspace.oid + name = var.name + + datastream = var.datastream.oid + + pubsub { + project_id = var.project + subscription_id = var.subscription + json_key = var.service_account_private_key_json + } +} diff --git a/modules/observe_pubsub_poller/metadata.yaml b/modules/observe_pubsub_poller/metadata.yaml new file mode 100644 index 0000000..f943f3a --- /dev/null +++ b/modules/observe_pubsub_poller/metadata.yaml @@ -0,0 +1,5 @@ +name: pubsub events +description: Onboard data using a GCP Pub/Sub Subscription +kind: poller +requiredvariables: +- datastream diff --git a/modules/observe_pubsub_poller/outputs.tf b/modules/observe_pubsub_poller/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/observe_pubsub_poller/variables.tf b/modules/observe_pubsub_poller/variables.tf new file mode 100644 index 0000000..e8969ce --- /dev/null +++ b/modules/observe_pubsub_poller/variables.tf @@ -0,0 +1,46 @@ +variable "name" { + type = string + description = "Poller name. Should be unique per datastream." + default = "PubSub" +} + +# tflint-ignore: terraform_unused_declarations +variable "description" { + type = string + description = "Short description meant for other humans" + default = "GCP Poller for Pub/Sub data" +} + +variable "workspace" { + type = object({ oid = string }) + description = "Workspace to apply module to." +} + +variable "datastream" { + type = object({ + oid = string + }) + description = <<-EOF + Datastream to derive resources from. + EOF +} + +variable "project" { + type = string + description = "GCP Project ID" +} + +variable "subscription" { + type = string + description = "GCP Pub/Sub Subscription ID (from topic)" +} + +variable "service_account_private_key_json" { + sensitive = true + type = string + description = <<-EOF + A GCP Service Account should include the following role: Pub/Sub Subscriber (roles/pubsub.subscriber). + + Please enter the entire JSON string of your service account. + EOF +} diff --git a/modules/observe_pubsub_poller/versions.tf b/modules/observe_pubsub_poller/versions.tf new file mode 100644 index 0000000..a39b2ae --- /dev/null +++ b/modules/observe_pubsub_poller/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + observe = { + source = "terraform.observeinc.com/observeinc/observe" + version = "~>0.13" + } + } + required_version = ">= 1.3.0" +} diff --git a/provider.tf b/provider.tf new file mode 100644 index 0000000..57684a5 --- /dev/null +++ b/provider.tf @@ -0,0 +1,13 @@ +# provider "google"{ +# project = "joe-test-proj" +# credentials = file("/Users/joe/.config/gcloud/application_default_credentials.json") +# #billing_project = "01801F-9A90AB-CAFEC6" +# #billing_project = "content-eng-billing-report" +# } + +# provider "google" { +# alias = "asset_folder_feed" +# credentials = file("/Users/joe/Downloads/joe-test-proj-da952aedf9fa.json") +# project = var.project_id +# region = var.region +# } \ No newline at end of file diff --git a/variables.tf b/variables.tf index 0115c1f..bb8fc18 100644 --- a/variables.tf +++ b/variables.tf @@ -19,7 +19,6 @@ variable "resource" { EOF type = string - validation { condition = length(split("/", var.resource)) == 2 error_message = "The resource value must be formatted as /." @@ -31,6 +30,11 @@ variable "resource" { } } +# variable "project_id" { +# type = string +# description = "GCP project to deploy sample env" +# } + variable "labels" { description = <<-EOF A map of labels to add to resources (https://cloud.google.com/resource-manager/docs/creating-managing-labels)" @@ -106,7 +110,11 @@ variable "function_roles" { "roles/cloudasset.viewer", "roles/browser", "roles/logging.viewer", - "roles/monitoring.viewer" # for viewing projects + "roles/monitoring.viewer", # for viewing projects + "roles/storage.objectCreator", + "roles/storage.objectViewer", + "roles/storage.objectAdmin", + "roles/storage.admin" ] } @@ -125,13 +133,13 @@ variable "folder_include_children" { variable "function_bucket" { description = "GCS bucket containing the Cloud Function source code" type = string - default = "observeinc" + default = "observeinc-colin" } variable "function_object" { description = "GCS object key of the Cloud Function source code zip file" type = string - default = "google-cloud-functions-v0.2.0.zip" + default = "google-cloud-functions-v0.3.0-alpha.7.zip" } variable "function_schedule" { @@ -169,6 +177,18 @@ variable "function_disable_logging" { default = false } +variable "function_output_bucket" { + description = "The Google Cloud Storage (GCS) bucket where the function output will be stored." + type = string + default = "chutchinson-export-assets" +} + +variable "function_schedule_frequency" { + description = "Cron schedule for the job" + type = string + default = "0 * * * *" +} + variable "poller_roles" { description = <<-EOF A list of IAM roles to give the Observe poller (through the service account key output).