@vannizhang/living-atlas-content-validator 1.0.0
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/LICENSE +101 -0
- package/README.md +196 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/accessInformation/isValidAccessInformation.d.ts +10 -0
- package/dist/lib/accessInformation/isValidAccessInformation.js +48 -0
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -0
- package/dist/lib/accessInformation/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/accessInformation/scoringRulesConfig.js +37 -0
- package/dist/lib/accessInformation/scoringRulesConfig.js.map +1 -0
- package/dist/lib/config.d.ts +6 -0
- package/dist/lib/config.js +61 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/description/isValidDescription.d.ts +18 -0
- package/dist/lib/description/isValidDescription.js +95 -0
- package/dist/lib/description/isValidDescription.js.map +1 -0
- package/dist/lib/description/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/description/scoringRulesConfig.js +49 -0
- package/dist/lib/description/scoringRulesConfig.js.map +1 -0
- package/dist/lib/layers/isValidLayerCount.d.ts +12 -0
- package/dist/lib/layers/isValidLayerCount.js +148 -0
- package/dist/lib/layers/isValidLayerCount.js.map +1 -0
- package/dist/lib/layers/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/layers/scoringRulesConfig.js +49 -0
- package/dist/lib/layers/scoringRulesConfig.js.map +1 -0
- package/dist/lib/licenseInfo/isValidLicenseInfo.d.ts +36 -0
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +108 -0
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -0
- package/dist/lib/licenseInfo/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/licenseInfo/scoringRulesConfig.js +49 -0
- package/dist/lib/licenseInfo/scoringRulesConfig.js.map +1 -0
- package/dist/lib/sharing/isValidAccess.d.ts +22 -0
- package/dist/lib/sharing/isValidAccess.js +79 -0
- package/dist/lib/sharing/isValidAccess.js.map +1 -0
- package/dist/lib/sharing/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/sharing/scoringRulesConfig.js +49 -0
- package/dist/lib/sharing/scoringRulesConfig.js.map +1 -0
- package/dist/lib/ssl/isValidSSL.d.ts +14 -0
- package/dist/lib/ssl/isValidSSL.js +62 -0
- package/dist/lib/ssl/isValidSSL.js.map +1 -0
- package/dist/lib/ssl/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/ssl/scoringRulesConfig.js +43 -0
- package/dist/lib/ssl/scoringRulesConfig.js.map +1 -0
- package/dist/lib/summary/isValidSummary.d.ts +17 -0
- package/dist/lib/summary/isValidSummary.js +114 -0
- package/dist/lib/summary/isValidSummary.js.map +1 -0
- package/dist/lib/summary/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/summary/scoringRulesConfig.js +55 -0
- package/dist/lib/summary/scoringRulesConfig.js.map +1 -0
- package/dist/lib/tags/isValidTags.d.ts +14 -0
- package/dist/lib/tags/isValidTags.js +82 -0
- package/dist/lib/tags/isValidTags.js.map +1 -0
- package/dist/lib/tags/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/tags/scoringRulesConfig.js +43 -0
- package/dist/lib/tags/scoringRulesConfig.js.map +1 -0
- package/dist/lib/thumbnail/isValidThumbnail.d.ts +10 -0
- package/dist/lib/thumbnail/isValidThumbnail.js +90 -0
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -0
- package/dist/lib/thumbnail/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/thumbnail/scoringRulesConfig.js +43 -0
- package/dist/lib/thumbnail/scoringRulesConfig.js.map +1 -0
- package/dist/lib/title/isValidTitle.d.ts +23 -0
- package/dist/lib/title/isValidTitle.js +128 -0
- package/dist/lib/title/isValidTitle.js.map +1 -0
- package/dist/lib/title/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/title/scoringRulesConfig.js +54 -0
- package/dist/lib/title/scoringRulesConfig.js.map +1 -0
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.d.ts +23 -0
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +138 -0
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -0
- package/dist/lib/userProfileDescription/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/userProfileDescription/scoringRulesConfig.js +61 -0
- package/dist/lib/userProfileDescription/scoringRulesConfig.js.map +1 -0
- package/dist/lib/userProfileName/isValidUserProfileName.d.ts +10 -0
- package/dist/lib/userProfileName/isValidUserProfileName.js +60 -0
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -0
- package/dist/lib/userProfileName/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/userProfileName/scoringRulesConfig.js +43 -0
- package/dist/lib/userProfileName/scoringRulesConfig.js.map +1 -0
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.d.ts +22 -0
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +62 -0
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -0
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.d.ts +3 -0
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js +37 -0
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js.map +1 -0
- package/dist/lib/util/assertString.d.ts +11 -0
- package/dist/lib/util/assertString.js +20 -0
- package/dist/lib/util/assertString.js.map +1 -0
- package/dist/lib/util/contains.d.ts +7 -0
- package/dist/lib/util/contains.js +17 -0
- package/dist/lib/util/contains.js.map +1 -0
- package/dist/lib/util/getNumberOfStrings.d.ts +6 -0
- package/dist/lib/util/getNumberOfStrings.js +25 -0
- package/dist/lib/util/getNumberOfStrings.js.map +1 -0
- package/dist/lib/util/getScoringRules.d.ts +21 -0
- package/dist/lib/util/getScoringRules.js +99 -0
- package/dist/lib/util/getScoringRules.js.map +1 -0
- package/dist/lib/util/getThumbnailFileName.d.ts +15 -0
- package/dist/lib/util/getThumbnailFileName.js +26 -0
- package/dist/lib/util/getThumbnailFileName.js.map +1 -0
- package/dist/lib/util/isArcGISDomain.d.ts +6 -0
- package/dist/lib/util/isArcGISDomain.js +16 -0
- package/dist/lib/util/isArcGISDomain.js.map +1 -0
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.d.ts +6 -0
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js +19 -0
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js.map +1 -0
- package/dist/lib/util/isDefined.d.ts +8 -0
- package/dist/lib/util/isDefined.js +15 -0
- package/dist/lib/util/isDefined.js.map +1 -0
- package/dist/lib/util/isEmail.d.ts +6 -0
- package/dist/lib/util/isEmail.js +14 -0
- package/dist/lib/util/isEmail.js.map +1 -0
- package/dist/lib/util/isEmpty.d.ts +6 -0
- package/dist/lib/util/isEmpty.js +17 -0
- package/dist/lib/util/isEmpty.js.map +1 -0
- package/dist/lib/util/isFeatureCollection.d.ts +7 -0
- package/dist/lib/util/isFeatureCollection.js +13 -0
- package/dist/lib/util/isFeatureCollection.js.map +1 -0
- package/dist/lib/util/isHosted.d.ts +7 -0
- package/dist/lib/util/isHosted.js +17 -0
- package/dist/lib/util/isHosted.js.map +1 -0
- package/dist/lib/util/isSecureProtocol.d.ts +6 -0
- package/dist/lib/util/isSecureProtocol.js +16 -0
- package/dist/lib/util/isSecureProtocol.js.map +1 -0
- package/dist/lib/util/isUppercase.d.ts +4 -0
- package/dist/lib/util/isUppercase.js +14 -0
- package/dist/lib/util/isUppercase.js.map +1 -0
- package/dist/lib/util/isUrl.d.ts +4 -0
- package/dist/lib/util/isUrl.js +12 -0
- package/dist/lib/util/isUrl.js.map +1 -0
- package/dist/lib/util/matches.d.ts +12 -0
- package/dist/lib/util/matches.js +22 -0
- package/dist/lib/util/matches.js.map +1 -0
- package/dist/lib/util/stringsConfig.d.ts +17 -0
- package/dist/lib/util/stringsConfig.js +42 -0
- package/dist/lib/util/stringsConfig.js.map +1 -0
- package/dist/lib/util/toString.d.ts +11 -0
- package/dist/lib/util/toString.js +31 -0
- package/dist/lib/util/toString.js.map +1 -0
- package/dist/lib/validate/validate.d.ts +11 -0
- package/dist/lib/validate/validate.js +62 -0
- package/dist/lib/validate/validate.js.map +1 -0
- package/dist/locale/de.json +195 -0
- package/dist/locale/en.json +195 -0
- package/dist/locale/es.json +195 -0
- package/dist/locale/fr.json +195 -0
- package/dist/locale/ja.json +195 -0
- package/dist/locale/pt-br.json +195 -0
- package/dist/types/index.d.ts +114 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Apache License - 2.0
|
|
2
|
+
|
|
3
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
|
+
|
|
5
|
+
1. Definitions.
|
|
6
|
+
|
|
7
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
8
|
+
|
|
9
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
10
|
+
|
|
11
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control
|
|
12
|
+
with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management
|
|
13
|
+
of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
|
14
|
+
ownership of such entity.
|
|
15
|
+
|
|
16
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
17
|
+
|
|
18
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source,
|
|
19
|
+
and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to
|
|
22
|
+
compiled object code, generated documentation, and conversions to other media types.
|
|
23
|
+
|
|
24
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice
|
|
25
|
+
that is included in or attached to the work (an example is provided in the Appendix below).
|
|
26
|
+
|
|
27
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the
|
|
28
|
+
editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes
|
|
29
|
+
of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of,
|
|
30
|
+
the Work and Derivative Works thereof.
|
|
31
|
+
|
|
32
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work
|
|
33
|
+
or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual
|
|
34
|
+
or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
|
|
35
|
+
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on
|
|
36
|
+
electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
37
|
+
the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing
|
|
38
|
+
by the copyright owner as "Not a Contribution."
|
|
39
|
+
|
|
40
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and
|
|
41
|
+
subsequently incorporated within the Work.
|
|
42
|
+
|
|
43
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
|
44
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display,
|
|
45
|
+
publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
46
|
+
|
|
47
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
48
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell,
|
|
49
|
+
sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are
|
|
50
|
+
necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was
|
|
51
|
+
submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
52
|
+
or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You
|
|
53
|
+
under this License for that Work shall terminate as of the date such litigation is filed.
|
|
54
|
+
|
|
55
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications,
|
|
56
|
+
and in Source or Object form, provided that You meet the following conditions:
|
|
57
|
+
|
|
58
|
+
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
59
|
+
|
|
60
|
+
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
61
|
+
|
|
62
|
+
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices
|
|
63
|
+
from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
64
|
+
|
|
65
|
+
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a
|
|
66
|
+
readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the
|
|
67
|
+
Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the
|
|
68
|
+
Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever
|
|
69
|
+
such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License.
|
|
70
|
+
You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
71
|
+
provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to
|
|
72
|
+
Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your
|
|
73
|
+
modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with
|
|
74
|
+
the conditions stated in this License.
|
|
75
|
+
|
|
76
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You
|
|
77
|
+
to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above,
|
|
78
|
+
nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
79
|
+
|
|
80
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except
|
|
81
|
+
as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
82
|
+
|
|
83
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides
|
|
84
|
+
its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation,
|
|
85
|
+
any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for
|
|
86
|
+
determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under
|
|
87
|
+
this License.
|
|
88
|
+
|
|
89
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required
|
|
90
|
+
by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages,
|
|
91
|
+
including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the
|
|
92
|
+
use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
|
93
|
+
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
94
|
+
|
|
95
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a
|
|
96
|
+
fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting
|
|
97
|
+
such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree
|
|
98
|
+
to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your
|
|
99
|
+
accepting any such warranty or additional liability.
|
|
100
|
+
|
|
101
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# ArcGIS Living Atlas Content Validator
|
|
2
|
+
This package provides validation and scoring rules for curating content in the ArcGIS Living Atlas.
|
|
3
|
+
|
|
4
|
+
## Background
|
|
5
|
+
The ArcGIS Living Atlas is a collection of curated GIS content. This content is submitted for inclusion in the Living Atlas by Esri Cartographers and Data Scientists from around the world.
|
|
6
|
+
|
|
7
|
+
The Living Atlas consists of items in ArcGIS Online. Users can nominate items for inclusion in the Living Atlas. During the nomination process, items are validated and scored based on the completeness of the item and its metadata. The score helps to identify key characteristics of your item that will ensure others can find and understand the item.
|
|
8
|
+
|
|
9
|
+
The details page of an item in ArcGIS Online provides information about the item being shared, along with additional information to help others find and use the item. The goal is to create a well-documented item description page so that others will understand what they have found, where the data is from, and what they can expect to see when opening the item.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
To install this Package, simply run:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npm install @vannizhang/living-atlas-content-validator
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
Here is an example of how to validate an item and the item owner's user profile in ArcGIS Online:
|
|
21
|
+
```js
|
|
22
|
+
import { validate } from ' @vannizhang/living-atlas-content-validator';
|
|
23
|
+
|
|
24
|
+
const validationResult = validate(
|
|
25
|
+
// ArcGIS Online Item
|
|
26
|
+
{
|
|
27
|
+
id: 'fd61b9e0c69c4e14bebd50a9a968348c',
|
|
28
|
+
owner: 'esri',
|
|
29
|
+
title: 'Sentinel-2 Views',
|
|
30
|
+
snippet: 'Sentinel-2, 10m Multispectral, Multitemporal, 13-band images with visual renderings and indices...',
|
|
31
|
+
type: 'Imagery Layer ',
|
|
32
|
+
thumbnail: 'thumbnail/thumbnail1577152707660.jpeg',
|
|
33
|
+
access: 'shared',
|
|
34
|
+
description: 'Sentinel-2, 10, 20, and 60m Multispectral, Multitemporal, 13-band imagery is rendered on-the-fly and available for visualization and analytics...',
|
|
35
|
+
// this is a custom property that provides the dimension of the thumbnail image
|
|
36
|
+
dimension: {
|
|
37
|
+
width: 400,
|
|
38
|
+
height: 240
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
// ArcGIS Online User Profile
|
|
42
|
+
{
|
|
43
|
+
fullName: 'Esri Inc.',
|
|
44
|
+
description: 'Esri develops geographic information systems (GIS) solutions that function as an integral component in nearly every type of organization....',
|
|
45
|
+
thumbnail: 'esri_150.jpg',
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Here is an example of output returned by `validate`:
|
|
51
|
+
```js
|
|
52
|
+
{
|
|
53
|
+
"id": "12345",
|
|
54
|
+
"totalScore": 60,
|
|
55
|
+
"validatedItem": {
|
|
56
|
+
"access": {
|
|
57
|
+
"property": "access",
|
|
58
|
+
"label": "Must be public",
|
|
59
|
+
"maxScore": 9,
|
|
60
|
+
"score": 2,
|
|
61
|
+
"messages": [
|
|
62
|
+
{
|
|
63
|
+
"code": "",
|
|
64
|
+
"message": "Must be public"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"weight": 4,
|
|
68
|
+
"critical": true
|
|
69
|
+
},
|
|
70
|
+
"accessInformation": {
|
|
71
|
+
"property": "accessInformation",
|
|
72
|
+
"label": "Add credits",
|
|
73
|
+
"maxScore": 8,
|
|
74
|
+
"score": 0,
|
|
75
|
+
"messages": [
|
|
76
|
+
{
|
|
77
|
+
"code": "",
|
|
78
|
+
"message": "Add credits"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"weight": 7,
|
|
82
|
+
"critical": false
|
|
83
|
+
},
|
|
84
|
+
"description": {
|
|
85
|
+
"property": "description",
|
|
86
|
+
"label": "Improve description",
|
|
87
|
+
"maxScore": 8,
|
|
88
|
+
"score": 1,
|
|
89
|
+
"messages": [
|
|
90
|
+
{
|
|
91
|
+
"code": "",
|
|
92
|
+
"message": "Description has no links"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"code": "",
|
|
96
|
+
"message": "Description too short"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"weight": 3,
|
|
100
|
+
"critical": true
|
|
101
|
+
},
|
|
102
|
+
"layerCount": {
|
|
103
|
+
"property": "layers",
|
|
104
|
+
"label": "Reduce the number of layers",
|
|
105
|
+
//...
|
|
106
|
+
},
|
|
107
|
+
"licenseInfo": {
|
|
108
|
+
"property": "licenseInfo",
|
|
109
|
+
"label": "Improve access and use constraints",
|
|
110
|
+
//...
|
|
111
|
+
},
|
|
112
|
+
"snippet": {
|
|
113
|
+
"property": "snippet",
|
|
114
|
+
"label": "Improve summary",
|
|
115
|
+
//...
|
|
116
|
+
},
|
|
117
|
+
"ssl": {
|
|
118
|
+
"property": "ssl",
|
|
119
|
+
"label": "Use HTTPS in the URL",
|
|
120
|
+
//...
|
|
121
|
+
},
|
|
122
|
+
"tags": {
|
|
123
|
+
"property": "tags",
|
|
124
|
+
"label": "Improve tags",
|
|
125
|
+
//...
|
|
126
|
+
},
|
|
127
|
+
"thumbnail": {
|
|
128
|
+
"property": "thumbnail",
|
|
129
|
+
"label": "Improve thumbnail",
|
|
130
|
+
//...
|
|
131
|
+
},
|
|
132
|
+
"title": {
|
|
133
|
+
"property": "title",
|
|
134
|
+
"label": "Improve title",
|
|
135
|
+
//...
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"validatedProfile": {
|
|
139
|
+
"userProfileDescription": {
|
|
140
|
+
"property": "userProfileDescription",
|
|
141
|
+
"label": "Improve profile description",
|
|
142
|
+
"maxScore": 7,
|
|
143
|
+
"score": 1,
|
|
144
|
+
"messages": [
|
|
145
|
+
{
|
|
146
|
+
"code": "",
|
|
147
|
+
"message": "Profile description does not contain an email"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"code": "",
|
|
151
|
+
"message": "Profile description does not contain a link"
|
|
152
|
+
},
|
|
153
|
+
//...
|
|
154
|
+
],
|
|
155
|
+
"weight": 12,
|
|
156
|
+
"critical": true
|
|
157
|
+
},
|
|
158
|
+
"userProfileFullName": {
|
|
159
|
+
"property": "userProfileName",
|
|
160
|
+
"label": "Improve profile full name",
|
|
161
|
+
//...
|
|
162
|
+
},
|
|
163
|
+
"userProfileThumbnail": {
|
|
164
|
+
"property": "userProfileThumbnail",
|
|
165
|
+
"label": "Improve profile thumbnail",
|
|
166
|
+
//...
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Configuration
|
|
173
|
+
You can set the language to be used in the output validation messages with the `setStrings` function. Here is an example:
|
|
174
|
+
```js
|
|
175
|
+
import { setStrings } from `@vannizhang/living-atlas-content-validator`
|
|
176
|
+
|
|
177
|
+
// You can choose any of these six languages: 'en', 'de', 'es', 'fr', 'ja', 'pt-br'
|
|
178
|
+
setStrings('de'); // use German
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### License
|
|
182
|
+
Copyright © 2022 Esri
|
|
183
|
+
|
|
184
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
185
|
+
you may not use this file except in compliance with the License.
|
|
186
|
+
You may obtain a copy of the License at
|
|
187
|
+
|
|
188
|
+
> http://www.apache.org/licenses/LICENSE-2.0
|
|
189
|
+
|
|
190
|
+
Unless required by applicable law or agreed to in writing, software
|
|
191
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
192
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
193
|
+
See the License for the specific language governing permissions and
|
|
194
|
+
limitations under the License.
|
|
195
|
+
|
|
196
|
+
A copy of the license is available in the repository's [LICENSE](./LICENSE) file.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ValidationMessage, ValidationInfo, ValidationResult, ScoringRules, ScoringRulesByType, ScoringRulesConfig } from './types';
|
|
2
|
+
import { isValidTitle } from './lib/title/isValidTitle';
|
|
3
|
+
import { isValidAccessInformation } from './lib/accessInformation/isValidAccessInformation';
|
|
4
|
+
import { isValidDescription } from './lib/description/isValidDescription';
|
|
5
|
+
import { isValidLayerCount } from './lib/layers/isValidLayerCount';
|
|
6
|
+
import { isValidLicenseInfo } from './lib/licenseInfo/isValidLicenseInfo';
|
|
7
|
+
import { isValidAccess } from './lib/sharing/isValidAccess';
|
|
8
|
+
import { isValidSSL } from './lib/ssl/isValidSSL';
|
|
9
|
+
import { isValidSummary } from './lib/summary/isValidSummary';
|
|
10
|
+
import { isValidTags } from './lib/tags/isValidTags';
|
|
11
|
+
import { isValidThumbnail } from './lib/thumbnail/isValidThumbnail';
|
|
12
|
+
import { isValidUserProfileDescription } from './lib/userProfileDescription/isValidUserProfileDescription';
|
|
13
|
+
import { isValidUserProfileName } from './lib/userProfileName/isValidUserProfileName';
|
|
14
|
+
import { isValidUserProfileThumbnail } from './lib/userProfileThumbnail/isValidUserProfileThumbnail';
|
|
15
|
+
import { validate } from './lib/validate/validate';
|
|
16
|
+
import { setStrings, getStringsConfig } from './lib/util/stringsConfig';
|
|
17
|
+
export { ValidationMessage, ValidationInfo, ValidationResult, ScoringRules, ScoringRulesByType, ScoringRulesConfig, setStrings, getStringsConfig, validate, isValidTitle, isValidAccessInformation, isValidDescription, isValidLayerCount, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidUserProfileThumbnail = exports.isValidUserProfileName = exports.isValidUserProfileDescription = exports.isValidThumbnail = exports.isValidTags = exports.isValidSummary = exports.isValidSSL = exports.isValidAccess = exports.isValidLicenseInfo = exports.isValidLayerCount = exports.isValidDescription = exports.isValidAccessInformation = exports.isValidTitle = exports.validate = exports.getStringsConfig = exports.setStrings = void 0;
|
|
4
|
+
const isValidTitle_1 = require("./lib/title/isValidTitle");
|
|
5
|
+
Object.defineProperty(exports, "isValidTitle", { enumerable: true, get: function () { return isValidTitle_1.isValidTitle; } });
|
|
6
|
+
const isValidAccessInformation_1 = require("./lib/accessInformation/isValidAccessInformation");
|
|
7
|
+
Object.defineProperty(exports, "isValidAccessInformation", { enumerable: true, get: function () { return isValidAccessInformation_1.isValidAccessInformation; } });
|
|
8
|
+
const isValidDescription_1 = require("./lib/description/isValidDescription");
|
|
9
|
+
Object.defineProperty(exports, "isValidDescription", { enumerable: true, get: function () { return isValidDescription_1.isValidDescription; } });
|
|
10
|
+
const isValidLayerCount_1 = require("./lib/layers/isValidLayerCount");
|
|
11
|
+
Object.defineProperty(exports, "isValidLayerCount", { enumerable: true, get: function () { return isValidLayerCount_1.isValidLayerCount; } });
|
|
12
|
+
const isValidLicenseInfo_1 = require("./lib/licenseInfo/isValidLicenseInfo");
|
|
13
|
+
Object.defineProperty(exports, "isValidLicenseInfo", { enumerable: true, get: function () { return isValidLicenseInfo_1.isValidLicenseInfo; } });
|
|
14
|
+
const isValidAccess_1 = require("./lib/sharing/isValidAccess");
|
|
15
|
+
Object.defineProperty(exports, "isValidAccess", { enumerable: true, get: function () { return isValidAccess_1.isValidAccess; } });
|
|
16
|
+
const isValidSSL_1 = require("./lib/ssl/isValidSSL");
|
|
17
|
+
Object.defineProperty(exports, "isValidSSL", { enumerable: true, get: function () { return isValidSSL_1.isValidSSL; } });
|
|
18
|
+
const isValidSummary_1 = require("./lib/summary/isValidSummary");
|
|
19
|
+
Object.defineProperty(exports, "isValidSummary", { enumerable: true, get: function () { return isValidSummary_1.isValidSummary; } });
|
|
20
|
+
const isValidTags_1 = require("./lib/tags/isValidTags");
|
|
21
|
+
Object.defineProperty(exports, "isValidTags", { enumerable: true, get: function () { return isValidTags_1.isValidTags; } });
|
|
22
|
+
const isValidThumbnail_1 = require("./lib/thumbnail/isValidThumbnail");
|
|
23
|
+
Object.defineProperty(exports, "isValidThumbnail", { enumerable: true, get: function () { return isValidThumbnail_1.isValidThumbnail; } });
|
|
24
|
+
const isValidUserProfileDescription_1 = require("./lib/userProfileDescription/isValidUserProfileDescription");
|
|
25
|
+
Object.defineProperty(exports, "isValidUserProfileDescription", { enumerable: true, get: function () { return isValidUserProfileDescription_1.isValidUserProfileDescription; } });
|
|
26
|
+
const isValidUserProfileName_1 = require("./lib/userProfileName/isValidUserProfileName");
|
|
27
|
+
Object.defineProperty(exports, "isValidUserProfileName", { enumerable: true, get: function () { return isValidUserProfileName_1.isValidUserProfileName; } });
|
|
28
|
+
const isValidUserProfileThumbnail_1 = require("./lib/userProfileThumbnail/isValidUserProfileThumbnail");
|
|
29
|
+
Object.defineProperty(exports, "isValidUserProfileThumbnail", { enumerable: true, get: function () { return isValidUserProfileThumbnail_1.isValidUserProfileThumbnail; } });
|
|
30
|
+
const validate_1 = require("./lib/validate/validate");
|
|
31
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_1.validate; } });
|
|
32
|
+
const stringsConfig_1 = require("./lib/util/stringsConfig");
|
|
33
|
+
Object.defineProperty(exports, "setStrings", { enumerable: true, get: function () { return stringsConfig_1.setStrings; } });
|
|
34
|
+
Object.defineProperty(exports, "getStringsConfig", { enumerable: true, get: function () { return stringsConfig_1.getStringsConfig; } });
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAWA,2DAAwD;AA6BpD,6FA7BK,2BAAY,OA6BL;AA5BhB,+FAA4F;AA6BxF,yGA7BK,mDAAwB,OA6BL;AA5B5B,6EAA0E;AA6BtE,mGA7BK,uCAAkB,OA6BL;AA5BtB,sEAAmE;AA6B/D,kGA7BK,qCAAiB,OA6BL;AA5BrB,6EAA0E;AA6BtE,mGA7BK,uCAAkB,OA6BL;AA5BtB,+DAA4D;AA6BxD,8FA7BK,6BAAa,OA6BL;AA5BjB,qDAAkD;AA6B9C,2FA7BK,uBAAU,OA6BL;AA5Bd,iEAA8D;AA6B1D,+FA7BK,+BAAc,OA6BL;AA5BlB,wDAAqD;AA6BjD,4FA7BK,yBAAW,OA6BL;AA5Bf,uEAAoE;AA6BhE,iGA7BK,mCAAgB,OA6BL;AA5BpB,8GAA2G;AA6BvG,8GA7BK,6DAA6B,OA6BL;AA5BjC,yFAAsF;AA6BlF,uGA7BK,+CAAsB,OA6BL;AA5B1B,wGAAqG;AA6BjG,4GA7BK,yDAA2B,OA6BL;AA5B/B,sDAAmD;AAe/C,yFAfK,mBAAQ,OAeL;AAbZ,4DAAwE;AAWpE,2FAXK,0BAAU,OAWL;AACV,iGAZiB,gCAAgB,OAYjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IItem, ValidationInfo } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validate an item's "Credits (Attribution)", which provides Information on the source of the item and its copyright status.
|
|
4
|
+
* A valid Access Information must meet these rules below:
|
|
5
|
+
*
|
|
6
|
+
* Living Atlas specific rule:
|
|
7
|
+
* - Cannot be empty
|
|
8
|
+
* - Only contains strings, no markup
|
|
9
|
+
*/
|
|
10
|
+
export declare const isValidAccessInformation: (item: IItem) => ValidationInfo;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isValidAccessInformation = void 0;
|
|
7
|
+
const scoringRulesConfig_1 = __importDefault(require("./scoringRulesConfig"));
|
|
8
|
+
const assertString_1 = require("../util/assertString");
|
|
9
|
+
const isEmpty_1 = require("../util/isEmpty");
|
|
10
|
+
const getScoringRules_1 = require("../util/getScoringRules");
|
|
11
|
+
const stringsConfig_1 = require("../util/stringsConfig");
|
|
12
|
+
/**
|
|
13
|
+
* Validate an item's "Credits (Attribution)", which provides Information on the source of the item and its copyright status.
|
|
14
|
+
* A valid Access Information must meet these rules below:
|
|
15
|
+
*
|
|
16
|
+
* Living Atlas specific rule:
|
|
17
|
+
* - Cannot be empty
|
|
18
|
+
* - Only contains strings, no markup
|
|
19
|
+
*/
|
|
20
|
+
const isValidAccessInformation = (item) => {
|
|
21
|
+
const { accessInformation } = item;
|
|
22
|
+
// scoring rules
|
|
23
|
+
const SCORING = (0, getScoringRules_1.getScoringRules)(item, scoringRulesConfig_1.default);
|
|
24
|
+
const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
|
|
25
|
+
const validAccessInformation = (0, assertString_1.assertString)(item.accessInformation) && !(0, isEmpty_1.isEmpty)(accessInformation);
|
|
26
|
+
// issues
|
|
27
|
+
const issues = {
|
|
28
|
+
property: 'accessInformation',
|
|
29
|
+
label: stringsConfig.accessInformation.LABEL,
|
|
30
|
+
maxScore: SCORING.EMPTY_STRING_SCORE + SCORING.EXIST_SCORE,
|
|
31
|
+
score: validAccessInformation
|
|
32
|
+
? SCORING.EXIST_SCORE
|
|
33
|
+
: SCORING.EMPTY_STRING_SCORE,
|
|
34
|
+
messages: validAccessInformation
|
|
35
|
+
? []
|
|
36
|
+
: [
|
|
37
|
+
{
|
|
38
|
+
code: stringsConfig.accessInformation.EMPTY_STRING_CODE,
|
|
39
|
+
message: stringsConfig.accessInformation.EMPTY_STRING_MESSAGE,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
weight: stringsConfig.accessInformation.WEIGHT,
|
|
43
|
+
critical: false,
|
|
44
|
+
};
|
|
45
|
+
return issues;
|
|
46
|
+
};
|
|
47
|
+
exports.isValidAccessInformation = isValidAccessInformation;
|
|
48
|
+
//# sourceMappingURL=isValidAccessInformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidAccessInformation.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/isValidAccessInformation.ts"],"names":[],"mappings":";;;;;;AAAA,8EAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,6DAA0D;AAE1D,yDAAyD;AAEzD;;;;;;;GAOG;AACI,MAAM,wBAAwB,GAAG,CAAC,IAAW,EAAkB,EAAE;IACpE,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAEnC,gBAAgB;IAChB,MAAM,OAAO,GAAG,IAAA,iCAAe,EAAC,IAAI,EAAE,4BAAkB,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,sBAAsB,GACxB,IAAA,2BAAY,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,iBAAiB,CAAC,CAAC;IAExE,SAAS;IACT,MAAM,MAAM,GAAG;QACX,QAAQ,EAAE,mBAAmB;QAC7B,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,KAAK;QAC5C,QAAQ,EAAE,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,WAAW;QAC1D,KAAK,EAAE,sBAAsB;YACzB,CAAC,CAAC,OAAO,CAAC,WAAW;YACrB,CAAC,CAAC,OAAO,CAAC,kBAAkB;QAChC,QAAQ,EAAE,sBAAsB;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACI;oBACI,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,iBAAiB;oBACvD,OAAO,EACH,aAAa,CAAC,iBAAiB,CAAC,oBAAoB;iBAC3D;aACJ;QACP,MAAM,EAAE,aAAa,CAAC,iBAAiB,CAAC,MAAM;QAC9C,QAAQ,EAAE,KAAK;KAClB,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAjCW,QAAA,wBAAwB,4BAiCnC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config = {
|
|
4
|
+
// Scoring
|
|
5
|
+
SCORING: {
|
|
6
|
+
DEFAULT: {
|
|
7
|
+
WEB_MAP: {
|
|
8
|
+
EMPTY_STRING_SCORE: 0,
|
|
9
|
+
EXIST_SCORE: 8,
|
|
10
|
+
},
|
|
11
|
+
WEB_SCENE: {
|
|
12
|
+
EMPTY_STRING_SCORE: 0,
|
|
13
|
+
EXIST_SCORE: 9,
|
|
14
|
+
},
|
|
15
|
+
APPLICATION: {
|
|
16
|
+
EMPTY_STRING_SCORE: 0,
|
|
17
|
+
EXIST_SCORE: 9,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
INTERNATIONAL: {
|
|
21
|
+
WEB_MAP: {
|
|
22
|
+
EMPTY_STRING_SCORE: 0,
|
|
23
|
+
EXIST_SCORE: 8,
|
|
24
|
+
},
|
|
25
|
+
WEB_SCENE: {
|
|
26
|
+
EMPTY_STRING_SCORE: 0,
|
|
27
|
+
EXIST_SCORE: 9,
|
|
28
|
+
},
|
|
29
|
+
APPLICATION: {
|
|
30
|
+
EMPTY_STRING_SCORE: 0,
|
|
31
|
+
EXIST_SCORE: 9,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.default = config;
|
|
37
|
+
//# sourceMappingURL=scoringRulesConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoringRulesConfig.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/scoringRulesConfig.ts"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAuB;IAC/B,UAAU;IACV,OAAO,EAAE;QACL,OAAO,EAAE;YACL,OAAO,EAAE;gBACL,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;YACD,SAAS,EAAE;gBACP,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;YACD,WAAW,EAAE;gBACT,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;SACJ;QAED,aAAa,EAAE;YACX,OAAO,EAAE;gBACL,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;YACD,SAAS,EAAE;gBACP,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;YACD,WAAW,EAAE;gBACT,kBAAkB,EAAE,CAAC;gBACrB,WAAW,EAAE,CAAC;aACjB;SACJ;KACJ;CACJ,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BLACKLIST: RegExp[];
|
|
2
|
+
/**
|
|
3
|
+
* Array of item types that are supported by the Living Atlas
|
|
4
|
+
*/
|
|
5
|
+
export declare const LIVING_ATLAS_SUPPORTED_ITEM_TYPES: readonly ["CityEngine Web Scene", "Dashboard", "Deep Learning Package", "Desktop Style", "Document Link", "Feature Collection", "Feature Service", "Image Service", "Map Service", "Project Package", "Raster function template", "Rule Package", "Scene Service", "StoryMap", "Style", "Vector Tile Service", "Web Experience", "Web Experience Template", "Web Map", "Web Mapping Application", "Web Scene", "WMS"];
|
|
6
|
+
export type LivingAtlasSupportedItemType = (typeof LIVING_ATLAS_SUPPORTED_ITEM_TYPES)[number];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// const config = {
|
|
3
|
+
// CITY_ENGINE_WEB_SCENE: 'CityEngine Web Scene',
|
|
4
|
+
// DASHBOARD: 'Dashboard',
|
|
5
|
+
// DOCUMENT_LINK: 'Document Link',
|
|
6
|
+
// FEATURE_COLLECTION: 'Feature Collection',
|
|
7
|
+
// FEATURE_SERVICE: 'Feature Service',
|
|
8
|
+
// IMAGE_SERVICE: 'Image Service',
|
|
9
|
+
// MAP_SERVICE: 'Map Service',
|
|
10
|
+
// PROJECT_PACKAGE: 'Project Package',
|
|
11
|
+
// RASTER_FUNCTION_TEMPLATE: 'Raster function template',
|
|
12
|
+
// RULE_PACKAGE: 'Rule Package',
|
|
13
|
+
// DEEP_LEARNING_PACKAGE: 'Deep Learning Package',
|
|
14
|
+
// SCENE_SERVICE: 'Scene Service',
|
|
15
|
+
// STORY_MAP: 'StoryMap',
|
|
16
|
+
// STYLE: 'Style',
|
|
17
|
+
// DESKTOP_STYLE: 'Desktop Style',
|
|
18
|
+
// VECTOR_TILE_SERVICE: 'Vector Tile Service',
|
|
19
|
+
// WEB_EXPERIENCE: 'Web Experience',
|
|
20
|
+
// WEB_EXPERIENCE_TEMPLATE: 'Web Experience Template',
|
|
21
|
+
// WEB_MAP: 'Web Map',
|
|
22
|
+
// WEB_MAPPING_APPLICATION: 'Web Mapping Application',
|
|
23
|
+
// WEB_SCENE: 'Web Scene',
|
|
24
|
+
// WMS: 'WMS',
|
|
25
|
+
// // GEOPROCESSING_SERVICE: 'Geoprocessing Service',
|
|
26
|
+
// // LAYER_PACKAGE: 'Layer Package',
|
|
27
|
+
// // MOBILE_APPLICATION: 'Mobile Application',
|
|
28
|
+
// // CITY_ENGINE: 'City Engine',
|
|
29
|
+
// };
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.LIVING_ATLAS_SUPPORTED_ITEM_TYPES = exports.BLACKLIST = void 0;
|
|
32
|
+
exports.BLACKLIST = [/\bdemo\b/i, /\btest\b/i, /\bcopy\b/i, /\beval\b/i];
|
|
33
|
+
/**
|
|
34
|
+
* Array of item types that are supported by the Living Atlas
|
|
35
|
+
*/
|
|
36
|
+
exports.LIVING_ATLAS_SUPPORTED_ITEM_TYPES = [
|
|
37
|
+
'CityEngine Web Scene',
|
|
38
|
+
'Dashboard',
|
|
39
|
+
'Deep Learning Package',
|
|
40
|
+
'Desktop Style',
|
|
41
|
+
'Document Link',
|
|
42
|
+
'Feature Collection',
|
|
43
|
+
'Feature Service',
|
|
44
|
+
'Image Service',
|
|
45
|
+
'Map Service',
|
|
46
|
+
'Project Package',
|
|
47
|
+
'Raster function template',
|
|
48
|
+
'Rule Package',
|
|
49
|
+
'Scene Service',
|
|
50
|
+
'StoryMap',
|
|
51
|
+
'Style',
|
|
52
|
+
'Vector Tile Service',
|
|
53
|
+
'Web Experience',
|
|
54
|
+
'Web Experience Template',
|
|
55
|
+
'Web Map',
|
|
56
|
+
'Web Mapping Application',
|
|
57
|
+
'Web Scene',
|
|
58
|
+
'WMS',
|
|
59
|
+
];
|
|
60
|
+
// export default config;
|
|
61
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";AAAA,mBAAmB;AACnB,qDAAqD;AACrD,8BAA8B;AAC9B,sCAAsC;AACtC,gDAAgD;AAChD,0CAA0C;AAC1C,sCAAsC;AACtC,kCAAkC;AAClC,0CAA0C;AAC1C,4DAA4D;AAC5D,oCAAoC;AACpC,sDAAsD;AACtD,sCAAsC;AACtC,6BAA6B;AAC7B,sBAAsB;AACtB,sCAAsC;AACtC,kDAAkD;AAClD,wCAAwC;AACxC,0DAA0D;AAC1D,0BAA0B;AAC1B,0DAA0D;AAC1D,8BAA8B;AAC9B,kBAAkB;AAClB,yDAAyD;AACzD,yCAAyC;AACzC,mDAAmD;AACnD,qCAAqC;AACrC,KAAK;;;AAEQ,QAAA,SAAS,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9E;;GAEG;AACU,QAAA,iCAAiC,GAAG;IAC7C,sBAAsB;IACtB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,eAAe;IACf,oBAAoB;IACpB,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,0BAA0B;IAC1B,cAAc;IACd,eAAe;IACf,UAAU;IACV,OAAO;IACP,qBAAqB;IACrB,gBAAgB;IAChB,yBAAyB;IACzB,SAAS;IACT,yBAAyB;IACzB,WAAW;IACX,KAAK;CACC,CAAC;AAKX,yBAAyB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IItem, ValidationInfo } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validate an item's description. A valid description must meet these rules below:
|
|
4
|
+
*
|
|
5
|
+
* ArcGIS Online specific rules:
|
|
6
|
+
* - ArcGIS Online permits this field to be left emtpy. This field supprts markup.
|
|
7
|
+
*
|
|
8
|
+
* Living Atlas specific rule:
|
|
9
|
+
* - Cannot be empty
|
|
10
|
+
* - Must contain at least one link
|
|
11
|
+
* - Must have 48 or more words
|
|
12
|
+
*
|
|
13
|
+
* Living Atlas specific rules (international):
|
|
14
|
+
* - Cannot be empty
|
|
15
|
+
* - Must contain at least one link
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare const isValidDescription: (item: IItem) => ValidationInfo;
|