From caf16bc03de557c096ffb07cd1b7e2eae92bd1ff Mon Sep 17 00:00:00 2001 From: Stepan Date: Fri, 9 Mar 2018 19:00:33 +0300 Subject: [PATCH 001/173] Concurrency fix for EventBus Prevent a possible race condition in InMemoryEventBusSubscriptionsManager --- .../EventBus/InMemoryEventBusSubscriptionsManager.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs index 88be8cf96..305f9ff8a 100644 --- a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs +++ b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs @@ -112,10 +112,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus private void RaiseOnEventRemoved(string eventName) { var handler = OnEventRemoved; - if (handler != null) - { - OnEventRemoved(this, eventName); - } + handler?.Invoke(this, eventName); } From fb7d83f82f5814d7ff8daf99ee1fd2569ed5bc4c Mon Sep 17 00:00:00 2001 From: vyunev Date: Thu, 10 May 2018 12:01:10 +0300 Subject: [PATCH 002/173] Fix AKS creation command There is no need in DNS parameter for AKS creation command as gen-k8s-env-aks.ps1 does not have it. --- k8s/README.k8s.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/README.k8s.md b/k8s/README.k8s.md index 77acdf236..c9e32f5f4 100644 --- a/k8s/README.k8s.md +++ b/k8s/README.k8s.md @@ -13,7 +13,7 @@ The k8s directory contains Kubernetes configuration for the eShopOnContainers ap >``` or using AKS instead of ACS >``` ->./gen-k8s-env-aks -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -dnsName k8s-dns -serviceName k8s-cluster -createAcr true -nodeCount 3 -nodeVMSize Standard_D2_v2 +>./gen-k8s-env-aks -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -serviceName k8s-cluster -createAcr true -nodeCount 3 -nodeVMSize Standard_D2_v2 >``` * A Docker development environment with `docker` and `docker-compose`. From fbf89f8fc77c039eeef952a4b651948933894934 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 17 Jul 2018 11:04:29 +0200 Subject: [PATCH 003/173] 1st devspaces test --- .../aggregator/Dockerfile.develop | 16 +++++ .../aggregator/Properties/launchSettings.json | 7 ++ .../Mobile.Bff.Shopping/aggregator/azds.yaml | 36 ++++++++++ .../Catalog/Catalog.API/Dockerfile.develop | 25 +++++++ .../Properties/launchSettings.json | 7 ++ src/Services/Catalog/Catalog.API/azds.yaml | 36 ++++++++++ .../Catalog.API/charts/catalogapi/.helmignore | 21 ++++++ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 ++ .../charts/catalogapi/templates/NOTES.txt | 19 +++++ .../charts/catalogapi/templates/_helpers.tpl | 32 +++++++++ .../catalogapi/templates/deployment.yaml | 72 +++++++++++++++++++ .../charts/catalogapi/templates/ingress.yaml | 39 ++++++++++ .../charts/catalogapi/templates/secrets.yaml | 12 ++++ .../charts/catalogapi/templates/service.yaml | 19 +++++ .../Catalog.API/charts/catalogapi/values.yaml | 60 ++++++++++++++++ 15 files changed, 406 insertions(+) create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/Dockerfile.develop create mode 100644 src/Services/Catalog/Catalog.API/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop new file mode 100644 index 000000000..e34f6ac1d --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" +RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json index 925e70b0d..c259d5094 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json @@ -24,6 +24,13 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:61632/" + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml new file mode 100644 index 000000000..dca11afbf --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/aggregator + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]aggregator...aksapp.io + - $(spacePrefix)aggregator$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop new file mode 100644 index 000000000..b9ec5f171 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -0,0 +1,25 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Catalog/Catalog.API" +RUN dotnet build "Catalog.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index 2b21ca280..f5e2b7149 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -23,6 +23,13 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml new file mode 100644 index 000000000..34397b646 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/catalogapi + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]catalogapi...aksapp.io + - $(spacePrefix)catalogapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml new file mode 100644 index 000000000..1c221148d --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: catalogapi +version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt new file mode 100644 index 000000000..ed8159763 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl new file mode 100644 index 000000000..908f9d8a3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "catalogapi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "catalogapi.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "catalogapi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml new file mode 100644 index 000000000..1b3777856 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "catalogapi.name" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + annotations: + buildID: {{ .Values.buildID }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + {{- if not .Values.disableProbes }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- $root := . }} + {{- range $ref, $values := .Values.secrets }} + {{- range $key, $value := $values }} + - name: {{ $ref }}_{{ $key }} + valueFrom: + secretKeyRef: + name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} + key: {{ $key }} + {{- end }} + {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml new file mode 100644 index 000000000..b52fc0f37 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "catalogapi.fullname" . -}} +{{- $servicePort := .Values.service.port -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml new file mode 100644 index 000000000..e13fb46d3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml @@ -0,0 +1,12 @@ +{{- $root := . }} +{{- range $name, $values := .Values.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} +data: + {{- range $key, $value := $values }} + {{ $key }}: {{ $value | b64enc }} + {{- end }} +--- +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml new file mode 100644 index 000000000..1c3572dec --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml new file mode 100644 index 000000000..5159ffa6e --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml @@ -0,0 +1,60 @@ +# Default values for catalogapi. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +fullnameOverride: catalogapi +replicaCount: 1 +image: + repository: catalogapi + tag: stable + pullPolicy: IfNotPresent +imagePullSecrets: [] + # Optionally specify an array of imagePullSecrets. + # Secrets must be manually created in the namespace. + # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod + # + # This uses credentials from secret "myRegistryKeySecretName". + # - name: myRegistryKeySecretName +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + # kubernetes.io/tls-acme: "true" + path: / + # hosts: + # - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local +secrets: {} + # Optionally specify a set of secret objects whose values + # will be injected as environment variables by default. + # You should add this section to a file like secrets.yaml + # that is explicitly NOT committed to source code control + # and then include it as part of your helm install step. + # ref: https://kubernetes.io/docs/concepts/configuration/secret/ + # + # This creates a secret "mysecret" and injects "mypassword" + # as the environment variable mysecret_mypassword=password. + # mysecret: + # mypassword: password +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file From 91d06af314be6f57dcc4cae16ce1a65d6506db0f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 31 Jul 2018 17:22:27 +0200 Subject: [PATCH 004/173] starting deploys to devspaces --- src/Services/Basket/Basket.API/.dockerignore | 14 ++++ .../Basket/Basket.API/Dockerfile.develop | 21 ++++++ src/Services/Basket/Basket.API/app.yaml | 43 +++++++++++ src/Services/Basket/Basket.API/azds.yaml | 39 ++++++++++ src/Services/Basket/Basket.API/inf.yaml | 18 +++++ .../Catalog/Catalog.API/Dockerfile.develop | 2 +- .../Properties/launchSettings.json | 4 +- src/Services/Catalog/Catalog.API/app.yaml | 39 ++++++++++ src/Services/Catalog/Catalog.API/azds.yaml | 9 ++- .../Catalog.API/charts/catalogapi/.helmignore | 21 ------ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 -- .../charts/catalogapi/templates/NOTES.txt | 19 ----- .../charts/catalogapi/templates/_helpers.tpl | 32 --------- .../catalogapi/templates/deployment.yaml | 72 ------------------- .../charts/catalogapi/templates/ingress.yaml | 39 ---------- .../charts/catalogapi/templates/secrets.yaml | 12 ---- .../charts/catalogapi/templates/service.yaml | 19 ----- .../Catalog.API/charts/catalogapi/values.yaml | 60 ---------------- src/Services/Catalog/Catalog.API/inf.yaml | 25 +++++++ .../Identity/Identity.API/.dockerignore | 14 ++++ .../Identity/Identity.API/Dockerfile.develop | 17 +++++ src/Services/Identity/Identity.API/app.yaml | 39 ++++++++++ src/Services/Identity/Identity.API/azds.yaml | 42 +++++++++++ src/Services/Identity/Identity.API/inf.yaml | 29 ++++++++ .../Ordering/Ordering.API/.dockerignore | 14 ++++ .../Ordering/Ordering.API/Dockerfile.develop | 26 +++++++ src/Services/Ordering/Ordering.API/app.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/azds.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/inf.yaml | 22 ++++++ 29 files changed, 498 insertions(+), 284 deletions(-) create mode 100644 src/Services/Basket/Basket.API/.dockerignore create mode 100644 src/Services/Basket/Basket.API/Dockerfile.develop create mode 100644 src/Services/Basket/Basket.API/app.yaml create mode 100644 src/Services/Basket/Basket.API/azds.yaml create mode 100644 src/Services/Basket/Basket.API/inf.yaml create mode 100644 src/Services/Catalog/Catalog.API/app.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml create mode 100644 src/Services/Catalog/Catalog.API/inf.yaml create mode 100644 src/Services/Identity/Identity.API/.dockerignore create mode 100644 src/Services/Identity/Identity.API/Dockerfile.develop create mode 100644 src/Services/Identity/Identity.API/app.yaml create mode 100644 src/Services/Identity/Identity.API/azds.yaml create mode 100644 src/Services/Identity/Identity.API/inf.yaml create mode 100644 src/Services/Ordering/Ordering.API/.dockerignore create mode 100644 src/Services/Ordering/Ordering.API/Dockerfile.develop create mode 100644 src/Services/Ordering/Ordering.API/app.yaml create mode 100644 src/Services/Ordering/Ordering.API/azds.yaml create mode 100644 src/Services/Ordering/Ordering.API/inf.yaml diff --git a/src/Services/Basket/Basket.API/.dockerignore b/src/Services/Basket/Basket.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Basket/Basket.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop new file mode 100644 index 000000000..b7d715b28 --- /dev/null +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -0,0 +1,21 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src + +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"] + +RUN dotnet restore src/Services/Basket/Basket.API/Basket.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR /src/src/Services/Basket/Basket.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/app.yaml b/src/Services/Basket/Basket.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Basket/Basket.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Basket/Basket.API/azds.yaml b/src/Services/Basket/Basket.API/azds.yaml new file mode 100644 index 000000000..597c79d8c --- /dev/null +++ b/src/Services/Basket/Basket.API/azds.yaml @@ -0,0 +1,39 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/basket-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + hosts: + # This expands to [space.s.]basketapi...aksapp.io + - $(spacePrefix)basketapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Basket/Basket.API/inf.yaml b/src/Services/Basket/Basket.API/inf.yaml new file mode 100644 index 000000000..3e3e143da --- /dev/null +++ b/src/Services/Basket/Basket.API/inf.yaml @@ -0,0 +1,18 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: # inf.redis defines the redis' connection strings + basket: + svc: basket-data # Name of k8s svc for basket redis + constr: basket-data # Connection string to Redis used by Basket API + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index b9ec5f171..b62c7f6e3 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -17,7 +17,7 @@ COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Mic COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/Services/Catalog/Catalog.API" RUN dotnet build "Catalog.API.csproj" diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index f5e2b7149..598254915 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -27,8 +27,8 @@ "Azure Dev Spaces": { "commandName": "AzureDevSpaces", "launchBrowser": true, - "resourceGroup": "eshoptestedu", - "aksName": "eshoptestedu", + "resourceGroup": "edu-devspaces3", + "aksName": "edu-devspaces3", "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } diff --git a/src/Services/Catalog/Catalog.API/app.yaml b/src/Services/Catalog/Catalog.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index 34397b646..7ea0ae087 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/catalogapi + chart: ../../../../k8s/helm/catalog-api values: - values.dev.yaml? - secrets.dev.yaml? + - inf.yaml + - app.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)basketapi$(hostSuffix)" disableProbes: true ingress: hosts: # This expands to [space.s.]catalogapi...aksapp.io - - $(spacePrefix)catalogapi$(hostSuffix) + - $(spacePrefix)basketapi$(hostSuffix) configurations: develop: build: diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore deleted file mode 100644 index f0c131944..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml deleted file mode 100644 index 1c221148d..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: catalogapi -version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt deleted file mode 100644 index ed8159763..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt +++ /dev/null @@ -1,19 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl deleted file mode 100644 index 908f9d8a3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "catalogapi.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "catalogapi.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "catalogapi.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml deleted file mode 100644 index 1b3777856..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "catalogapi.name" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - annotations: - buildID: {{ .Values.buildID }} - spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - {{- if not .Values.disableProbes }} - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - {{- end }} - env: - {{- $root := . }} - {{- range $ref, $values := .Values.secrets }} - {{- range $key, $value := $values }} - - name: {{ $ref }}_{{ $key }} - valueFrom: - secretKeyRef: - name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} - key: {{ $key }} - {{- end }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml deleted file mode 100644 index b52fc0f37..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "catalogapi.fullname" . -}} -{{- $servicePort := .Values.service.port -}} -{{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml deleted file mode 100644 index e13fb46d3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- $root := . }} -{{- range $name, $values := .Values.secrets }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} -data: - {{- range $key, $value := $values }} - {{ $key }}: {{ $value | b64enc }} - {{- end }} ---- -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml deleted file mode 100644 index 1c3572dec..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml deleted file mode 100644 index 5159ffa6e..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Default values for catalogapi. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -fullnameOverride: catalogapi -replicaCount: 1 -image: - repository: catalogapi - tag: stable - pullPolicy: IfNotPresent -imagePullSecrets: [] - # Optionally specify an array of imagePullSecrets. - # Secrets must be manually created in the namespace. - # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - # - # This uses credentials from secret "myRegistryKeySecretName". - # - name: myRegistryKeySecretName -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: - kubernetes.io/ingress.class: addon-http-application-routing - # kubernetes.io/tls-acme: "true" - path: / - # hosts: - # - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -secrets: {} - # Optionally specify a set of secret objects whose values - # will be injected as environment variables by default. - # You should add this section to a file like secrets.yaml - # that is explicitly NOT committed to source code control - # and then include it as part of your helm install step. - # ref: https://kubernetes.io/docs/concepts/configuration/secret/ - # - # This creates a secret "mysecret" and injects "mypassword" - # as the environment variable mysecret_mypassword=password. - # mysecret: - # mypassword: password -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi -nodeSelector: {} - -tolerations: [] - -affinity: {} \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml new file mode 100644 index 000000000..74a7762c4 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -0,0 +1,25 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) + db: CatalogDb # Catalog API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/.dockerignore b/src/Services/Identity/Identity.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Identity/Identity.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop new file mode 100644 index 000000000..e2083dd40 --- /dev/null +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -0,0 +1,17 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj +COPY . . +WORKDIR "/src/src/Services/Identity/Identity.API" +RUN dotnet build "Identity.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] diff --git a/src/Services/Identity/Identity.API/app.yaml b/src/Services/Identity/Identity.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Identity/Identity.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/azds.yaml b/src/Services/Identity/Identity.API/azds.yaml new file mode 100644 index 000000000..7d1a00460 --- /dev/null +++ b/src/Services/Identity/Identity.API/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/identity-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)identity$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]identity...aksapp.io + - $(spacePrefix)identity(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml new file mode 100644 index 000000000..a4c4b08ef --- /dev/null +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -0,0 +1,29 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + identity: + db: IdentityDb # Ordering API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + redis: # inf.redis defines the redis' connection strings + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/.dockerignore b/src/Services/Ordering/Ordering.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Ordering/Ordering.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop new file mode 100644 index 000000000..5f4cd3486 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -0,0 +1,26 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["Ordering.API.csproj", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj", "src/Services/Ordering/Ordering.Domain/"] +COPY ["src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj", "src/Services/Ordering/Ordering.Infrastructure/"] +COPY ["src/Services/Ordering/Ordering.API/Ordering.API.csproj", "src/Services/Ordering/Ordering.API/"] + +RUN dotnet restore src/Services/Ordering/Ordering.API/Ordering.API.csproj +COPY . . +WORKDIR /src/src/Services/Ordering/Ordering.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/app.yaml b/src/Services/Ordering/Ordering.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Ordering/Ordering.API/azds.yaml b/src/Services/Ordering/Ordering.API/azds.yaml new file mode 100644 index 000000000..b81f9d773 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/azds.yaml @@ -0,0 +1,43 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/ordering-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)orderingapi$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]orderingapi...aksapp.io + - $(spacePrefix)orderingapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Ordering/Ordering.API/inf.yaml b/src/Services/Ordering/Ordering.API/inf.yaml new file mode 100644 index 000000000..943ec99fb --- /dev/null +++ b/src/Services/Ordering/Ordering.API/inf.yaml @@ -0,0 +1,22 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + ordering: # inf.sql.ordering: settings for the ordering-api sql (user, pwd, db) + db: OrderingDb # Ordering API SQL db name + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not From cfc1df7c564dc889be95fb371d5bc4b9ab81e618 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Thu, 2 Aug 2018 17:05:11 +0200 Subject: [PATCH 005/173] odering.api dockerfile.develop --- src/Services/Ordering/Ordering.API/Dockerfile.develop | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 5f4cd3486..2106ff3da 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -5,7 +5,6 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["Ordering.API.csproj", "./"] COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] From 1b89edec1517080293f5773fd08ec9a40e958a64 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 29 Aug 2018 11:27:03 +0200 Subject: [PATCH 006/173] mvc devspace --- k8s/helm/webmvc/templates/configmap.yaml | 1 - src/Services/Catalog/Catalog.API/inf.yaml | 1 + src/Services/Identity/Identity.API/inf.yaml | 3 -- src/Web/WebMVC/.dockerignore | 14 +++++++ src/Web/WebMVC/Dockerfile.develop | 16 ++++++++ src/Web/WebMVC/app.yaml | 39 +++++++++++++++++++ src/Web/WebMVC/azds.yaml | 42 +++++++++++++++++++++ src/Web/WebMVC/inf.yaml | 24 ++++++++++++ src/Web/WebMVC/package-lock.json | 2 +- 9 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/Web/WebMVC/.dockerignore create mode 100644 src/Web/WebMVC/Dockerfile.develop create mode 100644 src/Web/WebMVC/app.yaml create mode 100644 src/Web/WebMVC/azds.yaml create mode 100644 src/Web/WebMVC/inf.yaml diff --git a/k8s/helm/webmvc/templates/configmap.yaml b/k8s/helm/webmvc/templates/configmap.yaml index 9d120fe7b..871f6c24e 100644 --- a/k8s/helm/webmvc/templates/configmap.yaml +++ b/k8s/helm/webmvc/templates/configmap.yaml @@ -2,7 +2,6 @@ {{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} {{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} -{{- $mongo := include "mongo-name" . -}} apiVersion: v1 diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml index 74a7762c4..18e2c04bf 100644 --- a/src/Services/Catalog/Catalog.API/inf.yaml +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -10,6 +10,7 @@ inf: pid: Developer catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) db: CatalogDb # Catalog API SQL db name + redis: keystore: svc: keystore-data # Name of k8s svc for keystore-data redis constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml index a4c4b08ef..dba30032b 100644 --- a/src/Services/Identity/Identity.API/inf.yaml +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -10,9 +10,6 @@ inf: pid: Developer identity: db: IdentityDb # Ordering API SQL db name - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) redis: # inf.redis defines the redis' connection strings keystore: svc: keystore-data # Name of k8s svc for keystore-data redis diff --git a/src/Web/WebMVC/.dockerignore b/src/Web/WebMVC/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Web/WebMVC/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop new file mode 100644 index 000000000..16041dc97 --- /dev/null +++ b/src/Web/WebMVC/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" +COPY . . +WORKDIR "/src/src/Web/WebMVC" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Web/WebMVC/app.yaml b/src/Web/WebMVC/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Web/WebMVC/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml new file mode 100644 index 000000000..438b36f0d --- /dev/null +++ b/src/Web/WebMVC/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\ + dockerfile: Dockerfile +install: + chart: ../../../k8s/helm/webmvc + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)webmvc$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)webmvc$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml new file mode 100644 index 000000000..9df900bae --- /dev/null +++ b/src/Web/WebMVC/inf.yaml @@ -0,0 +1,24 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + appinsights: + key: "" # App insights to use + k8s: {} + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not + +ingress: + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file diff --git a/src/Web/WebMVC/package-lock.json b/src/Web/WebMVC/package-lock.json index a94ca154f..785fd8273 100644 --- a/src/Web/WebMVC/package-lock.json +++ b/src/Web/WebMVC/package-lock.json @@ -19,7 +19,7 @@ "resolved": "https://registry.npmjs.org/toastr/-/toastr-2.1.4.tgz", "integrity": "sha1-i0O+ZPudDEFIcURvLbjoyk6V8YE=", "requires": { - "jquery": "3.3.1" + "jquery": ">=1.12.0" } } } From f778b37188b470a32a0efd703fdd17a52efdca33 Mon Sep 17 00:00:00 2001 From: Ivan Buha Date: Mon, 3 Sep 2018 16:15:20 -0500 Subject: [PATCH 007/173] Adjusted file name to match class name --- ...sisterConnection.cs => DefaultRabbitMQPersistentConnection.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/BuildingBlocks/EventBus/EventBusRabbitMQ/{DefaultRabbitMQPersisterConnection.cs => DefaultRabbitMQPersistentConnection.cs} (100%) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersistentConnection.cs similarity index 100% rename from src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs rename to src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersistentConnection.cs From 5fd5c6a27279c4d94ddc640f965f9719ad5c36ac Mon Sep 17 00:00:00 2001 From: Steven Yeh Date: Sat, 29 Sep 2018 11:18:10 -0500 Subject: [PATCH 008/173] Delete eShopOnContainers.TestRunner.iOS.csproj.bak --- ...ShopOnContainers.TestRunner.iOS.csproj.bak | 175 ------------------ 1 file changed, 175 deletions(-) delete mode 100644 src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj.bak diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj.bak b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj.bak deleted file mode 100644 index 0d45fd280..000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj.bak +++ /dev/null @@ -1,175 +0,0 @@ - - - - Debug - iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - eShopOnContainers.TestRunner.iOS - Resources - eShopOnContainers.TestRunner.iOS - - - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG - prompt - 4 - false - x86_64 - SdkOnly - True - 10.1 - False - False - False - False - False - False - False - True - Default - HttpClientHandler - False - - - none - true - bin\iPhoneSimulator\Release - prompt - 4 - None - x86_64 - false - - - true - full - false - bin\iPhone\Debug - DEBUG - prompt - 4 - false - ARMv7, ARM64 - Entitlements.plist - iPhone Developer - true - - - none - true - bin\iPhone\Release - prompt - 4 - Entitlements.plist - ARMv7, ARM64 - false - iPhone Developer - - - none - True - bin\iPhone\Ad-Hoc - prompt - 4 - False - ARMv7, ARM64 - Entitlements.plist - True - Automatic:AdHoc - iPhone Distribution - - - none - True - bin\iPhone\AppStore - prompt - 4 - False - ARMv7, ARM64 - Entitlements.plist - Automatic:AppStore - iPhone Distribution - - - - - - - - - - - - - - - - ..\..\packages\Xamarin.Forms.2.3.3.166-pre4\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll - True - - - ..\..\packages\Xamarin.Forms.2.3.3.166-pre4\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll - True - - - ..\..\packages\Xamarin.Forms.2.3.3.166-pre4\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll - True - - - ..\..\packages\Xamarin.Forms.2.3.3.166-pre4\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll - True - - - - ..\..\packages\xunit.abstractions.2.0.1\lib\netstandard1.0\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.assert.dll - True - - - ..\..\packages\xunit.extensibility.core.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.core.dll - True - - - ..\..\packages\xunit.extensibility.execution.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.execution.dotnet.dll - True - - - ..\..\packages\xunit.runner.devices.2.1.0\lib\Xamarin.iOS\xunit.runner.devices.dll - True - - - ..\..\packages\xunit.runner.utility.2.2.0-beta4-build3444\lib\netstandard1.1\xunit.runner.utility.dotnet.dll - True - - - - - - - - - {f7b6a162-bc4d-4924-b16a-713f9b0344e7} - eShopOnContainers.UnitTests - - - - - - - Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}. - - - - - - \ No newline at end of file From b95a4874495040d5eae2297d5794a5df67e6b3aa Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 1 Oct 2018 17:32:53 +0200 Subject: [PATCH 009/173] WIP on devspaces --- .../Mobile.Bff.Shopping/aggregator/Dockerfile.develop | 5 ++--- .../Mobile.Bff.Shopping/aggregator/azds.yaml | 11 ++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index e34f6ac1d..10ef2c3d4 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -5,12 +5,11 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" -RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml index dca11afbf..6537b476e 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/aggregator + chart: ../../../../k8s/helm/apigwms values: - values.dev.yaml? - secrets.dev.yaml? + - ..\..\..\..\k8s\helm\app.yaml + - ..\..\..\..\k8s\helm\inf.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)apigwms$(hostSuffix)" disableProbes: true ingress: hosts: - # This expands to [space.s.]aggregator...aksapp.io - - $(spacePrefix)aggregator$(hostSuffix) + # This expands to [space.s.]apigwms...aksapp.io + - $(spacePrefix)apigwms$(hostSuffix) configurations: develop: build: From 5aa855ed9efa4c45be6b29b9d3f309a5cdf71e68 Mon Sep 17 00:00:00 2001 From: libPhipp Date: Thu, 18 Oct 2018 22:31:58 +0200 Subject: [PATCH 010/173] Fix method name in OnDisconnectAsync --- src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs b/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs index 5fd6f3eb9..943198980 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs @@ -19,7 +19,7 @@ namespace Ordering.SignalrHub public override async Task OnDisconnectedAsync(Exception ex) { - await Groups.AddToGroupAsync(Context.ConnectionId, Context.User.Identity.Name); + await Groups.RemoveFromGroupAsync(Context.ConnectionId, Context.User.Identity.Name); await base.OnDisconnectedAsync(ex); } } From e410b8d6869c4cef16b38167730cd1e84a5ceeb6 Mon Sep 17 00:00:00 2001 From: dmalimon Date: Mon, 19 Nov 2018 18:16:01 +0200 Subject: [PATCH 011/173] Refactoring Buyer aggregate --- .../AggregatesModel/BuyerAggregate/Buyer.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs index 2fd52917e..1269fd259 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs @@ -32,8 +32,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration, int orderId) { - var existingPayment = _paymentMethods.Where(p => p.IsEqualTo(cardTypeId, cardNumber, expiration)) - .SingleOrDefault(); + var existingPayment = _paymentMethods + .SingleOrDefault(p => p.IsEqualTo(cardTypeId, cardNumber, expiration)); if (existingPayment != null) { @@ -41,16 +41,14 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B return existingPayment; } - else - { - var payment = new PaymentMethod(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration); - _paymentMethods.Add(payment); + var payment = new PaymentMethod(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration); - AddDomainEvent(new BuyerAndPaymentMethodVerifiedDomainEvent(this, payment, orderId)); + _paymentMethods.Add(payment); - return payment; - } + AddDomainEvent(new BuyerAndPaymentMethodVerifiedDomainEvent(this, payment, orderId)); + + return payment; } } } From 86c36c9d2a42ecaec759d3481fad7cd156e1b190 Mon Sep 17 00:00:00 2001 From: David Henley Date: Wed, 9 Jan 2019 13:39:12 -0600 Subject: [PATCH 012/173] Fixed type in HttpGlobalExceptionFilter Changed meesage to message --- .../Infrastructure/Filters/HttpGlobalExceptionFilter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs b/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs index 4c4c746a6..1c1dfd45f 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs @@ -49,7 +49,7 @@ namespace Catalog.API.Infrastructure.Filters if (env.IsDevelopment()) { - json.DeveloperMeesage = context.Exception; + json.DeveloperMessage = context.Exception; } context.Result = new InternalServerErrorObjectResult(json); @@ -62,7 +62,7 @@ namespace Catalog.API.Infrastructure.Filters { public string[] Messages { get; set; } - public object DeveloperMeesage { get; set; } + public object DeveloperMessage { get; set; } } } } From 4d6b2f03d21ceb86a360d691c1fd1bf54c727b5c Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 10:43:32 +0000 Subject: [PATCH 013/173] Add Serilog and Seq working in Docker --- docker-compose.override.yml | 6 + docker-compose.yml | 3 + .../Catalog/Catalog.API/Catalog.API.csproj | 3 + src/Services/Catalog/Catalog.API/Program.cs | 106 ++++++++++++------ .../Properties/launchSettings.json | 5 +- .../Catalog/Catalog.API/appsettings.json | 15 ++- src/Services/Catalog/Catalog.API/web.config | 6 +- 7 files changed, 98 insertions(+), 46 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index a0a3b35b7..4c9ab72a8 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -7,6 +7,12 @@ version: '3.4' # An external IP or DNS name has to be used (instead localhost and the 10.0.75.1 IP) when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance. services: + seq: + environment: + - ACCEPT_EULA=Y + ports: + - "5340:80" + sql.data: environment: - SA_PASSWORD=Pass@word diff --git a/docker-compose.yml b/docker-compose.yml index 95610ebd5..04f961816 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,9 @@ version: '3.4' services: + seq: + image: datalust/seq:latest + sql.data: image: microsoft/mssql-server-linux:2017-latest diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index a2be6b522..962f03ade 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -51,7 +51,10 @@ + + + diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 3f4c19955..82e0041a0 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -9,65 +9,97 @@ using Microsoft.Extensions.Options; using Serilog; using System; using System.IO; + namespace Microsoft.eShopOnContainers.Services.Catalog.API { public class Program { - public static void Main(string[] args) + private static readonly string ApplicationName = typeof(Program).Namespace; + + public static int Main(string[] args) { - BuildWebHost(args) - .MigrateDbContext((context,services)=> + var configuration = GetConfiguration(); + + Log.Logger = CreateSerilogLogger(configuration); + + try + { + Log.Information("Configuring web host ({Application})...", ApplicationName); + var host = BuildWebHost(configuration, args); + + Log.Information("Applying migrations ({Application})...", ApplicationName); + host.MigrateDbContext((context, services) => { var env = services.GetService(); var settings = services.GetService>(); var logger = services.GetService>(); new CatalogContextSeed() - .SeedAsync(context,env,settings,logger) + .SeedAsync(context, env, settings, logger) .Wait(); - }) - .MigrateDbContext((_,__)=> { }) - .Run(); + .MigrateDbContext((_, __) => { }); + + Log.Information("Starting web host ({Application})...", ApplicationName); + host.Run(); + + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", ApplicationName); + return 1; + } + finally + { + Log.CloseAndFlush(); + } } - public static IWebHost BuildWebHost(string[] args) => + private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) => WebHost.CreateDefaultBuilder(args) - .UseStartup() + .CaptureStartupErrors(false) + .UseStartup() .UseApplicationInsights() .UseContentRoot(Directory.GetCurrentDirectory()) .UseWebRoot("Pics") - .ConfigureAppConfiguration((builderContext, config) => - { - var builtConfig = config.Build(); + .UseConfiguration(configuration) + .UseSerilog() + .Build(); + + private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) + { + var seqServerUrl = configuration["Serilog:SeqServerUrl"]; - var configurationBuilder = new ConfigurationBuilder(); + return new LoggerConfiguration() + .MinimumLevel.Verbose() + .Enrich.WithMachineName() + .Enrich.WithProperty("Application", ApplicationName) + .Enrich.FromLogContext() + .WriteTo.Console() + .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) + .ReadFrom.Configuration(configuration) + .CreateLogger(); + } - if (Convert.ToBoolean(builtConfig["UseVault"])) - { - configurationBuilder.AddAzureKeyVault( - $"https://{builtConfig["Vault:Name"]}.vault.azure.net/", - builtConfig["Vault:ClientId"], - builtConfig["Vault:ClientSecret"]); - } + private static IConfiguration GetConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddEnvironmentVariables(); - configurationBuilder.AddEnvironmentVariables(); + var config = builder.Build(); - config.AddConfiguration(configurationBuilder.Build()); - }) - .ConfigureLogging((hostingContext, builder) => - { - builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); - builder.AddConsole(); - builder.AddDebug(); - }) - .UseSerilog((builderContext, config) => - { - config - .MinimumLevel.Information() - .Enrich.FromLogContext() - .WriteTo.Console(); - }) - .Build(); + if (config.GetValue("UseVault", false)) + { + builder.AddAzureKeyVault( + $"https://{config["Vault:Name"]}.vault.azure.net/", + config["Vault:ClientId"], + config["Vault:ClientSecret"]); + } + + return builder.Build(); + } } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index 2b21ca280..8f2cde4db 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -13,7 +13,10 @@ "launchBrowser": true, "launchUrl": "/swagger", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ConnectionString": "server=localhost,5433;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word", + "ASPNETCORE_ENVIRONMENT": "Development", + "EventBusConnection": "localhost", + "Serilog:SeqServerUrl": "http://locahost:5340" } }, "Microsoft.eShopOnContainers.Services.Catalog.API": { diff --git a/src/Services/Catalog/Catalog.API/appsettings.json b/src/Services/Catalog/Catalog.API/appsettings.json index 0bf489699..b26f63bff 100644 --- a/src/Services/Catalog/Catalog.API/appsettings.json +++ b/src/Services/Catalog/Catalog.API/appsettings.json @@ -2,12 +2,15 @@ "ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word", "PicBaseUrl": "http://localhost:5101/api/v1/catalog/items/[0]/pic/", "UseCustomizationData": false, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Trace", - "System": "Information", - "Microsoft": "Information" + "Serilog": { + "SeqServerUrl": null, + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.eShopOnContainers": "Information", + "System": "Warning" + } } }, "AzureServiceBusEnabled": false, diff --git a/src/Services/Catalog/Catalog.API/web.config b/src/Services/Catalog/Catalog.API/web.config index e04a0397b..2157aef31 100644 --- a/src/Services/Catalog/Catalog.API/web.config +++ b/src/Services/Catalog/Catalog.API/web.config @@ -2,8 +2,10 @@ - + - + + + \ No newline at end of file From 7cd717cf064a93e052e24873ec1a90f0ab6679e1 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 10:43:54 +0000 Subject: [PATCH 014/173] Add integration event traces --- .../CatalogIntegrationEventService.cs | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 8c550bf27..dd4e5b20e 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -5,6 +5,8 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; +using Microsoft.Extensions.Logging; +using Serilog.Context; using System; using System.Data.Common; using System.Threading.Tasks; @@ -17,10 +19,15 @@ namespace Catalog.API.IntegrationEvents private readonly IEventBus _eventBus; private readonly CatalogContext _catalogContext; private readonly IIntegrationEventLogService _eventLogService; + private readonly ILogger _logger; - public CatalogIntegrationEventService(IEventBus eventBus, CatalogContext catalogContext, - Func integrationEventLogServiceFactory) + public CatalogIntegrationEventService( + ILogger logger, + IEventBus eventBus, + CatalogContext catalogContext, + Func integrationEventLogServiceFactory) { + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _catalogContext = catalogContext ?? throw new ArgumentNullException(nameof(catalogContext)); _integrationEventLogServiceFactory = integrationEventLogServiceFactory ?? throw new ArgumentNullException(nameof(integrationEventLogServiceFactory)); _eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus)); @@ -29,28 +36,39 @@ namespace Catalog.API.IntegrationEvents public async Task PublishThroughEventBusAsync(IntegrationEvent evt) { - try + using (LogContext.PushProperty("IntegrationEventId", evt.Id)) { - await _eventLogService.MarkEventAsInProgressAsync(evt.Id); - _eventBus.Publish(evt); - await _eventLogService.MarkEventAsPublishedAsync(evt.Id); + try + { + _logger.LogInformation("----- CatalogIntegrationEventService - Publishing integration event: {IntegrationEventId} ({@IntegrationEvent})", evt.Id, evt); + + await _eventLogService.MarkEventAsInProgressAsync(evt.Id); + _eventBus.Publish(evt); + await _eventLogService.MarkEventAsPublishedAsync(evt.Id); + } + catch (Exception ex) + { + _logger.LogError(ex, "----- CatalogIntegrationEventService - ERROR Publishing integration event"); + await _eventLogService.MarkEventAsFailedAsync(evt.Id); + } } - catch (Exception) - { - await _eventLogService.MarkEventAsFailedAsync(evt.Id); - } } public async Task SaveEventAndCatalogContextChangesAsync(IntegrationEvent evt) { - //Use of an EF Core resiliency strategy when using multiple DbContexts within an explicit BeginTransaction(): - //See: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency - await ResilientTransaction.New(_catalogContext) - .ExecuteAsync(async () => { + using (LogContext.PushProperty("IntegrationEventId", evt.Id)) + { + _logger.LogInformation("----- CatalogIntegrationEventService - Saving changes and integrationEvent: {IntegrationEvent}", evt.Id); + + //Use of an EF Core resiliency strategy when using multiple DbContexts within an explicit BeginTransaction(): + //See: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency + await ResilientTransaction.New(_catalogContext).ExecuteAsync(async () => + { // Achieving atomicity between original catalog database operation and the IntegrationEventLog thanks to a local transaction await _catalogContext.SaveChangesAsync(); await _eventLogService.SaveEventAsync(evt, _catalogContext.Database.CurrentTransaction.GetDbTransaction()); }); + } } } } From d6aee2ce35ecad9a1c479afebd9abfe321556da9 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 10:47:07 +0000 Subject: [PATCH 015/173] Remove MachineName from logger configuration, not really useful for eShopOnContainers --- src/Services/Catalog/Catalog.API/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 82e0041a0..4f05f4b74 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -73,7 +73,6 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API return new LoggerConfiguration() .MinimumLevel.Verbose() - .Enrich.WithMachineName() .Enrich.WithProperty("Application", ApplicationName) .Enrich.FromLogContext() .WriteTo.Console() From 6d2c1fc717f254908e2fb2cb5e3cff314027a742 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 13:32:27 +0000 Subject: [PATCH 016/173] Use structured logging for exceptions --- .../EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs | 4 ++-- .../EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs index 2e0555e61..92853f918 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs @@ -72,7 +72,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ .Or() .WaitAndRetry(_retryCount, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), (ex, time) => { - _logger.LogWarning(ex.ToString()); + _logger.LogWarning(ex, "RabbitMQ Client could not connect after {TimeOut}s ({ExceptionMessage})", $"{time.TotalSeconds:n1}", ex.Message); } ); @@ -88,7 +88,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ _connection.CallbackException += OnCallbackException; _connection.ConnectionBlocked += OnConnectionBlocked; - _logger.LogInformation($"RabbitMQ persistent connection acquired a connection {_connection.Endpoint.HostName} and is subscribed to failure events"); + _logger.LogInformation("RabbitMQ acquired a persistent connection to '{HostName}' and is subscribed to failure events", _connection.Endpoint.HostName); return true; } diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs index a3b6437ef..f24616dc2 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs @@ -76,7 +76,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ .Or() .WaitAndRetry(_retryCount, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), (ex, time) => { - _logger.LogWarning(ex.ToString()); + _logger.LogWarning(ex, "Could not publish event: {EventId} after {Timeout}s ({ExceptionMessage})", @event.Id, $"{time.TotalSeconds:n1}", ex.Message); }); using (var channel = _persistentConnection.CreateModel()) From 3a22e2f35b118eb340ec49ae46f1e4c45923c9fc Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 13:33:36 +0000 Subject: [PATCH 017/173] Add Seq as sink and some integration event traces --- .../Basket/Basket.API/Basket.API.csproj | 18 +-- ...ductPriceChangedIntegrationEventHandler.cs | 31 ++++-- src/Services/Basket/Basket.API/Program.cs | 104 +++++++++++------- src/Services/Basket/Basket.API/Startup.cs | 4 +- .../Basket/Basket.API/appsettings.json | 15 ++- .../Catalog/Catalog.API/Catalog.API.csproj | 8 +- .../CatalogIntegrationEventService.cs | 2 +- 7 files changed, 115 insertions(+), 67 deletions(-) diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 4add803b6..0a1b5f581 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -13,25 +13,29 @@ - - + + + + + + - - - - + + + + + - diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs index 546483b40..aeadc9674 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs @@ -1,6 +1,8 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events; using Microsoft.eShopOnContainers.Services.Basket.API.Model; +using Microsoft.Extensions.Logging; +using Serilog.Context; using System; using System.Linq; using System.Threading.Tasks; @@ -9,22 +11,31 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even { public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler { + private readonly ILogger _logger; private readonly IBasketRepository _repository; - public ProductPriceChangedIntegrationEventHandler(IBasketRepository repository) + public ProductPriceChangedIntegrationEventHandler( + ILogger logger, + IBasketRepository repository) { + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _repository = repository ?? throw new ArgumentNullException(nameof(repository)); } public async Task Handle(ProductPriceChangedIntegrationEvent @event) { - var userIds = _repository.GetUsers(); - - foreach (var id in userIds) + using (LogContext.PushProperty("IntegrationEventId", @event.Id)) { - var basket = await _repository.GetBasketAsync(id); + _logger.LogInformation("----- ProductPriceChangedIntegrationEventHandler - Handling integration event: {IntegrationEventId} ({@IntegrationEvent})", @event.Id, @event); - await UpdatePriceInBasketItems(@event.ProductId, @event.NewPrice, @event.OldPrice, basket); + var userIds = _repository.GetUsers(); + + foreach (var id in userIds) + { + var basket = await _repository.GetBasketAsync(id); + + await UpdatePriceInBasketItems(@event.ProductId, @event.NewPrice, @event.OldPrice, basket); + } } } @@ -35,17 +46,19 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even if (itemsToUpdate != null) { + _logger.LogInformation("----- ProductPriceChangedIntegrationEventHandler - Updating items in basket for user: {BuyerId} ({@Items})", basket.BuyerId, itemsToUpdate); + foreach (var item in itemsToUpdate) { - if(item.UnitPrice == oldPrice) - { + if (item.UnitPrice == oldPrice) + { var originalPrice = item.UnitPrice; item.UnitPrice = newPrice; item.OldUnitPrice = originalPrice; } } await _repository.UpdateBasketAsync(basket); - } + } } } } diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index e4328645e..6b7387c55 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -12,51 +12,79 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API { public class Program { - public static void Main(string[] args) + private static readonly string ApplicationName = typeof(Program).Namespace; + + public static int Main(string[] args) { - BuildWebHost(args).Run(); + var configuration = GetConfiguration(); + + Log.Logger = CreateSerilogLogger(configuration); + + try + { + Log.Information("Configuring web host ({Application})...", ApplicationName); + var host = BuildWebHost(configuration, args); + + Log.Information("Starting web host ({Application})...", ApplicationName); + host.Run(); + + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", ApplicationName); + return 1; + } + finally + { + Log.CloseAndFlush(); + } } - public static IWebHost BuildWebHost(string[] args) => + private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) => WebHost.CreateDefaultBuilder(args) + .CaptureStartupErrors(false) .UseFailing(options => - { - options.ConfigPath = "/Failing"; - }) - .UseContentRoot(Directory.GetCurrentDirectory()) + options.ConfigPath = "/Failing") .UseStartup() - .ConfigureAppConfiguration((builderContext, config) => - { - var builtConfig = config.Build(); - - var configurationBuilder = new ConfigurationBuilder(); - - if (Convert.ToBoolean(builtConfig["UseVault"])) - { - configurationBuilder.AddAzureKeyVault( - $"https://{builtConfig["Vault:Name"]}.vault.azure.net/", - builtConfig["Vault:ClientId"], - builtConfig["Vault:ClientSecret"]); - } - - configurationBuilder.AddEnvironmentVariables(); - - config.AddConfiguration(configurationBuilder.Build()); - }) - .ConfigureLogging((hostingContext, builder) => - { - builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); - builder.AddConsole(); - builder.AddDebug(); - }) - .UseSerilog((builderContext, config) => - { - config - .MinimumLevel.Information() - .Enrich.FromLogContext() - .WriteTo.Console(); - }) .UseApplicationInsights() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseConfiguration(configuration) + .UseSerilog() .Build(); + + private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) + { + var seqServerUrl = configuration["Serilog:SeqServerUrl"]; + + return new LoggerConfiguration() + .MinimumLevel.Verbose() + .Enrich.WithProperty("Application", ApplicationName) + .Enrich.FromLogContext() + .WriteTo.Console() + .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) + .ReadFrom.Configuration(configuration) + .CreateLogger(); + } + + private static IConfiguration GetConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddEnvironmentVariables(); + + var config = builder.Build(); + + if (config.GetValue("UseVault", false)) + { + builder.AddAzureKeyVault( + $"https://{config["Vault:Name"]}.vault.azure.net/", + config["Vault:ClientId"], + config["Vault:ClientSecret"]); + } + + return builder.Build(); + } } } diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index eecc8bdd4..9ae6822f8 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -50,7 +50,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { - RegisterAppInsights(services); + RegisterAppInsights(services); // Add framework services. services.AddMvc(options => @@ -66,7 +66,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API services.AddCustomHealthCheck(Configuration); - services.Configure(Configuration); + services.Configure(Configuration); //By connecting here we are making sure that our service //cannot start until redis is ready. This might slow down startup, diff --git a/src/Services/Basket/Basket.API/appsettings.json b/src/Services/Basket/Basket.API/appsettings.json index 4bff4d70d..33f1c299f 100644 --- a/src/Services/Basket/Basket.API/appsettings.json +++ b/src/Services/Basket/Basket.API/appsettings.json @@ -1,10 +1,13 @@ { - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" + "Serilog": { + "SeqServerUrl": null, + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.eShopOnContainers": "Information", + "System": "Warning" + } } }, "IdentityUrl": "http://localhost:5105", diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 962f03ade..a413745dd 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -34,22 +34,22 @@ - + - - - + + + diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index dd4e5b20e..6b7a65968 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -58,7 +58,7 @@ namespace Catalog.API.IntegrationEvents { using (LogContext.PushProperty("IntegrationEventId", evt.Id)) { - _logger.LogInformation("----- CatalogIntegrationEventService - Saving changes and integrationEvent: {IntegrationEvent}", evt.Id); + _logger.LogInformation("----- CatalogIntegrationEventService - Saving changes and integrationEvent: {IntegrationEventId}", evt.Id); //Use of an EF Core resiliency strategy when using multiple DbContexts within an explicit BeginTransaction(): //See: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency From d83fa3bafcba337fdeca03ec560cf773514c746c Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Thu, 31 Jan 2019 15:30:50 +0000 Subject: [PATCH 018/173] Standarize log message --- .../EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs index 92853f918..93e5b2917 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/DefaultRabbitMQPersisterConnection.cs @@ -88,7 +88,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ _connection.CallbackException += OnCallbackException; _connection.ConnectionBlocked += OnConnectionBlocked; - _logger.LogInformation("RabbitMQ acquired a persistent connection to '{HostName}' and is subscribed to failure events", _connection.Endpoint.HostName); + _logger.LogInformation("RabbitMQ Client acquired a persistent connection to '{HostName}' and is subscribed to failure events", _connection.Endpoint.HostName); return true; } From 8de902cc7946f56e995b3c9b9998cee6806e4dcc Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 13:03:01 +0000 Subject: [PATCH 019/173] Add Seq to Ordering.API --- .../Ordering/Ordering.API/Ordering.API.csproj | 17 +-- src/Services/Ordering/Ordering.API/Program.cs | 108 ++++++++++++------ src/Services/Ordering/Ordering.API/Startup.cs | 10 +- .../Ordering/Ordering.API/appsettings.json | 15 ++- 4 files changed, 94 insertions(+), 56 deletions(-) diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index abd68e9a6..baa14b01d 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -27,30 +27,33 @@ - - + + + + + - + - - + + + + - - diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index b97ced4d4..28d4b9f8e 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -15,10 +15,22 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API { public class Program { - public static void Main(string[] args) + public static readonly string AppName = typeof(Program).Namespace; + public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); + + public static int Main(string[] args) { - BuildWebHost(args) - .MigrateDbContext((context, services) => + var configuration = GetConfiguration(); + + Log.Logger = CreateSerilogLogger(configuration); + + try + { + Log.Information("Configuring web host ({Application})...", AppName); + var host = BuildWebHost(configuration, args); + + Log.Information("Applying migrations ({Application})...", AppName); + host.MigrateDbContext((context, services) => { var env = services.GetService(); var settings = services.GetService>(); @@ -28,46 +40,66 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API .SeedAsync(context, env, settings, logger) .Wait(); }) - .MigrateDbContext((_,__)=>{}) - .Run(); + .MigrateDbContext((_, __) => { }); + + Log.Information("Starting web host ({Application})...", AppName); + host.Run(); + + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName); + return 1; + } + finally + { + Log.CloseAndFlush(); + } } - public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) + private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) => + WebHost.CreateDefaultBuilder(args) + .CaptureStartupErrors(false) .UseStartup() + .UseApplicationInsights() .UseContentRoot(Directory.GetCurrentDirectory()) - .ConfigureAppConfiguration((builderContext, config) => - { - var builtConfig = config.Build(); + .UseConfiguration(configuration) + .UseSerilog() + .Build(); - var configurationBuilder = new ConfigurationBuilder(); - - if (Convert.ToBoolean(builtConfig["UseVault"])) - { - configurationBuilder.AddAzureKeyVault( - $"https://{builtConfig["Vault:Name"]}.vault.azure.net/", - builtConfig["Vault:ClientId"], - builtConfig["Vault:ClientSecret"]); - } + private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) + { + var seqServerUrl = configuration["Serilog:SeqServerUrl"]; - configurationBuilder.AddEnvironmentVariables(); + return new LoggerConfiguration() + .MinimumLevel.Verbose() + .Enrich.WithProperty("Application", AppName) + .Enrich.FromLogContext() + .WriteTo.Console() + .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) + .ReadFrom.Configuration(configuration) + .CreateLogger(); + } - config.AddConfiguration(configurationBuilder.Build()); - }) - .ConfigureLogging((hostingContext, builder) => - { - builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); - builder.AddConsole(); - builder.AddDebug(); - }) - .UseApplicationInsights() - .UseSerilog((builderContext, config) => - { - config - .MinimumLevel.Information() - .Enrich.FromLogContext() - .WriteTo.Console(); - }) - .Build(); + private static IConfiguration GetConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddEnvironmentVariables(); + + var config = builder.Build(); + + if (config.GetValue("UseVault", false)) + { + builder.AddAzureKeyVault( + $"https://{config["Vault:Name"]}.vault.azure.net/", + config["Vault:ClientId"], + config["Vault:ClientSecret"]); + } + + return builder.Build(); + } } -} +} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index b517dfaa9..9e3317f51 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -74,15 +74,15 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); - loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + //loggerFactory.AddAzureWebAppDiagnostics(); + //loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) { loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'"); app.UsePathBase(pathBase); - } + } app.UseCors("CorsPolicy"); @@ -122,7 +122,7 @@ eventBus.Subscribe>(); eventBus.Subscribe>(); eventBus.Subscribe>(); - eventBus.Subscribe>(); + eventBus.Subscribe>(); } @@ -168,7 +168,7 @@ }) .SetCompatibilityVersion(CompatibilityVersion.Version_2_2) .AddControllersAsServices(); //Injecting Controllers themselves thru DI - //For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services + //For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services services.AddCors(options => { diff --git a/src/Services/Ordering/Ordering.API/appsettings.json b/src/Services/Ordering/Ordering.API/appsettings.json index 96dd74630..64b24a354 100644 --- a/src/Services/Ordering/Ordering.API/appsettings.json +++ b/src/Services/Ordering/Ordering.API/appsettings.json @@ -2,12 +2,15 @@ "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;", "IdentityUrl": "http://localhost:5105", "UseCustomizationData": false, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Trace", - "System": "Information", - "Microsoft": "Information" + "Serilog": { + "SeqServerUrl": null, + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.eShopOnContainers": "Information", + "System": "Warning" + } } }, "AzureServiceBusEnabled": false, From 24b660f339ba9f490f93d932d036310993b88f09 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 13:03:54 +0000 Subject: [PATCH 020/173] Expore Program.AppName/AppShortName for logging --- src/Services/Basket/Basket.API/Program.cs | 11 ++++++----- src/Services/Basket/Basket.API/Startup.cs | 4 ++-- src/Services/Catalog/Catalog.API/Program.cs | 17 +++++++++-------- src/Services/Catalog/Catalog.API/Startup.cs | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index 6b7387c55..3b460d586 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -12,7 +12,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API { public class Program { - private static readonly string ApplicationName = typeof(Program).Namespace; + public static readonly string AppName = typeof(Program).Namespace; + public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static int Main(string[] args) { @@ -22,17 +23,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API try { - Log.Information("Configuring web host ({Application})...", ApplicationName); + Log.Information("Configuring web host ({Application})...", AppName); var host = BuildWebHost(configuration, args); - Log.Information("Starting web host ({Application})...", ApplicationName); + Log.Information("Starting web host ({Application})...", AppName); host.Run(); return 0; } catch (Exception ex) { - Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", ApplicationName); + Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName); return 1; } finally @@ -59,7 +60,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API return new LoggerConfiguration() .MinimumLevel.Verbose() - .Enrich.WithProperty("Application", ApplicationName) + .Enrich.WithProperty("Application", AppName) .Enrich.FromLogContext() .WriteTo.Console() .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 9ae6822f8..4dc01098c 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -181,8 +181,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddAzureWebAppDiagnostics(); - loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + //loggerFactory.AddAzureWebAppDiagnostics(); + //loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 4f05f4b74..04455585c 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -14,7 +14,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API { public class Program { - private static readonly string ApplicationName = typeof(Program).Namespace; + public static readonly string AppName = typeof(Program).Namespace; + public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static int Main(string[] args) { @@ -24,10 +25,10 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API try { - Log.Information("Configuring web host ({Application})...", ApplicationName); + Log.Information("Configuring web host ({Application})...", AppName); var host = BuildWebHost(configuration, args); - Log.Information("Applying migrations ({Application})...", ApplicationName); + Log.Information("Applying migrations ({Application})...", AppName); host.MigrateDbContext((context, services) => { var env = services.GetService(); @@ -35,19 +36,19 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API var logger = services.GetService>(); new CatalogContextSeed() - .SeedAsync(context, env, settings, logger) - .Wait(); + .SeedAsync(context, env, settings, logger) + .Wait(); }) .MigrateDbContext((_, __) => { }); - Log.Information("Starting web host ({Application})...", ApplicationName); + Log.Information("Starting web host ({Application})...", AppName); host.Run(); return 0; } catch (Exception ex) { - Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", ApplicationName); + Log.Fatal(ex, "Program terminated unexpectedly ({Application})!", AppName); return 1; } finally @@ -73,7 +74,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API return new LoggerConfiguration() .MinimumLevel.Verbose() - .Enrich.WithProperty("Application", ApplicationName) + .Enrich.WithProperty("Application", AppName) .Enrich.FromLogContext() .WriteTo.Console() .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 5c77d37c8..990cd0f80 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -64,8 +64,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API { //Configure logs - loggerFactory.AddAzureWebAppDiagnostics(); - loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + //loggerFactory.AddAzureWebAppDiagnostics(); + //loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; From b9839d15c6720eecb7e29e2fe117c4fd9ab9630b Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 15:48:28 +0000 Subject: [PATCH 021/173] Added traces for UserCheckoutAcceptedIntegrationEvent --- .../Controllers/BasketController.cs | 26 ++++++++- .../Application/BasketWebApiTest.cs | 28 ++++++++-- ...CheckoutAcceptedIntegrationEventHandler.cs | 56 ++++++++++++------- 3 files changed, 83 insertions(+), 27 deletions(-) diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index 0e15e65dd..52b3dee2d 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -5,6 +5,8 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.eShopOnContainers.Services.Basket.API.Services; +using Microsoft.Extensions.Logging; +using Serilog.Context; using System; using System.Net; using System.Threading.Tasks; @@ -19,9 +21,15 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers private readonly IBasketRepository _repository; private readonly IIdentityService _identityService; private readonly IEventBus _eventBus; + private readonly ILogger _logger; - public BasketController(IBasketRepository repository, IIdentityService identityService, IEventBus eventBus) + public BasketController( + ILogger logger, + IBasketRepository repository, + IIdentityService identityService, + IEventBus eventBus) { + _logger = logger; _repository = repository; _identityService = identityService; _eventBus = eventBus; @@ -70,7 +78,21 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers // Once basket is checkout, sends an integration event to // ordering.api to convert basket to order and proceeds with // order creation process - _eventBus.Publish(eventMessage); + using (LogContext.PushProperty("IntegrationEventId", eventMessage.Id)) + { + try + { + _logger.LogInformation("----- BasketController - Publishing integration event: {IntegrationEventId} ({@IntegrationEvent})", eventMessage.Id, eventMessage); + + _eventBus.Publish(eventMessage); + } + catch (Exception ex) + { + _logger.LogError(ex, "----- BasketController - ERROR Publishing integration event"); + + throw; + } + } return Accepted(); } diff --git a/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs b/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs index a2e382b92..0045ce4aa 100644 --- a/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs +++ b/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.Services.Basket.API.Controllers; using Microsoft.eShopOnContainers.Services.Basket.API.Model; +using Microsoft.Extensions.Logging; using Moq; using System; using System.Collections.Generic; @@ -20,12 +21,14 @@ namespace UnitTest.Basket.Application private readonly Mock _basketRepositoryMock; private readonly Mock _identityServiceMock; private readonly Mock _serviceBusMock; + private readonly Mock> _loggerMock; public BasketWebApiTest() { _basketRepositoryMock = new Mock(); _identityServiceMock = new Mock(); _serviceBusMock = new Mock(); + _loggerMock = new Mock>(); } [Fact] @@ -43,7 +46,11 @@ namespace UnitTest.Basket.Application //Act var basketController = new BasketController( - _basketRepositoryMock.Object, _identityServiceMock.Object, _serviceBusMock.Object); + _loggerMock.Object, + _basketRepositoryMock.Object, + _identityServiceMock.Object, + _serviceBusMock.Object); + var actionResult = await basketController.GetBasketByIdAsync(fakeCustomerId); //Assert @@ -65,14 +72,17 @@ namespace UnitTest.Basket.Application //Act var basketController = new BasketController( - _basketRepositoryMock.Object, _identityServiceMock.Object, _serviceBusMock.Object); + _loggerMock.Object, + _basketRepositoryMock.Object, + _identityServiceMock.Object, + _serviceBusMock.Object); var actionResult = await basketController.UpdateBasketAsync(fakeCustomerBasket); //Assert Assert.Equal((actionResult.Result as OkObjectResult).StatusCode, (int)System.Net.HttpStatusCode.OK); Assert.Equal(((CustomerBasket)actionResult.Value).BuyerId, fakeCustomerId); - } + } [Fact] public async Task Doing_Checkout_Without_Basket_Should_Return_Bad_Request() @@ -84,7 +94,10 @@ namespace UnitTest.Basket.Application //Act var basketController = new BasketController( - _basketRepositoryMock.Object, _identityServiceMock.Object, _serviceBusMock.Object); + _loggerMock.Object, + _basketRepositoryMock.Object, + _identityServiceMock.Object, + _serviceBusMock.Object); var result = await basketController.CheckoutAsync(new BasketCheckout(), Guid.NewGuid().ToString()) as BadRequestResult; Assert.NotNull(result); @@ -102,7 +115,10 @@ namespace UnitTest.Basket.Application _identityServiceMock.Setup(x => x.GetUserIdentity()).Returns(fakeCustomerId); var basketController = new BasketController( - _basketRepositoryMock.Object, _identityServiceMock.Object, _serviceBusMock.Object); + _loggerMock.Object, + _basketRepositoryMock.Object, + _identityServiceMock.Object, + _serviceBusMock.Object); basketController.ControllerContext = new ControllerContext() { @@ -122,7 +138,7 @@ namespace UnitTest.Basket.Application } private CustomerBasket GetCustomerBasketFake(string fakeCustomerId) - { + { return new CustomerBasket(fakeCustomerId) { Items = new List() diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs index 33f327c6b..63962f814 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs @@ -5,19 +5,21 @@ using System.Threading.Tasks; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Microsoft.Extensions.Logging; using Ordering.API.Application.IntegrationEvents.Events; +using Serilog.Context; namespace Ordering.API.Application.IntegrationEvents.EventHandling { public class UserCheckoutAcceptedIntegrationEventHandler : IIntegrationEventHandler { private readonly IMediator _mediator; - private readonly ILoggerFactory _logger; + private readonly ILogger _logger; - public UserCheckoutAcceptedIntegrationEventHandler(IMediator mediator, - ILoggerFactory logger) + public UserCheckoutAcceptedIntegrationEventHandler( + IMediator mediator, + ILogger logger) { _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } /// @@ -31,22 +33,38 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling /// public async Task Handle(UserCheckoutAcceptedIntegrationEvent eventMsg) { - var result = false; - - if (eventMsg.RequestId != Guid.Empty) + using (LogContext.PushProperty("IntegrationEventId", eventMsg.Id)) { - var createOrderCommand = new CreateOrderCommand(eventMsg.Basket.Items, eventMsg.UserId, eventMsg.UserName, eventMsg.City, eventMsg.Street, - eventMsg.State, eventMsg.Country, eventMsg.ZipCode, - eventMsg.CardNumber, eventMsg.CardHolderName, eventMsg.CardExpiration, - eventMsg.CardSecurityNumber, eventMsg.CardTypeId); - - var requestCreateOrder = new IdentifiedCommand(createOrderCommand, eventMsg.RequestId); - result = await _mediator.Send(requestCreateOrder); - } - - _logger.CreateLogger(nameof(UserCheckoutAcceptedIntegrationEventHandler)) - .LogTrace(result ? $"UserCheckoutAccepted integration event has been received and a create new order process is started with requestId: {eventMsg.RequestId}" : - $"UserCheckoutAccepted integration event has been received but a new order process has failed with requestId: {eventMsg.RequestId}"); + _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - Handling integration event: {IntegrationEventId} ({@IntegrationEvent})", eventMsg.Id, eventMsg); + + var result = false; + + if (eventMsg.RequestId != Guid.Empty) + { + var createOrderCommand = new CreateOrderCommand(eventMsg.Basket.Items, eventMsg.UserId, eventMsg.UserName, eventMsg.City, eventMsg.Street, + eventMsg.State, eventMsg.Country, eventMsg.ZipCode, + eventMsg.CardNumber, eventMsg.CardHolderName, eventMsg.CardExpiration, + eventMsg.CardSecurityNumber, eventMsg.CardTypeId); + + _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand: {@CreateOrderCommand}", createOrderCommand); + + var requestCreateOrder = new IdentifiedCommand(createOrderCommand, eventMsg.RequestId); + result = await _mediator.Send(requestCreateOrder); + + if (result) + { + _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand suceeded - RequestId: {RequestId}", eventMsg.RequestId); + } + else + { + _logger.LogWarning("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand failed - RequestId: {RequestId}", eventMsg.RequestId); + } + } + else + { + _logger.LogWarning("----- UserCheckoutAcceptedIntegrationEventHandler - Invalid IntegrationEvent - RequestId is missing}"); + } + } } } } \ No newline at end of file From 76118776c43952e48ac43cc61343268def4abb84 Mon Sep 17 00:00:00 2001 From: Mohsen Alikhani Date: Wed, 6 Feb 2019 20:08:22 +0330 Subject: [PATCH 022/173] OrderController Recommendation It's good idea to take advantage of GetOrderByIdQuery and handle by GetCustomerByIdQueryHandler --- .../Ordering/Ordering.API/Controllers/OrdersController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index e2c711b69..5a00163a8 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -80,6 +80,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers { try { + //Todo: It's good idea to take advantage of GetOrderByIdQuery and handle by GetCustomerByIdQueryHandler + //var order customer = await _mediator.Send(new GetOrderByIdQuery(orderId)); var order = await _orderQueries.GetOrderAsync(orderId); return Ok(order); @@ -117,4 +119,4 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers return await _mediator.Send(createOrderDraftCommand); } } -} \ No newline at end of file +} From 423066a822ad7f8e5ef04f3b09191b461d6b7f49 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 18:53:30 +0000 Subject: [PATCH 023/173] Add log traces for integration event handling --- .../Controllers/BasketController.cs | 4 +- ...ductPriceChangedIntegrationEventHandler.cs | 2 +- src/Services/Basket/Basket.API/Program.cs | 2 +- .../CatalogIntegrationEventService.cs | 5 ++- src/Services/Catalog/Catalog.API/Program.cs | 2 +- .../Behaviors/BehaviorsHelperExtensions.cs | 29 +++++++++++++++ .../Application/Behaviors/LoggingBehavior.cs | 8 ++-- .../Behaviors/TransactionBehaviour.cs | 14 +++---- .../Behaviors/ValidatorBehavior.cs | 23 +++++++++--- ...CheckoutAcceptedIntegrationEventHandler.cs | 37 +++++++++++-------- .../OrderingIntegrationEventService.cs | 4 +- src/Services/Ordering/Ordering.API/Program.cs | 2 +- src/Services/Ordering/Ordering.API/Startup.cs | 1 - 13 files changed, 90 insertions(+), 43 deletions(-) create mode 100644 src/Services/Ordering/Ordering.API/Application/Behaviors/BehaviorsHelperExtensions.cs diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index 52b3dee2d..269f99c0d 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -82,13 +82,13 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers { try { - _logger.LogInformation("----- BasketController - Publishing integration event: {IntegrationEventId} ({@IntegrationEvent})", eventMessage.Id, eventMessage); + _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", eventMessage.Id, Program.AppShortName, eventMessage); _eventBus.Publish(eventMessage); } catch (Exception ex) { - _logger.LogError(ex, "----- BasketController - ERROR Publishing integration event"); + _logger.LogError(ex, "----- ERROR Publishing integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", eventMessage.Id, Program.AppShortName, eventMessage); throw; } diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs index aeadc9674..9970497af 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs @@ -26,7 +26,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even { using (LogContext.PushProperty("IntegrationEventId", @event.Id)) { - _logger.LogInformation("----- ProductPriceChangedIntegrationEventHandler - Handling integration event: {IntegrationEventId} ({@IntegrationEvent})", @event.Id, @event); + _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", @event.Id, Program.AppShortName, @event); var userIds = _repository.GetUsers(); diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index 3b460d586..6bd2cdd8d 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -13,7 +13,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API public class Program { public static readonly string AppName = typeof(Program).Namespace; - public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); + public static readonly string AppShortName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static int Main(string[] args) { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 6b7a65968..416739d85 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -4,6 +4,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities; +using Microsoft.eShopOnContainers.Services.Catalog.API; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; using Microsoft.Extensions.Logging; using Serilog.Context; @@ -40,7 +41,7 @@ namespace Catalog.API.IntegrationEvents { try { - _logger.LogInformation("----- CatalogIntegrationEventService - Publishing integration event: {IntegrationEventId} ({@IntegrationEvent})", evt.Id, evt); + _logger.LogInformation("----- Publishing integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", evt.Id, Program.AppShortName, evt); await _eventLogService.MarkEventAsInProgressAsync(evt.Id); _eventBus.Publish(evt); @@ -48,7 +49,7 @@ namespace Catalog.API.IntegrationEvents } catch (Exception ex) { - _logger.LogError(ex, "----- CatalogIntegrationEventService - ERROR Publishing integration event"); + _logger.LogError(ex, "----- ERROR Publishing integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", evt.Id, Program.AppShortName, evt); await _eventLogService.MarkEventAsFailedAsync(evt.Id); } } diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 04455585c..d8dbe2e32 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -15,7 +15,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API public class Program { public static readonly string AppName = typeof(Program).Namespace; - public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); + public static readonly string AppShortName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static int Main(string[] args) { diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/BehaviorsHelperExtensions.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/BehaviorsHelperExtensions.cs new file mode 100644 index 000000000..1c44df90a --- /dev/null +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/BehaviorsHelperExtensions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Ordering.API.Application.Behaviors +{ + internal static class BehaviorsHelperExtensions + { + internal static string GetTypeName(this object @object) + { + var typeName = string.Empty; + var type = @object.GetType(); + + if (type.IsGenericType) + { + var genericTypes = string.Join(",", type.GetGenericArguments().Select(t => t.Name).ToArray()); + typeName = $"{type.Name.Remove(type.Name.IndexOf('`'))}<{genericTypes}>"; + } + else + { + typeName = type.Name; + } + + return typeName; + } + + } +} diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs index 2708db8a9..b43cd942f 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs @@ -1,9 +1,10 @@ using MediatR; using Microsoft.Extensions.Logging; +using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace Ordering.API.Infrastructure.Behaviors +namespace Ordering.API.Application.Behaviors { public class LoggingBehavior : IPipelineBehavior { @@ -12,9 +13,10 @@ namespace Ordering.API.Infrastructure.Behaviors public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) { - _logger.LogInformation($"Handling {typeof(TRequest).Name}"); + _logger.LogInformation("----- Handling command {CommandName} ({@Command})", request.GetTypeName(), request); var response = await next(); - _logger.LogInformation($"Handled {typeof(TResponse).Name}"); + _logger.LogInformation("----- Command {CommandName} handled - response: {@Response}", request.GetTypeName(), response); + return response; } } diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs index 6f9aed9e5..0c40faa4d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs @@ -4,8 +4,6 @@ using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; using Microsoft.Extensions.Logging; using Ordering.API.Application.IntegrationEvents; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -29,13 +27,15 @@ namespace Ordering.API.Application.Behaviors public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) { TResponse response = default(TResponse); + var typeName = request.GetTypeName(); try { var strategy = _dbContext.Database.CreateExecutionStrategy(); - await strategy.ExecuteAsync(async () => + + await strategy.ExecuteAsync(async () => { - _logger.LogInformation($"Begin transaction {typeof(TRequest).Name}"); + _logger.LogInformation("----- Begin transaction for {CommandName} ({@Command})", typeName, request); await _dbContext.BeginTransactionAsync(); @@ -43,16 +43,16 @@ namespace Ordering.API.Application.Behaviors await _dbContext.CommitTransactionAsync(); - _logger.LogInformation($"Committed transaction {typeof(TRequest).Name}"); + _logger.LogInformation("----- Transaction commited for {CommandName}", typeName); await _orderingIntegrationEventService.PublishEventsThroughEventBusAsync(); }); return response; } - catch (Exception) + catch (Exception ex) { - _logger.LogInformation($"Rollback transaction executed {typeof(TRequest).Name}"); + _logger.LogError(ex, "----- ERROR Handling transaction for {CommandName} ({@Command})", typeName, request); _dbContext.RollbackTransaction(); throw; diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs index de0a2ba4b..d40b105d0 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs @@ -1,20 +1,30 @@ using FluentValidation; using MediatR; +using Microsoft.Extensions.Logging; using Ordering.Domain.Exceptions; -using System; using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace Ordering.API.Infrastructure.Behaviors +namespace Ordering.API.Application.Behaviors { public class ValidatorBehavior : IPipelineBehavior { + private readonly ILogger> _logger; private readonly IValidator[] _validators; - public ValidatorBehavior(IValidator[] validators) => _validators = validators; + + public ValidatorBehavior(IValidator[] validators, ILogger> logger) + { + _validators = validators; + _logger = logger; + } public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) { + var typeName = request.GetTypeName(); + + _logger.LogInformation("----- Validating command {CommandType}", typeName); + var failures = _validators .Select(v => v.Validate(request)) .SelectMany(result => result.Errors) @@ -23,12 +33,13 @@ namespace Ordering.API.Infrastructure.Behaviors if (failures.Any()) { + _logger.LogWarning("----- Validation errors - {CommandType} - Command: {@Command} - Errors: {@ValidationErrors}", typeName, request, failures); + throw new OrderingDomainException( $"Command Validation Errors for type {typeof(TRequest).Name}", new ValidationException("Validation exception", failures)); } - var response = await next(); - return response; + return await next(); } } -} +} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs index 63962f814..457b116cb 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs @@ -6,6 +6,7 @@ using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Microsoft.Extensions.Logging; using Ordering.API.Application.IntegrationEvents.Events; using Serilog.Context; +using Microsoft.eShopOnContainers.Services.Ordering.API; namespace Ordering.API.Application.IntegrationEvents.EventHandling { @@ -35,34 +36,38 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling { using (LogContext.PushProperty("IntegrationEventId", eventMsg.Id)) { - _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - Handling integration event: {IntegrationEventId} ({@IntegrationEvent})", eventMsg.Id, eventMsg); + _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppShortName} - ({@IntegrationEvent})", eventMsg.Id, Program.AppShortName, eventMsg); var result = false; if (eventMsg.RequestId != Guid.Empty) { - var createOrderCommand = new CreateOrderCommand(eventMsg.Basket.Items, eventMsg.UserId, eventMsg.UserName, eventMsg.City, eventMsg.Street, - eventMsg.State, eventMsg.Country, eventMsg.ZipCode, - eventMsg.CardNumber, eventMsg.CardHolderName, eventMsg.CardExpiration, - eventMsg.CardSecurityNumber, eventMsg.CardTypeId); + using (LogContext.PushProperty("IdentifiedCommandId", eventMsg.RequestId)) + { + var createOrderCommand = new CreateOrderCommand(eventMsg.Basket.Items, eventMsg.UserId, eventMsg.UserName, eventMsg.City, eventMsg.Street, + eventMsg.State, eventMsg.Country, eventMsg.ZipCode, + eventMsg.CardNumber, eventMsg.CardHolderName, eventMsg.CardExpiration, + eventMsg.CardSecurityNumber, eventMsg.CardTypeId); - _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand: {@CreateOrderCommand}", createOrderCommand); + var requestCreateOrder = new IdentifiedCommand(createOrderCommand, eventMsg.RequestId); - var requestCreateOrder = new IdentifiedCommand(createOrderCommand, eventMsg.RequestId); - result = await _mediator.Send(requestCreateOrder); + _logger.LogInformation("----- IdentifiedCreateOrderCommand: {@IdentifiedCreateOrderCommand}", requestCreateOrder); - if (result) - { - _logger.LogInformation("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand suceeded - RequestId: {RequestId}", eventMsg.RequestId); - } - else - { - _logger.LogWarning("----- UserCheckoutAcceptedIntegrationEventHandler - CreateOrderCommand failed - RequestId: {RequestId}", eventMsg.RequestId); + result = await _mediator.Send(requestCreateOrder); + + if (result) + { + _logger.LogInformation("----- CreateOrderCommand suceeded - RequestId: {RequestId}", eventMsg.RequestId); + } + else + { + _logger.LogWarning("----- CreateOrderCommand failed - RequestId: {RequestId}", eventMsg.RequestId); + } } } else { - _logger.LogWarning("----- UserCheckoutAcceptedIntegrationEventHandler - Invalid IntegrationEvent - RequestId is missing}"); + _logger.LogWarning("----- Invalid IntegrationEvent - RequestId is missing - {@IntegrationEvent}", eventMsg); } } } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs index 9c1bd4e1b..e0da77a8f 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs @@ -22,7 +22,7 @@ namespace Ordering.API.Application.IntegrationEvents private readonly IntegrationEventLogContext _eventLogContext; private readonly IIntegrationEventLogService _eventLogService; - public OrderingIntegrationEventService(IEventBus eventBus, + public OrderingIntegrationEventService(IEventBus eventBus, OrderingContext orderingContext, IntegrationEventLogContext eventLogContext, Func integrationEventLogServiceFactory) @@ -48,7 +48,7 @@ namespace Ordering.API.Application.IntegrationEvents catch (Exception) { await _eventLogService.MarkEventAsFailedAsync(logEvt.EventId); - } + } } } diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index 28d4b9f8e..fd09ff63e 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -16,7 +16,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API public class Program { public static readonly string AppName = typeof(Program).Namespace; - public static readonly string ShortAppName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); + public static readonly string AppShortName = AppName.Substring(AppName.LastIndexOf('.', AppName.LastIndexOf('.') - 1) + 1); public static int Main(string[] args) { diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 9e3317f51..91ffe8d59 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -125,7 +125,6 @@ eventBus.Subscribe>(); } - protected virtual void ConfigureAuth(IApplicationBuilder app) { if (Configuration.GetValue("UseLoadTest")) From f3cd3738d96e8a2312b03433cee3e60f6c912b54 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 21:36:40 +0000 Subject: [PATCH 024/173] Add logging to CreateOrderCommandHandler --- .../Application/Commands/CreateOrderCommandHandler.cs | 8 +++++++- .../OrderingIntegrationEventService.cs | 11 ++++++++++- .../Infrastructure/AutofacModules/MediatorModule.cs | 1 - 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs index 9a3035d5c..45400f57f 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs @@ -6,6 +6,7 @@ using MediatR; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; + using Microsoft.Extensions.Logging; using System; using System.Threading; using System.Threading.Tasks; @@ -18,17 +19,20 @@ private readonly IIdentityService _identityService; private readonly IMediator _mediator; private readonly IOrderingIntegrationEventService _orderingIntegrationEventService; + private readonly ILogger _logger; // Using DI to inject infrastructure persistence Repositories public CreateOrderCommandHandler(IMediator mediator, IOrderingIntegrationEventService orderingIntegrationEventService, IOrderRepository orderRepository, - IIdentityService identityService) + IIdentityService identityService, + ILogger logger) { _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _identityService = identityService ?? throw new ArgumentNullException(nameof(identityService)); _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); _orderingIntegrationEventService = orderingIntegrationEventService ?? throw new ArgumentNullException(nameof(orderingIntegrationEventService)); + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public async Task Handle(CreateOrderCommand message, CancellationToken cancellationToken) @@ -49,6 +53,8 @@ order.AddOrderItem(item.ProductId, item.ProductName, item.UnitPrice, item.Discount, item.PictureUrl, item.Units); } + _logger.LogInformation("----- Creating Order - Order: {@Order}", order); + _orderRepository.Add(order); return await _orderRepository.UnitOfWork diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs index e0da77a8f..5bae18beb 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs @@ -6,6 +6,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; +using Microsoft.Extensions.Logging; using System; using System.Data.Common; using System.Diagnostics; @@ -21,24 +22,30 @@ namespace Ordering.API.Application.IntegrationEvents private readonly OrderingContext _orderingContext; private readonly IntegrationEventLogContext _eventLogContext; private readonly IIntegrationEventLogService _eventLogService; + private readonly ILogger _logger; public OrderingIntegrationEventService(IEventBus eventBus, OrderingContext orderingContext, IntegrationEventLogContext eventLogContext, - Func integrationEventLogServiceFactory) + Func integrationEventLogServiceFactory, + ILogger logger) { _orderingContext = orderingContext ?? throw new ArgumentNullException(nameof(orderingContext)); _eventLogContext = eventLogContext ?? throw new ArgumentNullException(nameof(eventLogContext)); _integrationEventLogServiceFactory = integrationEventLogServiceFactory ?? throw new ArgumentNullException(nameof(integrationEventLogServiceFactory)); _eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus)); _eventLogService = _integrationEventLogServiceFactory(_orderingContext.Database.GetDbConnection()); + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public async Task PublishEventsThroughEventBusAsync() { var pendindLogEvents = await _eventLogService.RetrieveEventLogsPendingToPublishAsync(); + foreach (var logEvt in pendindLogEvents) { + _logger.LogInformation("----- Publishing integration event {IntegrationEventId} ({@IntegrationEvent})", logEvt.EventId, logEvt); + try { await _eventLogService.MarkEventAsInProgressAsync(logEvt.EventId); @@ -54,6 +61,8 @@ namespace Ordering.API.Application.IntegrationEvents public async Task AddAndSaveEventAsync(IntegrationEvent evt) { + _logger.LogInformation("----- Saving integration event {IntegrationEventId} to repository ({@IntegrationEvent})", evt.Id, evt); + await _eventLogService.SaveEventAsync(evt, _orderingContext.GetCurrentTransaction.GetDbTransaction()); } } diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs index 99a413f9f..67275a587 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs @@ -7,7 +7,6 @@ using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Ordering.API.Application.Behaviors; using Ordering.API.Application.DomainEventHandlers.OrderStartedEvent; using Ordering.API.Application.Validations; -using Ordering.API.Infrastructure.Behaviors; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules { From 29c41fe3e35d0571335cc95e66c627bb7b51f335 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Wed, 6 Feb 2019 21:37:30 +0000 Subject: [PATCH 025/173] Remove specific version for Microsoft.AspNetCore.App --- src/Services/Basket/Basket.API/Basket.API.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 0a1b5f581..dbf4308ac 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -22,7 +22,7 @@ - + From 8a602a1dd8c7536fa5de86aee86045569585d358 Mon Sep 17 00:00:00 2001 From: Matt M Date: Thu, 7 Feb 2019 10:18:41 -0700 Subject: [PATCH 026/173] Added ApiGateways to solution mimicking eShopOnContainers-ServicesAndWebApps solution structure --- eShopOnContainers.sln | 390 ++++++++++++++++++++---------------------- 1 file changed, 183 insertions(+), 207 deletions(-) diff --git a/eShopOnContainers.sln b/eShopOnContainers.sln index 999203557..8e08a05fa 100644 --- a/eShopOnContainers.sln +++ b/eShopOnContainers.sln @@ -55,20 +55,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBusRabbitMQ", "src\Bui EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationEventLogEF", "src\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj", "{9EE28E45-1533-472B-8267-56C48855BA0E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HealthChecks", "HealthChecks", "{A81ECBC2-6B00-4DCD-8388-469174033379}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.HealthChecks", "src\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj", "{942ED6E8-0050-495F-A0EA-01E97F63760C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebStatus", "src\Web\WebStatus\WebStatus.csproj", "{C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Payment", "Payment", "{022E145D-1593-47EE-9608-8E323D3C63F5}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services\Payment\Payment.API\Payment.API.csproj", "{1A01AF82-6FCB-464C-B39C-F127AEBD315D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.HealthChecks", "src\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj", "{22A0F9C1-2D4A-4107-95B7-8459E6688BC5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.HealthChecks.SqlServer", "src\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.SqlServer\Microsoft.Extensions.HealthChecks.SqlServer.csproj", "{4BD76717-3102-4969-8C2C-BAAA3F0263B6}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Location", "Location", "{41139F64-4046-4F16-96B7-D941D96FA9C6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Locations.API", "src\Services\Location\Locations.API\Locations.API.csproj", "{E7581357-FC34-474C-B8F5-307EE3CE05EF}" @@ -79,8 +71,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Marketing.API", "src\Servic EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBusServiceBus", "src\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj", "{69AF10D3-AA76-4FF7-B187-EC7E8CC5F5B8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.HealthChecks.AzureStorage", "src\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.AzureStorage\Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "{768C887F-C229-4B94-ACD8-0C7F65686524}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebHost", "WebHost", "{1815B651-941C-466B-AE33-D1D7EEB8F77F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebHost.Customization", "src\BuildingBlocks\WebHostCustomization\WebHost.Customization\WebHost.Customization.csproj", "{15F4B3AA-89B6-4A0D-9051-414305974781}" @@ -141,6 +131,36 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DA1786E4 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{30308DE0-8128-4613-BCAD-B0BEFFB20E38}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiGateways", "ApiGateways", "{79C64C7A-ED74-4F01-921F-92F4F9FC1E1D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiGw-Base", "ApiGw-Base", "{56AD1FCA-6E16-4798-BF29-941C5B3277D2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile.Bff.Marketing", "Mobile.Bff.Marketing", "{34ED3311-2B30-4C8B-823B-312B50FFC32A}" + ProjectSection(SolutionItems) = preProject + src\ApiGateways\Mobile.Bff.Marketing\apigw\configuration.json = src\ApiGateways\Mobile.Bff.Marketing\apigw\configuration.json + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile.Bff.Shopping", "Mobile.Bff.Shopping", "{A32A5254-BA36-46FC-8C75-F7B8FFE8FCD0}" + ProjectSection(SolutionItems) = preProject + src\ApiGateways\Mobile.Bff.Shopping\apigw\configuration.json = src\ApiGateways\Mobile.Bff.Shopping\apigw\configuration.json + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web.Bff.Marketing", "Web.Bff.Marketing", "{696D2B7E-6B75-401D-964A-BFE6F4D7AF73}" + ProjectSection(SolutionItems) = preProject + src\ApiGateways\Web.Bff.Marketing\apigw\configuration.json = src\ApiGateways\Web.Bff.Marketing\apigw\configuration.json + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web.Bff.Shopping", "Web.Bff.Shopping", "{424BC53E-17EA-4E12-BC07-64BAA927ABCB}" + ProjectSection(SolutionItems) = preProject + src\ApiGateways\Web.Bff.Shopping\apigw\configuration.json = src\ApiGateways\Web.Bff.Shopping\apigw\configuration.json + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OcelotApiGw", "src\ApiGateways\ApiGw-Base\OcelotApiGw.csproj", "{0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggregator", "src\ApiGateways\Mobile.Bff.Shopping\aggregator\Mobile.Shopping.HttpAggregator.csproj", "{98E0B3BA-6601-4C59-A9AA-24A00A17D835}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web.Shopping.HttpAggregator", "src\ApiGateways\Web.Bff.Shopping\aggregator\Web.Shopping.HttpAggregator.csproj", "{E39BD762-BC86-459D-B818-B6BF2D9F1352}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -635,54 +655,6 @@ Global {9EE28E45-1533-472B-8267-56C48855BA0E}.Release|x64.Build.0 = Release|Any CPU {9EE28E45-1533-472B-8267-56C48855BA0E}.Release|x86.ActiveCfg = Release|Any CPU {9EE28E45-1533-472B-8267-56C48855BA0E}.Release|x86.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|ARM.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|iPhone.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|x64.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|x64.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|x86.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.AppStore|x86.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|ARM.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|ARM.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|iPhone.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|x64.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|x64.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|x86.ActiveCfg = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Debug|x86.Build.0 = Debug|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|Any CPU.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|ARM.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|ARM.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|iPhone.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|iPhone.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|x64.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|x64.Build.0 = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|x86.ActiveCfg = Release|Any CPU - {942ED6E8-0050-495F-A0EA-01E97F63760C}.Release|x86.Build.0 = Release|Any CPU {C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -779,102 +751,6 @@ Global {1A01AF82-6FCB-464C-B39C-F127AEBD315D}.Release|x64.Build.0 = Release|Any CPU {1A01AF82-6FCB-464C-B39C-F127AEBD315D}.Release|x86.ActiveCfg = Release|Any CPU {1A01AF82-6FCB-464C-B39C-F127AEBD315D}.Release|x86.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|ARM.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|iPhone.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|x64.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|x64.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|x86.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.AppStore|x86.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|ARM.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|ARM.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|iPhone.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|x64.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|x64.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|x86.ActiveCfg = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Debug|x86.Build.0 = Debug|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|Any CPU.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|ARM.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|ARM.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|iPhone.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|iPhone.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|x64.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|x64.Build.0 = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|x86.ActiveCfg = Release|Any CPU - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}.Release|x86.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|ARM.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|iPhone.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|x64.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|x64.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|x86.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.AppStore|x86.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|ARM.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|ARM.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|iPhone.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|x64.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|x64.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|x86.ActiveCfg = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Debug|x86.Build.0 = Debug|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|Any CPU.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|ARM.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|ARM.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|iPhone.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|iPhone.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x64.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x64.Build.0 = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x86.ActiveCfg = Release|Any CPU - {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x86.Build.0 = Release|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -1019,54 +895,6 @@ Global {69AF10D3-AA76-4FF7-B187-EC7E8CC5F5B8}.Release|x64.Build.0 = Release|Any CPU {69AF10D3-AA76-4FF7-B187-EC7E8CC5F5B8}.Release|x86.ActiveCfg = Release|Any CPU {69AF10D3-AA76-4FF7-B187-EC7E8CC5F5B8}.Release|x86.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|ARM.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|iPhone.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|x64.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|x64.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|x86.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.AppStore|x86.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|Any CPU.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|ARM.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|ARM.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|iPhone.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|x64.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|x64.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|x86.ActiveCfg = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Debug|x86.Build.0 = Debug|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|Any CPU.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|Any CPU.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|ARM.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|ARM.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|iPhone.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|iPhone.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|x64.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|x64.Build.0 = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|x86.ActiveCfg = Release|Any CPU - {768C887F-C229-4B94-ACD8-0C7F65686524}.Release|x86.Build.0 = Release|Any CPU {15F4B3AA-89B6-4A0D-9051-414305974781}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {15F4B3AA-89B6-4A0D-9051-414305974781}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {15F4B3AA-89B6-4A0D-9051-414305974781}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -2067,6 +1895,150 @@ Global {3572B4E2-4399-4797-B5C2-3720D870E0C3}.Release|x64.Build.0 = Release|Any CPU {3572B4E2-4399-4797-B5C2-3720D870E0C3}.Release|x86.ActiveCfg = Release|Any CPU {3572B4E2-4399-4797-B5C2-3720D870E0C3}.Release|x86.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|ARM.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|iPhone.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|x64.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|x64.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|x86.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.AppStore|x86.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|ARM.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|ARM.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|iPhone.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|x64.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|x64.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|x86.ActiveCfg = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Debug|x86.Build.0 = Debug|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|Any CPU.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|ARM.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|ARM.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|iPhone.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|iPhone.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|x64.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|x64.Build.0 = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|x86.ActiveCfg = Release|Any CPU + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC}.Release|x86.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|ARM.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|iPhone.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|x64.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|x64.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|x86.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.AppStore|x86.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|ARM.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|ARM.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|iPhone.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|x64.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|x64.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|x86.ActiveCfg = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Debug|x86.Build.0 = Debug|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|Any CPU.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|ARM.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|ARM.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|iPhone.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|iPhone.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|x64.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|x64.Build.0 = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|x86.ActiveCfg = Release|Any CPU + {98E0B3BA-6601-4C59-A9AA-24A00A17D835}.Release|x86.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|ARM.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|iPhone.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|x64.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|x64.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|x86.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.AppStore|x86.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|ARM.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|iPhone.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|x64.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|x64.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|x86.ActiveCfg = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Debug|x86.Build.0 = Debug|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|Any CPU.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|ARM.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|ARM.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|iPhone.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|iPhone.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x64.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x64.Build.0 = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x86.ActiveCfg = Release|Any CPU + {E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2092,19 +2064,14 @@ Global {0044B293-1DCC-4224-B948-00CF6DC7F510} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} {8088F3FC-6787-45FA-A924-816EC81CBFAC} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} {9EE28E45-1533-472B-8267-56C48855BA0E} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} - {A81ECBC2-6B00-4DCD-8388-469174033379} = {DB0EFB20-B024-4E5E-A75C-52143C131D25} - {942ED6E8-0050-495F-A0EA-01E97F63760C} = {A81ECBC2-6B00-4DCD-8388-469174033379} {C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} {022E145D-1593-47EE-9608-8E323D3C63F5} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} {1A01AF82-6FCB-464C-B39C-F127AEBD315D} = {022E145D-1593-47EE-9608-8E323D3C63F5} - {22A0F9C1-2D4A-4107-95B7-8459E6688BC5} = {A81ECBC2-6B00-4DCD-8388-469174033379} - {4BD76717-3102-4969-8C2C-BAAA3F0263B6} = {A81ECBC2-6B00-4DCD-8388-469174033379} {41139F64-4046-4F16-96B7-D941D96FA9C6} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} {E7581357-FC34-474C-B8F5-307EE3CE05EF} = {41139F64-4046-4F16-96B7-D941D96FA9C6} {A5260DE0-1FDD-467E-9CC1-A028AB081CEE} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} {DF395F85-B010-465D-857A-7EBCC512C0C2} = {A5260DE0-1FDD-467E-9CC1-A028AB081CEE} {69AF10D3-AA76-4FF7-B187-EC7E8CC5F5B8} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} - {768C887F-C229-4B94-ACD8-0C7F65686524} = {A81ECBC2-6B00-4DCD-8388-469174033379} {1815B651-941C-466B-AE33-D1D7EEB8F77F} = {DB0EFB20-B024-4E5E-A75C-52143C131D25} {15F4B3AA-89B6-4A0D-9051-414305974781} = {1815B651-941C-466B-AE33-D1D7EEB8F77F} {EF3EDC78-E864-43FF-8E80-CF33DD9508A3} = {932D8224-11F6-4D07-B109-DA28AD288A63} @@ -2135,6 +2102,15 @@ Global {2B26A7AA-6D61-42FA-8AB7-C0F05AAE7F1C} = {41139F64-4046-4F16-96B7-D941D96FA9C6} {DA1786E4-30AB-434E-A827-92896390B79D} = {A5260DE0-1FDD-467E-9CC1-A028AB081CEE} {30308DE0-8128-4613-BCAD-B0BEFFB20E38} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} + {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} = {932D8224-11F6-4D07-B109-DA28AD288A63} + {56AD1FCA-6E16-4798-BF29-941C5B3277D2} = {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} + {34ED3311-2B30-4C8B-823B-312B50FFC32A} = {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} + {A32A5254-BA36-46FC-8C75-F7B8FFE8FCD0} = {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} + {696D2B7E-6B75-401D-964A-BFE6F4D7AF73} = {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} + {424BC53E-17EA-4E12-BC07-64BAA927ABCB} = {79C64C7A-ED74-4F01-921F-92F4F9FC1E1D} + {0A328C44-4C4E-49BE-9FB4-9D851CEC28AC} = {56AD1FCA-6E16-4798-BF29-941C5B3277D2} + {98E0B3BA-6601-4C59-A9AA-24A00A17D835} = {A32A5254-BA36-46FC-8C75-F7B8FFE8FCD0} + {E39BD762-BC86-459D-B818-B6BF2D9F1352} = {424BC53E-17EA-4E12-BC07-64BAA927ABCB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9} From 820330556b8ca66e4309824c57eca031e598dcf4 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 13 Feb 2019 10:02:07 +0100 Subject: [PATCH 027/173] updated files to new devspaces format --- .../aggregator/Dockerfile.develop | 2 +- .../Basket/Basket.API/Dockerfile.develop | 2 +- .../Catalog/Catalog.API/Dockerfile.develop | 2 +- .../Identity/Identity.API/Dockerfile.develop | 2 +- .../Ordering/Ordering.API/Dockerfile.develop | 2 +- src/Web/WebMVC/Dockerfile.develop | 8 +++--- src/Web/WebMVC/azds.yaml | 27 +++++++++---------- src/Web/WebMVC/inf.yaml | 2 +- 8 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index 10ef2c3d4..64e63de0f 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop index b7d715b28..cd6252343 100644 --- a/src/Services/Basket/Basket.API/Dockerfile.develop +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index b62c7f6e3..f6a111386 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop index e2083dd40..4d49cfdcb 100644 --- a/src/Services/Identity/Identity.API/Dockerfile.develop +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 2106ff3da..01b1e58c1 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2.100-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop index 16041dc97..7e923c2b4 100644 --- a/src/Web/WebMVC/Dockerfile.develop +++ b/src/Web/WebMVC/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.1-sdk +FROM microsoft/dotnet:2.2-sdk ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -6,11 +6,9 @@ EXPOSE 80 WORKDIR /src COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] -COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" COPY . . WORKDIR "/src/src/Web/WebMVC" -RUN dotnet build --no-restore -c $BUILD_CONFIGURATION +RUN dotnet build --no-restore "WebMVC.csproj" -c $BUILD_CONFIGURATION -ENTRYPOINT ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 438b36f0d..5c95c50ee 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -1,40 +1,39 @@ kind: helm-release -apiVersion: 1.0 +apiVersion: 1.1 build: context: ..\..\..\ dockerfile: Dockerfile install: chart: ../../../k8s/helm/webmvc - values: - - values.dev.yaml? - - secrets.dev.yaml? - - inf.yaml - - app.yaml set: replicaCount: 1 image: tag: $(tag) pullPolicy: Never - inf: - k8s: - dns: "$(spacePrefix)webmvc$(hostSuffix)" ingress: + annotations: + kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - $(spacePrefix)webmvc$(hostSuffix) + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml configurations: develop: build: - dockerfile: Dockerfile.develop useGitIgnore: true + dockerfile: Dockerfile.develop args: BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} container: sync: - - "**/Pages/**" - - "**/Views/**" - - "**/wwwroot/**" - - "!**/*.{sln,csproj}" + - '**/Pages/**' + - '**/Views/**' + - '**/wwwroot/**' + - '!**/*.{sln,csproj}' command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] iterate: processesToKill: [dotnet, vsdbg] diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml index 9df900bae..bac6d51a4 100644 --- a/src/Web/WebMVC/inf.yaml +++ b/src/Web/WebMVC/inf.yaml @@ -19,6 +19,6 @@ inf: ingress: annotations: - kubernetes.io/ingress.class: addon-http-application-routing +# kubernetes.io/ingress.class: addon-http-application-routing ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file From 031de21ea483bf8fcfc78e657afb72efc5fdaa1a Mon Sep 17 00:00:00 2001 From: SychevIgor Date: Wed, 13 Feb 2019 14:56:36 +0300 Subject: [PATCH 028/173] typo typo --- deploy/az/servicebus/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/az/servicebus/readme.md b/deploy/az/servicebus/readme.md index 16da4c7b2..886b3ec60 100644 --- a/deploy/az/servicebus/readme.md +++ b/deploy/az/servicebus/readme.md @@ -8,7 +8,7 @@ The ARM template `sbusdeploy.json` and its parameter file (`sbusdeploy.parameter ## Editing sbusdeploy.parameters.json file -You can edit the `sbusdeploy.parameters.parameters.json` file to set your values, but is not needed. The only parameter than can +You can edit the `sbusdeploy.parameters.json` file to set your values, but is not needed. The only parameter than can be set is: 1. `namespaceprefix` is a string that is used to create the namespace. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. @@ -21,4 +21,4 @@ i. e. if you are in windows, to deploy servicebus in a new resourcegroup located ``` create-resources.cmd servicebus\sbusdeploy newResourceGroup -c westus -``` \ No newline at end of file +``` From 71bcc081c1bef1a899040c4ccb8673463058c1de Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Fri, 15 Feb 2019 14:24:56 +0000 Subject: [PATCH 029/173] .gitignore site.*.js files, as the are created on opening the Project --- src/Web/WebMVC/.gitignore | 1 + src/Web/WebMVC/wwwroot/js/site.js | 3444 ------------------------- src/Web/WebMVC/wwwroot/js/site.min.js | 29 - 3 files changed, 1 insertion(+), 3473 deletions(-) create mode 100644 src/Web/WebMVC/.gitignore delete mode 100644 src/Web/WebMVC/wwwroot/js/site.js delete mode 100644 src/Web/WebMVC/wwwroot/js/site.min.js diff --git a/src/Web/WebMVC/.gitignore b/src/Web/WebMVC/.gitignore new file mode 100644 index 000000000..271953e2f --- /dev/null +++ b/src/Web/WebMVC/.gitignore @@ -0,0 +1 @@ +wwwroot/js/site* diff --git a/src/Web/WebMVC/wwwroot/js/site.js b/src/Web/WebMVC/wwwroot/js/site.js deleted file mode 100644 index c616a9005..000000000 --- a/src/Web/WebMVC/wwwroot/js/site.js +++ /dev/null @@ -1,3444 +0,0 @@ -/** - * @overview ASP.NET Core SignalR JavaScript Client. - * @version 1.0.3. - * @license - * Copyright (c) .NET Foundation. All rights reserved. - * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.signalR = factory()); -}(this, (function () { 'use strict'; - -var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); -} - -function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; -}; - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator]; - return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -} - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - - -var tslib_1 = Object.freeze({ - __extends: __extends, - __assign: __assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault -}); - -var es6Promise_auto = createCommonjsModule(function (module, exports) { -/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.2+97478eb6 - */ - -(function (global, factory) { - module.exports = factory(); -}(commonjsGlobal, (function () { function objectOrFunction(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} - -function isFunction(x) { - return typeof x === 'function'; -} - - - -var _isArray = void 0; -if (Array.isArray) { - _isArray = Array.isArray; -} else { - _isArray = function (x) { - return Object.prototype.toString.call(x) === '[object Array]'; - }; -} - -var isArray = _isArray; - -var len = 0; -var vertxNext = void 0; -var customSchedulerFn = void 0; - -var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } -}; - -function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; -} - -function setAsap(asapFn) { - asap = asapFn; -} - -var browserWindow = typeof window !== 'undefined' ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; - -// test for web worker but not in IE10 -var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; - -// node -function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return function () { - return process.nextTick(flush); - }; -} - -// vertx -function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; - } - - return useSetTimeout(); -} - -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); - - return function () { - node.data = iterations = ++iterations % 2; - }; -} - -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; -} - -function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var globalSetTimeout = setTimeout; - return function () { - return globalSetTimeout(flush, 1); - }; -} - -var queue = new Array(1000); -function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue[i]; - var arg = queue[i + 1]; - - callback(arg); - - queue[i] = undefined; - queue[i + 1] = undefined; - } - - len = 0; -} - -function attemptVertx() { - try { - var r = commonjsRequire; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } -} - -var scheduleFlush = void 0; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); -} else if (isWorker) { - scheduleFlush = useMessageChannel(); -} else if (browserWindow === undefined && typeof commonjsRequire === 'function') { - scheduleFlush = attemptVertx(); -} else { - scheduleFlush = useSetTimeout(); -} - -function then(onFulfillment, onRejection) { - var parent = this; - - var child = new this.constructor(noop); - - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - - var _state = parent._state; - - - if (_state) { - var callback = arguments[_state - 1]; - asap(function () { - return invokeCallback(_state, child, callback, parent._result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - - return child; -} - -/** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` -*/ -function resolve$1(object) { - /*jshint validthis:true */ - var Constructor = this; - - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - - var promise = new Constructor(noop); - resolve(promise, object); - return promise; -} - -var PROMISE_ID = Math.random().toString(36).substring(16); - -function noop() {} - -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; - -var GET_THEN_ERROR = new ErrorObject(); - -function selfFulfillment() { - return new TypeError("You cannot resolve a promise with itself"); -} - -function cannotReturnOwn() { - return new TypeError('A promises callback cannot return that same promise.'); -} - -function getThen(promise) { - try { - return promise.then; - } catch (error) { - GET_THEN_ERROR.error = error; - return GET_THEN_ERROR; - } -} - -function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { - try { - then$$1.call(value, fulfillmentHandler, rejectionHandler); - } catch (e) { - return e; - } -} - -function handleForeignThenable(promise, thenable, then$$1) { - asap(function (promise) { - var sealed = false; - var error = tryThen(then$$1, thenable, function (value) { - if (sealed) { - return; - } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, function (reason) { - if (sealed) { - return; - } - sealed = true; - - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); - - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} - -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } -} - -function handleMaybeThenable(promise, maybeThenable, then$$1) { - if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$1 === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - GET_THEN_ERROR.error = null; - } else if (then$$1 === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$1)) { - handleForeignThenable(promise, maybeThenable, then$$1); - } else { - fulfill(promise, maybeThenable); - } - } -} - -function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); - } -} - -function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - - publish(promise); -} - -function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } - - promise._result = value; - promise._state = FULFILLED; - - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } -} - -function reject(promise, reason) { - if (promise._state !== PENDING) { - return; - } - promise._state = REJECTED; - promise._result = reason; - - asap(publishRejection, promise); -} - -function subscribe(parent, child, onFulfillment, onRejection) { - var _subscribers = parent._subscribers; - var length = _subscribers.length; - - - parent._onerror = null; - - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - - if (length === 0 && parent._state) { - asap(publish, parent); - } -} - -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - - if (subscribers.length === 0) { - return; - } - - var child = void 0, - callback = void 0, - detail = promise._result; - - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - - promise._subscribers.length = 0; -} - -function ErrorObject() { - this.error = null; -} - -var TRY_CATCH_ERROR = new ErrorObject(); - -function tryCatch(callback, detail) { - try { - return callback(detail); - } catch (e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } -} - -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = void 0, - error = void 0, - succeeded = void 0, - failed = void 0; - - if (hasCallback) { - value = tryCatch(callback, detail); - - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value.error = null; - } else { - succeeded = true; - } - - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - succeeded = true; - } - - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (failed) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } -} - -function initializePromise(promise, resolver) { - try { - resolver(function resolvePromise(value) { - resolve(promise, value); - }, function rejectPromise(reason) { - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); - } -} - -var id = 0; -function nextId() { - return id++; -} - -function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = []; -} - -function validationError() { - return new Error('Array Methods must be provided an Array'); -} - -function validationError() { - return new Error('Array Methods must be provided an Array'); -} - -var Enumerator = function () { - function Enumerator(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - - this._result = new Array(this.length); - - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - - Enumerator.prototype._enumerate = function _enumerate(input) { - for (var i = 0; this._state === PENDING && i < input.length; i++) { - this._eachEntry(input[i], i); - } - }; - - Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { - var c = this._instanceConstructor; - var resolve$$1 = c.resolve; - - - if (resolve$$1 === resolve$1) { - var _then = getThen(entry); - - if (_then === then && entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof _then !== 'function') { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise$2) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, _then); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve$$1) { - return resolve$$1(entry); - }), i); - } - } else { - this._willSettleAt(resolve$$1(entry), i); - } - }; - - Enumerator.prototype._settledAt = function _settledAt(state, i, value) { - var promise = this.promise; - - - if (promise._state === PENDING) { - this._remaining--; - - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; - - Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { - var enumerator = this; - - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; - - return Enumerator; -}(); - -/** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static -*/ -function all(entries) { - return new Enumerator(this, entries).promise; -} - -/** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. -*/ -function race(entries) { - /*jshint validthis:true */ - var Constructor = this; - - if (!isArray(entries)) { - return new Constructor(function (_, reject) { - return reject(new TypeError('You must pass an array to race.')); - }); - } else { - return new Constructor(function (resolve, reject) { - var length = entries.length; - for (var i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } -} - -/** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. -*/ -function reject$1(reason) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop); - reject(promise, reason); - return promise; -} - -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} - -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); -} - -/** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor -*/ - -var Promise$2 = function () { - function Promise(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = []; - - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } - } - - /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - Assimilation - ------------ - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - If the assimliated promise rejects, then the downstream promise will also reject. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - Simple Example - -------------- - Synchronous Example - ```javascript - let result; - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - Promise Example; - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- - Synchronous Example - ```javascript - let author, books; - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - function foundBooks(books) { - } - function failure(reason) { - } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); - } - // success - } - }); - ``` - Promise Example; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} - */ - - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} - */ - - - Promise.prototype.catch = function _catch(onRejection) { - return this.then(null, onRejection); - }; - - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} - */ - - - Promise.prototype.finally = function _finally(callback) { - var promise = this; - var constructor = promise.constructor; - - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }); - }; - - return Promise; -}(); - -Promise$2.prototype.then = then; -Promise$2.all = all; -Promise$2.race = race; -Promise$2.resolve = resolve$1; -Promise$2.reject = reject$1; -Promise$2._setScheduler = setScheduler; -Promise$2._setAsap = setAsap; -Promise$2._asap = asap; - -/*global self*/ -function polyfill() { - var local = void 0; - - if (typeof commonjsGlobal !== 'undefined') { - local = commonjsGlobal; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - - var P = local.Promise; - - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call(P.resolve()); - } catch (e) { - // silently ignored - } - - if (promiseToString === '[object Promise]' && !P.cast) { - return; - } - } - - local.Promise = Promise$2; -} - -// Strange compat.. -Promise$2.polyfill = polyfill; -Promise$2.Promise = Promise$2; - -Promise$2.polyfill(); - -return Promise$2; - -}))); - - - - -}); - -var Errors = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - -/** Error thrown when an HTTP request fails. */ -var HttpError = /** @class */ (function (_super) { - tslib_1.__extends(HttpError, _super); - /** Constructs a new instance of {@link HttpError}. - * - * @param {string} errorMessage A descriptive error message. - * @param {number} statusCode The HTTP status code represented by this error. - */ - function HttpError(errorMessage, statusCode) { - var _newTarget = this.constructor; - var _this = this; - var trueProto = _newTarget.prototype; - _this = _super.call(this, errorMessage) || this; - _this.statusCode = statusCode; - // Workaround issue in Typescript compiler - // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 - _this.__proto__ = trueProto; - return _this; - } - return HttpError; -}(Error)); -exports.HttpError = HttpError; -/** Error thrown when a timeout elapses. */ -var TimeoutError = /** @class */ (function (_super) { - tslib_1.__extends(TimeoutError, _super); - /** Constructs a new instance of {@link TimeoutError}. - * - * @param {string} errorMessage A descriptive error message. - */ - function TimeoutError(errorMessage) { - var _newTarget = this.constructor; - if (errorMessage === void 0) { errorMessage = "A timeout occurred."; } - var _this = this; - var trueProto = _newTarget.prototype; - _this = _super.call(this, errorMessage) || this; - // Workaround issue in Typescript compiler - // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 - _this.__proto__ = trueProto; - return _this; - } - return TimeoutError; -}(Error)); -exports.TimeoutError = TimeoutError; - -}); - -unwrapExports(Errors); -var Errors_1 = Errors.HttpError; -var Errors_2 = Errors.TimeoutError; - -var ILogger = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here. -/** Indicates the severity of a log message. - * - * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. - */ -var LogLevel; -(function (LogLevel) { - /** Log level for very low severity diagnostic messages. */ - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - /** Log level for low severity diagnostic messages. */ - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - /** Log level for informational diagnostic messages. */ - LogLevel[LogLevel["Information"] = 2] = "Information"; - /** Log level for diagnostic messages that indicate a non-fatal problem. */ - LogLevel[LogLevel["Warning"] = 3] = "Warning"; - /** Log level for diagnostic messages that indicate a failure in the current operation. */ - LogLevel[LogLevel["Error"] = 4] = "Error"; - /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ - LogLevel[LogLevel["Critical"] = 5] = "Critical"; - /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ - LogLevel[LogLevel["None"] = 6] = "None"; -})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); - -}); - -unwrapExports(ILogger); -var ILogger_1 = ILogger.LogLevel; - -var HttpClient_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - -/** Represents an HTTP response. */ -var HttpResponse = /** @class */ (function () { - function HttpResponse(statusCode, statusText, content) { - this.statusCode = statusCode; - this.statusText = statusText; - this.content = content; - } - return HttpResponse; -}()); -exports.HttpResponse = HttpResponse; -/** Abstraction over an HTTP client. - * - * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms. - */ -var HttpClient = /** @class */ (function () { - function HttpClient() { - } - HttpClient.prototype.get = function (url, options) { - return this.send(tslib_1.__assign({}, options, { method: "GET", url: url })); - }; - HttpClient.prototype.post = function (url, options) { - return this.send(tslib_1.__assign({}, options, { method: "POST", url: url })); - }; - HttpClient.prototype.delete = function (url, options) { - return this.send(tslib_1.__assign({}, options, { method: "DELETE", url: url })); - }; - return HttpClient; -}()); -exports.HttpClient = HttpClient; -/** Default implementation of {@link HttpClient}. */ -var DefaultHttpClient = /** @class */ (function (_super) { - tslib_1.__extends(DefaultHttpClient, _super); - /** Creates a new instance of the {@link DefaultHttpClient}, using the provided {@link ILogger} to log messages. */ - function DefaultHttpClient(logger) { - var _this = _super.call(this) || this; - _this.logger = logger; - return _this; - } - /** @inheritDoc */ - DefaultHttpClient.prototype.send = function (request) { - var _this = this; - return new Promise(function (resolve, reject) { - var xhr = new XMLHttpRequest(); - xhr.open(request.method, request.url, true); - xhr.withCredentials = true; - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - // Explicitly setting the Content-Type header for React Native on Android platform. - xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); - if (request.headers) { - Object.keys(request.headers) - .forEach(function (header) { return xhr.setRequestHeader(header, request.headers[header]); }); - } - if (request.responseType) { - xhr.responseType = request.responseType; - } - if (request.abortSignal) { - request.abortSignal.onabort = function () { - xhr.abort(); - }; - } - if (request.timeout) { - xhr.timeout = request.timeout; - } - xhr.onload = function () { - if (request.abortSignal) { - request.abortSignal.onabort = null; - } - if (xhr.status >= 200 && xhr.status < 300) { - resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText)); - } - else { - reject(new Errors.HttpError(xhr.statusText, xhr.status)); - } - }; - xhr.onerror = function () { - _this.logger.log(ILogger.LogLevel.Warning, "Error from HTTP request. " + xhr.status + ": " + xhr.statusText); - reject(new Errors.HttpError(xhr.statusText, xhr.status)); - }; - xhr.ontimeout = function () { - _this.logger.log(ILogger.LogLevel.Warning, "Timeout from HTTP request."); - reject(new Errors.TimeoutError()); - }; - xhr.send(request.content || ""); - }); - }; - return DefaultHttpClient; -}(HttpClient)); -exports.DefaultHttpClient = DefaultHttpClient; - -}); - -unwrapExports(HttpClient_1); -var HttpClient_2 = HttpClient_1.HttpResponse; -var HttpClient_3 = HttpClient_1.HttpClient; -var HttpClient_4 = HttpClient_1.DefaultHttpClient; - -var TextMessageFormat_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -// Not exported from index -var TextMessageFormat = /** @class */ (function () { - function TextMessageFormat() { - } - TextMessageFormat.write = function (output) { - return "" + output + TextMessageFormat.RecordSeparator; - }; - TextMessageFormat.parse = function (input) { - if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { - throw new Error("Message is incomplete."); - } - var messages = input.split(TextMessageFormat.RecordSeparator); - messages.pop(); - return messages; - }; - TextMessageFormat.RecordSeparatorCode = 0x1e; - TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); - return TextMessageFormat; -}()); -exports.TextMessageFormat = TextMessageFormat; - -}); - -unwrapExports(TextMessageFormat_1); -var TextMessageFormat_2 = TextMessageFormat_1.TextMessageFormat; - -var HandshakeProtocol_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - -var HandshakeProtocol = /** @class */ (function () { - function HandshakeProtocol() { - } - // Handshake request is always JSON - HandshakeProtocol.prototype.writeHandshakeRequest = function (handshakeRequest) { - return TextMessageFormat_1.TextMessageFormat.write(JSON.stringify(handshakeRequest)); - }; - HandshakeProtocol.prototype.parseHandshakeResponse = function (data) { - var responseMessage; - var messageData; - var remainingData; - if (data instanceof ArrayBuffer) { - // Format is binary but still need to read JSON text from handshake response - var binaryData = new Uint8Array(data); - var separatorIndex = binaryData.indexOf(TextMessageFormat_1.TextMessageFormat.RecordSeparatorCode); - if (separatorIndex === -1) { - throw new Error("Message is incomplete."); - } - // content before separator is handshake response - // optional content after is additional messages - var responseLength = separatorIndex + 1; - messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength)); - remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null; - } - else { - var textData = data; - var separatorIndex = textData.indexOf(TextMessageFormat_1.TextMessageFormat.RecordSeparator); - if (separatorIndex === -1) { - throw new Error("Message is incomplete."); - } - // content before separator is handshake response - // optional content after is additional messages - var responseLength = separatorIndex + 1; - messageData = textData.substring(0, responseLength); - remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null; - } - // At this point we should have just the single handshake message - var messages = TextMessageFormat_1.TextMessageFormat.parse(messageData); - responseMessage = JSON.parse(messages[0]); - // multiple messages could have arrived with handshake - // return additional data to be parsed as usual, or null if all parsed - return [remainingData, responseMessage]; - }; - return HandshakeProtocol; -}()); -exports.HandshakeProtocol = HandshakeProtocol; - -}); - -unwrapExports(HandshakeProtocol_1); -var HandshakeProtocol_2 = HandshakeProtocol_1.HandshakeProtocol; - -var IHubProtocol = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -/** Defines the type of a Hub Message. */ -var MessageType; -(function (MessageType) { - /** Indicates the message is an Invocation message and implements the {@link InvocationMessage} interface. */ - MessageType[MessageType["Invocation"] = 1] = "Invocation"; - /** Indicates the message is a StreamItem message and implements the {@link StreamItemMessage} interface. */ - MessageType[MessageType["StreamItem"] = 2] = "StreamItem"; - /** Indicates the message is a Completion message and implements the {@link CompletionMessage} interface. */ - MessageType[MessageType["Completion"] = 3] = "Completion"; - /** Indicates the message is a Stream Invocation message and implements the {@link StreamInvocationMessage} interface. */ - MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation"; - /** Indicates the message is a Cancel Invocation message and implements the {@link CancelInvocationMessage} interface. */ - MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation"; - /** Indicates the message is a Ping message and implements the {@link PingMessage} interface. */ - MessageType[MessageType["Ping"] = 6] = "Ping"; - /** Indicates the message is a Close message and implements the {@link CloseMessage} interface. */ - MessageType[MessageType["Close"] = 7] = "Close"; -})(MessageType = exports.MessageType || (exports.MessageType = {})); - -}); - -unwrapExports(IHubProtocol); -var IHubProtocol_1 = IHubProtocol.MessageType; - -var Loggers = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -/** A logger that does nothing when log messages are sent to it. */ -var NullLogger = /** @class */ (function () { - function NullLogger() { - } - /** @inheritDoc */ - NullLogger.prototype.log = function (logLevel, message) { - }; - /** The singleton instance of the {@link NullLogger}. */ - NullLogger.instance = new NullLogger(); - return NullLogger; -}()); -exports.NullLogger = NullLogger; - -}); - -unwrapExports(Loggers); -var Loggers_1 = Loggers.NullLogger; - -var Utils = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - -var Arg = /** @class */ (function () { - function Arg() { - } - Arg.isRequired = function (val, name) { - if (val === null || val === undefined) { - throw new Error("The '" + name + "' argument is required."); - } - }; - Arg.isIn = function (val, values, name) { - // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself. - if (!(val in values)) { - throw new Error("Unknown " + name + " value: " + val + "."); - } - }; - return Arg; -}()); -exports.Arg = Arg; -function getDataDetail(data, includeContent) { - var length = null; - if (data instanceof ArrayBuffer) { - length = "Binary data of length " + data.byteLength; - if (includeContent) { - length += ". Content: '" + formatArrayBuffer(data) + "'"; - } - } - else if (typeof data === "string") { - length = "String data of length " + data.length; - if (includeContent) { - length += ". Content: '" + data + "'."; - } - } - return length; -} -exports.getDataDetail = getDataDetail; -function formatArrayBuffer(data) { - var view = new Uint8Array(data); - // Uint8Array.map only supports returning another Uint8Array? - var str = ""; - view.forEach(function (num) { - var pad = num < 16 ? "0" : ""; - str += "0x" + pad + num.toString(16) + " "; - }); - // Trim of trailing space. - return str.substr(0, str.length - 1); -} -exports.formatArrayBuffer = formatArrayBuffer; -function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, logMessageContent) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var headers, token, response, _a; - return tslib_1.__generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, accessTokenFactory()]; - case 1: - token = _b.sent(); - if (token) { - headers = (_a = {}, _a["Authorization"] = "Bearer " + token, _a); - } - logger.log(ILogger.LogLevel.Trace, "(" + transportName + " transport) sending data. " + getDataDetail(content, logMessageContent) + "."); - return [4 /*yield*/, httpClient.post(url, { - content: content, - headers: headers, - })]; - case 2: - response = _b.sent(); - logger.log(ILogger.LogLevel.Trace, "(" + transportName + " transport) request complete. Response status: " + response.statusCode + "."); - return [2 /*return*/]; - } - }); - }); -} -exports.sendMessage = sendMessage; -function createLogger(logger) { - if (logger === undefined) { - return new ConsoleLogger(ILogger.LogLevel.Information); - } - if (logger === null) { - return Loggers.NullLogger.instance; - } - if (logger.log) { - return logger; - } - return new ConsoleLogger(logger); -} -exports.createLogger = createLogger; -var Subject = /** @class */ (function () { - function Subject(cancelCallback) { - this.observers = []; - this.cancelCallback = cancelCallback; - } - Subject.prototype.next = function (item) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - observer.next(item); - } - }; - Subject.prototype.error = function (err) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.error) { - observer.error(err); - } - } - }; - Subject.prototype.complete = function () { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.complete) { - observer.complete(); - } - } - }; - Subject.prototype.subscribe = function (observer) { - this.observers.push(observer); - return new SubjectSubscription(this, observer); - }; - return Subject; -}()); -exports.Subject = Subject; -var SubjectSubscription = /** @class */ (function () { - function SubjectSubscription(subject, observer) { - this.subject = subject; - this.observer = observer; - } - SubjectSubscription.prototype.dispose = function () { - var index = this.subject.observers.indexOf(this.observer); - if (index > -1) { - this.subject.observers.splice(index, 1); - } - if (this.subject.observers.length === 0) { - this.subject.cancelCallback().catch(function (_) { }); - } - }; - return SubjectSubscription; -}()); -exports.SubjectSubscription = SubjectSubscription; -var ConsoleLogger = /** @class */ (function () { - function ConsoleLogger(minimumLogLevel) { - this.minimumLogLevel = minimumLogLevel; - } - ConsoleLogger.prototype.log = function (logLevel, message) { - if (logLevel >= this.minimumLogLevel) { - switch (logLevel) { - case ILogger.LogLevel.Critical: - case ILogger.LogLevel.Error: - console.error(ILogger.LogLevel[logLevel] + ": " + message); - break; - case ILogger.LogLevel.Warning: - console.warn(ILogger.LogLevel[logLevel] + ": " + message); - break; - case ILogger.LogLevel.Information: - console.info(ILogger.LogLevel[logLevel] + ": " + message); - break; - default: - // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug - console.log(ILogger.LogLevel[logLevel] + ": " + message); - break; - } - } - }; - return ConsoleLogger; -}()); -exports.ConsoleLogger = ConsoleLogger; - -}); - -unwrapExports(Utils); -var Utils_1 = Utils.Arg; -var Utils_2 = Utils.getDataDetail; -var Utils_3 = Utils.formatArrayBuffer; -var Utils_4 = Utils.sendMessage; -var Utils_5 = Utils.createLogger; -var Utils_6 = Utils.Subject; -var Utils_7 = Utils.SubjectSubscription; -var Utils_8 = Utils.ConsoleLogger; - -var HubConnection_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - - -var DEFAULT_TIMEOUT_IN_MS = 30 * 1000; -/** Represents a connection to a SignalR Hub. */ -var HubConnection = /** @class */ (function () { - function HubConnection(connection, logger, protocol) { - var _this = this; - Utils.Arg.isRequired(connection, "connection"); - Utils.Arg.isRequired(logger, "logger"); - Utils.Arg.isRequired(protocol, "protocol"); - this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS; - this.logger = logger; - this.protocol = protocol; - this.connection = connection; - this.handshakeProtocol = new HandshakeProtocol_1.HandshakeProtocol(); - this.connection.onreceive = function (data) { return _this.processIncomingData(data); }; - this.connection.onclose = function (error) { return _this.connectionClosed(error); }; - this.callbacks = {}; - this.methods = {}; - this.closedCallbacks = []; - this.id = 0; - } - /** @internal */ - // Using a public static factory method means we can have a private constructor and an _internal_ - // create method that can be used by HubConnectionBuilder. An "internal" constructor would just - // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a - // public parameter-less constructor. - HubConnection.create = function (connection, logger, protocol) { - return new HubConnection(connection, logger, protocol); - }; - /** Starts the connection. - * - * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error. - */ - HubConnection.prototype.start = function () { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var handshakeRequest; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - handshakeRequest = { - protocol: this.protocol.name, - version: this.protocol.version, - }; - this.logger.log(ILogger.LogLevel.Debug, "Starting HubConnection."); - this.receivedHandshakeResponse = false; - return [4 /*yield*/, this.connection.start(this.protocol.transferFormat)]; - case 1: - _a.sent(); - this.logger.log(ILogger.LogLevel.Debug, "Sending handshake request."); - return [4 /*yield*/, this.connection.send(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))]; - case 2: - _a.sent(); - this.logger.log(ILogger.LogLevel.Information, "Using HubProtocol '" + this.protocol.name + "'."); - // defensively cleanup timeout in case we receive a message from the server before we finish start - this.cleanupTimeout(); - this.configureTimeout(); - return [2 /*return*/]; - } - }); - }); - }; - /** Stops the connection. - * - * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error. - */ - HubConnection.prototype.stop = function () { - this.logger.log(ILogger.LogLevel.Debug, "Stopping HubConnection."); - this.cleanupTimeout(); - return this.connection.stop(); - }; - /** Invokes a streaming hub method on the server using the specified name and arguments. - * - * @typeparam T The type of the items returned by the server. - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {IStreamResult} An object that yields results from the server as they are received. - */ - HubConnection.prototype.stream = function (methodName) { - var _this = this; - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var invocationDescriptor = this.createStreamInvocation(methodName, args); - var subject = new Utils.Subject(function () { - var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId); - var cancelMessage = _this.protocol.writeMessage(cancelInvocation); - delete _this.callbacks[invocationDescriptor.invocationId]; - return _this.connection.send(cancelMessage); - }); - this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { - if (error) { - subject.error(error); - return; - } - if (invocationEvent.type === IHubProtocol.MessageType.Completion) { - if (invocationEvent.error) { - subject.error(new Error(invocationEvent.error)); - } - else { - subject.complete(); - } - } - else { - subject.next((invocationEvent.item)); - } - }; - var message = this.protocol.writeMessage(invocationDescriptor); - this.connection.send(message) - .catch(function (e) { - subject.error(e); - delete _this.callbacks[invocationDescriptor.invocationId]; - }); - return subject; - }; - /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver. - * - * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still - * be processing the invocation. - * - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error. - */ - HubConnection.prototype.send = function (methodName) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var invocationDescriptor = this.createInvocation(methodName, args, true); - var message = this.protocol.writeMessage(invocationDescriptor); - return this.connection.send(message); - }; - /** Invokes a hub method on the server using the specified name and arguments. - * - * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise - * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of - * resolving the Promise. - * - * @typeparam T The expected return type. - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error. - */ - HubConnection.prototype.invoke = function (methodName) { - var _this = this; - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var invocationDescriptor = this.createInvocation(methodName, args, false); - var p = new Promise(function (resolve, reject) { - _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { - if (error) { - reject(error); - return; - } - if (invocationEvent.type === IHubProtocol.MessageType.Completion) { - var completionMessage = invocationEvent; - if (completionMessage.error) { - reject(new Error(completionMessage.error)); - } - else { - resolve(completionMessage.result); - } - } - else { - reject(new Error("Unexpected message type: " + invocationEvent.type)); - } - }; - var message = _this.protocol.writeMessage(invocationDescriptor); - _this.connection.send(message) - .catch(function (e) { - reject(e); - delete _this.callbacks[invocationDescriptor.invocationId]; - }); - }); - return p; - }; - /** Registers a handler that will be invoked when the hub method with the specified method name is invoked. - * - * @param {string} methodName The name of the hub method to define. - * @param {Function} newMethod The handler that will be raised when the hub method is invoked. - */ - HubConnection.prototype.on = function (methodName, newMethod) { - if (!methodName || !newMethod) { - return; - } - methodName = methodName.toLowerCase(); - if (!this.methods[methodName]) { - this.methods[methodName] = []; - } - // Preventing adding the same handler multiple times. - if (this.methods[methodName].indexOf(newMethod) !== -1) { - return; - } - this.methods[methodName].push(newMethod); - }; - HubConnection.prototype.off = function (methodName, method) { - if (!methodName) { - return; - } - methodName = methodName.toLowerCase(); - var handlers = this.methods[methodName]; - if (!handlers) { - return; - } - if (method) { - var removeIdx = handlers.indexOf(method); - if (removeIdx !== -1) { - handlers.splice(removeIdx, 1); - if (handlers.length === 0) { - delete this.methods[methodName]; - } - } - } - else { - delete this.methods[methodName]; - } - }; - /** Registers a handler that will be invoked when the connection is closed. - * - * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any). - */ - HubConnection.prototype.onclose = function (callback) { - if (callback) { - this.closedCallbacks.push(callback); - } - }; - HubConnection.prototype.processIncomingData = function (data) { - this.cleanupTimeout(); - if (!this.receivedHandshakeResponse) { - data = this.processHandshakeResponse(data); - this.receivedHandshakeResponse = true; - } - // Data may have all been read when processing handshake response - if (data) { - // Parse the messages - var messages = this.protocol.parseMessages(data, this.logger); - for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { - var message = messages_1[_i]; - switch (message.type) { - case IHubProtocol.MessageType.Invocation: - this.invokeClientMethod(message); - break; - case IHubProtocol.MessageType.StreamItem: - case IHubProtocol.MessageType.Completion: - var callback = this.callbacks[message.invocationId]; - if (callback != null) { - if (message.type === IHubProtocol.MessageType.Completion) { - delete this.callbacks[message.invocationId]; - } - callback(message); - } - break; - case IHubProtocol.MessageType.Ping: - // Don't care about pings - break; - case IHubProtocol.MessageType.Close: - this.logger.log(ILogger.LogLevel.Information, "Close message received from server."); - this.connection.stop(message.error ? new Error("Server returned an error on close: " + message.error) : null); - break; - default: - this.logger.log(ILogger.LogLevel.Warning, "Invalid message type: " + message.type); - break; - } - } - } - this.configureTimeout(); - }; - HubConnection.prototype.processHandshakeResponse = function (data) { - var responseMessage; - var remainingData; - try { - _a = this.handshakeProtocol.parseHandshakeResponse(data), remainingData = _a[0], responseMessage = _a[1]; - } - catch (e) { - var message = "Error parsing handshake response: " + e; - this.logger.log(ILogger.LogLevel.Error, message); - var error = new Error(message); - this.connection.stop(error); - throw error; - } - if (responseMessage.error) { - var message = "Server returned handshake error: " + responseMessage.error; - this.logger.log(ILogger.LogLevel.Error, message); - this.connection.stop(new Error(message)); - } - else { - this.logger.log(ILogger.LogLevel.Debug, "Server handshake complete."); - } - return remainingData; - var _a; - }; - HubConnection.prototype.configureTimeout = function () { - var _this = this; - if (!this.connection.features || !this.connection.features.inherentKeepAlive) { - // Set the timeout timer - this.timeoutHandle = setTimeout(function () { return _this.serverTimeout(); }, this.serverTimeoutInMilliseconds); - } - }; - HubConnection.prototype.serverTimeout = function () { - // The server hasn't talked to us in a while. It doesn't like us anymore ... :( - // Terminate the connection - this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server.")); - }; - HubConnection.prototype.invokeClientMethod = function (invocationMessage) { - var _this = this; - var methods = this.methods[invocationMessage.target.toLowerCase()]; - if (methods) { - methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); }); - if (invocationMessage.invocationId) { - // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response. - var message = "Server requested a response, which is not supported in this version of the client."; - this.logger.log(ILogger.LogLevel.Error, message); - this.connection.stop(new Error(message)); - } - } - else { - this.logger.log(ILogger.LogLevel.Warning, "No client method with the name '" + invocationMessage.target + "' found."); - } - }; - HubConnection.prototype.connectionClosed = function (error) { - var _this = this; - var callbacks = this.callbacks; - this.callbacks = {}; - Object.keys(callbacks) - .forEach(function (key) { - var callback = callbacks[key]; - callback(undefined, error ? error : new Error("Invocation canceled due to connection being closed.")); - }); - this.cleanupTimeout(); - this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); - }; - HubConnection.prototype.cleanupTimeout = function () { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - } - }; - HubConnection.prototype.createInvocation = function (methodName, args, nonblocking) { - if (nonblocking) { - return { - arguments: args, - target: methodName, - type: IHubProtocol.MessageType.Invocation, - }; - } - else { - var id = this.id; - this.id++; - return { - arguments: args, - invocationId: id.toString(), - target: methodName, - type: IHubProtocol.MessageType.Invocation, - }; - } - }; - HubConnection.prototype.createStreamInvocation = function (methodName, args) { - var id = this.id; - this.id++; - return { - arguments: args, - invocationId: id.toString(), - target: methodName, - type: IHubProtocol.MessageType.StreamInvocation, - }; - }; - HubConnection.prototype.createCancelInvocation = function (id) { - return { - invocationId: id, - type: IHubProtocol.MessageType.CancelInvocation, - }; - }; - return HubConnection; -}()); -exports.HubConnection = HubConnection; - -}); - -unwrapExports(HubConnection_1); -var HubConnection_2 = HubConnection_1.HubConnection; - -var ITransport = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -// This will be treated as a bit flag in the future, so we keep it using power-of-two values. -/** Specifies a specific HTTP transport type. */ -var HttpTransportType; -(function (HttpTransportType) { - /** Specifies no transport preference. */ - HttpTransportType[HttpTransportType["None"] = 0] = "None"; - /** Specifies the WebSockets transport. */ - HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets"; - /** Specifies the Server-Sent Events transport. */ - HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents"; - /** Specifies the Long Polling transport. */ - HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling"; -})(HttpTransportType = exports.HttpTransportType || (exports.HttpTransportType = {})); -/** Specifies the transfer format for a connection. */ -var TransferFormat; -(function (TransferFormat) { - /** Specifies that only text data will be transmitted over the connection. */ - TransferFormat[TransferFormat["Text"] = 1] = "Text"; - /** Specifies that binary data will be transmitted over the connection. */ - TransferFormat[TransferFormat["Binary"] = 2] = "Binary"; -})(TransferFormat = exports.TransferFormat || (exports.TransferFormat = {})); - -}); - -unwrapExports(ITransport); -var ITransport_1 = ITransport.HttpTransportType; -var ITransport_2 = ITransport.TransferFormat; - -var AbortController_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController -// We don't actually ever use the API being polyfilled, we always use the polyfill because -// it's a very new API right now. -// Not exported from index. -var AbortController = /** @class */ (function () { - function AbortController() { - this.isAborted = false; - } - AbortController.prototype.abort = function () { - if (!this.isAborted) { - this.isAborted = true; - if (this.onabort) { - this.onabort(); - } - } - }; - Object.defineProperty(AbortController.prototype, "signal", { - get: function () { - return this; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbortController.prototype, "aborted", { - get: function () { - return this.isAborted; - }, - enumerable: true, - configurable: true - }); - return AbortController; -}()); -exports.AbortController = AbortController; - -}); - -unwrapExports(AbortController_1); -var AbortController_2 = AbortController_1.AbortController; - -var LongPollingTransport_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - - - -var SHUTDOWN_TIMEOUT = 5 * 1000; -// Not exported from 'index', this type is internal. -var LongPollingTransport = /** @class */ (function () { - function LongPollingTransport(httpClient, accessTokenFactory, logger, logMessageContent, shutdownTimeout) { - this.httpClient = httpClient; - this.accessTokenFactory = accessTokenFactory || (function () { return null; }); - this.logger = logger; - this.pollAbort = new AbortController_1.AbortController(); - this.logMessageContent = logMessageContent; - this.shutdownTimeout = shutdownTimeout || SHUTDOWN_TIMEOUT; - } - Object.defineProperty(LongPollingTransport.prototype, "pollAborted", { - // This is an internal type, not exported from 'index' so this is really just internal. - get: function () { - return this.pollAbort.aborted; - }, - enumerable: true, - configurable: true - }); - LongPollingTransport.prototype.connect = function (url, transferFormat) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var pollOptions, token, closeError, pollUrl, response; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - Utils.Arg.isRequired(url, "url"); - Utils.Arg.isRequired(transferFormat, "transferFormat"); - Utils.Arg.isIn(transferFormat, ITransport.TransferFormat, "transferFormat"); - this.url = url; - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Connecting"); - if (transferFormat === ITransport.TransferFormat.Binary && (typeof new XMLHttpRequest().responseType !== "string")) { - // This will work if we fix: https://github.com/aspnet/SignalR/issues/742 - throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported."); - } - pollOptions = { - abortSignal: this.pollAbort.signal, - headers: {}, - timeout: 90000, - }; - if (transferFormat === ITransport.TransferFormat.Binary) { - pollOptions.responseType = "arraybuffer"; - } - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - this.updateHeaderToken(pollOptions, token); - pollUrl = url + "&_=" + Date.now(); - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) polling: " + pollUrl); - return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)]; - case 2: - response = _a.sent(); - if (response.statusCode !== 200) { - this.logger.log(ILogger.LogLevel.Error, "(LongPolling transport) Unexpected response code: " + response.statusCode); - // Mark running as false so that the poll immediately ends and runs the close logic - closeError = new Errors.HttpError(response.statusText, response.statusCode); - this.running = false; - } - else { - this.running = true; - } - this.poll(this.url, pollOptions, closeError); - return [2 /*return*/, Promise.resolve()]; - } - }); - }); - }; - LongPollingTransport.prototype.updateHeaderToken = function (request, token) { - if (token) { - // tslint:disable-next-line:no-string-literal - request.headers["Authorization"] = "Bearer " + token; - return; - } - // tslint:disable-next-line:no-string-literal - if (request.headers["Authorization"]) { - // tslint:disable-next-line:no-string-literal - delete request.headers["Authorization"]; - } - }; - LongPollingTransport.prototype.poll = function (url, pollOptions, closeError) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var token, pollUrl, response, e_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, , 8, 9]); - _a.label = 1; - case 1: - if (!this.running) return [3 /*break*/, 7]; - return [4 /*yield*/, this.accessTokenFactory()]; - case 2: - token = _a.sent(); - this.updateHeaderToken(pollOptions, token); - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); - pollUrl = url + "&_=" + Date.now(); - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) polling: " + pollUrl); - return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)]; - case 4: - response = _a.sent(); - if (response.statusCode === 204) { - this.logger.log(ILogger.LogLevel.Information, "(LongPolling transport) Poll terminated by server"); - this.running = false; - } - else if (response.statusCode !== 200) { - this.logger.log(ILogger.LogLevel.Error, "(LongPolling transport) Unexpected response code: " + response.statusCode); - // Unexpected status code - closeError = new Errors.HttpError(response.statusText, response.statusCode); - this.running = false; - } - else { - // Process the response - if (response.content) { - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) data received. " + Utils.getDataDetail(response.content, this.logMessageContent)); - if (this.onreceive) { - this.onreceive(response.content); - } - } - else { - // This is another way timeout manifest. - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Poll timed out, reissuing."); - } - } - return [3 /*break*/, 6]; - case 5: - e_1 = _a.sent(); - if (!this.running) { - // Log but disregard errors that occur after we were stopped by DELETE - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Poll errored after shutdown: " + e_1.message); - } - else { - if (e_1 instanceof Errors.TimeoutError) { - // Ignore timeouts and reissue the poll. - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Poll timed out, reissuing."); - } - else { - // Close the connection with the error as the result. - closeError = e_1; - this.running = false; - } - } - return [3 /*break*/, 6]; - case 6: return [3 /*break*/, 1]; - case 7: return [3 /*break*/, 9]; - case 8: - // Indicate that we've stopped so the shutdown timer doesn't get registered. - this.stopped = true; - // Clean up the shutdown timer if it was registered - if (this.shutdownTimer) { - clearTimeout(this.shutdownTimer); - } - // Fire our onclosed event - if (this.onclose) { - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Firing onclose event. Error: " + (closeError || "")); - this.onclose(closeError); - } - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) Transport finished."); - return [7 /*endfinally*/]; - case 9: return [2 /*return*/]; - } - }); - }); - }; - LongPollingTransport.prototype.send = function (data) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - if (!this.running) { - return [2 /*return*/, Promise.reject(new Error("Cannot send until the transport is connected"))]; - } - return [2 /*return*/, Utils.sendMessage(this.logger, "LongPolling", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)]; - }); - }); - }; - LongPollingTransport.prototype.stop = function () { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var _this = this; - var deleteOptions, token, response; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, , 3, 4]); - this.running = false; - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) sending DELETE request to " + this.url + "."); - deleteOptions = { - headers: {}, - }; - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - this.updateHeaderToken(deleteOptions, token); - return [4 /*yield*/, this.httpClient.delete(this.url, deleteOptions)]; - case 2: - response = _a.sent(); - this.logger.log(ILogger.LogLevel.Trace, "(LongPolling transport) DELETE request accepted."); - return [3 /*break*/, 4]; - case 3: - // Abort the poll after the shutdown timeout if the server doesn't stop the poll. - if (!this.stopped) { - this.shutdownTimer = setTimeout(function () { - _this.logger.log(ILogger.LogLevel.Warning, "(LongPolling transport) server did not terminate after DELETE request, canceling poll."); - // Abort any outstanding poll - _this.pollAbort.abort(); - }, this.shutdownTimeout); - } - return [7 /*endfinally*/]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - return LongPollingTransport; -}()); -exports.LongPollingTransport = LongPollingTransport; - -}); - -unwrapExports(LongPollingTransport_1); -var LongPollingTransport_2 = LongPollingTransport_1.LongPollingTransport; - -var ServerSentEventsTransport_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - -var ServerSentEventsTransport = /** @class */ (function () { - function ServerSentEventsTransport(httpClient, accessTokenFactory, logger, logMessageContent) { - this.httpClient = httpClient; - this.accessTokenFactory = accessTokenFactory || (function () { return null; }); - this.logger = logger; - this.logMessageContent = logMessageContent; - } - ServerSentEventsTransport.prototype.connect = function (url, transferFormat) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var _this = this; - var token; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - Utils.Arg.isRequired(url, "url"); - Utils.Arg.isRequired(transferFormat, "transferFormat"); - Utils.Arg.isIn(transferFormat, ITransport.TransferFormat, "transferFormat"); - if (typeof (EventSource) === "undefined") { - throw new Error("'EventSource' is not supported in your environment."); - } - this.logger.log(ILogger.LogLevel.Trace, "(SSE transport) Connecting"); - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - if (token) { - url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)); - } - this.url = url; - return [2 /*return*/, new Promise(function (resolve, reject) { - var opened = false; - if (transferFormat !== ITransport.TransferFormat.Text) { - reject(new Error("The Server-Sent Events transport only supports the 'Text' transfer format")); - } - var eventSource = new EventSource(url, { withCredentials: true }); - try { - eventSource.onmessage = function (e) { - if (_this.onreceive) { - try { - _this.logger.log(ILogger.LogLevel.Trace, "(SSE transport) data received. " + Utils.getDataDetail(e.data, _this.logMessageContent) + "."); - _this.onreceive(e.data); - } - catch (error) { - if (_this.onclose) { - _this.onclose(error); - } - return; - } - } - }; - eventSource.onerror = function (e) { - var error = new Error(e.message || "Error occurred"); - if (opened) { - _this.close(error); - } - else { - reject(error); - } - }; - eventSource.onopen = function () { - _this.logger.log(ILogger.LogLevel.Information, "SSE connected to " + _this.url); - _this.eventSource = eventSource; - opened = true; - resolve(); - }; - } - catch (e) { - return Promise.reject(e); - } - })]; - } - }); - }); - }; - ServerSentEventsTransport.prototype.send = function (data) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - if (!this.eventSource) { - return [2 /*return*/, Promise.reject(new Error("Cannot send until the transport is connected"))]; - } - return [2 /*return*/, Utils.sendMessage(this.logger, "SSE", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)]; - }); - }); - }; - ServerSentEventsTransport.prototype.stop = function () { - this.close(); - return Promise.resolve(); - }; - ServerSentEventsTransport.prototype.close = function (e) { - if (this.eventSource) { - this.eventSource.close(); - this.eventSource = null; - if (this.onclose) { - this.onclose(e); - } - } - }; - return ServerSentEventsTransport; -}()); -exports.ServerSentEventsTransport = ServerSentEventsTransport; - -}); - -unwrapExports(ServerSentEventsTransport_1); -var ServerSentEventsTransport_2 = ServerSentEventsTransport_1.ServerSentEventsTransport; - -var WebSocketTransport_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - -var WebSocketTransport = /** @class */ (function () { - function WebSocketTransport(accessTokenFactory, logger, logMessageContent) { - this.logger = logger; - this.accessTokenFactory = accessTokenFactory || (function () { return null; }); - this.logMessageContent = logMessageContent; - } - WebSocketTransport.prototype.connect = function (url, transferFormat) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var _this = this; - var token; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - Utils.Arg.isRequired(url, "url"); - Utils.Arg.isRequired(transferFormat, "transferFormat"); - Utils.Arg.isIn(transferFormat, ITransport.TransferFormat, "transferFormat"); - if (typeof (WebSocket) === "undefined") { - throw new Error("'WebSocket' is not supported in your environment."); - } - this.logger.log(ILogger.LogLevel.Trace, "(WebSockets transport) Connecting"); - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - if (token) { - url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)); - } - return [2 /*return*/, new Promise(function (resolve, reject) { - url = url.replace(/^http/, "ws"); - var webSocket = new WebSocket(url); - if (transferFormat === ITransport.TransferFormat.Binary) { - webSocket.binaryType = "arraybuffer"; - } - webSocket.onopen = function (event) { - _this.logger.log(ILogger.LogLevel.Information, "WebSocket connected to " + url); - _this.webSocket = webSocket; - resolve(); - }; - webSocket.onerror = function (event) { - reject(event.error); - }; - webSocket.onmessage = function (message) { - _this.logger.log(ILogger.LogLevel.Trace, "(WebSockets transport) data received. " + Utils.getDataDetail(message.data, _this.logMessageContent) + "."); - if (_this.onreceive) { - _this.onreceive(message.data); - } - }; - webSocket.onclose = function (event) { - // webSocket will be null if the transport did not start successfully - _this.logger.log(ILogger.LogLevel.Trace, "(WebSockets transport) socket closed."); - if (_this.onclose) { - if (event.wasClean === false || event.code !== 1000) { - _this.onclose(new Error("Websocket closed with status code: " + event.code + " (" + event.reason + ")")); - } - else { - _this.onclose(); - } - } - }; - })]; - } - }); - }); - }; - WebSocketTransport.prototype.send = function (data) { - if (this.webSocket && this.webSocket.readyState === WebSocket.OPEN) { - this.logger.log(ILogger.LogLevel.Trace, "(WebSockets transport) sending data. " + Utils.getDataDetail(data, this.logMessageContent) + "."); - this.webSocket.send(data); - return Promise.resolve(); - } - return Promise.reject("WebSocket is not in the OPEN state"); - }; - WebSocketTransport.prototype.stop = function () { - if (this.webSocket) { - this.webSocket.close(); - this.webSocket = null; - } - return Promise.resolve(); - }; - return WebSocketTransport; -}()); -exports.WebSocketTransport = WebSocketTransport; - -}); - -unwrapExports(WebSocketTransport_1); -var WebSocketTransport_2 = WebSocketTransport_1.WebSocketTransport; - -var HttpConnection_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - - - - - -var MAX_REDIRECTS = 100; -var HttpConnection = /** @class */ (function () { - function HttpConnection(url, options) { - if (options === void 0) { options = {}; } - this.features = {}; - Utils.Arg.isRequired(url, "url"); - this.logger = Utils.createLogger(options.logger); - this.baseUrl = this.resolveUrl(url); - options = options || {}; - options.accessTokenFactory = options.accessTokenFactory || (function () { return null; }); - options.logMessageContent = options.logMessageContent || false; - this.httpClient = options.httpClient || new HttpClient_1.DefaultHttpClient(this.logger); - this.connectionState = 2 /* Disconnected */; - this.options = options; - } - HttpConnection.prototype.start = function (transferFormat) { - transferFormat = transferFormat || ITransport.TransferFormat.Binary; - Utils.Arg.isIn(transferFormat, ITransport.TransferFormat, "transferFormat"); - this.logger.log(ILogger.LogLevel.Debug, "Starting connection with transfer format '" + ITransport.TransferFormat[transferFormat] + "'."); - if (this.connectionState !== 2 /* Disconnected */) { - return Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")); - } - this.connectionState = 0 /* Connecting */; - this.startPromise = this.startInternal(transferFormat); - return this.startPromise; - }; - HttpConnection.prototype.send = function (data) { - if (this.connectionState !== 1 /* Connected */) { - throw new Error("Cannot send data if the connection is not in the 'Connected' State."); - } - return this.transport.send(data); - }; - HttpConnection.prototype.stop = function (error) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var e_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - this.connectionState = 2 /* Disconnected */; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.startPromise]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - e_1 = _a.sent(); - return [3 /*break*/, 4]; - case 4: - if (!this.transport) return [3 /*break*/, 6]; - this.stopError = error; - return [4 /*yield*/, this.transport.stop()]; - case 5: - _a.sent(); - this.transport = null; - _a.label = 6; - case 6: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.startInternal = function (transferFormat) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var _this = this; - var url, negotiateResponse, redirects, _loop_1, this_1, state_1, e_2; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - url = this.baseUrl; - this.accessTokenFactory = this.options.accessTokenFactory; - _a.label = 1; - case 1: - _a.trys.push([1, 12, , 13]); - if (!this.options.skipNegotiation) return [3 /*break*/, 5]; - if (!(this.options.transport === ITransport.HttpTransportType.WebSockets)) return [3 /*break*/, 3]; - // No need to add a connection ID in this case - this.transport = this.constructTransport(ITransport.HttpTransportType.WebSockets); - // We should just call connect directly in this case. - // No fallback or negotiate in this case. - return [4 /*yield*/, this.transport.connect(url, transferFormat)]; - case 2: - // We should just call connect directly in this case. - // No fallback or negotiate in this case. - _a.sent(); - return [3 /*break*/, 4]; - case 3: throw Error("Negotiation can only be skipped when using the WebSocket transport directly."); - case 4: return [3 /*break*/, 11]; - case 5: - negotiateResponse = null; - redirects = 0; - _loop_1 = function () { - var accessToken_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this_1.getNegotiationResponse(url)]; - case 1: - negotiateResponse = _a.sent(); - // the user tries to stop the connection when it is being started - if (this_1.connectionState === 2 /* Disconnected */) { - return [2 /*return*/, { value: void 0 }]; - } - if (negotiateResponse.url) { - url = negotiateResponse.url; - } - if (negotiateResponse.accessToken) { - accessToken_1 = negotiateResponse.accessToken; - this_1.accessTokenFactory = function () { return accessToken_1; }; - } - redirects++; - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _a.label = 6; - case 6: return [5 /*yield**/, _loop_1()]; - case 7: - state_1 = _a.sent(); - if (typeof state_1 === "object") - return [2 /*return*/, state_1.value]; - _a.label = 8; - case 8: - if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3 /*break*/, 6]; - _a.label = 9; - case 9: - if (redirects === MAX_REDIRECTS && negotiateResponse.url) { - throw Error("Negotiate redirection limit exceeded."); - } - return [4 /*yield*/, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)]; - case 10: - _a.sent(); - _a.label = 11; - case 11: - if (this.transport instanceof LongPollingTransport_1.LongPollingTransport) { - this.features.inherentKeepAlive = true; - } - this.transport.onreceive = this.onreceive; - this.transport.onclose = function (e) { return _this.stopConnection(e); }; - // only change the state if we were connecting to not overwrite - // the state if the connection is already marked as Disconnected - this.changeState(0 /* Connecting */, 1 /* Connected */); - return [3 /*break*/, 13]; - case 12: - e_2 = _a.sent(); - this.logger.log(ILogger.LogLevel.Error, "Failed to start the connection: " + e_2); - this.connectionState = 2 /* Disconnected */; - this.transport = null; - throw e_2; - case 13: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.getNegotiationResponse = function (url) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var token, headers, negotiateUrl, response, e_3, _a; - return tslib_1.__generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _b.sent(); - if (token) { - headers = (_a = {}, _a["Authorization"] = "Bearer " + token, _a); - } - negotiateUrl = this.resolveNegotiateUrl(url); - this.logger.log(ILogger.LogLevel.Debug, "Sending negotiation request: " + negotiateUrl); - _b.label = 2; - case 2: - _b.trys.push([2, 4, , 5]); - return [4 /*yield*/, this.httpClient.post(negotiateUrl, { - content: "", - headers: headers, - })]; - case 3: - response = _b.sent(); - if (response.statusCode !== 200) { - throw Error("Unexpected status code returned from negotiate " + response.statusCode); - } - return [2 /*return*/, JSON.parse(response.content)]; - case 4: - e_3 = _b.sent(); - this.logger.log(ILogger.LogLevel.Error, "Failed to complete negotiation with the server: " + e_3); - throw e_3; - case 5: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.createConnectUrl = function (url, connectionId) { - return url + (url.indexOf("?") === -1 ? "?" : "&") + ("id=" + connectionId); - }; - HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var connectUrl, transports, _i, transports_1, endpoint, transport, ex_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId); - if (!this.isITransport(requestedTransport)) return [3 /*break*/, 2]; - this.logger.log(ILogger.LogLevel.Debug, "Connection was provided an instance of ITransport, using that directly."); - this.transport = requestedTransport; - return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; - case 1: - _a.sent(); - // only change the state if we were connecting to not overwrite - // the state if the connection is already marked as Disconnected - this.changeState(0 /* Connecting */, 1 /* Connected */); - return [2 /*return*/]; - case 2: - transports = negotiateResponse.availableTransports; - _i = 0, transports_1 = transports; - _a.label = 3; - case 3: - if (!(_i < transports_1.length)) return [3 /*break*/, 9]; - endpoint = transports_1[_i]; - this.connectionState = 0 /* Connecting */; - transport = this.resolveTransport(endpoint, requestedTransport, requestedTransferFormat); - if (!(typeof transport === "number")) return [3 /*break*/, 8]; - this.transport = this.constructTransport(transport); - if (!(negotiateResponse.connectionId === null)) return [3 /*break*/, 5]; - return [4 /*yield*/, this.getNegotiationResponse(url)]; - case 4: - negotiateResponse = _a.sent(); - connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId); - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; - case 6: - _a.sent(); - this.changeState(0 /* Connecting */, 1 /* Connected */); - return [2 /*return*/]; - case 7: - ex_1 = _a.sent(); - this.logger.log(ILogger.LogLevel.Error, "Failed to start the transport '" + ITransport.HttpTransportType[transport] + "': " + ex_1); - this.connectionState = 2 /* Disconnected */; - negotiateResponse.connectionId = null; - return [3 /*break*/, 8]; - case 8: - _i++; - return [3 /*break*/, 3]; - case 9: throw new Error("Unable to initialize any of the available transports."); - } - }); - }); - }; - HttpConnection.prototype.constructTransport = function (transport) { - switch (transport) { - case ITransport.HttpTransportType.WebSockets: - return new WebSocketTransport_1.WebSocketTransport(this.accessTokenFactory, this.logger, this.options.logMessageContent); - case ITransport.HttpTransportType.ServerSentEvents: - return new ServerSentEventsTransport_1.ServerSentEventsTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent); - case ITransport.HttpTransportType.LongPolling: - return new LongPollingTransport_1.LongPollingTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent); - default: - throw new Error("Unknown transport: " + transport + "."); - } - }; - HttpConnection.prototype.resolveTransport = function (endpoint, requestedTransport, requestedTransferFormat) { - var transport = ITransport.HttpTransportType[endpoint.transport]; - if (transport === null || transport === undefined) { - this.logger.log(ILogger.LogLevel.Debug, "Skipping transport '" + endpoint.transport + "' because it is not supported by this client."); - } - else { - var transferFormats = endpoint.transferFormats.map(function (s) { return ITransport.TransferFormat[s]; }); - if (transportMatches(requestedTransport, transport)) { - if (transferFormats.indexOf(requestedTransferFormat) >= 0) { - if ((transport === ITransport.HttpTransportType.WebSockets && typeof WebSocket === "undefined") || - (transport === ITransport.HttpTransportType.ServerSentEvents && typeof EventSource === "undefined")) { - this.logger.log(ILogger.LogLevel.Debug, "Skipping transport '" + ITransport.HttpTransportType[transport] + "' because it is not supported in your environment.'"); - } - else { - this.logger.log(ILogger.LogLevel.Debug, "Selecting transport '" + ITransport.HttpTransportType[transport] + "'"); - return transport; - } - } - else { - this.logger.log(ILogger.LogLevel.Debug, "Skipping transport '" + ITransport.HttpTransportType[transport] + "' because it does not support the requested transfer format '" + ITransport.TransferFormat[requestedTransferFormat] + "'."); - } - } - else { - this.logger.log(ILogger.LogLevel.Debug, "Skipping transport '" + ITransport.HttpTransportType[transport] + "' because it was disabled by the client."); - } - } - return null; - }; - HttpConnection.prototype.isITransport = function (transport) { - return transport && typeof (transport) === "object" && "connect" in transport; - }; - HttpConnection.prototype.changeState = function (from, to) { - if (this.connectionState === from) { - this.connectionState = to; - return true; - } - return false; - }; - HttpConnection.prototype.stopConnection = function (error) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - this.transport = null; - // If we have a stopError, it takes precedence over the error from the transport - error = this.stopError || error; - if (error) { - this.logger.log(ILogger.LogLevel.Error, "Connection disconnected with error '" + error + "'."); - } - else { - this.logger.log(ILogger.LogLevel.Information, "Connection disconnected."); - } - this.connectionState = 2 /* Disconnected */; - if (this.onclose) { - this.onclose(error); - } - return [2 /*return*/]; - }); - }); - }; - HttpConnection.prototype.resolveUrl = function (url) { - // startsWith is not supported in IE - if (url.lastIndexOf("https://", 0) === 0 || url.lastIndexOf("http://", 0) === 0) { - return url; - } - if (typeof window === "undefined" || !window || !window.document) { - throw new Error("Cannot resolve '" + url + "'."); - } - // Setting the url to the href propery of an anchor tag handles normalization - // for us. There are 3 main cases. - // 1. Relative path normalization e.g "b" -> "http://localhost:5000/a/b" - // 2. Absolute path normalization e.g "/a/b" -> "http://localhost:5000/a/b" - // 3. Networkpath reference normalization e.g "//localhost:5000/a/b" -> "http://localhost:5000/a/b" - var aTag = window.document.createElement("a"); - aTag.href = url; - this.logger.log(ILogger.LogLevel.Information, "Normalizing '" + url + "' to '" + aTag.href + "'."); - return aTag.href; - }; - HttpConnection.prototype.resolveNegotiateUrl = function (url) { - var index = url.indexOf("?"); - var negotiateUrl = url.substring(0, index === -1 ? url.length : index); - if (negotiateUrl[negotiateUrl.length - 1] !== "/") { - negotiateUrl += "/"; - } - negotiateUrl += "negotiate"; - negotiateUrl += index === -1 ? "" : url.substring(index); - return negotiateUrl; - }; - return HttpConnection; -}()); -exports.HttpConnection = HttpConnection; -function transportMatches(requestedTransport, actualTransport) { - return !requestedTransport || ((actualTransport & requestedTransport) !== 0); -} - -}); - -unwrapExports(HttpConnection_1); -var HttpConnection_2 = HttpConnection_1.HttpConnection; - -var JsonHubProtocol_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - - -var JSON_HUB_PROTOCOL_NAME = "json"; -/** Implements the JSON Hub Protocol. */ -var JsonHubProtocol = /** @class */ (function () { - function JsonHubProtocol() { - /** @inheritDoc */ - this.name = JSON_HUB_PROTOCOL_NAME; - /** @inheritDoc */ - this.version = 1; - /** @inheritDoc */ - this.transferFormat = ITransport.TransferFormat.Text; - } - /** Creates an array of {@link HubMessage} objects from the specified serialized representation. - * - * @param {string} input A string containing the serialized representation. - * @param {ILogger} logger A logger that will be used to log messages that occur during parsing. - */ - JsonHubProtocol.prototype.parseMessages = function (input, logger) { - // The interface does allow "ArrayBuffer" to be passed in, but this implementation does not. So let's throw a useful error. - if (typeof input !== "string") { - throw new Error("Invalid input for JSON hub protocol. Expected a string."); - } - if (!input) { - return []; - } - if (logger === null) { - logger = Loggers.NullLogger.instance; - } - // Parse the messages - var messages = TextMessageFormat_1.TextMessageFormat.parse(input); - var hubMessages = []; - for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { - var message = messages_1[_i]; - var parsedMessage = JSON.parse(message); - if (typeof parsedMessage.type !== "number") { - throw new Error("Invalid payload."); - } - switch (parsedMessage.type) { - case IHubProtocol.MessageType.Invocation: - this.isInvocationMessage(parsedMessage); - break; - case IHubProtocol.MessageType.StreamItem: - this.isStreamItemMessage(parsedMessage); - break; - case IHubProtocol.MessageType.Completion: - this.isCompletionMessage(parsedMessage); - break; - case IHubProtocol.MessageType.Ping: - // Single value, no need to validate - break; - case IHubProtocol.MessageType.Close: - // All optional values, no need to validate - break; - default: - // Future protocol changes can add message types, old clients can ignore them - logger.log(ILogger.LogLevel.Information, "Unknown message type '" + parsedMessage.type + "' ignored."); - continue; - } - hubMessages.push(parsedMessage); - } - return hubMessages; - }; - /** Writes the specified {@link HubMessage} to a string and returns it. - * - * @param {HubMessage} message The message to write. - * @returns {string} A string containing the serialized representation of the message. - */ - JsonHubProtocol.prototype.writeMessage = function (message) { - return TextMessageFormat_1.TextMessageFormat.write(JSON.stringify(message)); - }; - JsonHubProtocol.prototype.isInvocationMessage = function (message) { - this.assertNotEmptyString(message.target, "Invalid payload for Invocation message."); - if (message.invocationId !== undefined) { - this.assertNotEmptyString(message.invocationId, "Invalid payload for Invocation message."); - } - }; - JsonHubProtocol.prototype.isStreamItemMessage = function (message) { - this.assertNotEmptyString(message.invocationId, "Invalid payload for StreamItem message."); - if (message.item === undefined) { - throw new Error("Invalid payload for StreamItem message."); - } - }; - JsonHubProtocol.prototype.isCompletionMessage = function (message) { - if (message.result && message.error) { - throw new Error("Invalid payload for Completion message."); - } - if (!message.result && message.error) { - this.assertNotEmptyString(message.error, "Invalid payload for Completion message."); - } - this.assertNotEmptyString(message.invocationId, "Invalid payload for Completion message."); - }; - JsonHubProtocol.prototype.assertNotEmptyString = function (value, errorMessage) { - if (typeof value !== "string" || value === "") { - throw new Error(errorMessage); - } - }; - return JsonHubProtocol; -}()); -exports.JsonHubProtocol = JsonHubProtocol; - -}); - -unwrapExports(JsonHubProtocol_1); -var JsonHubProtocol_2 = JsonHubProtocol_1.JsonHubProtocol; - -var HubConnectionBuilder_1 = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - - - - - -/** A builder for configuring {@link HubConnection} instances. */ -var HubConnectionBuilder = /** @class */ (function () { - function HubConnectionBuilder() { - } - HubConnectionBuilder.prototype.configureLogging = function (logging) { - Utils.Arg.isRequired(logging, "logging"); - if (isLogger(logging)) { - this.logger = logging; - } - else { - this.logger = new Utils.ConsoleLogger(logging); - } - return this; - }; - HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) { - Utils.Arg.isRequired(url, "url"); - this.url = url; - // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed - // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called. - if (typeof transportTypeOrOptions === "object") { - this.httpConnectionOptions = transportTypeOrOptions; - } - else { - this.httpConnectionOptions = { - transport: transportTypeOrOptions, - }; - } - return this; - }; - /** Configures the {@link HubConnection} to use the specified Hub Protocol. - * - * @param {IHubProtocol} protocol The {@link IHubProtocol} implementation to use. - */ - HubConnectionBuilder.prototype.withHubProtocol = function (protocol) { - Utils.Arg.isRequired(protocol, "protocol"); - this.protocol = protocol; - return this; - }; - /** Creates a {@link HubConnection} from the configuration options specified in this builder. - * - * @returns {HubConnection} The configured {@link HubConnection}. - */ - HubConnectionBuilder.prototype.build = function () { - // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one - // provided to configureLogger - var httpConnectionOptions = this.httpConnectionOptions || {}; - // If it's 'null', the user **explicitly** asked for null, don't mess with it. - if (httpConnectionOptions.logger === undefined) { - // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it. - httpConnectionOptions.logger = this.logger; - } - // Now create the connection - if (!this.url) { - throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection."); - } - var connection = new HttpConnection_1.HttpConnection(this.url, httpConnectionOptions); - return HubConnection_1.HubConnection.create(connection, this.logger || Loggers.NullLogger.instance, this.protocol || new JsonHubProtocol_1.JsonHubProtocol()); - }; - return HubConnectionBuilder; -}()); -exports.HubConnectionBuilder = HubConnectionBuilder; -function isLogger(logger) { - return logger.log !== undefined; -} - -}); - -unwrapExports(HubConnectionBuilder_1); -var HubConnectionBuilder_2 = HubConnectionBuilder_1.HubConnectionBuilder; - -var cjs = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -// Version token that will be replaced by the prepack command -/** The version of the SignalR client. */ -exports.VERSION = "0.0.0-DEV_BUILD"; - -exports.HttpError = Errors.HttpError; -exports.TimeoutError = Errors.TimeoutError; - -exports.DefaultHttpClient = HttpClient_1.DefaultHttpClient; -exports.HttpClient = HttpClient_1.HttpClient; -exports.HttpResponse = HttpClient_1.HttpResponse; - -exports.HubConnection = HubConnection_1.HubConnection; - -exports.HubConnectionBuilder = HubConnectionBuilder_1.HubConnectionBuilder; - -exports.MessageType = IHubProtocol.MessageType; - -exports.LogLevel = ILogger.LogLevel; - -exports.HttpTransportType = ITransport.HttpTransportType; -exports.TransferFormat = ITransport.TransferFormat; - -exports.NullLogger = Loggers.NullLogger; - -exports.JsonHubProtocol = JsonHubProtocol_1.JsonHubProtocol; - -}); - -unwrapExports(cjs); -var cjs_1 = cjs.VERSION; -var cjs_2 = cjs.HttpError; -var cjs_3 = cjs.TimeoutError; -var cjs_4 = cjs.DefaultHttpClient; -var cjs_5 = cjs.HttpClient; -var cjs_6 = cjs.HttpResponse; -var cjs_7 = cjs.HubConnection; -var cjs_8 = cjs.HubConnectionBuilder; -var cjs_9 = cjs.MessageType; -var cjs_10 = cjs.LogLevel; -var cjs_11 = cjs.HttpTransportType; -var cjs_12 = cjs.TransferFormat; -var cjs_13 = cjs.NullLogger; -var cjs_14 = cjs.JsonHubProtocol; - -var browserIndex = createCommonjsModule(function (module, exports) { -Object.defineProperty(exports, "__esModule", { value: true }); - -// This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds. - -// Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties -// that exist on Uint8Array with the same name, and JavaScript is magic. -// We make them 'writable' because the Buffer polyfill messes with it as well. -if (!Uint8Array.prototype.indexOf) { - Object.defineProperty(Uint8Array.prototype, "indexOf", { - value: Array.prototype.indexOf, - writable: true, - }); -} -if (!Uint8Array.prototype.slice) { - Object.defineProperty(Uint8Array.prototype, "slice", { - value: Array.prototype.slice, - writable: true, - }); -} -if (!Uint8Array.prototype.forEach) { - Object.defineProperty(Uint8Array.prototype, "forEach", { - value: Array.prototype.forEach, - writable: true, - }); -} -tslib_1.__exportStar(cjs, exports); - -}); - -var browserIndex$1 = unwrapExports(browserIndex); - -return browserIndex$1; - -}))); -//# sourceMappingURL=signalr.js.map - -!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("
").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("
"),M=e("
"),B=e("
"),q=e("
"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}); -//# sourceMappingURL=toastr.js.map \ No newline at end of file diff --git a/src/Web/WebMVC/wwwroot/js/site.min.js b/src/Web/WebMVC/wwwroot/js/site.min.js deleted file mode 100644 index 09acfb4f0..000000000 --- a/src/Web/WebMVC/wwwroot/js/site.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @overview ASP.NET Core SignalR JavaScript Client. - * @version 1.0.3. - * @license - * Copyright (c) .NET Foundation. All rights reserved. - * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - */ -(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.signalR=t()})(this,function(){"use strict";function rt(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");}function e(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n["default"]:n}function f(n,t){return t={exports:{}},n(t,t.exports),t.exports}function ot(n,t){function i(){this.constructor=n}ut(n,t);n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function st(n,t){var u={},r;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(r=0,i=Object.getOwnPropertySymbols(n);r=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u}function ct(n,t){return function(i,r){t(i,r,n)}}function lt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function at(n,t,i,r){return new(i||(i=Promise))(function(u,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?u(n.value):new i(function(t){t(n.value)}).then(o,s)}e((r=r.apply(n,t||[])).next())})}function vt(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=u[e[0]&2?"return":e[0]?"throw":"next"])&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[0,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}}}function et(n,t){var i=typeof Symbol=="function"&&n[Symbol.iterator],r,u,f,e;if(!i)return n;r=i.call(n);f=[];try{while((t===void 0||t-->0)&&!(u=r.next()).done)f.push(u.value)}catch(o){e={error:o}}finally{try{u&&!u.done&&(i=r["return"])&&i.call(r)}finally{if(e)throw e.error;}}return f}function pt(){for(var n=[],t=0;t1||f(n,t)})})}function f(n,t){try{h(o[n](t))}catch(i){s(r[0][3],i)}}function h(n){n.value instanceof a?Promise.resolve(n.value.v).then(c,l):s(r[0][2],n)}function c(n){f("next",n)}function l(n){f("throw",n)}function s(n,t){(n(t),r.shift(),r.length)&&f(r[0][0],r[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(n,t||[]),u,r=[];return u={},e("next"),e("throw"),e("return"),u[Symbol.asyncIterator]=function(){return this},u}function bt(n){function i(i,u){n[i]&&(t[i]=function(t){return(r=!r)?{value:a(n[i](t)),done:i==="return"}:u?u(t):t})}var t,r;return t={},i("next"),i("throw",function(n){throw n;}),i("return"),t[Symbol.iterator]=function(){return this},t}function kt(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator];return t?t.call(n):typeof tt=="function"?tt(n):n[Symbol.iterator]()}function dt(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n}function gt(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t}function ni(n){return n&&n.__esModule?n:{"default":n}}var nt=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ut,ft,ti,h,ii,p,ri,u,ui,l,fi,i,ei,r,oi,v,si,b,hi,k,ci,d,li,y,ai,g,vi,o; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};ft=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i=200&&e.status<300?r(new u(e.status,e.statusText,e.response||e.responseText)):f(new s.HttpError(e.statusText,e.status))};e.onerror=function(){i.logger.log(n.LogLevel.Warning,"Error from HTTP request. "+e.status+": "+e.statusText);f(new s.HttpError(e.statusText,e.status))};e.ontimeout=function(){i.logger.log(n.LogLevel.Warning,"Timeout from HTTP request.");f(new s.TimeoutError)};e.send(t.content||"")})},r}(f);r.DefaultHttpClient=e});e(h);var ki=h.HttpResponse,di=h.HttpClient,gi=h.DefaultHttpClient,c=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.write=function(t){return""+t+n.RecordSeparator},n.parse=function(t){if(t[t.length-1]!==n.RecordSeparator)throw new Error("Message is incomplete.");var i=t.split(n.RecordSeparator);return i.pop(),i},n.RecordSeparatorCode=30,n.RecordSeparator=String.fromCharCode(n.RecordSeparatorCode),n}();t.TextMessageFormat=i});e(c);ii=c.TextMessageFormat;p=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.prototype.writeHandshakeRequest=function(n){return c.TextMessageFormat.write(JSON.stringify(n))},n.prototype.parseHandshakeResponse=function(n){var o,f,e,r,u,i,t,s;if(n instanceof ArrayBuffer){if(r=new Uint8Array(n),i=r.indexOf(c.TextMessageFormat.RecordSeparatorCode),i===-1)throw new Error("Message is incomplete.");t=i+1;f=String.fromCharCode.apply(null,r.slice(0,t));e=r.byteLength>t?r.slice(t).buffer:null}else{if(u=n,i=u.indexOf(c.TextMessageFormat.RecordSeparator),i===-1)throw new Error("Message is incomplete.");t=i+1;f=u.substring(0,t);e=u.length>t?u.substring(t):null}return s=c.TextMessageFormat.parse(f),o=JSON.parse(s[0]),[e,o]},n}();t.HandshakeProtocol=i});e(p);ri=p.HandshakeProtocol;u=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i;(function(n){n[n.Invocation=1]="Invocation";n[n.StreamItem=2]="StreamItem";n[n.Completion=3]="Completion";n[n.StreamInvocation=4]="StreamInvocation";n[n.CancelInvocation=5]="CancelInvocation";n[n.Ping=6]="Ping";n[n.Close=7]="Close"})(i=t.MessageType||(t.MessageType={}))});e(u);ui=u.MessageType;l=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.prototype.log=function(){},n.instance=new n,n}();t.NullLogger=i});e(l);fi=l.NullLogger;i=f(function(i,r){function o(n,t){var i=null;return n instanceof ArrayBuffer?(i="Binary data of length "+n.byteLength,t&&(i+=". Content: '"+s(n)+"'")):typeof n=="string"&&(i="String data of length "+n.length,t&&(i+=". Content: '"+n+"'.")),i}function s(n){var i=new Uint8Array(n),t="";return i.forEach(function(n){var i=n<16?"0":"";t+="0x"+i+n.toString(16)+" "}),t.substr(0,t.length-1)}function c(i,r,u,f,e,s,h){return t.__awaiter(this,void 0,void 0,function(){var a,c,v,l;return t.__generator(this,function(t){switch(t.label){case 0:return[4,e()];case 1:return c=t.sent(),c&&(a=(l={},l.Authorization="Bearer "+c,l)),i.log(n.LogLevel.Trace,"("+r+" transport) sending data. "+o(s,h)+"."),[4,u.post(f,{content:s,headers:a})];case 2:return v=t.sent(),i.log(n.LogLevel.Trace,"("+r+" transport) request complete. Response status: "+v.statusCode+"."),[2]}})})}function a(t){return t===undefined?new u(n.LogLevel.Information):t===null?l.NullLogger.instance:t.log?t:new u(t)}var e,h,f,u;Object.defineProperty(r,"__esModule",{value:!0});e=function(){function n(){}return n.isRequired=function(n,t){if(n===null||n===undefined)throw new Error("The '"+t+"' argument is required.");},n.isIn=function(n,t,i){if(!(n in t))throw new Error("Unknown "+i+" value: "+n+".");},n}();r.Arg=e;r.getDataDetail=o;r.formatArrayBuffer=s;r.sendMessage=c;r.createLogger=a;h=function(){function n(n){this.observers=[];this.cancelCallback=n}return n.prototype.next=function(n){for(var r,t=0,i=this.observers;t-1&&this.subject.observers.splice(n,1);this.subject.observers.length===0&&this.subject.cancelCallback().catch(function(){})},n}();r.SubjectSubscription=f;u=function(){function t(n){this.minimumLogLevel=n}return t.prototype.log=function(t,i){if(t>=this.minimumLogLevel)switch(t){case n.LogLevel.Critical:case n.LogLevel.Error:console.error(n.LogLevel[t]+": "+i);break;case n.LogLevel.Warning:console.warn(n.LogLevel[t]+": "+i);break;case n.LogLevel.Information:console.info(n.LogLevel[t]+": "+i);break;default:console.log(n.LogLevel[t]+": "+i)}},t}();r.ConsoleLogger=u});e(i);var nr=i.Arg,tr=i.getDataDetail,ir=i.formatArrayBuffer,rr=i.sendMessage,ur=i.createLogger,fr=i.Subject,er=i.SubjectSubscription,or=i.ConsoleLogger,w=f(function(r,f){Object.defineProperty(f,"__esModule",{value:!0});var e=3e4,o=function(){function r(n,t,r){var u=this;i.Arg.isRequired(n,"connection");i.Arg.isRequired(t,"logger");i.Arg.isRequired(r,"protocol");this.serverTimeoutInMilliseconds=e;this.logger=t;this.protocol=r;this.connection=n;this.handshakeProtocol=new p.HandshakeProtocol;this.connection.onreceive=function(n){return u.processIncomingData(n)};this.connection.onclose=function(n){return u.connectionClosed(n)};this.callbacks={};this.methods={};this.closedCallbacks=[];this.id=0}return r.create=function(n,t,i){return new r(n,t,i)},r.prototype.start=function(){return t.__awaiter(this,void 0,void 0,function(){var i;return t.__generator(this,function(t){switch(t.label){case 0:return i={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(n.LogLevel.Debug,"Starting HubConnection."),this.receivedHandshakeResponse=!1,[4,this.connection.start(this.protocol.transferFormat)];case 1:return t.sent(),this.logger.log(n.LogLevel.Debug,"Sending handshake request."),[4,this.connection.send(this.handshakeProtocol.writeHandshakeRequest(i))];case 2:return t.sent(),this.logger.log(n.LogLevel.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.configureTimeout(),[2]}})})},r.prototype.stop=function(){return this.logger.log(n.LogLevel.Debug,"Stopping HubConnection."),this.cleanupTimeout(),this.connection.stop()},r.prototype.stream=function(n){for(var r,t,s,f=this,o=[],e=1;e"));this.onclose(f)}return this.logger.log(n.LogLevel.Trace,"(LongPolling transport) Transport finished."),[7];case 9:return[2]}})})},u.prototype.send=function(n){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){return this.running?[2,i.sendMessage(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,n,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},u.prototype.stop=function(){return t.__awaiter(this,void 0,void 0,function(){var r=this,i,u,f;return t.__generator(this,function(t){switch(t.label){case 0:return t.trys.push([0,,3,4]),this.running=!1,this.logger.log(n.LogLevel.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),i={headers:{}},[4,this.accessTokenFactory()];case 1:return u=t.sent(),this.updateHeaderToken(i,u),[4,this.httpClient.delete(this.url,i)];case 2:return f=t.sent(),this.logger.log(n.LogLevel.Trace,"(LongPolling transport) DELETE request accepted."),[3,4];case 3:return this.stopped||(this.shutdownTimer=setTimeout(function(){r.logger.log(n.LogLevel.Warning,"(LongPolling transport) server did not terminate after DELETE request, canceling poll.");r.pollAbort.abort()},this.shutdownTimeout)),[7];case 4:return[2]}})})},u}();f.LongPollingTransport=o});e(v);si=v.LongPollingTransport;b=f(function(u,f){Object.defineProperty(f,"__esModule",{value:!0});var e=function(){function u(n,t,i,r){this.httpClient=n;this.accessTokenFactory=t||function(){return null};this.logger=i;this.logMessageContent=r}return u.prototype.connect=function(u,f){return t.__awaiter(this,void 0,void 0,function(){var e=this,o;return t.__generator(this,function(t){switch(t.label){case 0:if(i.Arg.isRequired(u,"url"),i.Arg.isRequired(f,"transferFormat"),i.Arg.isIn(f,r.TransferFormat,"transferFormat"),typeof EventSource=="undefined")throw new Error("'EventSource' is not supported in your environment.");return this.logger.log(n.LogLevel.Trace,"(SSE transport) Connecting"),[4,this.accessTokenFactory()];case 1:return o=t.sent(),o&&(u+=(u.indexOf("?")<0?"?":"&")+("access_token="+encodeURIComponent(o))),this.url=u,[2,new Promise(function(t,o){var h=!1,s;f!==r.TransferFormat.Text&&o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));s=new EventSource(u,{withCredentials:!0});try{s.onmessage=function(t){if(e.onreceive)try{e.logger.log(n.LogLevel.Trace,"(SSE transport) data received. "+i.getDataDetail(t.data,e.logMessageContent)+".");e.onreceive(t.data)}catch(r){if(e.onclose)e.onclose(r);return}};s.onerror=function(n){var t=new Error(n.message||"Error occurred");h?e.close(t):o(t)};s.onopen=function(){e.logger.log(n.LogLevel.Information,"SSE connected to "+e.url);e.eventSource=s;h=!0;t()}}catch(c){return Promise.reject(c)}})]}})})},u.prototype.send=function(n){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){return this.eventSource?[2,i.sendMessage(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,n,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},u.prototype.stop=function(){return this.close(),Promise.resolve()},u.prototype.close=function(n){if(this.eventSource&&(this.eventSource.close(),this.eventSource=null,this.onclose))this.onclose(n)},u}();f.ServerSentEventsTransport=e});e(b);hi=b.ServerSentEventsTransport;k=f(function(u,f){Object.defineProperty(f,"__esModule",{value:!0});var e=function(){function u(n,t,i){this.logger=t;this.accessTokenFactory=n||function(){return null};this.logMessageContent=i}return u.prototype.connect=function(u,f){return t.__awaiter(this,void 0,void 0,function(){var e=this,o;return t.__generator(this,function(t){switch(t.label){case 0:if(i.Arg.isRequired(u,"url"),i.Arg.isRequired(f,"transferFormat"),i.Arg.isIn(f,r.TransferFormat,"transferFormat"),typeof WebSocket=="undefined")throw new Error("'WebSocket' is not supported in your environment.");return this.logger.log(n.LogLevel.Trace,"(WebSockets transport) Connecting"),[4,this.accessTokenFactory()];case 1:return o=t.sent(),o&&(u+=(u.indexOf("?")<0?"?":"&")+("access_token="+encodeURIComponent(o))),[2,new Promise(function(t,o){u=u.replace(/^http/,"ws");var s=new WebSocket(u);f===r.TransferFormat.Binary&&(s.binaryType="arraybuffer");s.onopen=function(){e.logger.log(n.LogLevel.Information,"WebSocket connected to "+u);e.webSocket=s;t()};s.onerror=function(n){o(n.error)};s.onmessage=function(t){if(e.logger.log(n.LogLevel.Trace,"(WebSockets transport) data received. "+i.getDataDetail(t.data,e.logMessageContent)+"."),e.onreceive)e.onreceive(t.data)};s.onclose=function(t){if(e.logger.log(n.LogLevel.Trace,"(WebSockets transport) socket closed."),e.onclose)if(t.wasClean===!1||t.code!==1e3)e.onclose(new Error("Websocket closed with status code: "+t.code+" ("+t.reason+")"));else e.onclose()}})]}})})},u.prototype.send=function(t){return this.webSocket&&this.webSocket.readyState===WebSocket.OPEN?(this.logger.log(n.LogLevel.Trace,"(WebSockets transport) sending data. "+i.getDataDetail(t,this.logMessageContent)+"."),this.webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},u.prototype.stop=function(){return this.webSocket&&(this.webSocket.close(),this.webSocket=null),Promise.resolve()},u}();f.WebSocketTransport=e});e(k);ci=k.WebSocketTransport;d=f(function(u,f){function s(n,t){return!n||(t&n)!=0}Object.defineProperty(f,"__esModule",{value:!0});var e=100,o=function(){function u(n,t){t===void 0&&(t={});this.features={};i.Arg.isRequired(n,"url");this.logger=i.createLogger(t.logger);this.baseUrl=this.resolveUrl(n);t=t||{};t.accessTokenFactory=t.accessTokenFactory||function(){return null};t.logMessageContent=t.logMessageContent||!1;this.httpClient=t.httpClient||new h.DefaultHttpClient(this.logger);this.connectionState=2;this.options=t}return u.prototype.start=function(t){return(t=t||r.TransferFormat.Binary,i.Arg.isIn(t,r.TransferFormat,"transferFormat"),this.logger.log(n.LogLevel.Debug,"Starting connection with transfer format '"+r.TransferFormat[t]+"'."),this.connectionState!==2)?Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")):(this.connectionState=0,this.startPromise=this.startInternal(t),this.startPromise)},u.prototype.send=function(n){if(this.connectionState!==1)throw new Error("Cannot send data if the connection is not in the 'Connected' State.");return this.transport.send(n)},u.prototype.stop=function(n){return t.__awaiter(this,void 0,void 0,function(){var i;return t.__generator(this,function(t){switch(t.label){case 0:this.connectionState=2;t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.startPromise];case 2:return t.sent(),[3,4];case 3:return i=t.sent(),[3,4];case 4:return this.transport?(this.stopError=n,[4,this.transport.stop()]):[3,6];case 5:t.sent();this.transport=null;t.label=6;case 6:return[2]}})})},u.prototype.startInternal=function(i){return t.__awaiter(this,void 0,void 0,function(){var a=this,f,u,o,l,s,h,c;return t.__generator(this,function(y){switch(y.label){case 0:f=this.baseUrl;this.accessTokenFactory=this.options.accessTokenFactory;y.label=1;case 1:return(y.trys.push([1,12,,13]),!this.options.skipNegotiation)?[3,5]:(this.options.transport===r.HttpTransportType.WebSockets)?(this.transport=this.constructTransport(r.HttpTransportType.WebSockets),[4,this.transport.connect(f,i)]):[3,3];case 2:return y.sent(),[3,4];case 3:throw Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:u=null;o=0;l=function(){var n;return t.__generator(this,function(t){switch(t.label){case 0:return[4,s.getNegotiationResponse(f)];case 1:return(u=t.sent(),s.connectionState===2)?[2,{value:void 0}]:(u.url&&(f=u.url),u.accessToken&&(n=u.accessToken,s.accessTokenFactory=function(){return n}),o++,[2])}})};s=this;y.label=6;case 6:return[5,l()];case 7:if(h=y.sent(),typeof h=="object")return[2,h.value];y.label=8;case 8:if(u.url&&o=0)if(f===r.HttpTransportType.WebSockets&&typeof WebSocket=="undefined"||f===r.HttpTransportType.ServerSentEvents&&typeof EventSource=="undefined")this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it is not supported in your environment.'");else return this.logger.log(n.LogLevel.Debug,"Selecting transport '"+r.HttpTransportType[f]+"'"),f;else this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it does not support the requested transfer format '"+r.TransferFormat[u]+"'.");else this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it was disabled by the client.");return null},u.prototype.isITransport=function(n){return n&&typeof n=="object"&&"connect"in n},u.prototype.changeState=function(n,t){return this.connectionState===n?(this.connectionState=t,!0):!1},u.prototype.stopConnection=function(i){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){if(this.transport=null,i=this.stopError||i,i?this.logger.log(n.LogLevel.Error,"Connection disconnected with error '"+i+"'."):this.logger.log(n.LogLevel.Information,"Connection disconnected."),this.connectionState=2,this.onclose)this.onclose(i);return[2]})})},u.prototype.resolveUrl=function(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(typeof window=="undefined"||!window||!window.document)throw new Error("Cannot resolve '"+t+"'.");var i=window.document.createElement("a");return i.href=t,this.logger.log(n.LogLevel.Information,"Normalizing '"+t+"' to '"+i.href+"'."),i.href},u.prototype.resolveNegotiateUrl=function(n){var i=n.indexOf("?"),t=n.substring(0,i===-1?n.length:i);return t[t.length-1]!=="/"&&(t+="/"),t+="negotiate",t+(i===-1?"":n.substring(i))},u}();f.HttpConnection=o});e(d);li=d.HttpConnection;y=f(function(t,i){Object.defineProperty(i,"__esModule",{value:!0});var f="json",e=function(){function t(){this.name=f;this.version=1;this.transferFormat=r.TransferFormat.Text}return t.prototype.parseMessages=function(t,i){var s,e,f,o,h,r;if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];for(i===null&&(i=l.NullLogger.instance),s=c.TextMessageFormat.parse(t),e=[],f=0,o=s;f=0;r--)h(n(u[r]),i)}function h(t,i,r){var u=!(!r||!r.force)&&r.force;return!(!t||!u&&0!==n(":focus",t).length)&&(t[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){e(t)}}),!0)}function nt(i){return t=n("
").attr("id",i.containerId).addClass(i.positionClass),t.appendTo(n(i.target)),t}function tt(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("
"),M=e("
"),B=e("
"),q=e("
"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}); -//# sourceMappingURL=toastr.js.map \ No newline at end of file diff --git a/src/Web/WebMVC/wwwroot/js/site.min.js b/src/Web/WebMVC/wwwroot/js/site.min.js deleted file mode 100644 index 09acfb4f0..000000000 --- a/src/Web/WebMVC/wwwroot/js/site.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @overview ASP.NET Core SignalR JavaScript Client. - * @version 1.0.3. - * @license - * Copyright (c) .NET Foundation. All rights reserved. - * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - */ -(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.signalR=t()})(this,function(){"use strict";function rt(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");}function e(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n["default"]:n}function f(n,t){return t={exports:{}},n(t,t.exports),t.exports}function ot(n,t){function i(){this.constructor=n}ut(n,t);n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function st(n,t){var u={},r;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(r=0,i=Object.getOwnPropertySymbols(n);r=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u}function ct(n,t){return function(i,r){t(i,r,n)}}function lt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function at(n,t,i,r){return new(i||(i=Promise))(function(u,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?u(n.value):new i(function(t){t(n.value)}).then(o,s)}e((r=r.apply(n,t||[])).next())})}function vt(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=u[e[0]&2?"return":e[0]?"throw":"next"])&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[0,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}}}function et(n,t){var i=typeof Symbol=="function"&&n[Symbol.iterator],r,u,f,e;if(!i)return n;r=i.call(n);f=[];try{while((t===void 0||t-->0)&&!(u=r.next()).done)f.push(u.value)}catch(o){e={error:o}}finally{try{u&&!u.done&&(i=r["return"])&&i.call(r)}finally{if(e)throw e.error;}}return f}function pt(){for(var n=[],t=0;t1||f(n,t)})})}function f(n,t){try{h(o[n](t))}catch(i){s(r[0][3],i)}}function h(n){n.value instanceof a?Promise.resolve(n.value.v).then(c,l):s(r[0][2],n)}function c(n){f("next",n)}function l(n){f("throw",n)}function s(n,t){(n(t),r.shift(),r.length)&&f(r[0][0],r[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(n,t||[]),u,r=[];return u={},e("next"),e("throw"),e("return"),u[Symbol.asyncIterator]=function(){return this},u}function bt(n){function i(i,u){n[i]&&(t[i]=function(t){return(r=!r)?{value:a(n[i](t)),done:i==="return"}:u?u(t):t})}var t,r;return t={},i("next"),i("throw",function(n){throw n;}),i("return"),t[Symbol.iterator]=function(){return this},t}function kt(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator];return t?t.call(n):typeof tt=="function"?tt(n):n[Symbol.iterator]()}function dt(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n}function gt(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t}function ni(n){return n&&n.__esModule?n:{"default":n}}var nt=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ut,ft,ti,h,ii,p,ri,u,ui,l,fi,i,ei,r,oi,v,si,b,hi,k,ci,d,li,y,ai,g,vi,o; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};ft=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i=200&&e.status<300?r(new u(e.status,e.statusText,e.response||e.responseText)):f(new s.HttpError(e.statusText,e.status))};e.onerror=function(){i.logger.log(n.LogLevel.Warning,"Error from HTTP request. "+e.status+": "+e.statusText);f(new s.HttpError(e.statusText,e.status))};e.ontimeout=function(){i.logger.log(n.LogLevel.Warning,"Timeout from HTTP request.");f(new s.TimeoutError)};e.send(t.content||"")})},r}(f);r.DefaultHttpClient=e});e(h);var ki=h.HttpResponse,di=h.HttpClient,gi=h.DefaultHttpClient,c=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.write=function(t){return""+t+n.RecordSeparator},n.parse=function(t){if(t[t.length-1]!==n.RecordSeparator)throw new Error("Message is incomplete.");var i=t.split(n.RecordSeparator);return i.pop(),i},n.RecordSeparatorCode=30,n.RecordSeparator=String.fromCharCode(n.RecordSeparatorCode),n}();t.TextMessageFormat=i});e(c);ii=c.TextMessageFormat;p=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.prototype.writeHandshakeRequest=function(n){return c.TextMessageFormat.write(JSON.stringify(n))},n.prototype.parseHandshakeResponse=function(n){var o,f,e,r,u,i,t,s;if(n instanceof ArrayBuffer){if(r=new Uint8Array(n),i=r.indexOf(c.TextMessageFormat.RecordSeparatorCode),i===-1)throw new Error("Message is incomplete.");t=i+1;f=String.fromCharCode.apply(null,r.slice(0,t));e=r.byteLength>t?r.slice(t).buffer:null}else{if(u=n,i=u.indexOf(c.TextMessageFormat.RecordSeparator),i===-1)throw new Error("Message is incomplete.");t=i+1;f=u.substring(0,t);e=u.length>t?u.substring(t):null}return s=c.TextMessageFormat.parse(f),o=JSON.parse(s[0]),[e,o]},n}();t.HandshakeProtocol=i});e(p);ri=p.HandshakeProtocol;u=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i;(function(n){n[n.Invocation=1]="Invocation";n[n.StreamItem=2]="StreamItem";n[n.Completion=3]="Completion";n[n.StreamInvocation=4]="StreamInvocation";n[n.CancelInvocation=5]="CancelInvocation";n[n.Ping=6]="Ping";n[n.Close=7]="Close"})(i=t.MessageType||(t.MessageType={}))});e(u);ui=u.MessageType;l=f(function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.prototype.log=function(){},n.instance=new n,n}();t.NullLogger=i});e(l);fi=l.NullLogger;i=f(function(i,r){function o(n,t){var i=null;return n instanceof ArrayBuffer?(i="Binary data of length "+n.byteLength,t&&(i+=". Content: '"+s(n)+"'")):typeof n=="string"&&(i="String data of length "+n.length,t&&(i+=". Content: '"+n+"'.")),i}function s(n){var i=new Uint8Array(n),t="";return i.forEach(function(n){var i=n<16?"0":"";t+="0x"+i+n.toString(16)+" "}),t.substr(0,t.length-1)}function c(i,r,u,f,e,s,h){return t.__awaiter(this,void 0,void 0,function(){var a,c,v,l;return t.__generator(this,function(t){switch(t.label){case 0:return[4,e()];case 1:return c=t.sent(),c&&(a=(l={},l.Authorization="Bearer "+c,l)),i.log(n.LogLevel.Trace,"("+r+" transport) sending data. "+o(s,h)+"."),[4,u.post(f,{content:s,headers:a})];case 2:return v=t.sent(),i.log(n.LogLevel.Trace,"("+r+" transport) request complete. Response status: "+v.statusCode+"."),[2]}})})}function a(t){return t===undefined?new u(n.LogLevel.Information):t===null?l.NullLogger.instance:t.log?t:new u(t)}var e,h,f,u;Object.defineProperty(r,"__esModule",{value:!0});e=function(){function n(){}return n.isRequired=function(n,t){if(n===null||n===undefined)throw new Error("The '"+t+"' argument is required.");},n.isIn=function(n,t,i){if(!(n in t))throw new Error("Unknown "+i+" value: "+n+".");},n}();r.Arg=e;r.getDataDetail=o;r.formatArrayBuffer=s;r.sendMessage=c;r.createLogger=a;h=function(){function n(n){this.observers=[];this.cancelCallback=n}return n.prototype.next=function(n){for(var r,t=0,i=this.observers;t-1&&this.subject.observers.splice(n,1);this.subject.observers.length===0&&this.subject.cancelCallback().catch(function(){})},n}();r.SubjectSubscription=f;u=function(){function t(n){this.minimumLogLevel=n}return t.prototype.log=function(t,i){if(t>=this.minimumLogLevel)switch(t){case n.LogLevel.Critical:case n.LogLevel.Error:console.error(n.LogLevel[t]+": "+i);break;case n.LogLevel.Warning:console.warn(n.LogLevel[t]+": "+i);break;case n.LogLevel.Information:console.info(n.LogLevel[t]+": "+i);break;default:console.log(n.LogLevel[t]+": "+i)}},t}();r.ConsoleLogger=u});e(i);var nr=i.Arg,tr=i.getDataDetail,ir=i.formatArrayBuffer,rr=i.sendMessage,ur=i.createLogger,fr=i.Subject,er=i.SubjectSubscription,or=i.ConsoleLogger,w=f(function(r,f){Object.defineProperty(f,"__esModule",{value:!0});var e=3e4,o=function(){function r(n,t,r){var u=this;i.Arg.isRequired(n,"connection");i.Arg.isRequired(t,"logger");i.Arg.isRequired(r,"protocol");this.serverTimeoutInMilliseconds=e;this.logger=t;this.protocol=r;this.connection=n;this.handshakeProtocol=new p.HandshakeProtocol;this.connection.onreceive=function(n){return u.processIncomingData(n)};this.connection.onclose=function(n){return u.connectionClosed(n)};this.callbacks={};this.methods={};this.closedCallbacks=[];this.id=0}return r.create=function(n,t,i){return new r(n,t,i)},r.prototype.start=function(){return t.__awaiter(this,void 0,void 0,function(){var i;return t.__generator(this,function(t){switch(t.label){case 0:return i={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(n.LogLevel.Debug,"Starting HubConnection."),this.receivedHandshakeResponse=!1,[4,this.connection.start(this.protocol.transferFormat)];case 1:return t.sent(),this.logger.log(n.LogLevel.Debug,"Sending handshake request."),[4,this.connection.send(this.handshakeProtocol.writeHandshakeRequest(i))];case 2:return t.sent(),this.logger.log(n.LogLevel.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.configureTimeout(),[2]}})})},r.prototype.stop=function(){return this.logger.log(n.LogLevel.Debug,"Stopping HubConnection."),this.cleanupTimeout(),this.connection.stop()},r.prototype.stream=function(n){for(var r,t,s,f=this,o=[],e=1;e"));this.onclose(f)}return this.logger.log(n.LogLevel.Trace,"(LongPolling transport) Transport finished."),[7];case 9:return[2]}})})},u.prototype.send=function(n){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){return this.running?[2,i.sendMessage(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,n,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},u.prototype.stop=function(){return t.__awaiter(this,void 0,void 0,function(){var r=this,i,u,f;return t.__generator(this,function(t){switch(t.label){case 0:return t.trys.push([0,,3,4]),this.running=!1,this.logger.log(n.LogLevel.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),i={headers:{}},[4,this.accessTokenFactory()];case 1:return u=t.sent(),this.updateHeaderToken(i,u),[4,this.httpClient.delete(this.url,i)];case 2:return f=t.sent(),this.logger.log(n.LogLevel.Trace,"(LongPolling transport) DELETE request accepted."),[3,4];case 3:return this.stopped||(this.shutdownTimer=setTimeout(function(){r.logger.log(n.LogLevel.Warning,"(LongPolling transport) server did not terminate after DELETE request, canceling poll.");r.pollAbort.abort()},this.shutdownTimeout)),[7];case 4:return[2]}})})},u}();f.LongPollingTransport=o});e(v);si=v.LongPollingTransport;b=f(function(u,f){Object.defineProperty(f,"__esModule",{value:!0});var e=function(){function u(n,t,i,r){this.httpClient=n;this.accessTokenFactory=t||function(){return null};this.logger=i;this.logMessageContent=r}return u.prototype.connect=function(u,f){return t.__awaiter(this,void 0,void 0,function(){var e=this,o;return t.__generator(this,function(t){switch(t.label){case 0:if(i.Arg.isRequired(u,"url"),i.Arg.isRequired(f,"transferFormat"),i.Arg.isIn(f,r.TransferFormat,"transferFormat"),typeof EventSource=="undefined")throw new Error("'EventSource' is not supported in your environment.");return this.logger.log(n.LogLevel.Trace,"(SSE transport) Connecting"),[4,this.accessTokenFactory()];case 1:return o=t.sent(),o&&(u+=(u.indexOf("?")<0?"?":"&")+("access_token="+encodeURIComponent(o))),this.url=u,[2,new Promise(function(t,o){var h=!1,s;f!==r.TransferFormat.Text&&o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));s=new EventSource(u,{withCredentials:!0});try{s.onmessage=function(t){if(e.onreceive)try{e.logger.log(n.LogLevel.Trace,"(SSE transport) data received. "+i.getDataDetail(t.data,e.logMessageContent)+".");e.onreceive(t.data)}catch(r){if(e.onclose)e.onclose(r);return}};s.onerror=function(n){var t=new Error(n.message||"Error occurred");h?e.close(t):o(t)};s.onopen=function(){e.logger.log(n.LogLevel.Information,"SSE connected to "+e.url);e.eventSource=s;h=!0;t()}}catch(c){return Promise.reject(c)}})]}})})},u.prototype.send=function(n){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){return this.eventSource?[2,i.sendMessage(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,n,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},u.prototype.stop=function(){return this.close(),Promise.resolve()},u.prototype.close=function(n){if(this.eventSource&&(this.eventSource.close(),this.eventSource=null,this.onclose))this.onclose(n)},u}();f.ServerSentEventsTransport=e});e(b);hi=b.ServerSentEventsTransport;k=f(function(u,f){Object.defineProperty(f,"__esModule",{value:!0});var e=function(){function u(n,t,i){this.logger=t;this.accessTokenFactory=n||function(){return null};this.logMessageContent=i}return u.prototype.connect=function(u,f){return t.__awaiter(this,void 0,void 0,function(){var e=this,o;return t.__generator(this,function(t){switch(t.label){case 0:if(i.Arg.isRequired(u,"url"),i.Arg.isRequired(f,"transferFormat"),i.Arg.isIn(f,r.TransferFormat,"transferFormat"),typeof WebSocket=="undefined")throw new Error("'WebSocket' is not supported in your environment.");return this.logger.log(n.LogLevel.Trace,"(WebSockets transport) Connecting"),[4,this.accessTokenFactory()];case 1:return o=t.sent(),o&&(u+=(u.indexOf("?")<0?"?":"&")+("access_token="+encodeURIComponent(o))),[2,new Promise(function(t,o){u=u.replace(/^http/,"ws");var s=new WebSocket(u);f===r.TransferFormat.Binary&&(s.binaryType="arraybuffer");s.onopen=function(){e.logger.log(n.LogLevel.Information,"WebSocket connected to "+u);e.webSocket=s;t()};s.onerror=function(n){o(n.error)};s.onmessage=function(t){if(e.logger.log(n.LogLevel.Trace,"(WebSockets transport) data received. "+i.getDataDetail(t.data,e.logMessageContent)+"."),e.onreceive)e.onreceive(t.data)};s.onclose=function(t){if(e.logger.log(n.LogLevel.Trace,"(WebSockets transport) socket closed."),e.onclose)if(t.wasClean===!1||t.code!==1e3)e.onclose(new Error("Websocket closed with status code: "+t.code+" ("+t.reason+")"));else e.onclose()}})]}})})},u.prototype.send=function(t){return this.webSocket&&this.webSocket.readyState===WebSocket.OPEN?(this.logger.log(n.LogLevel.Trace,"(WebSockets transport) sending data. "+i.getDataDetail(t,this.logMessageContent)+"."),this.webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},u.prototype.stop=function(){return this.webSocket&&(this.webSocket.close(),this.webSocket=null),Promise.resolve()},u}();f.WebSocketTransport=e});e(k);ci=k.WebSocketTransport;d=f(function(u,f){function s(n,t){return!n||(t&n)!=0}Object.defineProperty(f,"__esModule",{value:!0});var e=100,o=function(){function u(n,t){t===void 0&&(t={});this.features={};i.Arg.isRequired(n,"url");this.logger=i.createLogger(t.logger);this.baseUrl=this.resolveUrl(n);t=t||{};t.accessTokenFactory=t.accessTokenFactory||function(){return null};t.logMessageContent=t.logMessageContent||!1;this.httpClient=t.httpClient||new h.DefaultHttpClient(this.logger);this.connectionState=2;this.options=t}return u.prototype.start=function(t){return(t=t||r.TransferFormat.Binary,i.Arg.isIn(t,r.TransferFormat,"transferFormat"),this.logger.log(n.LogLevel.Debug,"Starting connection with transfer format '"+r.TransferFormat[t]+"'."),this.connectionState!==2)?Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")):(this.connectionState=0,this.startPromise=this.startInternal(t),this.startPromise)},u.prototype.send=function(n){if(this.connectionState!==1)throw new Error("Cannot send data if the connection is not in the 'Connected' State.");return this.transport.send(n)},u.prototype.stop=function(n){return t.__awaiter(this,void 0,void 0,function(){var i;return t.__generator(this,function(t){switch(t.label){case 0:this.connectionState=2;t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.startPromise];case 2:return t.sent(),[3,4];case 3:return i=t.sent(),[3,4];case 4:return this.transport?(this.stopError=n,[4,this.transport.stop()]):[3,6];case 5:t.sent();this.transport=null;t.label=6;case 6:return[2]}})})},u.prototype.startInternal=function(i){return t.__awaiter(this,void 0,void 0,function(){var a=this,f,u,o,l,s,h,c;return t.__generator(this,function(y){switch(y.label){case 0:f=this.baseUrl;this.accessTokenFactory=this.options.accessTokenFactory;y.label=1;case 1:return(y.trys.push([1,12,,13]),!this.options.skipNegotiation)?[3,5]:(this.options.transport===r.HttpTransportType.WebSockets)?(this.transport=this.constructTransport(r.HttpTransportType.WebSockets),[4,this.transport.connect(f,i)]):[3,3];case 2:return y.sent(),[3,4];case 3:throw Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:u=null;o=0;l=function(){var n;return t.__generator(this,function(t){switch(t.label){case 0:return[4,s.getNegotiationResponse(f)];case 1:return(u=t.sent(),s.connectionState===2)?[2,{value:void 0}]:(u.url&&(f=u.url),u.accessToken&&(n=u.accessToken,s.accessTokenFactory=function(){return n}),o++,[2])}})};s=this;y.label=6;case 6:return[5,l()];case 7:if(h=y.sent(),typeof h=="object")return[2,h.value];y.label=8;case 8:if(u.url&&o=0)if(f===r.HttpTransportType.WebSockets&&typeof WebSocket=="undefined"||f===r.HttpTransportType.ServerSentEvents&&typeof EventSource=="undefined")this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it is not supported in your environment.'");else return this.logger.log(n.LogLevel.Debug,"Selecting transport '"+r.HttpTransportType[f]+"'"),f;else this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it does not support the requested transfer format '"+r.TransferFormat[u]+"'.");else this.logger.log(n.LogLevel.Debug,"Skipping transport '"+r.HttpTransportType[f]+"' because it was disabled by the client.");return null},u.prototype.isITransport=function(n){return n&&typeof n=="object"&&"connect"in n},u.prototype.changeState=function(n,t){return this.connectionState===n?(this.connectionState=t,!0):!1},u.prototype.stopConnection=function(i){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(){if(this.transport=null,i=this.stopError||i,i?this.logger.log(n.LogLevel.Error,"Connection disconnected with error '"+i+"'."):this.logger.log(n.LogLevel.Information,"Connection disconnected."),this.connectionState=2,this.onclose)this.onclose(i);return[2]})})},u.prototype.resolveUrl=function(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(typeof window=="undefined"||!window||!window.document)throw new Error("Cannot resolve '"+t+"'.");var i=window.document.createElement("a");return i.href=t,this.logger.log(n.LogLevel.Information,"Normalizing '"+t+"' to '"+i.href+"'."),i.href},u.prototype.resolveNegotiateUrl=function(n){var i=n.indexOf("?"),t=n.substring(0,i===-1?n.length:i);return t[t.length-1]!=="/"&&(t+="/"),t+="negotiate",t+(i===-1?"":n.substring(i))},u}();f.HttpConnection=o});e(d);li=d.HttpConnection;y=f(function(t,i){Object.defineProperty(i,"__esModule",{value:!0});var f="json",e=function(){function t(){this.name=f;this.version=1;this.transferFormat=r.TransferFormat.Text}return t.prototype.parseMessages=function(t,i){var s,e,f,o,h,r;if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];for(i===null&&(i=l.NullLogger.instance),s=c.TextMessageFormat.parse(t),e=[],f=0,o=s;f=0;r--)h(n(u[r]),i)}function h(t,i,r){var u=!(!r||!r.force)&&r.force;return!(!t||!u&&0!==n(":focus",t).length)&&(t[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){e(t)}}),!0)}function nt(i){return t=n("
").attr("id",i.containerId).addClass(i.positionClass),t.appendTo(n(i.target)),t}function tt(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'