fiftyone.geolocation 4.2.1 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +3 -0
- package/README.md +2 -2
- package/ci/README.md +2 -0
- package/ci/build-and-test.yml +34 -0
- package/ci/common-ci/.github/labels.yml +59 -0
- package/ci/common-ci/.github/workflows/sync-labels.yml +49 -0
- package/ci/common-ci/CiTips.md +34 -0
- package/ci/common-ci/GitVersion.yml +18 -0
- package/ci/common-ci/LICENSE +286 -0
- package/ci/common-ci/README.md +365 -0
- package/ci/common-ci/build-and-test.yml +65 -0
- package/ci/common-ci/check-merge-commit-format.yml +50 -0
- package/ci/common-ci/cloud-release-config.json +51 -0
- package/ci/common-ci/create-tag.yml +41 -0
- package/ci/common-ci/deploy.yml +25 -0
- package/ci/common-ci/dotnet/shared-code-signing-steps.yml +20 -0
- package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +29 -0
- package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
- package/ci/common-ci/java/readme.md +22 -0
- package/ci/common-ci/java/shared-code-signing-steps.yml +17 -0
- package/ci/common-ci/node/shared-extract-and-publish-packages.yml +26 -0
- package/ci/common-ci/php/readme.md +15 -0
- package/ci/common-ci/release-config-schema.json +52 -0
- package/ci/common-ci/release-config-template.json +310 -0
- package/ci/common-ci/release-config.json +128 -0
- package/ci/common-ci/release-process.drawio +165 -0
- package/ci/common-ci/release-process.png +0 -0
- package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
- package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.Tests.ps1 +1 -0
- package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +16 -0
- package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.Tests.ps1 +3 -0
- package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.psm1 +200 -0
- package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
- package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
- package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.Tests.ps1 +25 -0
- package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.psm1 +22 -0
- package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.Tests.ps1 +1 -0
- package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.psm1 +41 -0
- package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.Tests.ps1 +5 -0
- package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +698 -0
- package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +842 -0
- package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +926 -0
- package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.Tests.ps1 +1 -0
- package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.psm1 +87 -0
- package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.Tests.ps1 +194 -0
- package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.psm1 +653 -0
- package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +277 -0
- package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +554 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.Tests.ps1 +1141 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psd1 +0 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psm1 +1465 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.Tests.ps1 +318 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.psm1 +344 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +1186 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +900 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +139 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/c-test-env-config.json +268 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-deploy-test-env-config.json +700 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-test-env-config.json +533 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-deploy-test-env-config.json +511 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-test-env-config.json +388 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-deploy-test-env-config.json +419 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-test-env-config.json +329 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/php-test-env-config.json +540 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-deploy-test-env-config.json +411 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-test-env-config.json +321 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/test-env-config.json +457 -0
- package/ci/common-ci/scripts/modules/51DRestModule/51DRestModule.psm1 +38 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
- package/ci/common-ci/shared-auto-complete-pr-stage.yml +61 -0
- package/ci/common-ci/shared-create-tag-job.yml +23 -0
- package/ci/common-ci/shared-docker-build-steps.yml +34 -0
- package/ci/common-ci/shared-docker-push-steps.yml +32 -0
- package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
- package/ci/common-ci/shared-git-tag-job.yml +38 -0
- package/ci/common-ci/shared-git-version-job.yml +71 -0
- package/ci/common-ci/shared-publish-github-stage.yml +107 -0
- package/ci/common-ci/shared-submodule-trigger-stage.yml +110 -0
- package/ci/common-ci/shared-variables.yml +3 -0
- package/ci/common-ci/trigger-release-apis.yml +39 -0
- package/ci/create-packages.yml +109 -0
- package/ci/deploy-external.yml +55 -0
- package/ci/deploy-internal.yml +50 -0
- package/ci/shared-build-and-test-platforms.yml +26 -0
- package/ci/shared-build-and-test-stage.yml +128 -0
- package/ci/shared-variables.yml +7 -0
- package/ci/submodule-trigger.yml +12 -0
- package/docs/Doxyfile +3 -3
- package/docs/DoxygenLayout.xml +1 -1
- package/examples/examples.test.js +3 -3
- package/geoLocationPipelineBuilder.js +16 -13
- package/package.json +14 -6
- package/setup.js +1 -0
- package/tests/geoLocationCloud.test.js +192 -0
- package/tsconfig.json +21 -0
- package/types/geoLocationCloud.d.ts +7 -0
- package/types/geoLocationPipelineBuilder.d.ts +17 -0
- package/types/index.d.ts +2 -0
- package/build-and-test.yml +0 -112
- package/publish-packages.yml +0 -87
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
- master
|
|
3
|
+
- develop
|
|
4
|
+
- release/*
|
|
5
|
+
|
|
6
|
+
# Don't trigger for a pull request
|
|
7
|
+
pr: none
|
|
8
|
+
|
|
9
|
+
# Include shared variables
|
|
10
|
+
variables:
|
|
11
|
+
- template: shared-variables.yml
|
|
12
|
+
- group: CIAutomation
|
|
13
|
+
# Access token for the git repository. Used by the git tag task.
|
|
14
|
+
- name: system_accesstoken
|
|
15
|
+
value: $(System.AccessToken)
|
|
16
|
+
|
|
17
|
+
resources:
|
|
18
|
+
repositories:
|
|
19
|
+
- repository: ciTemplates # Id of the repository used to reference to in this script
|
|
20
|
+
type: git
|
|
21
|
+
name: common-ci # Name of the actual repository
|
|
22
|
+
|
|
23
|
+
stages:
|
|
24
|
+
|
|
25
|
+
- stage: Publish
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
- template: shared-git-version-job.yml@ciTemplates
|
|
29
|
+
parameters:
|
|
30
|
+
imageName: $(linuxImage)
|
|
31
|
+
|
|
32
|
+
- job: Publish
|
|
33
|
+
displayName: Publish Packages
|
|
34
|
+
dependsOn: Versioning
|
|
35
|
+
condition: and(succeeded(), ne(variables['CreatePackages'], 'Off'))
|
|
36
|
+
|
|
37
|
+
pool:
|
|
38
|
+
vmImage: $(linuxImage)
|
|
39
|
+
|
|
40
|
+
variables:
|
|
41
|
+
- group: PackageFeedAccessToken
|
|
42
|
+
- name: GitVersionSemVer
|
|
43
|
+
value: $[ dependencies.Versioning.outputs['SetGitVersionVars.GitVersionSemVer'] ]
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
# The lines below are needed to allow the pipeline access to the
|
|
47
|
+
# OAuth access token that controls write access to the git repository.
|
|
48
|
+
# (Required for GitTag task)
|
|
49
|
+
- checkout: self
|
|
50
|
+
lfs: true
|
|
51
|
+
submodules: recursive
|
|
52
|
+
persistCredentials: true
|
|
53
|
+
|
|
54
|
+
# Set version number.
|
|
55
|
+
- task: Npm@1
|
|
56
|
+
displayName: 'npm version fiftyone.geolocation'
|
|
57
|
+
inputs:
|
|
58
|
+
command: 'custom'
|
|
59
|
+
workingDir: '$(System.DefaultWorkingDirectory)'
|
|
60
|
+
verbose: true
|
|
61
|
+
customCommand: 'version --no-git-tag-version $(GitVersionSemVer)'
|
|
62
|
+
continueOnError: true
|
|
63
|
+
condition: succeededOrFailed()
|
|
64
|
+
|
|
65
|
+
# Create packages
|
|
66
|
+
- script: |
|
|
67
|
+
npm pack
|
|
68
|
+
displayName: 'Create npm package for later release'
|
|
69
|
+
condition: succeededOrFailed()
|
|
70
|
+
|
|
71
|
+
# Copy artifacts contents.
|
|
72
|
+
- task: CopyFiles@2
|
|
73
|
+
inputs:
|
|
74
|
+
sourceFolder: '$(Build.SourcesDirectory)'
|
|
75
|
+
contents: '**/*.tgz'
|
|
76
|
+
targetFolder: $(Build.ArtifactStagingDirectory)/npm/fiftyone.geolocation
|
|
77
|
+
displayName: 'Copy tgz files'
|
|
78
|
+
condition: succeededOrFailed()
|
|
79
|
+
|
|
80
|
+
- task: CopyFiles@2
|
|
81
|
+
inputs:
|
|
82
|
+
sourceFolder: '$(Build.SourcesDirectory)'
|
|
83
|
+
contents: '**/package.json'
|
|
84
|
+
targetFolder: $(Build.ArtifactStagingDirectory)/npm/fiftyone.geolocation
|
|
85
|
+
displayName: 'Copy package.json files'
|
|
86
|
+
condition: succeededOrFailed()
|
|
87
|
+
|
|
88
|
+
- script: |
|
|
89
|
+
ls $(Build.ArtifactStagingDirectory)/npm/fiftyone.geolocation/*fiftyone.geolocation*.tgz
|
|
90
|
+
if [ $? -ne 0 ]; then
|
|
91
|
+
echo "ERROR: Could not find packed module."
|
|
92
|
+
exit 1
|
|
93
|
+
fi
|
|
94
|
+
displayName: 'List artifact staging contents'
|
|
95
|
+
condition: succeededOrFailed()
|
|
96
|
+
failOnStderr: true
|
|
97
|
+
|
|
98
|
+
# Publish artifacts to DevOps
|
|
99
|
+
- task: PublishBuildArtifacts@1
|
|
100
|
+
inputs:
|
|
101
|
+
pathtoPublish: '$(Build.ArtifactStagingDirectory)/npm'
|
|
102
|
+
artifactName: npm
|
|
103
|
+
displayName: 'Publish npm artifact'
|
|
104
|
+
condition: succeededOrFailed()
|
|
105
|
+
|
|
106
|
+
- template: shared-git-tag-job.yml@ciTemplates
|
|
107
|
+
parameters:
|
|
108
|
+
imageName: $(linuxImage)
|
|
109
|
+
jobDependencies: [Versioning,Publish]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Disable automatic runs of this pipeline when changes are pushed to the repository.
|
|
2
|
+
trigger: none
|
|
3
|
+
|
|
4
|
+
# Disable automatic runs of this pipeline when a PR is create.
|
|
5
|
+
pr: none
|
|
6
|
+
|
|
7
|
+
# Add the pipeline that builds the packages as a resource.
|
|
8
|
+
# This allows the deployment pipeline to be triggered whenever
|
|
9
|
+
# the build pipeline completes.
|
|
10
|
+
resources:
|
|
11
|
+
pipelines:
|
|
12
|
+
- pipeline: build-pipeline # The name for the triggering build pipeline within this script
|
|
13
|
+
source: location-node-create-packages # Name of the pipeline from here: https://51degrees.visualstudio.com/Pipeline/_build
|
|
14
|
+
trigger: true
|
|
15
|
+
repositories:
|
|
16
|
+
- repository: ciTemplates # Id of the repository used to reference to in this script
|
|
17
|
+
type: git
|
|
18
|
+
name: common-ci # Name of the actual repository
|
|
19
|
+
|
|
20
|
+
# Include shared variables
|
|
21
|
+
variables:
|
|
22
|
+
- template: shared-variables.yml
|
|
23
|
+
- name: targetBranch
|
|
24
|
+
value: 'refs/heads/master'
|
|
25
|
+
- group: CIAutomation
|
|
26
|
+
|
|
27
|
+
stages:
|
|
28
|
+
|
|
29
|
+
- stage: publish_npm
|
|
30
|
+
displayName: Publish to NPM
|
|
31
|
+
condition: eq(variables['build.sourceBranch'], variables['targetBranch'])
|
|
32
|
+
jobs:
|
|
33
|
+
- deployment: deploy_npm
|
|
34
|
+
displayName: Deploy to NPM
|
|
35
|
+
pool:
|
|
36
|
+
vmImage: $(linuxImage)
|
|
37
|
+
workspace:
|
|
38
|
+
clean: all
|
|
39
|
+
environment: npm
|
|
40
|
+
strategy:
|
|
41
|
+
runOnce:
|
|
42
|
+
deploy:
|
|
43
|
+
steps:
|
|
44
|
+
|
|
45
|
+
- template: node/shared-extract-and-publish-packages.yml@ciTemplates
|
|
46
|
+
parameters:
|
|
47
|
+
publishConnection: 'NPM publish connection'
|
|
48
|
+
packageName: 'fiftyone.geolocation'
|
|
49
|
+
internalFeedId: $(InternalFeedId)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
- template: shared-publish-github-stage.yml@ciTemplates
|
|
53
|
+
parameters:
|
|
54
|
+
imageName: $(linuxImage)
|
|
55
|
+
branchName: ${{ variables.targetBranch }}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Disable automatic runs of this pipeline when changes are pushed to the repository.
|
|
2
|
+
trigger: none
|
|
3
|
+
|
|
4
|
+
# Disable automatic runs of this pipeline when a PR is create.
|
|
5
|
+
pr: none
|
|
6
|
+
|
|
7
|
+
# Add the pipeline that builds the packages as a resource.
|
|
8
|
+
# This allows the deployment pipeline to be triggered whenever
|
|
9
|
+
# the build pipeline completes.
|
|
10
|
+
resources:
|
|
11
|
+
pipelines:
|
|
12
|
+
- pipeline: build-pipeline # The name for the triggering build pipeline within this script
|
|
13
|
+
source: location-node-create-packages # Name of the pipeline from here: https://51degrees.visualstudio.com/Pipeline/_build
|
|
14
|
+
trigger: true
|
|
15
|
+
repositories:
|
|
16
|
+
- repository: ciTemplates # Id of the repository used to reference to in this script
|
|
17
|
+
type: git
|
|
18
|
+
name: common-ci # Name of the actual repository
|
|
19
|
+
|
|
20
|
+
# Include shared variables
|
|
21
|
+
variables:
|
|
22
|
+
- template: shared-variables.yml
|
|
23
|
+
- name: targetBranch
|
|
24
|
+
value: 'refs/heads/master'
|
|
25
|
+
- group: CIAutomation
|
|
26
|
+
|
|
27
|
+
stages:
|
|
28
|
+
- stage: publish_internal
|
|
29
|
+
displayName: Publish Internal
|
|
30
|
+
jobs:
|
|
31
|
+
# Note - A 'deployment' job will automatically download the artifacts created by the triggering pipeline.
|
|
32
|
+
- deployment: deploy_internal
|
|
33
|
+
displayName: Deploy Internal
|
|
34
|
+
pool:
|
|
35
|
+
vmImage: $(linuxImage)
|
|
36
|
+
workspace:
|
|
37
|
+
clean: all
|
|
38
|
+
environment: packages-internal
|
|
39
|
+
strategy:
|
|
40
|
+
runOnce:
|
|
41
|
+
deploy:
|
|
42
|
+
steps:
|
|
43
|
+
#- bash: 'ls -R "$(PIPELINE.WORKSPACE)"'
|
|
44
|
+
# displayName: 'List files and directories'
|
|
45
|
+
|
|
46
|
+
- template: node/shared-extract-and-publish-packages.yml@ciTemplates
|
|
47
|
+
parameters:
|
|
48
|
+
publishConnection: 'NPM internal'
|
|
49
|
+
packageName: 'fiftyone.geolocation'
|
|
50
|
+
internalFeedId: $(InternalFeedId)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
parameters:
|
|
2
|
+
- name: windowsImage
|
|
3
|
+
- name: linuxImage
|
|
4
|
+
- name: macImage
|
|
5
|
+
- name: runTests
|
|
6
|
+
type: string
|
|
7
|
+
default: 'On'
|
|
8
|
+
|
|
9
|
+
stages:
|
|
10
|
+
- template: shared-build-and-test-stage.yml
|
|
11
|
+
parameters:
|
|
12
|
+
stageName: Windows
|
|
13
|
+
imageName: ${{ parameters.windowsImage }}
|
|
14
|
+
runTests: ${{ parameters.runTests }}
|
|
15
|
+
|
|
16
|
+
- template: shared-build-and-test-stage.yml
|
|
17
|
+
parameters:
|
|
18
|
+
stageName: Linux
|
|
19
|
+
imageName: ${{ parameters.linuxImage }}
|
|
20
|
+
runTests: ${{ parameters.runTests }}
|
|
21
|
+
|
|
22
|
+
- template: shared-build-and-test-stage.yml
|
|
23
|
+
parameters:
|
|
24
|
+
stageName: MacOS
|
|
25
|
+
imageName: ${{ parameters.macImage }}
|
|
26
|
+
runTests: ${{ parameters.runTests }}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
parameters:
|
|
2
|
+
- name: stageName
|
|
3
|
+
- name: imageName
|
|
4
|
+
- name: runTests
|
|
5
|
+
type: string
|
|
6
|
+
default: 'On'
|
|
7
|
+
|
|
8
|
+
stages:
|
|
9
|
+
- stage: ${{ parameters.stageName }}
|
|
10
|
+
dependsOn: []
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
- job: Build_and_Test
|
|
14
|
+
displayName: Build and Test
|
|
15
|
+
condition: ne(${{ parameters.runTests }}, 'Off')
|
|
16
|
+
|
|
17
|
+
pool:
|
|
18
|
+
vmImage: ${{ parameters.imageName }}
|
|
19
|
+
|
|
20
|
+
variables:
|
|
21
|
+
- group: InternalKeys
|
|
22
|
+
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
node_10_x:
|
|
26
|
+
node_version: 10.x
|
|
27
|
+
node_12_x:
|
|
28
|
+
node_version: 12.x
|
|
29
|
+
node_14_x:
|
|
30
|
+
node_version: 14.x
|
|
31
|
+
node_16_x:
|
|
32
|
+
node_version: 16.x
|
|
33
|
+
maxParallel: 1
|
|
34
|
+
|
|
35
|
+
steps:
|
|
36
|
+
- checkout: self
|
|
37
|
+
lfs: true
|
|
38
|
+
submodules: recursive
|
|
39
|
+
|
|
40
|
+
- task: NodeTool@0
|
|
41
|
+
inputs:
|
|
42
|
+
versionSpec: $(node_version)
|
|
43
|
+
displayName: 'Install Node.js'
|
|
44
|
+
|
|
45
|
+
# The secure file to download will be stored in the
|
|
46
|
+
# Pipelines/Library/SecureFiles section in Azure DevOps.
|
|
47
|
+
- task: DownloadSecureFile@1
|
|
48
|
+
displayName: 'Download .npmrc'
|
|
49
|
+
name: npmrc
|
|
50
|
+
inputs:
|
|
51
|
+
secureFile: '.npmrc'
|
|
52
|
+
|
|
53
|
+
- task: CopyFiles@2
|
|
54
|
+
displayName: 'Copy .npmrc to working directory'
|
|
55
|
+
inputs:
|
|
56
|
+
sourceFolder: '$(Agent.TempDirectory)'
|
|
57
|
+
targetFolder: '$(System.DefaultWorkingDirectory)'
|
|
58
|
+
contents: '.npmrc'
|
|
59
|
+
|
|
60
|
+
# 1. Set resource key environment variable from location resource key value
|
|
61
|
+
# in 'InternalKeys' group
|
|
62
|
+
# 2. Install dependencies.
|
|
63
|
+
# 3. Run tests.
|
|
64
|
+
# TODO: Remove specific device detection version once 4.3.3 released
|
|
65
|
+
- bash: |
|
|
66
|
+
echo "Resource key for testing = $(SuperResourceKey)"
|
|
67
|
+
export RESOURCE_KEY="$(SuperResourceKey)"
|
|
68
|
+
echo "Cloud endpoint for testing = $(FOD_CLOUD_API_URL)"
|
|
69
|
+
export FOD_CLOUD_API_URL="$(FOD_CLOUD_API_URL)"
|
|
70
|
+
npm install
|
|
71
|
+
npm install fiftyone.devicedetection@4.3.3-beta.1
|
|
72
|
+
npm test
|
|
73
|
+
displayName: 'Build and Test'
|
|
74
|
+
|
|
75
|
+
- bash: |
|
|
76
|
+
eslint='{
|
|
77
|
+
"env": {
|
|
78
|
+
"browser": true,
|
|
79
|
+
"commonjs": true,
|
|
80
|
+
"es6": true
|
|
81
|
+
},
|
|
82
|
+
"extends": [
|
|
83
|
+
"standard"
|
|
84
|
+
],
|
|
85
|
+
"globals": {
|
|
86
|
+
"Atomics": "readonly",
|
|
87
|
+
"SharedArrayBuffer": "readonly",
|
|
88
|
+
"test": true,
|
|
89
|
+
"jest": true,
|
|
90
|
+
"expect": true,
|
|
91
|
+
"resourceKey": true
|
|
92
|
+
},
|
|
93
|
+
"parserOptions": {
|
|
94
|
+
"ecmaVersion": 2018
|
|
95
|
+
},
|
|
96
|
+
"rules": {
|
|
97
|
+
"node/no-deprecated-api": "off",
|
|
98
|
+
"no-throw-literal": "off",
|
|
99
|
+
"no-path-concat": "off",
|
|
100
|
+
"no-prototype-builtins": "off",
|
|
101
|
+
"no-eval": "off",
|
|
102
|
+
"semi": [
|
|
103
|
+
2,
|
|
104
|
+
"always"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}'
|
|
108
|
+
echo $eslint
|
|
109
|
+
echo $eslint > .eslintrc
|
|
110
|
+
npm install -g eslint@6.8.0
|
|
111
|
+
eslint '**/*.js'
|
|
112
|
+
displayName: "Set up and run eslint"
|
|
113
|
+
condition: ne(variables['node_version'], '6.x')
|
|
114
|
+
failOnStderr: true
|
|
115
|
+
|
|
116
|
+
- task: PublishTestResults@2
|
|
117
|
+
condition: succeededOrFailed()
|
|
118
|
+
inputs:
|
|
119
|
+
testRunner: JUnit
|
|
120
|
+
testResultsFiles: '**/test_results.xml'
|
|
121
|
+
testRunTitle: 'Node $(node_version) ${{ parameters.stageName }}'
|
|
122
|
+
|
|
123
|
+
- task: PublishCodeCoverageResults@1
|
|
124
|
+
inputs:
|
|
125
|
+
codeCoverageTool: Cobertura
|
|
126
|
+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
|
|
127
|
+
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
|
|
128
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
trigger: none
|
|
2
|
+
|
|
3
|
+
pr: none
|
|
4
|
+
|
|
5
|
+
resources:
|
|
6
|
+
repositories:
|
|
7
|
+
- repository: ciTemplates # Id of the repository used to reference to in this script
|
|
8
|
+
type: git
|
|
9
|
+
name: common-ci # Name of the actual repository
|
|
10
|
+
|
|
11
|
+
stages:
|
|
12
|
+
- template: shared-submodule-trigger-stage.yml@ciTemplates
|
package/docs/Doxyfile
CHANGED
|
@@ -38,7 +38,7 @@ PROJECT_NAME = "51Degrees Geo-Location Node.js"
|
|
|
38
38
|
# could be handy for archiving the generated documentation or if some version
|
|
39
39
|
# control system is used.
|
|
40
40
|
|
|
41
|
-
PROJECT_NUMBER = 4.
|
|
41
|
+
PROJECT_NUMBER = 4.3
|
|
42
42
|
|
|
43
43
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
|
44
44
|
# for a project that appears at the top of each page and should give viewer a
|
|
@@ -56,7 +56,7 @@ PROJECT_LOGO = ../../../docs/images/logo-51Degrees-Docs.png
|
|
|
56
56
|
# The PROJECT_URL tag is used to specify the URL which is linked by the
|
|
57
57
|
# PROJECT_LOGO.
|
|
58
58
|
|
|
59
|
-
PROJECT_URL = ../../documentation/4.
|
|
59
|
+
PROJECT_URL = ../../documentation/4.3/index.html
|
|
60
60
|
|
|
61
61
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
|
62
62
|
# into which the generated documentation will be written. If a relative path is
|
|
@@ -1101,7 +1101,7 @@ GENERATE_HTML = YES
|
|
|
1101
1101
|
# The default directory is: html.
|
|
1102
1102
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
|
1103
1103
|
|
|
1104
|
-
HTML_OUTPUT = 4.
|
|
1104
|
+
HTML_OUTPUT = 4.3
|
|
1105
1105
|
|
|
1106
1106
|
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
|
|
1107
1107
|
# generated HTML page (for example: .htm, .php, .asp).
|
package/docs/DoxygenLayout.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!-- Generated by doxygen 1.8.15 -->
|
|
3
3
|
<!-- Navigation index tabs for HTML output -->
|
|
4
4
|
<navindex>
|
|
5
|
-
<tab type="user" visible="yes" title="General Docs" url="../../documentation/4.
|
|
5
|
+
<tab type="user" visible="yes" title="General Docs" url="../../documentation/4.3/index.html"/>
|
|
6
6
|
<tab type="pages" visible="yes" title="" intro=""/>
|
|
7
7
|
<tab type="classlist" visible="yes" title="Classes" intro="51Degrees Node.js classes. These contain the interfaces and logic of the geo-location engines."/>
|
|
8
8
|
<tab type="examples" visible="yes" title="Examples" intro="51Degrees geo-location examples."/>
|
|
@@ -61,17 +61,17 @@ try {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (isAsync) {
|
|
64
|
-
test('cloud getting started', (done) => {
|
|
64
|
+
test('cloud getting started', async (done) => {
|
|
65
65
|
setTimeout(done, 1000);
|
|
66
66
|
|
|
67
67
|
testExample({ file: (__dirname) + '/gettingStarted.js' });
|
|
68
68
|
});
|
|
69
|
-
test('combining services', (done) => {
|
|
69
|
+
test('combining services', async (done) => {
|
|
70
70
|
setTimeout(done, 1000);
|
|
71
71
|
|
|
72
72
|
testExample({ file: (__dirname) + '/combiningServices.js' });
|
|
73
73
|
});
|
|
74
|
-
test('configure from file', (done) => {
|
|
74
|
+
test('configure from file', async (done) => {
|
|
75
75
|
setTimeout(done, 1000);
|
|
76
76
|
|
|
77
77
|
testExample({ file: (__dirname) + '/configureFromFile.js' });
|
|
@@ -20,18 +20,10 @@
|
|
|
20
20
|
* such notice(s) shall fulfill the requirements of that article.
|
|
21
21
|
* ********************************************************************* */
|
|
22
22
|
|
|
23
|
-
const require51 = (requestedPackage) => {
|
|
24
|
-
try {
|
|
25
|
-
return require(__dirname + '/../' + requestedPackage);
|
|
26
|
-
} catch (e) {
|
|
27
|
-
return require(requestedPackage);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
23
|
const GeoLocationCloud = require('./geoLocationCloud');
|
|
32
|
-
const CloudRequestEngine =
|
|
33
|
-
const PipelineBuilder =
|
|
34
|
-
const ShareUsageElement =
|
|
24
|
+
const CloudRequestEngine = require('fiftyone.pipeline.cloudrequestengine').CloudRequestEngine;
|
|
25
|
+
const PipelineBuilder = require('fiftyone.pipeline.core').PipelineBuilder;
|
|
26
|
+
const ShareUsageElement = require('fiftyone.pipeline.engines.fiftyone').ShareUsage;
|
|
35
27
|
|
|
36
28
|
class GeoLocationPipelineBuilder extends PipelineBuilder {
|
|
37
29
|
/**
|
|
@@ -40,9 +32,17 @@ class GeoLocationPipelineBuilder extends PipelineBuilder {
|
|
|
40
32
|
* @param {Boolean} options.shareUsage // include share usage element?
|
|
41
33
|
* @param {String} options.resourceKey // resourceKey for cloud
|
|
42
34
|
* @param {String} options.locationProvider // the provider to request data from. Either "fiftyonedegrees" or "digitalelement".
|
|
35
|
+
* @param {string} options.cloudRequestOrigin The value to set the
|
|
36
|
+
* Origin header to when making requests to the cloud service
|
|
43
37
|
*
|
|
44
38
|
*/
|
|
45
|
-
constructor ({
|
|
39
|
+
constructor ({
|
|
40
|
+
shareUsage = true,
|
|
41
|
+
resourceKey = null,
|
|
42
|
+
locationProvider = 'fiftyonedegrees',
|
|
43
|
+
baseURL = null,
|
|
44
|
+
cloudRequestOrigin = null
|
|
45
|
+
}) {
|
|
46
46
|
super(...arguments);
|
|
47
47
|
|
|
48
48
|
// Check if share usage enabled and add it to the pipeline if so
|
|
@@ -53,7 +53,10 @@ class GeoLocationPipelineBuilder extends PipelineBuilder {
|
|
|
53
53
|
|
|
54
54
|
// First we need the cloudRequestEngine
|
|
55
55
|
|
|
56
|
-
const cloudRequestEngineOptions = {
|
|
56
|
+
const cloudRequestEngineOptions = {
|
|
57
|
+
resourceKey: resourceKey,
|
|
58
|
+
cloudRequestOrigin: cloudRequestOrigin
|
|
59
|
+
};
|
|
57
60
|
if (baseURL !== null) {
|
|
58
61
|
cloudRequestEngineOptions.baseURL = baseURL;
|
|
59
62
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fiftyone.geolocation",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "Geo-location services for the 51Degrees Pipeline API",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
6
7
|
"directories": {
|
|
7
8
|
"test": "tests"
|
|
8
9
|
},
|
|
@@ -16,19 +17,21 @@
|
|
|
16
17
|
"Joseph Dix <joseph@51degrees.com> (https://51degrees.com)"
|
|
17
18
|
],
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"fiftyone.pipeline.cloudrequestengine": "^4.
|
|
20
|
-
"fiftyone.pipeline.core": "^4.
|
|
21
|
-
"fiftyone.pipeline.engines": "^4.
|
|
22
|
-
"fiftyone.pipeline.engines.fiftyone": "^4.
|
|
20
|
+
"fiftyone.pipeline.cloudrequestengine": "^4.3.5",
|
|
21
|
+
"fiftyone.pipeline.core": "^4.3.5",
|
|
22
|
+
"fiftyone.pipeline.engines": "^4.3.5",
|
|
23
|
+
"fiftyone.pipeline.engines.fiftyone": "^4.3.5"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
26
|
+
"@types/node": "^15.12.2",
|
|
25
27
|
"eslint": "^6.8.0",
|
|
26
28
|
"eslint-config-standard": "^14.1.1",
|
|
27
29
|
"eslint-plugin-import": "^2.22.0",
|
|
28
30
|
"eslint-plugin-node": "^11.1.0",
|
|
29
31
|
"eslint-plugin-promise": "^4.2.1",
|
|
30
32
|
"eslint-plugin-standard": "^4.0.1",
|
|
31
|
-
"jest": "^
|
|
33
|
+
"jest": "^27.0.6",
|
|
34
|
+
"jest-expect-message": "^1.0.2",
|
|
32
35
|
"jest-junit": "^9.0.0"
|
|
33
36
|
},
|
|
34
37
|
"license": "EUPL-1.2",
|
|
@@ -39,6 +42,11 @@
|
|
|
39
42
|
"outputName": "test_results.xml"
|
|
40
43
|
},
|
|
41
44
|
"jest": {
|
|
45
|
+
"testRunner": "jest-jasmine2",
|
|
46
|
+
"setupFilesAfterEnv": [
|
|
47
|
+
"./setup.js",
|
|
48
|
+
"jest-expect-message"
|
|
49
|
+
],
|
|
42
50
|
"globals": {
|
|
43
51
|
"resourceKey": "!!YOUR_RESOURCE_KEY!!"
|
|
44
52
|
}
|
package/setup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jest.setTimeout(10000); // in milliseconds
|