@esri/hub-common 14.90.0 → 14.90.1
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/dist/esm/items/slugs.js
CHANGED
|
@@ -1,32 +1,55 @@
|
|
|
1
1
|
import { getItem, searchItems } from "@esri/arcgis-rest-portal";
|
|
2
2
|
import { slugify } from "../utils";
|
|
3
3
|
import { uriSlugToKeywordSlug } from "./_internal/slugConverters";
|
|
4
|
+
const TYPEKEYWORD_SLUG_PREFIX = "slug";
|
|
5
|
+
const TYPEKEYWORD_MAX_LENGTH = 256;
|
|
4
6
|
/**
|
|
5
|
-
* Create a slug, namespaced to an org
|
|
6
|
-
* Typically used to lookup items by a human readable name in urls
|
|
7
|
+
* Create a slug, namespaced to an org and accounting for the 256 character limit
|
|
8
|
+
* of individual typekeywords. Typically used to lookup items by a human readable name in urls
|
|
7
9
|
*
|
|
8
10
|
* @param title
|
|
9
11
|
* @param orgKey
|
|
10
12
|
* @returns
|
|
11
13
|
*/
|
|
12
14
|
export function constructSlug(title, orgKey) {
|
|
13
|
-
|
|
15
|
+
// typekeywords have a max length of 256 characters, so we use the slug
|
|
16
|
+
// format that gets persisted in typekeywords as our basis
|
|
17
|
+
return ([
|
|
18
|
+
// add the typekeyword slug prefix
|
|
19
|
+
TYPEKEYWORD_SLUG_PREFIX,
|
|
20
|
+
// add the orgKey segment
|
|
21
|
+
orgKey.toLowerCase(),
|
|
22
|
+
// add the slugified title segment
|
|
23
|
+
slugify(title),
|
|
24
|
+
]
|
|
25
|
+
.join("|")
|
|
26
|
+
// allow some padding at the end for incrementing so we don't wind up w/ weird, inconsistent slugs
|
|
27
|
+
// when the increment goes from single to multiple digits, i.e. avoid producing the following when
|
|
28
|
+
// deduping:
|
|
29
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-long
|
|
30
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-lo-1
|
|
31
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-l-11
|
|
32
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-100
|
|
33
|
+
.substring(0, TYPEKEYWORD_MAX_LENGTH - 4)
|
|
34
|
+
// removing tailing hyphens
|
|
35
|
+
.replace(/-+$/, "")
|
|
36
|
+
// remove typekeyword slug prefix, it's re-added in setSlugKeyword
|
|
37
|
+
.replace(new RegExp(`^${TYPEKEYWORD_SLUG_PREFIX}\\|`), ""));
|
|
14
38
|
}
|
|
15
39
|
/**
|
|
16
40
|
* Adds/Updates the slug typekeyword
|
|
17
41
|
* Returns a new array of keywords
|
|
18
|
-
*
|
|
19
|
-
* @param
|
|
20
|
-
* @
|
|
42
|
+
*
|
|
43
|
+
* @param typeKeywords A collection of typekeywords
|
|
44
|
+
* @param slug The slug to add/update
|
|
45
|
+
* @returns An updated collection of typekeywords
|
|
21
46
|
*/
|
|
22
47
|
export function setSlugKeyword(typeKeywords, slug) {
|
|
23
48
|
// remove slug entry from array
|
|
24
|
-
const
|
|
25
|
-
return !entry.startsWith("slug|");
|
|
26
|
-
});
|
|
49
|
+
const updatedTypekeywords = typeKeywords.filter((entry) => !entry.startsWith(`${TYPEKEYWORD_SLUG_PREFIX}|`));
|
|
27
50
|
// now add it
|
|
28
|
-
|
|
29
|
-
return
|
|
51
|
+
updatedTypekeywords.push([TYPEKEYWORD_SLUG_PREFIX, slug].join("|"));
|
|
52
|
+
return updatedTypekeywords;
|
|
30
53
|
}
|
|
31
54
|
/**
|
|
32
55
|
* Get an item by searching for items with a typeKeyword like `slug|{slug-value}`
|
|
@@ -67,8 +90,11 @@ export function getItemBySlug(slug, requestOptions) {
|
|
|
67
90
|
* @returns
|
|
68
91
|
*/
|
|
69
92
|
export function findItemsBySlug(slugInfo, requestOptions) {
|
|
93
|
+
const filter = slugInfo.slug.startsWith(`${TYPEKEYWORD_SLUG_PREFIX}|`)
|
|
94
|
+
? slugInfo.slug
|
|
95
|
+
: [TYPEKEYWORD_SLUG_PREFIX, slugInfo.slug].join("|");
|
|
70
96
|
const opts = {
|
|
71
|
-
filter: `typekeywords:"
|
|
97
|
+
filter: `typekeywords:"${filter}"`,
|
|
72
98
|
};
|
|
73
99
|
if (requestOptions.authentication) {
|
|
74
100
|
opts.authentication = requestOptions.authentication;
|
|
@@ -104,20 +130,11 @@ export function findItemsBySlug(slugInfo, requestOptions) {
|
|
|
104
130
|
* @returns
|
|
105
131
|
*/
|
|
106
132
|
export function getUniqueSlug(slugInfo, requestOptions, step = 0) {
|
|
107
|
-
|
|
108
|
-
if (step) {
|
|
109
|
-
combinedSlug = `${slugInfo.slug}-${step}`;
|
|
110
|
-
}
|
|
133
|
+
const combinedSlug = step ? [slugInfo.slug, step].join("-") : slugInfo.slug;
|
|
111
134
|
return findItemsBySlug({ slug: combinedSlug, exclude: slugInfo.existingId }, requestOptions)
|
|
112
|
-
.then((results) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return getUniqueSlug(slugInfo, requestOptions, step);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return combinedSlug;
|
|
119
|
-
}
|
|
120
|
-
})
|
|
135
|
+
.then((results) => !results.length
|
|
136
|
+
? combinedSlug
|
|
137
|
+
: getUniqueSlug(slugInfo, requestOptions, step + 1))
|
|
121
138
|
.catch((e) => {
|
|
122
139
|
throw Error(`Error in getUniqueSlug ${e}`);
|
|
123
140
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slugs.js","sourceRoot":"","sources":["../../../src/items/slugs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc;IACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"slugs.js","sourceRoot":"","sources":["../../../src/items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AO,WAAW,CAAC,IAAI,CAAC;SACrB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QACjB,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,QAGC,EACD,cAA+B,EAC/B,OAAe,CAAC;IAEhB,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5E,OAAO,eAAe,CACpB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,EACpD,cAAc,CACf;SACE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,CAAC,OAAO,CAAC,MAAM;QACb,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,CACtD;SACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/node/items/slugs.js
CHANGED
|
@@ -4,33 +4,56 @@ exports.getUniqueSlug = exports.findItemsBySlug = exports.getItemBySlug = export
|
|
|
4
4
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const slugConverters_1 = require("./_internal/slugConverters");
|
|
7
|
+
const TYPEKEYWORD_SLUG_PREFIX = "slug";
|
|
8
|
+
const TYPEKEYWORD_MAX_LENGTH = 256;
|
|
7
9
|
/**
|
|
8
|
-
* Create a slug, namespaced to an org
|
|
9
|
-
* Typically used to lookup items by a human readable name in urls
|
|
10
|
+
* Create a slug, namespaced to an org and accounting for the 256 character limit
|
|
11
|
+
* of individual typekeywords. Typically used to lookup items by a human readable name in urls
|
|
10
12
|
*
|
|
11
13
|
* @param title
|
|
12
14
|
* @param orgKey
|
|
13
15
|
* @returns
|
|
14
16
|
*/
|
|
15
17
|
function constructSlug(title, orgKey) {
|
|
16
|
-
|
|
18
|
+
// typekeywords have a max length of 256 characters, so we use the slug
|
|
19
|
+
// format that gets persisted in typekeywords as our basis
|
|
20
|
+
return ([
|
|
21
|
+
// add the typekeyword slug prefix
|
|
22
|
+
TYPEKEYWORD_SLUG_PREFIX,
|
|
23
|
+
// add the orgKey segment
|
|
24
|
+
orgKey.toLowerCase(),
|
|
25
|
+
// add the slugified title segment
|
|
26
|
+
utils_1.slugify(title),
|
|
27
|
+
]
|
|
28
|
+
.join("|")
|
|
29
|
+
// allow some padding at the end for incrementing so we don't wind up w/ weird, inconsistent slugs
|
|
30
|
+
// when the increment goes from single to multiple digits, i.e. avoid producing the following when
|
|
31
|
+
// deduping:
|
|
32
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-long
|
|
33
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-lo-1
|
|
34
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-l-11
|
|
35
|
+
// slug|qa-pre-a-hub|some-really-really-...-really-100
|
|
36
|
+
.substring(0, TYPEKEYWORD_MAX_LENGTH - 4)
|
|
37
|
+
// removing tailing hyphens
|
|
38
|
+
.replace(/-+$/, "")
|
|
39
|
+
// remove typekeyword slug prefix, it's re-added in setSlugKeyword
|
|
40
|
+
.replace(new RegExp(`^${TYPEKEYWORD_SLUG_PREFIX}\\|`), ""));
|
|
17
41
|
}
|
|
18
42
|
exports.constructSlug = constructSlug;
|
|
19
43
|
/**
|
|
20
44
|
* Adds/Updates the slug typekeyword
|
|
21
45
|
* Returns a new array of keywords
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
24
|
-
* @
|
|
46
|
+
*
|
|
47
|
+
* @param typeKeywords A collection of typekeywords
|
|
48
|
+
* @param slug The slug to add/update
|
|
49
|
+
* @returns An updated collection of typekeywords
|
|
25
50
|
*/
|
|
26
51
|
function setSlugKeyword(typeKeywords, slug) {
|
|
27
52
|
// remove slug entry from array
|
|
28
|
-
const
|
|
29
|
-
return !entry.startsWith("slug|");
|
|
30
|
-
});
|
|
53
|
+
const updatedTypekeywords = typeKeywords.filter((entry) => !entry.startsWith(`${TYPEKEYWORD_SLUG_PREFIX}|`));
|
|
31
54
|
// now add it
|
|
32
|
-
|
|
33
|
-
return
|
|
55
|
+
updatedTypekeywords.push([TYPEKEYWORD_SLUG_PREFIX, slug].join("|"));
|
|
56
|
+
return updatedTypekeywords;
|
|
34
57
|
}
|
|
35
58
|
exports.setSlugKeyword = setSlugKeyword;
|
|
36
59
|
/**
|
|
@@ -73,8 +96,11 @@ exports.getItemBySlug = getItemBySlug;
|
|
|
73
96
|
* @returns
|
|
74
97
|
*/
|
|
75
98
|
function findItemsBySlug(slugInfo, requestOptions) {
|
|
99
|
+
const filter = slugInfo.slug.startsWith(`${TYPEKEYWORD_SLUG_PREFIX}|`)
|
|
100
|
+
? slugInfo.slug
|
|
101
|
+
: [TYPEKEYWORD_SLUG_PREFIX, slugInfo.slug].join("|");
|
|
76
102
|
const opts = {
|
|
77
|
-
filter: `typekeywords:"
|
|
103
|
+
filter: `typekeywords:"${filter}"`,
|
|
78
104
|
};
|
|
79
105
|
if (requestOptions.authentication) {
|
|
80
106
|
opts.authentication = requestOptions.authentication;
|
|
@@ -111,20 +137,11 @@ exports.findItemsBySlug = findItemsBySlug;
|
|
|
111
137
|
* @returns
|
|
112
138
|
*/
|
|
113
139
|
function getUniqueSlug(slugInfo, requestOptions, step = 0) {
|
|
114
|
-
|
|
115
|
-
if (step) {
|
|
116
|
-
combinedSlug = `${slugInfo.slug}-${step}`;
|
|
117
|
-
}
|
|
140
|
+
const combinedSlug = step ? [slugInfo.slug, step].join("-") : slugInfo.slug;
|
|
118
141
|
return findItemsBySlug({ slug: combinedSlug, exclude: slugInfo.existingId }, requestOptions)
|
|
119
|
-
.then((results) =>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return getUniqueSlug(slugInfo, requestOptions, step);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
return combinedSlug;
|
|
126
|
-
}
|
|
127
|
-
})
|
|
142
|
+
.then((results) => !results.length
|
|
143
|
+
? combinedSlug
|
|
144
|
+
: getUniqueSlug(slugInfo, requestOptions, step + 1))
|
|
128
145
|
.catch((e) => {
|
|
129
146
|
throw Error(`Error in getUniqueSlug ${e}`);
|
|
130
147
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slugs.js","sourceRoot":"","sources":["../../../src/items/slugs.ts"],"names":[],"mappings":";;;AAAA,iEAAgF;AAGhF,oCAAmC;AACnC,+DAAkE;AAElE;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,MAAc;IACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"slugs.js","sourceRoot":"","sources":["../../../src/items/slugs.ts"],"names":[],"mappings":";;;AAAA,iEAAgF;AAGhF,oCAAmC;AACnC,+DAAkE;AAElE,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAEvC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,MAAc;IACzD,uEAAuE;IACvE,0DAA0D;IAC1D,OAAO,CACL;QACE,kCAAkC;QAClC,uBAAuB;QACvB,yBAAyB;QACzB,MAAM,CAAC,WAAW,EAAE;QACpB,kCAAkC;QAClC,eAAO,CAAC,KAAK,CAAC;KACf;SACE,IAAI,CAAC,GAAG,CAAC;QACV,kGAAkG;QAClG,kGAAkG;QAClG,YAAY;QACZ,uDAAuD;QACvD,uDAAuD;QACvD,uDAAuD;QACvD,sDA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,CACf;SACE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,CAAC,OAAO,CAAC,MAAM;QACb,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,CACtD;SACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC;AArBD,sCAqBC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
2
|
import { IItem } from "@esri/arcgis-rest-types";
|
|
3
3
|
/**
|
|
4
|
-
* Create a slug, namespaced to an org
|
|
5
|
-
* Typically used to lookup items by a human readable name in urls
|
|
4
|
+
* Create a slug, namespaced to an org and accounting for the 256 character limit
|
|
5
|
+
* of individual typekeywords. Typically used to lookup items by a human readable name in urls
|
|
6
6
|
*
|
|
7
7
|
* @param title
|
|
8
8
|
* @param orgKey
|
|
@@ -12,9 +12,10 @@ export declare function constructSlug(title: string, orgKey: string): string;
|
|
|
12
12
|
/**
|
|
13
13
|
* Adds/Updates the slug typekeyword
|
|
14
14
|
* Returns a new array of keywords
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
15
|
+
*
|
|
16
|
+
* @param typeKeywords A collection of typekeywords
|
|
17
|
+
* @param slug The slug to add/update
|
|
18
|
+
* @returns An updated collection of typekeywords
|
|
18
19
|
*/
|
|
19
20
|
export declare function setSlugKeyword(typeKeywords: string[], slug: string): string[];
|
|
20
21
|
/**
|