@omerlo/omerlo-webkit 0.0.10 → 0.0.12
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/omerlo/reader/endpoints/contents.js +2 -0
- package/dist/omerlo/reader/endpoints/organizations.js +7 -7
- package/dist/omerlo/reader/endpoints/profileType.d.ts +1 -1
- package/dist/omerlo/reader/endpoints/profileType.js +10 -2
- package/dist/omerlo/reader/endpoints/projects.js +4 -4
- package/package.json +1 -1
|
@@ -51,6 +51,7 @@ export function parseContentSummary(data, assocs) {
|
|
|
51
51
|
subtitleText: data.localized.subtitle_text,
|
|
52
52
|
visual: parseVisual(data.visual, assocs),
|
|
53
53
|
meta: buildMeta(data.localized.locale),
|
|
54
|
+
metadata: {},
|
|
54
55
|
authors: getAssocs(assocs, 'profiles', data.localized.author_ids)
|
|
55
56
|
};
|
|
56
57
|
}
|
|
@@ -73,6 +74,7 @@ export function parseContentSummary(data, assocs) {
|
|
|
73
74
|
subtitleText: data.subtitle_text,
|
|
74
75
|
visual: parseVisual(data.visual, assocs),
|
|
75
76
|
meta: { locales: parseLocalesMetadata(data.meta) },
|
|
77
|
+
metadata: {},
|
|
76
78
|
authors: getAssocs(assocs, 'profiles', data.author_ids)
|
|
77
79
|
};
|
|
78
80
|
}
|
|
@@ -21,21 +21,21 @@ export function parseOrganizationSummary(data, assocs) {
|
|
|
21
21
|
kind: 'organization',
|
|
22
22
|
name: data.name,
|
|
23
23
|
profileImageURL: data.logo_image_url,
|
|
24
|
-
meta: buildMeta(data.localized
|
|
25
|
-
summaryHtml: data.localized
|
|
26
|
-
summaryText: data.localized
|
|
24
|
+
meta: buildMeta(data.localized?.locale),
|
|
25
|
+
summaryHtml: data.localized?.summary_html,
|
|
26
|
+
summaryText: data.localized?.summary_text,
|
|
27
27
|
updatedAt: new Date(data.updated_at)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export function parseOrganization(data, assocs) {
|
|
31
|
-
const contact = data.
|
|
32
|
-
? parseProfileContact(data.
|
|
31
|
+
const contact = data.localized_contact
|
|
32
|
+
? parseProfileContact(data.localized_contact, assocs)
|
|
33
33
|
: null;
|
|
34
34
|
const address = data.localized_address
|
|
35
35
|
? parseProfileAddress(data.localized_address, assocs)
|
|
36
36
|
: null;
|
|
37
|
-
const description = data.
|
|
38
|
-
? parseProfileDescription(data.
|
|
37
|
+
const description = data.localized_description
|
|
38
|
+
? parseProfileDescription(data.localized_description, assocs)
|
|
39
39
|
: null;
|
|
40
40
|
return {
|
|
41
41
|
...parseOrganizationSummary(data, assocs),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ApiAssocs, type ApiData } from '../utils/api';
|
|
2
|
-
import type
|
|
2
|
+
import { type LocalesMetadata } from '../utils/response';
|
|
3
3
|
export interface ProfileTypeSummary {
|
|
4
4
|
id: string;
|
|
5
5
|
kind: 'person' | 'project' | 'organization' | 'event';
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import {} from '../utils/api';
|
|
2
|
+
import { parseLocalesMetadata } from '../utils/response';
|
|
2
3
|
import { buildMeta } from '../utils/parseHelpers';
|
|
3
4
|
export function parseProfileTypeSummary(data, _assocs) {
|
|
5
|
+
let localizedField;
|
|
6
|
+
// NOTE: This is to support publisher public api v2
|
|
7
|
+
if (data.localized) {
|
|
8
|
+
localizedField = { name: data.localized.name, meta: buildMeta(data.localized.locale) };
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
localizedField = { name: data.name, meta: { locales: parseLocalesMetadata(data.meta) } };
|
|
12
|
+
}
|
|
4
13
|
return {
|
|
14
|
+
...localizedField,
|
|
5
15
|
id: data.id,
|
|
6
16
|
kind: data.kind,
|
|
7
17
|
key: data.key,
|
|
8
|
-
name: data.localized.name,
|
|
9
|
-
meta: buildMeta(data.localized.locale),
|
|
10
18
|
updatedAt: new Date(data.updated_at)
|
|
11
19
|
};
|
|
12
20
|
}
|
|
@@ -9,10 +9,10 @@ export function parseProjectSummary(data, assocs) {
|
|
|
9
9
|
kind: 'project',
|
|
10
10
|
profileImageURL: data.logo_image_url,
|
|
11
11
|
coverImageURL: data.cover_image_url,
|
|
12
|
-
meta: buildMeta(data.localized),
|
|
13
|
-
name: data.localized
|
|
14
|
-
summaryHtml: data.localized
|
|
15
|
-
summaryText: data.localized
|
|
12
|
+
meta: buildMeta(data.localized?.locale),
|
|
13
|
+
name: data.localized?.name,
|
|
14
|
+
summaryHtml: data.localized?.summary_html,
|
|
15
|
+
summaryText: data.localized?.summary_text,
|
|
16
16
|
updatedAt: new Date(data.updated_at)
|
|
17
17
|
};
|
|
18
18
|
}
|