fiftyone.geolocation 4.3.0 → 4.3.5
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/ci/build-and-test.yml +21 -0
- package/ci/common-ci/.github/labels.yml +80 -0
- package/ci/common-ci/.github/workflows/sync-labels.yml +52 -0
- package/ci/common-ci/CiTips.md +30 -1
- package/ci/common-ci/GitVersion.yml +18 -0
- package/ci/common-ci/README.md +155 -17
- package/ci/common-ci/build-and-test.yml +65 -0
- package/ci/common-ci/check-merge-commit-format.yml +56 -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 +16 -2
- 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-package-signing-steps.yml +17 -0
- package/ci/{shared-extract-and-publish-packages.yml → common-ci/node/shared-extract-and-publish-packages.yml} +7 -1
- 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 +89 -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 +74 -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 +702 -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 +19 -30
- 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 +69 -60
- 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 +24 -36
- package/ci/deploy-external.yml +55 -0
- package/ci/{deploy.yml → deploy-internal.yml} +3 -29
- package/ci/shared-build-and-test-platforms.yml +7 -1
- package/ci/shared-build-and-test-stage.yml +9 -2
- package/ci/submodule-trigger.yml +12 -0
- package/examples/examples.test.js +3 -3
- package/geoLocationPipelineBuilder.js +13 -10
- package/package.json +11 -7
- package/setup.js +1 -0
package/ci/create-packages.yml
CHANGED
|
@@ -6,40 +6,41 @@ trigger:
|
|
|
6
6
|
# Don't trigger for a pull request
|
|
7
7
|
pr: none
|
|
8
8
|
|
|
9
|
-
# Schedule to run overnight
|
|
10
|
-
schedules:
|
|
11
|
-
- cron: "0 20 * * *"
|
|
12
|
-
displayName: Daily overnight build
|
|
13
|
-
branches:
|
|
14
|
-
include:
|
|
15
|
-
- develop
|
|
16
|
-
|
|
17
9
|
# Include shared variables
|
|
18
10
|
variables:
|
|
19
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
|
|
20
22
|
|
|
21
23
|
stages:
|
|
22
|
-
- template: shared-build-and-test-platforms.yml
|
|
23
|
-
parameters:
|
|
24
|
-
windowsImage: $(windowsImage)
|
|
25
|
-
linuxImage: $(linuxImage)
|
|
26
|
-
macImage: $(macImage)
|
|
27
24
|
|
|
28
25
|
- stage: Publish
|
|
29
|
-
dependsOn: [Windows,Linux,MacOS]
|
|
30
26
|
|
|
31
27
|
jobs:
|
|
28
|
+
- template: shared-git-version-job.yml@ciTemplates
|
|
29
|
+
parameters:
|
|
30
|
+
imageName: $(linuxImage)
|
|
31
|
+
|
|
32
32
|
- job: Publish
|
|
33
33
|
displayName: Publish Packages
|
|
34
|
+
dependsOn: Versioning
|
|
35
|
+
condition: and(succeeded(), ne(variables['CreatePackages'], 'Off'))
|
|
34
36
|
|
|
35
37
|
pool:
|
|
36
38
|
vmImage: $(linuxImage)
|
|
37
39
|
|
|
38
40
|
variables:
|
|
39
41
|
- group: PackageFeedAccessToken
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
value: $(System.AccessToken)
|
|
42
|
+
- name: GitVersionSemVer
|
|
43
|
+
value: $[ dependencies.Versioning.outputs['SetGitVersionVars.GitVersionSemVer'] ]
|
|
43
44
|
|
|
44
45
|
steps:
|
|
45
46
|
# The lines below are needed to allow the pipeline access to the
|
|
@@ -50,13 +51,6 @@ stages:
|
|
|
50
51
|
submodules: recursive
|
|
51
52
|
persistCredentials: true
|
|
52
53
|
|
|
53
|
-
- task: gittools.gitversion.gitversion-task.GitVersion@5
|
|
54
|
-
displayName: 'Determine Version Number'
|
|
55
|
-
# Give this task a name so we can use the variables it sets later.
|
|
56
|
-
name: GitVersion
|
|
57
|
-
inputs:
|
|
58
|
-
preferBundledVersion: false
|
|
59
|
-
|
|
60
54
|
# Set version number.
|
|
61
55
|
- task: Npm@1
|
|
62
56
|
displayName: 'npm version fiftyone.geolocation'
|
|
@@ -64,7 +58,7 @@ stages:
|
|
|
64
58
|
command: 'custom'
|
|
65
59
|
workingDir: '$(System.DefaultWorkingDirectory)'
|
|
66
60
|
verbose: true
|
|
67
|
-
customCommand: 'version --no-git-tag-version $(
|
|
61
|
+
customCommand: 'version --no-git-tag-version $(GitVersionSemVer)'
|
|
68
62
|
continueOnError: true
|
|
69
63
|
condition: succeededOrFailed()
|
|
70
64
|
|
|
@@ -101,17 +95,6 @@ stages:
|
|
|
101
95
|
condition: succeededOrFailed()
|
|
102
96
|
failOnStderr: true
|
|
103
97
|
|
|
104
|
-
# Add a tag to the git repository with the version number of
|
|
105
|
-
# the package that has just been published
|
|
106
|
-
- task: ATP.ATP-GitTag.GitTag.GitTag@5
|
|
107
|
-
displayName: 'Tag Repo With Version Number'
|
|
108
|
-
inputs:
|
|
109
|
-
tagUser: 'Azure DevOps'
|
|
110
|
-
tagEmail: 'CIUser@51Degrees.com'
|
|
111
|
-
# Only create the tag if we also published a package as defined in
|
|
112
|
-
# the previous task.
|
|
113
|
-
condition: succeeded()
|
|
114
|
-
|
|
115
98
|
# Publish artifacts to DevOps
|
|
116
99
|
- task: PublishBuildArtifacts@1
|
|
117
100
|
inputs:
|
|
@@ -119,3 +102,8 @@ stages:
|
|
|
119
102
|
artifactName: npm
|
|
120
103
|
displayName: 'Publish npm artifact'
|
|
121
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 }}
|
|
@@ -22,6 +22,7 @@ variables:
|
|
|
22
22
|
- template: shared-variables.yml
|
|
23
23
|
- name: targetBranch
|
|
24
24
|
value: 'refs/heads/master'
|
|
25
|
+
- group: CIAutomation
|
|
25
26
|
|
|
26
27
|
stages:
|
|
27
28
|
- stage: publish_internal
|
|
@@ -42,35 +43,8 @@ stages:
|
|
|
42
43
|
#- bash: 'ls -R "$(PIPELINE.WORKSPACE)"'
|
|
43
44
|
# displayName: 'List files and directories'
|
|
44
45
|
|
|
45
|
-
- template: shared-extract-and-publish-packages.yml
|
|
46
|
+
- template: node/shared-extract-and-publish-packages.yml@ciTemplates
|
|
46
47
|
parameters:
|
|
47
48
|
publishConnection: 'NPM internal'
|
|
48
49
|
packageName: 'fiftyone.geolocation'
|
|
49
|
-
|
|
50
|
-
- stage: publish_npm
|
|
51
|
-
displayName: Publish to NPM
|
|
52
|
-
dependsOn: []
|
|
53
|
-
condition: eq(variables['build.sourceBranch'], variables['targetBranch'])
|
|
54
|
-
jobs:
|
|
55
|
-
- deployment: deploy_npm
|
|
56
|
-
displayName: Deploy to NPM
|
|
57
|
-
pool:
|
|
58
|
-
vmImage: $(linuxImage)
|
|
59
|
-
workspace:
|
|
60
|
-
clean: all
|
|
61
|
-
environment: npm
|
|
62
|
-
strategy:
|
|
63
|
-
runOnce:
|
|
64
|
-
deploy:
|
|
65
|
-
steps:
|
|
66
|
-
|
|
67
|
-
- template: shared-extract-and-publish-packages.yml
|
|
68
|
-
parameters:
|
|
69
|
-
publishConnection: 'NPM publish connection'
|
|
70
|
-
packageName: 'fiftyone.geolocation'
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- template: shared-publish-github-stage.yml@ciTemplates
|
|
74
|
-
parameters:
|
|
75
|
-
imageName: $(linuxImage)
|
|
76
|
-
branchName: ${{ variables.targetBranch }}
|
|
50
|
+
internalFeedId: $(InternalFeedId)
|
|
@@ -2,19 +2,25 @@ parameters:
|
|
|
2
2
|
- name: windowsImage
|
|
3
3
|
- name: linuxImage
|
|
4
4
|
- name: macImage
|
|
5
|
+
- name: runTests
|
|
6
|
+
type: string
|
|
7
|
+
default: 'On'
|
|
5
8
|
|
|
6
9
|
stages:
|
|
7
10
|
- template: shared-build-and-test-stage.yml
|
|
8
11
|
parameters:
|
|
9
12
|
stageName: Windows
|
|
10
13
|
imageName: ${{ parameters.windowsImage }}
|
|
14
|
+
runTests: ${{ parameters.runTests }}
|
|
11
15
|
|
|
12
16
|
- template: shared-build-and-test-stage.yml
|
|
13
17
|
parameters:
|
|
14
18
|
stageName: Linux
|
|
15
19
|
imageName: ${{ parameters.linuxImage }}
|
|
20
|
+
runTests: ${{ parameters.runTests }}
|
|
16
21
|
|
|
17
22
|
- template: shared-build-and-test-stage.yml
|
|
18
23
|
parameters:
|
|
19
24
|
stageName: MacOS
|
|
20
|
-
imageName: ${{ parameters.macImage }}
|
|
25
|
+
imageName: ${{ parameters.macImage }}
|
|
26
|
+
runTests: ${{ parameters.runTests }}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
parameters:
|
|
2
2
|
- name: stageName
|
|
3
3
|
- name: imageName
|
|
4
|
+
- name: runTests
|
|
5
|
+
type: string
|
|
6
|
+
default: 'On'
|
|
4
7
|
|
|
5
8
|
stages:
|
|
6
9
|
- stage: ${{ parameters.stageName }}
|
|
@@ -9,6 +12,7 @@ stages:
|
|
|
9
12
|
jobs:
|
|
10
13
|
- job: Build_and_Test
|
|
11
14
|
displayName: Build and Test
|
|
15
|
+
condition: ne(${{ parameters.runTests }}, 'Off')
|
|
12
16
|
|
|
13
17
|
pool:
|
|
14
18
|
vmImage: ${{ parameters.imageName }}
|
|
@@ -24,6 +28,8 @@ stages:
|
|
|
24
28
|
node_version: 12.x
|
|
25
29
|
node_14_x:
|
|
26
30
|
node_version: 14.x
|
|
31
|
+
node_16_x:
|
|
32
|
+
node_version: 16.x
|
|
27
33
|
maxParallel: 1
|
|
28
34
|
|
|
29
35
|
steps:
|
|
@@ -55,13 +61,14 @@ stages:
|
|
|
55
61
|
# in 'InternalKeys' group
|
|
56
62
|
# 2. Install dependencies.
|
|
57
63
|
# 3. Run tests.
|
|
64
|
+
# TODO: Remove specific device detection version once 4.3.3 released
|
|
58
65
|
- bash: |
|
|
59
66
|
echo "Resource key for testing = $(SuperResourceKey)"
|
|
60
67
|
export RESOURCE_KEY="$(SuperResourceKey)"
|
|
61
68
|
echo "Cloud endpoint for testing = $(FOD_CLOUD_API_URL)"
|
|
62
69
|
export FOD_CLOUD_API_URL="$(FOD_CLOUD_API_URL)"
|
|
63
70
|
npm install
|
|
64
|
-
npm install fiftyone.devicedetection
|
|
71
|
+
npm install fiftyone.devicedetection@4.3.3-beta.1
|
|
65
72
|
npm test
|
|
66
73
|
displayName: 'Build and Test'
|
|
67
74
|
|
|
@@ -101,7 +108,7 @@ stages:
|
|
|
101
108
|
echo $eslint
|
|
102
109
|
echo $eslint > .eslintrc
|
|
103
110
|
npm install -g eslint@6.8.0
|
|
104
|
-
eslint **/*.js
|
|
111
|
+
eslint '**/*.js'
|
|
105
112
|
displayName: "Set up and run eslint"
|
|
106
113
|
condition: ne(variables['node_version'], '6.x')
|
|
107
114
|
failOnStderr: true
|
|
@@ -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
|
|
@@ -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,14 +20,6 @@
|
|
|
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
24
|
const CloudRequestEngine = require('fiftyone.pipeline.cloudrequestengine').CloudRequestEngine;
|
|
33
25
|
const PipelineBuilder = require('fiftyone.pipeline.core').PipelineBuilder;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fiftyone.geolocation",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
4
4
|
"description": "Geo-location services for the 51Degrees Pipeline API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"Joseph Dix <joseph@51degrees.com> (https://51degrees.com)"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"fiftyone.pipeline.cloudrequestengine": "^4.3.
|
|
21
|
-
"fiftyone.pipeline.core": "^4.3.
|
|
22
|
-
"fiftyone.pipeline.engines": "^4.3.
|
|
23
|
-
"fiftyone.pipeline.engines.fiftyone": "^4.3.
|
|
20
|
+
"fiftyone.pipeline.cloudrequestengine": "^4.3.6",
|
|
21
|
+
"fiftyone.pipeline.core": "^4.3.6",
|
|
22
|
+
"fiftyone.pipeline.engines": "^4.3.6",
|
|
23
|
+
"fiftyone.pipeline.engines.fiftyone": "^4.3.6"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^15.12.2",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"eslint-plugin-node": "^11.1.0",
|
|
31
31
|
"eslint-plugin-promise": "^4.2.1",
|
|
32
32
|
"eslint-plugin-standard": "^4.0.1",
|
|
33
|
-
"jest": "^
|
|
33
|
+
"jest": "^27.0.6",
|
|
34
34
|
"jest-expect-message": "^1.0.2",
|
|
35
35
|
"jest-junit": "^9.0.0"
|
|
36
36
|
},
|
|
@@ -42,7 +42,11 @@
|
|
|
42
42
|
"outputName": "test_results.xml"
|
|
43
43
|
},
|
|
44
44
|
"jest": {
|
|
45
|
-
"
|
|
45
|
+
"testRunner": "jest-jasmine2",
|
|
46
|
+
"setupFilesAfterEnv": [
|
|
47
|
+
"./setup.js",
|
|
48
|
+
"jest-expect-message"
|
|
49
|
+
],
|
|
46
50
|
"globals": {
|
|
47
51
|
"resourceKey": "!!YOUR_RESOURCE_KEY!!"
|
|
48
52
|
}
|
package/setup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jest.setTimeout(10000); // in milliseconds
|