@esri/hub-common 13.21.0 → 13.21.1-hotfix.20230728

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.
Files changed (76) hide show
  1. package/dist/esm/content/_internal/index.js +493 -0
  2. package/dist/esm/content/_internal/index.js.map +1 -0
  3. package/dist/esm/content/_internal.js +493 -0
  4. package/dist/esm/content/_internal.js.map +1 -0
  5. package/dist/esm/core/schemas/hubproject.js +300 -0
  6. package/dist/esm/core/schemas/hubproject.js.map +1 -0
  7. package/dist/esm/core/types/index.js +1 -0
  8. package/dist/esm/core/types/index.js.map +1 -1
  9. package/dist/esm/index.js +3 -0
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/initiatives/HubInitiative.js +5 -12
  12. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  13. package/dist/esm/initiatives/view.js +13 -35
  14. package/dist/esm/initiatives/view.js.map +1 -1
  15. package/dist/esm/projects/HubProject.js +4 -11
  16. package/dist/esm/projects/HubProject.js.map +1 -1
  17. package/dist/esm/projects/view.js +13 -35
  18. package/dist/esm/projects/view.js.map +1 -1
  19. package/dist/esm/search/_internal/commonHelpers/expandApi.js +53 -0
  20. package/dist/esm/search/_internal/commonHelpers/expandApi.js.map +1 -0
  21. package/dist/esm/search/_internal/utils.js +95 -0
  22. package/dist/esm/search/_internal/utils.js.map +1 -0
  23. package/dist/esm/sites/_internal/applyDefaultCollectionMigration.js +3 -0
  24. package/dist/esm/sites/_internal/applyDefaultCollectionMigration.js.map +1 -1
  25. package/dist/esm/sites/_internal/catalogMigration.js +50 -0
  26. package/dist/esm/sites/_internal/catalogMigration.js.map +1 -0
  27. package/dist/esm/urls/getCardModelUrl.js +76 -0
  28. package/dist/esm/urls/getCardModelUrl.js.map +1 -0
  29. package/dist/esm/urls/index.js +3 -0
  30. package/dist/esm/urls/index.js.map +1 -1
  31. package/dist/node/content/_internal/index.js +499 -0
  32. package/dist/node/content/_internal/index.js.map +1 -0
  33. package/dist/node/content/_internal.js +499 -0
  34. package/dist/node/content/_internal.js.map +1 -0
  35. package/dist/node/core/schemas/hubproject.js +303 -0
  36. package/dist/node/core/schemas/hubproject.js.map +1 -0
  37. package/dist/node/core/types/index.js +1 -0
  38. package/dist/node/core/types/index.js.map +1 -1
  39. package/dist/node/index.js +3 -0
  40. package/dist/node/index.js.map +1 -1
  41. package/dist/node/initiatives/HubInitiative.js +4 -11
  42. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  43. package/dist/node/initiatives/view.js +13 -35
  44. package/dist/node/initiatives/view.js.map +1 -1
  45. package/dist/node/projects/HubProject.js +3 -10
  46. package/dist/node/projects/HubProject.js.map +1 -1
  47. package/dist/node/projects/view.js +13 -35
  48. package/dist/node/projects/view.js.map +1 -1
  49. package/dist/node/search/_internal/commonHelpers/expandApi.js +57 -0
  50. package/dist/node/search/_internal/commonHelpers/expandApi.js.map +1 -0
  51. package/dist/node/search/_internal/utils.js +101 -0
  52. package/dist/node/search/_internal/utils.js.map +1 -0
  53. package/dist/node/sites/_internal/applyDefaultCollectionMigration.js +3 -0
  54. package/dist/node/sites/_internal/applyDefaultCollectionMigration.js.map +1 -1
  55. package/dist/node/sites/_internal/catalogMigration.js +54 -0
  56. package/dist/node/sites/_internal/catalogMigration.js.map +1 -0
  57. package/dist/node/urls/getCardModelUrl.js +81 -0
  58. package/dist/node/urls/getCardModelUrl.js.map +1 -0
  59. package/dist/node/urls/index.js +3 -0
  60. package/dist/node/urls/index.js.map +1 -1
  61. package/dist/types/content/_internal/index.d.ts +351 -0
  62. package/dist/types/content/_internal.d.ts +343 -0
  63. package/dist/types/core/behaviors/IWithCardBehavior.d.ts +3 -10
  64. package/dist/types/core/schemas/hubproject.d.ts +10 -0
  65. package/dist/types/core/types/IHubCardViewModel.d.ts +16 -0
  66. package/dist/types/core/types/index.d.ts +1 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/initiatives/HubInitiative.d.ts +6 -13
  69. package/dist/types/initiatives/view.d.ts +5 -10
  70. package/dist/types/projects/HubProject.d.ts +3 -10
  71. package/dist/types/projects/view.d.ts +5 -10
  72. package/dist/types/search/_internal/commonHelpers/expandApi.d.ts +14 -0
  73. package/dist/types/search/_internal/utils.d.ts +28 -0
  74. package/dist/types/sites/_internal/catalogMigration.d.ts +9 -0
  75. package/dist/types/urls/getCardModelUrl.d.ts +21 -0
  76. package/package.json +1 -1
@@ -0,0 +1,493 @@
1
+ /**
2
+ * Use this module for functions that do not need to be used by consumers (yet),
3
+ * but may be shared between hub.js modules, and/or need to be tested
4
+ * to get 100% coverage w/o writing cumbersome tests of higher level functions.
5
+ *
6
+ * Consuming will not be able to import these functions.
7
+ *
8
+ * It's probably a good pattern to add functions here first and then
9
+ * move them to index.ts only when they are needed by a consumer.
10
+ */
11
+ import { parseServiceUrl } from "@esri/arcgis-rest-feature-layer";
12
+ import { PublisherSource } from "../../core";
13
+ import { bBoxToExtent, extentToBBox, extentToPolygon, getExtentCenter, isBBox, } from "../../extent";
14
+ import { getFamily } from "../get-family";
15
+ import { getProp } from "../../objects";
16
+ /**
17
+ * Create a new content with updated boundary properties
18
+ * @param content original content
19
+ * @param boundary boundary provenance
20
+ * @returns
21
+ * @private
22
+ */
23
+ export const setContentBoundary = (content, boundary) => {
24
+ // update content's item and boundary
25
+ const properties = Object.assign(Object.assign({}, (content.item.properties || {})), { boundary });
26
+ const item = Object.assign(Object.assign({}, content.item), { properties });
27
+ const updated = Object.assign(Object.assign({}, content), { item });
28
+ return Object.assign(Object.assign({}, updated), { boundary: getContentBoundary(item) });
29
+ };
30
+ /**
31
+ * get a content's boundary based on the item's boundary property
32
+ * @param item
33
+ * @returns
34
+ * @private
35
+ */
36
+ export const getContentBoundary = (item) => {
37
+ var _a;
38
+ const bBox = item.extent;
39
+ const isValidItemExtent = isBBox(bBox);
40
+ // user specified provenance is stored in item.properties
41
+ const provenance = ((_a = item.properties) === null || _a === void 0 ? void 0 : _a.boundary) ||
42
+ // but we default to item if the item has an extent
43
+ (isValidItemExtent ? "item" : undefined);
44
+ const boundary = {
45
+ geometry: null,
46
+ provenance,
47
+ };
48
+ if (provenance === "item" && isValidItemExtent) {
49
+ const extent = bBoxToExtent(bBox);
50
+ const center = getExtentCenter(extent);
51
+ boundary.center = [center.x, center.y];
52
+ boundary.geometry = Object.assign(Object.assign({}, extentToPolygon(extent)), { type: "polygon" });
53
+ boundary.spatialReference = boundary.geometry.spatialReference;
54
+ }
55
+ return boundary;
56
+ };
57
+ /**
58
+ * Determine if we are in an enterprise environment
59
+ * NOTE: when no request options are provided, the underlying
60
+ * request functions assume that we are online in production
61
+ * so we only want use enterprise logic if isPortal is explicitly defined
62
+ * @param requestOptions
63
+ * @returns
64
+ * @private
65
+ */
66
+ export const isPortal = (requestOptions) => {
67
+ return requestOptions && requestOptions.isPortal;
68
+ };
69
+ /**
70
+ * Determine if we can use the Hub API for an item, i.e.
71
+ * the item is public and we are not in an enterprise environment
72
+ * @param item
73
+ * @param requestOptions
74
+ * @returns
75
+ * @private
76
+ */
77
+ export const canUseHubApiForItem = (item, requestOptions) => {
78
+ return !!item && item.access === "public" && !isPortal(requestOptions);
79
+ };
80
+ /**
81
+ * Returns whether or not an item is a proxied csv
82
+ *
83
+ * @param item
84
+ * @param requestOptions Hub Request Options (including whether we're in portal)
85
+ * @returns
86
+ * @private
87
+ */
88
+ export const isProxiedCSV = (item, requestOptions) => !isPortal(requestOptions) &&
89
+ item.access === "public" &&
90
+ item.type === "CSV" &&
91
+ item.size <= 5000000;
92
+ /**
93
+ * Get the relative URL to use for the item in a hub site
94
+ * @param type
95
+ * @param identifier
96
+ * @param typeKeywords
97
+ * @returns
98
+ * @private
99
+ */
100
+ export const getHubRelativeUrl = (type, identifier, typeKeywords) => {
101
+ // solution types have their own logic
102
+ let contentUrl = getSolutionUrl(type, identifier, typeKeywords) ||
103
+ getInitiativeTemplateUrl(type, identifier, typeKeywords);
104
+ if (!contentUrl) {
105
+ const family = getFamily(type);
106
+ const familiesWithPluralizedRoute = [
107
+ "app",
108
+ "dataset",
109
+ "document",
110
+ "map",
111
+ "template",
112
+ "project",
113
+ ];
114
+ // default to the catchall content route
115
+ let path = "/content";
116
+ if (family === "feedback") {
117
+ // the exception
118
+ path = "/feedback/surveys";
119
+ }
120
+ else if (isPageType(type, typeKeywords)) {
121
+ // pages are in the document family,
122
+ // but instead of showing the page's metadata on /documents/about
123
+ // but we render the page on the pages route
124
+ path = "/pages";
125
+ }
126
+ else if (familiesWithPluralizedRoute.indexOf(family) > -1) {
127
+ // the rule: route name is plural of family name
128
+ path = `/${family}s`;
129
+ }
130
+ contentUrl = `${path}/${identifier}`;
131
+ }
132
+ return contentUrl;
133
+ };
134
+ /**
135
+ * Is this content type a page?
136
+ * @param type
137
+ * @returns
138
+ * @private
139
+ */
140
+ export const isPageType = (type, typeKeywords = []) => ["Hub Page", "Site Page"].includes(type) || typeKeywords.includes("hubPage");
141
+ const getSolutionUrl = (type, identifier, typeKeywords) => {
142
+ let hubUrl;
143
+ if (type === "Solution") {
144
+ // solution types are now in the Template family
145
+ // we send all except the deployed solution items to the route for initiative templates
146
+ if ((typeKeywords === null || typeKeywords === void 0 ? void 0 : typeKeywords.indexOf("Deployed")) > -1) {
147
+ // deployed solutions go to the generic content route
148
+ hubUrl = `/content/${identifier}/about`;
149
+ }
150
+ else {
151
+ hubUrl = `/templates/${identifier}/about`;
152
+ }
153
+ }
154
+ else if (type === "Web Mapping Application" &&
155
+ (typeKeywords === null || typeKeywords === void 0 ? void 0 : typeKeywords.indexOf("hubSolutionTemplate")) > -1) {
156
+ hubUrl = `/templates/${identifier}/about`;
157
+ }
158
+ return hubUrl;
159
+ };
160
+ const getInitiativeTemplateUrl = (type, identifier, typeKeywords) => {
161
+ if ((type === "Hub Initiative" &&
162
+ (typeKeywords === null || typeKeywords === void 0 ? void 0 : typeKeywords.indexOf("hubInitiativeTemplate")) > -1) ||
163
+ type === "Hub Initiative Template") {
164
+ return `/initiatives/templates/${identifier}/about`;
165
+ }
166
+ };
167
+ /**
168
+ * Get the path to a well known metadata value
169
+ * @param identifier identifier for well known metadata value
170
+ * @returns path to be used like get(metadata, path)
171
+ * @private
172
+ */
173
+ export function getMetadataPath(identifier) {
174
+ // NOTE: i have verified that this will work regardless of the "Metadata Style" set on the org
175
+ const metadataPaths = {
176
+ updateFrequency: "metadata.dataIdInfo.resMaint.maintFreq.MaintFreqCd.@_value",
177
+ reviseDate: "metadata.dataIdInfo.idCitation.date.reviseDate",
178
+ pubDate: "metadata.dataIdInfo.idCitation.date.pubDate",
179
+ createDate: "metadata.dataIdInfo.idCitation.date.createDate",
180
+ metadataUpdateFrequency: "metadata.mdMaint.maintFreq.MaintFreqCd.@_value",
181
+ metadataUpdatedDate: "metadata.mdDateSt",
182
+ };
183
+ return metadataPaths[identifier];
184
+ }
185
+ /**
186
+ * Get a well known value from metadata
187
+ * @param metadata
188
+ * @param identifier identifier for well known metadata value
189
+ * @returns
190
+ * @private
191
+ */
192
+ export function getValueFromMetadata(metadata, identifier) {
193
+ const path = getMetadataPath(identifier);
194
+ return path && getProp(metadata, path);
195
+ }
196
+ /**
197
+ * Date precisions
198
+ */
199
+ export var DatePrecision;
200
+ (function (DatePrecision) {
201
+ DatePrecision["Year"] = "year";
202
+ DatePrecision["Month"] = "month";
203
+ DatePrecision["Day"] = "day";
204
+ DatePrecision["Time"] = "time";
205
+ })(DatePrecision || (DatePrecision = {}));
206
+ /**
207
+ * Parses an ISO8601 date string into a date and a precision.
208
+ * This is because a) if somone entered 2018, we want to respect that and not treat it as the same as 2018-01-01
209
+ * and b) you cannot naively call new Date with an ISO 8601 string that does not include time information
210
+ * For example, when I, here in mountain time, do new Date('2018').getFullYear() I get "2017".
211
+ * This is because when you do not provide time or timezone info, UTC is assumed, so new Date('2018') is 2018-01-01T00:00:00 in UTC
212
+ * which is actually 7 hours earlier here in mountain time.
213
+ *
214
+ * @param {string} isoString
215
+ * @return { date: Date, precision: DatePrecision }
216
+ * @private
217
+ */
218
+ export function parseISODateString(isoString) {
219
+ isoString = `${isoString}`;
220
+ let date;
221
+ let precision;
222
+ if (/^\d{4}$/.test(isoString)) {
223
+ // yyyy
224
+ date = new Date(+isoString, 0, 1);
225
+ precision = DatePrecision.Year;
226
+ }
227
+ else if (/^\d{4}-\d{1,2}$/.test(isoString)) {
228
+ // yyyy-mm
229
+ const parts = isoString.split("-");
230
+ date = new Date(+parts[0], +parts[1] - 1, 1);
231
+ precision = DatePrecision.Month;
232
+ }
233
+ else if (/^\d{4}-\d{1,2}-\d{1,2}$/.test(isoString)) {
234
+ // yyyy-mm-dd
235
+ const parts = isoString.split("-");
236
+ date = new Date(+parts[0], +parts[1] - 1, +parts[2]);
237
+ precision = DatePrecision.Day;
238
+ }
239
+ else if (!Number.isNaN(Date.parse(isoString))) {
240
+ // any other string parsable to a valid date
241
+ date = new Date(isoString);
242
+ precision = isoString.includes("T")
243
+ ? DatePrecision.Time
244
+ : DatePrecision.Day;
245
+ }
246
+ return date && precision && { date, precision };
247
+ }
248
+ // NOTE: IItem has spatialRefernce: ISpatialReference, but
249
+ // the portal REST API returns spatialReference as as string
250
+ // that is always either WKID like "102100" or the name of a
251
+ // WKT like "NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103_Feet".
252
+ // We only coerce WKIDs into a ISpatialReference objects since we
253
+ // can't easily lookup a complete WKT.
254
+ /**
255
+ * Get the spatial reference as an object for an item
256
+ * @param item
257
+ * @returns spatial reference object
258
+ * @private
259
+ */
260
+ export const getItemSpatialReference = (item) => {
261
+ const spatialReference = item.spatialReference;
262
+ if (!spatialReference || typeof spatialReference === "object") {
263
+ // no need to try and transform this into an ISpatialReference
264
+ return spatialReference;
265
+ }
266
+ // otherwise it _should_ be a string (if coming form the REST API)
267
+ // but we force it in case it was set to a number somewhere outside of TS
268
+ const spatialReferenceString = spatialReference + "";
269
+ const wkid = parseInt(spatialReferenceString, 10);
270
+ return isNaN(wkid)
271
+ ? // It looks like the portal api returns the name of a WKT, but we'd
272
+ // need to perform a lookup to get the full WKT. Return null for now.
273
+ null
274
+ : //
275
+ { wkid };
276
+ };
277
+ /**
278
+ * Extracts additional resources from the provided metadata
279
+ * and transforms them into a hub-friendly format.
280
+ *
281
+ * Returns null if no resources are available
282
+ *
283
+ * @param item
284
+ * @param metadata formal metadata
285
+ * @returns
286
+ * @private
287
+ */
288
+ export const getAdditionalResources = (item, metadata, requestOptions) => {
289
+ const rawResources = extractRawResources(metadata);
290
+ return (rawResources &&
291
+ rawResources.map((resource) => ({
292
+ name: resource.orName,
293
+ url: getAdditionalResourceUrl(resource, item, requestOptions),
294
+ isDataSource: isDataSourceOfItem(resource, item),
295
+ })));
296
+ };
297
+ /**
298
+ * @private
299
+ *
300
+ * Extracts additional resources from formal item metadata.
301
+ * If none are available, null is returned.
302
+ *
303
+ * @param metadata the formal item metadata
304
+ * @returns an array of all additional resources, or null
305
+ */
306
+ export const extractRawResources = (metadata) => {
307
+ const rawResources = [];
308
+ // The property path to additional resources should be fairly simple.
309
+ // In many cases, it's just `metadata.metadata.distInfo.distTranOps.onLineSrc`.
310
+ // However, since `distInfo`, `distTranOps` and `onLineSrc` can be either
311
+ // Objects OR Arrays, we have to do all this looping.
312
+ castToArray(getProp(metadata, "metadata.distInfo") || []).forEach((distInfo) => {
313
+ castToArray(distInfo.distTranOps || []).forEach((distTranOps) => {
314
+ castToArray(distTranOps.onLineSrc || []).forEach((onLineSrc) => {
315
+ rawResources.push(onLineSrc);
316
+ });
317
+ });
318
+ });
319
+ return rawResources.length ? rawResources : null;
320
+ };
321
+ /**
322
+ * @private
323
+ *
324
+ * Arrays are returned as-is.
325
+ * Objects are wrapped into a 1 element array.
326
+ *
327
+ * @param objectOrArray
328
+ * @returns the casted array
329
+ */
330
+ const castToArray = (objectOrArray) => {
331
+ return Array.isArray(objectOrArray) ? objectOrArray : [objectOrArray];
332
+ };
333
+ /**
334
+ * Determines whether a raw additional resource (i.e. extracted out of formal
335
+ * metadata with no transformation) references the underlying service that backs
336
+ * the item.
337
+ *
338
+ * @param resource raw additional resource of an item
339
+ * @param item
340
+ * @returns
341
+ * @private
342
+ */
343
+ export const isDataSourceOfItem = (resource, item) => {
344
+ const serviceUrl = item.url && parseServiceUrl(item.url);
345
+ return (serviceUrl && resource.linkage && resource.linkage.includes(serviceUrl));
346
+ };
347
+ /**
348
+ * Returns the url for an additional resource.
349
+ *
350
+ * Automatically appends auth token if token is available
351
+ * and resource points to the backing service of an item.
352
+ *
353
+ * @param resource raw additional resource of an item
354
+ * @param item
355
+ * @param requestOptions IHubRequestOptions, including authentication
356
+ * @returns
357
+ * @private
358
+ */
359
+ export const getAdditionalResourceUrl = (resource, item, requestOptions) => {
360
+ let result = resource.linkage;
361
+ const token = getProp(requestOptions, "authentication.token");
362
+ if (token && isDataSourceOfItem(resource, item)) {
363
+ const resUrl = new URL(resource.linkage);
364
+ const params = new URLSearchParams(resUrl.search);
365
+ params.set("token", token);
366
+ resUrl.search = params.toString();
367
+ result = resUrl.toString();
368
+ }
369
+ return result;
370
+ };
371
+ /**
372
+ * @private
373
+ *
374
+ * Contains fallback logic for determining a content's extent.
375
+ *
376
+ * The fallback priority is as follows:
377
+ * 1) item's extent (if valid bbox)
378
+ * 2) extent enrichment from the hub api (if coordinates are valid bbox)
379
+ * 3) layer's extent (if spatial reference is 4326)
380
+ *
381
+ * If none of these conditions are met, undefined is returned.
382
+ *
383
+ * @param item
384
+ * @param layer
385
+ * @param extentEnrichment
386
+ * @returns the correct extent in a bbox format, or undefined
387
+ */
388
+ export const determineExtent = (item, extentEnrichment, layer) => {
389
+ const itemExtent = isBBox(item.extent) ? item.extent : undefined;
390
+ const extentEnrichmentCoordinates = isBBox(extentEnrichment === null || extentEnrichment === void 0 ? void 0 : extentEnrichment.coordinates)
391
+ ? extentEnrichment.coordinates
392
+ : undefined;
393
+ const layerExtent = getProp(layer, "extent.spatialReference.wkid") === 4326
394
+ ? extentToBBox(layer.extent)
395
+ : undefined;
396
+ return itemExtent || extentEnrichmentCoordinates || layerExtent;
397
+ };
398
+ /**
399
+ * @private
400
+ *
401
+ * Extracts the first contact from a given formal item metadata path.
402
+ * This is particularly helpful if the contact path is either an object or an array.
403
+ *
404
+ * Note: the raw contact object must have the following properties:
405
+ * - `rpIndName`: name of the individual
406
+ * - `rpOrgName`: name of the individual's organization
407
+ *
408
+ * @param metadata formal item metadata
409
+ * @param path path to the contact object/array
410
+ * @returns
411
+ */
412
+ export const extractFirstContact = (metadata, path) => {
413
+ const rawContacts = getProp(metadata, path) || {};
414
+ const { rpIndName, rpOrgName } = Array.isArray(rawContacts)
415
+ ? rawContacts[0]
416
+ : rawContacts;
417
+ return { individualName: rpIndName, organizationName: rpOrgName };
418
+ };
419
+ /**
420
+ * Determines the correct orgId for an item.
421
+ * Note: it's undocumented, but the portal API will return orgId for items... sometimes.
422
+ *
423
+ * @param item
424
+ * @param ownerUser item owner's hydrated user object
425
+ */
426
+ export const getItemOrgId = (item, ownerUser) => item.orgId || (ownerUser === null || ownerUser === void 0 ? void 0 : ownerUser.orgId);
427
+ /**
428
+ * Calculates the Publisher display info for the given item.
429
+ * Utilizes this fallback pattern:
430
+ * 1) Formal Item Metadata > Resource > Citation > Contact
431
+ * 2) Formal Item Metadata > Resource > Contact
432
+ * 3) Item’s Owner and Org Name
433
+ * 4) Undefined (Item Owner / Org are private and we can't access additional info)
434
+ *
435
+ * @param item
436
+ * @param metadata
437
+ * @param org portal info of the item's organization
438
+ * @param ownerUser the item owner's hydrated user
439
+ * @returns
440
+ */
441
+ export const getPublisherInfo = (item, metadata, org, ownerUser) => {
442
+ const result = {
443
+ nameSource: PublisherSource.None,
444
+ organizationSource: PublisherSource.None,
445
+ };
446
+ const citationContact = extractFirstContact(metadata, "metadata.dataIdInfo.idCitation.citRespParty");
447
+ const resourceContact = extractFirstContact(metadata, "metadata.dataIdInfo.idPoC");
448
+ const metadataContact = extractFirstContact(metadata, "metadata.mdContact");
449
+ // Determine publisher name properties
450
+ const ownerFullName = getProp(ownerUser, "fullName");
451
+ if (citationContact.individualName) {
452
+ result.name = citationContact.individualName;
453
+ result.nameSource = PublisherSource.CitationContact;
454
+ }
455
+ else if (resourceContact.individualName) {
456
+ result.name = resourceContact.individualName;
457
+ result.nameSource = PublisherSource.ResourceContact;
458
+ }
459
+ else if (metadataContact.individualName) {
460
+ result.name = metadataContact.individualName;
461
+ result.nameSource = PublisherSource.MetadataContact;
462
+ }
463
+ else if (ownerFullName) {
464
+ result.name = ownerFullName;
465
+ result.username = ownerUser.username;
466
+ result.nameSource = PublisherSource.ItemOwner;
467
+ }
468
+ // Determine publisher org properties
469
+ const orgName = getProp(org, "name");
470
+ if (citationContact.organizationName) {
471
+ result.organization = citationContact.organizationName;
472
+ result.organizationSource = PublisherSource.CitationContact;
473
+ }
474
+ else if (resourceContact.organizationName) {
475
+ result.organization = resourceContact.organizationName;
476
+ result.organizationSource = PublisherSource.ResourceContact;
477
+ }
478
+ else if (metadataContact.organizationName) {
479
+ result.organization = metadataContact.organizationName;
480
+ result.organizationSource = PublisherSource.MetadataContact;
481
+ }
482
+ else if (orgName) {
483
+ result.organization = orgName;
484
+ result.orgId = getItemOrgId(item, ownerUser);
485
+ result.organizationSource = PublisherSource.ItemOwner;
486
+ }
487
+ // We assume the item belongs to external org if no org info is available and the item is private
488
+ result.isExternal =
489
+ result.organizationSource === PublisherSource.None &&
490
+ item.access !== "public";
491
+ return result;
492
+ };
493
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content/_internal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOlE,OAAO,EAAe,eAAe,EAAE,MAAM,YAAY,CAAC;AAM1D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,MAAM,GACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE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