@streamscloud/streams-analytics-collector 2.0.10 → 3.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/dist/analytics-collector.d.ts +24 -0
- package/dist/analytics-collector.js +51 -0
- package/dist/{analytics/app-events-tracker.d.ts → app-events-tracker.d.ts} +37 -0
- package/dist/appearance-events-tracker.d.ts +14 -0
- package/dist/appearance-events-tracker.js +26 -0
- package/dist/contained-entity-measurements-tracker.d.ts +15 -0
- package/dist/contained-entity-measurements-tracker.js +78 -0
- package/dist/events-reporter.d.ts +14 -0
- package/dist/events-reporter.js +27 -0
- package/dist/gql-data-sender.d.ts +16 -0
- package/dist/gql-data-sender.js +38 -0
- package/dist/graphql/report-event.graphql.js +3 -0
- package/dist/graphql/report-external-event.graphql.js +3 -0
- package/dist/graphql/report-external-measurement.graphql.js +3 -0
- package/dist/graphql/report-measurement.graphql.js +3 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -4
- package/dist/measurements-batcher.d.ts +23 -0
- package/dist/measurements-batcher.js +90 -0
- package/dist/measurements-reporter.d.ts +15 -0
- package/dist/measurements-reporter.js +28 -0
- package/dist/report-event.graphql.js +3 -0
- package/dist/report-external-event.graphql.js +3 -0
- package/dist/report-external-measurement.graphql.js +3 -0
- package/dist/report-measurement.graphql.js +3 -0
- package/dist/reporting/events-reporter.d.ts +14 -0
- package/dist/reporting/events-reporter.js +30 -0
- package/dist/reporting/gql-data-sender.d.ts +12 -0
- package/dist/reporting/gql-data-sender.js +35 -0
- package/dist/reporting/index.d.ts +4 -0
- package/dist/reporting/measurements-reporter.d.ts +15 -0
- package/dist/reporting/measurements-reporter.js +31 -0
- package/dist/reporting/report-event.graphql.js +3 -0
- package/dist/reporting/report-external-event.graphql.js +3 -0
- package/dist/reporting/report-external-measurement.graphql.js +3 -0
- package/dist/reporting/report-measurement.graphql.js +3 -0
- package/dist/reporting/types.d.ts +54 -0
- package/dist/reporting/types.js +35 -0
- package/dist/schemas.d.ts +5 -0
- package/dist/schemas.js +17 -0
- package/dist/types.d.ts +0 -4
- package/dist/types.js +38 -0
- package/dist/viewport-visibility-tracker.d.ts +13 -0
- package/dist/viewport-visibility-tracker.js +104 -0
- package/package.json +5 -6
- package/dist/adcampaignsquery.graphql.js +0 -3
- package/dist/analytics/ViewportVisibilityTracker.d.ts +0 -46
- package/dist/analytics/ViewportVisibilityTracker.js +0 -117
- package/dist/analytics/app-events-tracker.js +0 -430
- package/dist/analytics/index.d.ts +0 -3
- package/dist/analytics/index.js +0 -3
- package/dist/analytics/types.d.ts +0 -37
- package/dist/analytics/types.js +0 -33
- package/dist/analytics.graphql.js +0 -3
- package/dist/articlequery.graphql.js +0 -3
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +0 -1
- package/dist/components/types.d.ts +0 -19
- package/dist/components/types.js +0 -12
- package/dist/components-data/component-data-provider.service.d.ts +0 -3
- package/dist/components-data/component-data-provider.service.js +0 -35
- package/dist/components-data/components-data-fetcher.service.d.ts +0 -5
- package/dist/components-data/components-data-fetcher.service.js +0 -35
- package/dist/components-data/components-data-parameters-reader.service.d.ts +0 -2
- package/dist/components-data/components-data-parameters-reader.service.js +0 -20
- package/dist/components-data/index.d.ts +0 -4
- package/dist/components-data/index.js +0 -3
- package/dist/components-data/types.d.ts +0 -24
- package/dist/components-data/types.js +0 -6
- package/dist/contentlistsquery.graphql.js +0 -3
- package/dist/data-loaders/index.d.ts +0 -2
- package/dist/data-loaders/index.js +0 -2
- package/dist/data-loaders/short-videos-data-loader/index.d.ts +0 -2
- package/dist/data-loaders/short-videos-data-loader/loader.d.ts +0 -4
- package/dist/data-loaders/short-videos-data-loader/loader.js +0 -14
- package/dist/data-loaders/short-videos-data-loader/mapper.d.ts +0 -3
- package/dist/data-loaders/short-videos-data-loader/mapper.js +0 -27
- package/dist/data-loaders/short-videos-data-loader/types.d.ts +0 -14
- package/dist/data-loaders/streams-data-loader/index.d.ts +0 -2
- package/dist/data-loaders/streams-data-loader/loader.d.ts +0 -4
- package/dist/data-loaders/streams-data-loader/loader.js +0 -14
- package/dist/data-loaders/streams-data-loader/mapper.d.ts +0 -3
- package/dist/data-loaders/streams-data-loader/mapper.js +0 -11
- package/dist/data-loaders/streams-data-loader/types.d.ts +0 -4
- package/dist/data-loaders/types.d.ts +0 -3
- package/dist/external-analytics.graphql.js +0 -3
- package/dist/internal-analytics.graphql.js +0 -3
- package/dist/postsquery.graphql.js +0 -3
- package/dist/services/embed-content-api-client.d.ts +0 -8
- package/dist/services/embed-content-api-client.js +0 -48
- package/dist/services/embed-content-client.service.d.ts +0 -2
- package/dist/services/embed-content-client.service.js +0 -5
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -2
- package/dist/services/operations/posts-query.graphql.js +0 -3
- package/dist/services/operations/streams-query.graphql.js +0 -3
- package/dist/services/types.d.ts +0 -303
- package/dist/streams-api-client-model.d.ts +0 -5
- package/dist/streams-content-api-client.d.ts +0 -14
- package/dist/streams-content-api-client.js +0 -89
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { ComponentDataProvider, ComponentsData, ComponentsDataParameters, ContentParameters, ComponentData, ComponentDataModel, DataParameters } from './types';
|
|
2
|
-
export { createComponentDataProvider } from './component-data-provider.service';
|
|
3
|
-
export { createComponentsDataFetcher } from './components-data-fetcher.service';
|
|
4
|
-
export { getComponentsDataParameters } from './components-data-parameters-reader.service';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ShortVideoModel, StreamModel } from '../data-loaders';
|
|
2
|
-
export declare const DataType: {
|
|
3
|
-
ShortVideo: string;
|
|
4
|
-
Stream: string;
|
|
5
|
-
};
|
|
6
|
-
export type ComponentsDataParameters = {
|
|
7
|
-
[key: string]: ContentParameters | undefined;
|
|
8
|
-
};
|
|
9
|
-
export type ContentParameters = {
|
|
10
|
-
ids: string[];
|
|
11
|
-
};
|
|
12
|
-
export type ComponentsData = {
|
|
13
|
-
[key: string]: ComponentDataModel[];
|
|
14
|
-
};
|
|
15
|
-
export type ComponentDataModel = ShortVideoModel | StreamModel;
|
|
16
|
-
export type DataParameters = {
|
|
17
|
-
[key: string]: string[] | undefined;
|
|
18
|
-
};
|
|
19
|
-
export type ComponentData = {
|
|
20
|
-
[key: string]: ComponentDataModel[] | undefined;
|
|
21
|
-
};
|
|
22
|
-
export type ComponentDataProvider = {
|
|
23
|
-
getData: (parameters?: DataParameters) => ComponentData;
|
|
24
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var SiteContentListsQuery = "query SiteContentLists($cursor: CursorOfSiteContentListsOrderByInput!, $filter: SiteContentListsFilterInput!) {\n siteContentLists(cursor: $cursor, filter: $filter) {\n items {\n ...ContentListFragment\n }\n }\n}\n\nfragment ContentListFragment on ContentList {\n id\n name\n}\n";
|
|
2
|
-
|
|
3
|
-
export { SiteContentListsQuery as default };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { mapToSiteShortVideoModels } from './mapper.js';
|
|
2
|
-
|
|
3
|
-
const getShortVideosDataLoader = (client) => ({
|
|
4
|
-
async load(ids) {
|
|
5
|
-
const posts = await client.getPosts(ids);
|
|
6
|
-
if (!posts) {
|
|
7
|
-
console.error('Failed to fetch site short video posts: Null-payload received', posts);
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
return mapToSiteShortVideoModels(posts);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export { getShortVideosDataLoader };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const mapToSiteShortVideoModels = (posts) => {
|
|
2
|
-
return posts.map((post) => {
|
|
3
|
-
const shortVideo = {
|
|
4
|
-
id: post.id,
|
|
5
|
-
displayDate: post.postHeading.postDisplayDate,
|
|
6
|
-
authorName: post.postHeading.sourceName,
|
|
7
|
-
authorImage: post.postHeading.sourceImage ?? '',
|
|
8
|
-
authorType: post.postHeading.sourceType,
|
|
9
|
-
viewsCount: post.postHeading.postViewsCount,
|
|
10
|
-
reactionsCount: post.social?.reactions.total ?? 0,
|
|
11
|
-
commentsCount: post.social?.commentsCount ?? 0,
|
|
12
|
-
sharesCount: post.social?.sharesCount ?? 0,
|
|
13
|
-
text: post.postData.shortVideoData.text ?? '',
|
|
14
|
-
media: post.postData.media.map((x) => {
|
|
15
|
-
const media = {
|
|
16
|
-
type: x.type,
|
|
17
|
-
url: x.url,
|
|
18
|
-
thumbnailUrl: x.thumbnailUrl
|
|
19
|
-
};
|
|
20
|
-
return media;
|
|
21
|
-
})
|
|
22
|
-
};
|
|
23
|
-
return shortVideo;
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { mapToSiteShortVideoModels };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Media } from '../../services/types';
|
|
2
|
-
export interface ShortVideoModel {
|
|
3
|
-
id: string;
|
|
4
|
-
text: string;
|
|
5
|
-
authorName: string;
|
|
6
|
-
authorImage: string;
|
|
7
|
-
authorType: string;
|
|
8
|
-
displayDate: string;
|
|
9
|
-
viewsCount: number;
|
|
10
|
-
reactionsCount: number;
|
|
11
|
-
commentsCount: number;
|
|
12
|
-
sharesCount: number;
|
|
13
|
-
media: Media[];
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { mapToStreamModels } from './mapper.js';
|
|
2
|
-
|
|
3
|
-
const getStreamsDataLoader = (client) => ({
|
|
4
|
-
async load(ids) {
|
|
5
|
-
const streams = await client.getStreams(ids);
|
|
6
|
-
if (!streams) {
|
|
7
|
-
console.error('Failed to fetch site short video posts: Null-payload received', streams);
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
return mapToStreamModels(streams);
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export { getStreamsDataLoader };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var SitePostsQuery = "query SitePosts($cursor: CursorOfSitePostsOrderByInput!, $filter: SitePostsFilterInput!) {\n sitePosts(cursor: $cursor, filter: $filter) {\n items {\n ...PostItemFragment\n }\n }\n}\n\nfragment PostItemFragment on Post {\n id\n postType\n postData {\n media {\n ...ContentMediaItemPayloadFragment\n ...ContentMediaItemTagsPayloadFragment\n }\n audioData {\n text\n }\n eventData {\n title\n text\n location {\n latitude\n longitude\n name\n }\n startDateTime\n endDateTime\n }\n mediaData {\n text\n }\n momentData {\n text\n }\n linkData {\n text\n linkData {\n ...LinkViewPayloadFragment\n }\n }\n shortVideoData {\n text\n }\n articleData {\n title\n kicker\n article {\n slug\n }\n }\n textData {\n text\n }\n videoData {\n title\n text\n }\n }\n postHeading {\n ...PostHeadingPayloadFragment\n }\n}\n\nfragment ContentMediaItemPayloadFragment on ContentMediaItem {\n url(scale: ORIGINAL_ENCODED)\n thumbnailUrl(scale: ORIGINAL_ENCODED)\n type\n metadata {\n ...MediaItemMetadataPayloadFragment\n }\n}\n\nfragment MediaItemMetadataPayloadFragment on MediaItemMetadata {\n fileName\n width\n height\n durationSec\n}\n\nfragment ContentMediaItemTagsPayloadFragment on ContentMediaItem {\n productTags {\n ...ProductTagPositionPayloadFragment\n }\n userTags {\n ...UserTagPositionPayloadFragment\n }\n mediaPageTags {\n ...MediaPageTagPositionPayloadFragment\n }\n}\n\nfragment ProductTagPositionPayloadFragment on ProductTagPosition {\n itemId\n leftPCT\n topPCT\n product {\n id\n name\n image\n price\n currency\n }\n}\n\nfragment UserTagPositionPayloadFragment on UserTagPosition {\n itemId\n leftPCT\n topPCT\n user {\n id\n name\n image\n username\n }\n}\n\nfragment MediaPageTagPositionPayloadFragment on MediaPageTagPosition {\n itemId\n leftPCT\n topPCT\n mediaPage {\n id\n name\n image\n handle\n }\n}\n\nfragment LinkViewPayloadFragment on LinkData {\n hideImage\n host\n text\n title\n url\n media {\n url\n thumbnailUrl\n type\n }\n}\n\nfragment PostHeadingPayloadFragment on PostHeading {\n sourceId\n sourceName\n sourceImage\n sourceHandle\n sourceType\n postDisplayDate\n postViewsCount\n}\n";
|
|
2
|
-
|
|
3
|
-
export { SitePostsQuery as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Post, Stream } from './types';
|
|
2
|
-
export declare class EmbedContentApiClient {
|
|
3
|
-
private readonly gqlEndpoint;
|
|
4
|
-
constructor(gqlEndpoint: string);
|
|
5
|
-
getPosts(ids: string[]): Promise<Post[] | undefined>;
|
|
6
|
-
getStreams(ids: string[]): Promise<Stream[] | undefined>;
|
|
7
|
-
private queryGql;
|
|
8
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import EmbedPostsQuery from './operations/posts-query.graphql.js';
|
|
2
|
-
import EmbedStreamsQuery from './operations/streams-query.graphql.js';
|
|
3
|
-
|
|
4
|
-
class EmbedContentApiClient {
|
|
5
|
-
gqlEndpoint;
|
|
6
|
-
constructor(gqlEndpoint) {
|
|
7
|
-
this.gqlEndpoint = gqlEndpoint;
|
|
8
|
-
}
|
|
9
|
-
async getPosts(ids) {
|
|
10
|
-
const response = await this.queryGql(EmbedPostsQuery, {
|
|
11
|
-
input: {
|
|
12
|
-
filter: {
|
|
13
|
-
ids: ids
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return response.embedPosts?.items;
|
|
18
|
-
}
|
|
19
|
-
async getStreams(ids) {
|
|
20
|
-
const response = await this.queryGql(EmbedStreamsQuery, {
|
|
21
|
-
input: {
|
|
22
|
-
filter: {
|
|
23
|
-
ids: ids
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return response.embedStreams?.items;
|
|
28
|
-
}
|
|
29
|
-
queryGql = async (query, variables) => {
|
|
30
|
-
const response = await fetch(this.gqlEndpoint, {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
headers: {
|
|
33
|
-
'Content-Type': 'application/json'
|
|
34
|
-
},
|
|
35
|
-
body: JSON.stringify({
|
|
36
|
-
query,
|
|
37
|
-
variables
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
const gql = await response.json();
|
|
41
|
-
if (!gql.data) {
|
|
42
|
-
throw new Error(JSON.stringify(gql.errors));
|
|
43
|
-
}
|
|
44
|
-
return gql.data;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { EmbedContentApiClient };
|
package/dist/services/index.d.ts
DELETED
package/dist/services/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var EmbedPostsQuery = "query EmbedPosts($input: EmbedPostsInput!) {\n embedPosts(input: $input) {\n items {\n id\n postHeading {\n postDisplayDate\n postViewsCount\n sourceId\n sourceImage\n sourceName\n sourceType\n }\n social {\n commentsCount\n sharesCount\n reactions {\n total\n }\n }\n postData {\n postType\n media {\n thumbnailUrl(scale: ORIGINAL_ENCODED)\n url(scale: ORIGINAL_ENCODED)\n type\n }\n shortVideoData {\n text\n }\n }\n }\n }\n}";
|
|
2
|
-
|
|
3
|
-
export { EmbedPostsQuery as default };
|
package/dist/services/types.d.ts
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { MediaItem } from '../types';
|
|
2
|
-
export type EmbedContentApiClientModel = {
|
|
3
|
-
streamsGqlEndpoint: string;
|
|
4
|
-
};
|
|
5
|
-
export type EmbedPostsInput = {
|
|
6
|
-
filter: EmbedPostsFilterInput;
|
|
7
|
-
};
|
|
8
|
-
export type EmbedStreamsInput = {
|
|
9
|
-
filter: EmbedPostsFilterInput;
|
|
10
|
-
};
|
|
11
|
-
export interface Media {
|
|
12
|
-
type: MediaType;
|
|
13
|
-
url: string;
|
|
14
|
-
thumbnailUrl: string | null;
|
|
15
|
-
}
|
|
16
|
-
export type EmbedPostsFilterInput = {
|
|
17
|
-
ids: string[];
|
|
18
|
-
};
|
|
19
|
-
export type EmbedPostsData = {
|
|
20
|
-
embedPosts: CursorResultOfPost;
|
|
21
|
-
};
|
|
22
|
-
export type EmbedStreamsFilterInput = {
|
|
23
|
-
ids: string[];
|
|
24
|
-
};
|
|
25
|
-
export type EmbedStreamsData = {
|
|
26
|
-
embedStreams: CursorResultOfStreams;
|
|
27
|
-
};
|
|
28
|
-
export type GqlResponse<T> = {
|
|
29
|
-
data?: T;
|
|
30
|
-
errors?: unknown;
|
|
31
|
-
};
|
|
32
|
-
export type ContentMediaItem = IMediaItem & {
|
|
33
|
-
blobId: string;
|
|
34
|
-
mediaPageTags?: MediaPageTagPosition[];
|
|
35
|
-
metadata: MediaItemMetadata;
|
|
36
|
-
thumbnailBlobId?: string;
|
|
37
|
-
thumbnailUrl: string | null;
|
|
38
|
-
type: MediaType;
|
|
39
|
-
url: string;
|
|
40
|
-
userTags?: UserTagPosition[];
|
|
41
|
-
};
|
|
42
|
-
export type CtaButton = {
|
|
43
|
-
background: string;
|
|
44
|
-
border: string;
|
|
45
|
-
text: string;
|
|
46
|
-
textColor: string;
|
|
47
|
-
url: string;
|
|
48
|
-
};
|
|
49
|
-
export type IMediaItem = {
|
|
50
|
-
blobId: string;
|
|
51
|
-
metadata: MediaItemMetadata;
|
|
52
|
-
thumbnailBlobId?: string;
|
|
53
|
-
thumbnailUrl?: string;
|
|
54
|
-
type: MediaType;
|
|
55
|
-
url: string;
|
|
56
|
-
};
|
|
57
|
-
export declare enum MediaFormat {
|
|
58
|
-
W4H3 = "W4H3",
|
|
59
|
-
W16H9 = "W16H9"
|
|
60
|
-
}
|
|
61
|
-
export type MediaItemMetadata = {
|
|
62
|
-
durationSec?: number;
|
|
63
|
-
fileName?: string;
|
|
64
|
-
height: number;
|
|
65
|
-
width: number;
|
|
66
|
-
};
|
|
67
|
-
export type MediaPageTag = {
|
|
68
|
-
handle: string;
|
|
69
|
-
id: string;
|
|
70
|
-
image?: string;
|
|
71
|
-
name: string;
|
|
72
|
-
};
|
|
73
|
-
export type MediaPageTagPosition = TagPosition & {
|
|
74
|
-
itemId: string;
|
|
75
|
-
leftPCT: number;
|
|
76
|
-
mediaPage?: MediaPageTag;
|
|
77
|
-
topPCT: number;
|
|
78
|
-
};
|
|
79
|
-
export type MediaPostData = {
|
|
80
|
-
ctaButton?: CtaButton;
|
|
81
|
-
preferredMediaFormat: MediaFormat;
|
|
82
|
-
text?: string;
|
|
83
|
-
};
|
|
84
|
-
export declare enum MediaType {
|
|
85
|
-
Audio = "AUDIO",
|
|
86
|
-
Image = "IMAGE",
|
|
87
|
-
ShortVideo = "SHORT_VIDEO",
|
|
88
|
-
Video = "VIDEO"
|
|
89
|
-
}
|
|
90
|
-
export type MomentInfo = {
|
|
91
|
-
author: Profile;
|
|
92
|
-
cover: string;
|
|
93
|
-
displayDate: Date;
|
|
94
|
-
id: string;
|
|
95
|
-
isSeen: boolean;
|
|
96
|
-
text?: string;
|
|
97
|
-
};
|
|
98
|
-
export declare enum MomentLifetime {
|
|
99
|
-
Day = "DAY",
|
|
100
|
-
Week = "WEEK"
|
|
101
|
-
}
|
|
102
|
-
export type MomentPostData = {
|
|
103
|
-
lifetime: MomentLifetime;
|
|
104
|
-
text?: string;
|
|
105
|
-
};
|
|
106
|
-
export type MomentsContainerInfo = {
|
|
107
|
-
hideIfNoMoments: boolean;
|
|
108
|
-
image?: ScaledImageBlob;
|
|
109
|
-
momentsEnabled: boolean;
|
|
110
|
-
primaryColor?: string;
|
|
111
|
-
targetId: string;
|
|
112
|
-
targetType: PublishTargetType;
|
|
113
|
-
useImageAsMomentsCover: boolean;
|
|
114
|
-
};
|
|
115
|
-
export type MomentsInfo = {
|
|
116
|
-
containerInfo: MomentsContainerInfo;
|
|
117
|
-
moments: MomentInfo[];
|
|
118
|
-
unseenMomentsCount: number;
|
|
119
|
-
};
|
|
120
|
-
export type CursorResultOfStreams = {
|
|
121
|
-
continuationToken?: string;
|
|
122
|
-
items: Stream[];
|
|
123
|
-
};
|
|
124
|
-
export type CursorResultOfPost = {
|
|
125
|
-
continuationToken?: string;
|
|
126
|
-
items: Post[];
|
|
127
|
-
};
|
|
128
|
-
export type Post = {
|
|
129
|
-
authorProfile: Profile;
|
|
130
|
-
createdAt: Date;
|
|
131
|
-
createdBy: string;
|
|
132
|
-
displayDate: Date;
|
|
133
|
-
editorProfile: Profile;
|
|
134
|
-
enableSocialInteractions: boolean;
|
|
135
|
-
expiresOn?: Date;
|
|
136
|
-
generatedName: string;
|
|
137
|
-
id: string;
|
|
138
|
-
isPinned: boolean;
|
|
139
|
-
isSeen: boolean;
|
|
140
|
-
language: string;
|
|
141
|
-
mainImage?: string;
|
|
142
|
-
ownerProfile: Profile;
|
|
143
|
-
postData: PostData;
|
|
144
|
-
postHeading: PostHeading;
|
|
145
|
-
postProfile: Profile;
|
|
146
|
-
postType: PostType;
|
|
147
|
-
publishedTo?: PublishTarget;
|
|
148
|
-
scheduledOn?: Date;
|
|
149
|
-
sharesCount: number;
|
|
150
|
-
showInFeed: boolean;
|
|
151
|
-
social?: PostSocialInteractions;
|
|
152
|
-
status: Status;
|
|
153
|
-
updatedAt: Date;
|
|
154
|
-
updatedBy: string;
|
|
155
|
-
userReaction?: Reaction;
|
|
156
|
-
viewsCount: number;
|
|
157
|
-
};
|
|
158
|
-
export type PostData = {
|
|
159
|
-
media: ContentMediaItem[];
|
|
160
|
-
mediaData?: MediaPostData;
|
|
161
|
-
momentData?: MomentPostData;
|
|
162
|
-
postType: PostType;
|
|
163
|
-
shortVideoData?: ShortVideoPostData;
|
|
164
|
-
textData?: TextPostData;
|
|
165
|
-
videoData?: VideoPostData;
|
|
166
|
-
};
|
|
167
|
-
export type PostHeading = {
|
|
168
|
-
networkData?: PostHeadingNetworkTargetData;
|
|
169
|
-
postDisplayDate: string;
|
|
170
|
-
postViewsCount: number;
|
|
171
|
-
sourceHandle: string;
|
|
172
|
-
sourceId: string;
|
|
173
|
-
sourceImage?: string;
|
|
174
|
-
sourceIsRemoved: boolean;
|
|
175
|
-
sourceName: string;
|
|
176
|
-
sourceType: PostSourceType;
|
|
177
|
-
wasModified: boolean;
|
|
178
|
-
};
|
|
179
|
-
export type PostHeadingNetworkTargetData = {
|
|
180
|
-
momentsInfo: MomentsInfo;
|
|
181
|
-
primaryColor?: string;
|
|
182
|
-
};
|
|
183
|
-
export type PostSocialInteractions = {
|
|
184
|
-
commentsCount: number;
|
|
185
|
-
reactions: ReactionsCount;
|
|
186
|
-
sharesCount: number;
|
|
187
|
-
};
|
|
188
|
-
export declare enum PostSourceType {
|
|
189
|
-
Channel = "CHANNEL",
|
|
190
|
-
Group = "GROUP",
|
|
191
|
-
MediaPage = "MEDIA_PAGE",
|
|
192
|
-
Organization = "ORGANIZATION",
|
|
193
|
-
UserProfile = "USER_PROFILE"
|
|
194
|
-
}
|
|
195
|
-
export declare enum PostType {
|
|
196
|
-
Article = "ARTICLE",
|
|
197
|
-
Audio = "AUDIO",
|
|
198
|
-
Event = "EVENT",
|
|
199
|
-
Link = "LINK",
|
|
200
|
-
Media = "MEDIA",
|
|
201
|
-
Moment = "MOMENT",
|
|
202
|
-
ShortVideo = "SHORT_VIDEO",
|
|
203
|
-
Text = "TEXT",
|
|
204
|
-
Video = "VIDEO"
|
|
205
|
-
}
|
|
206
|
-
export type Profile = {
|
|
207
|
-
__typename?: 'Profile';
|
|
208
|
-
handle: string;
|
|
209
|
-
id: string;
|
|
210
|
-
image?: string;
|
|
211
|
-
isRemoved: boolean;
|
|
212
|
-
name: string;
|
|
213
|
-
type: ProfileType;
|
|
214
|
-
};
|
|
215
|
-
export declare enum ProfileType {
|
|
216
|
-
Channel = "CHANNEL",
|
|
217
|
-
Group = "GROUP",
|
|
218
|
-
Organization = "ORGANIZATION",
|
|
219
|
-
User = "USER"
|
|
220
|
-
}
|
|
221
|
-
export type PublishTarget = {
|
|
222
|
-
enableMoments: boolean;
|
|
223
|
-
enablePostsSocialInteractionsByDefault: boolean;
|
|
224
|
-
id: string;
|
|
225
|
-
image?: string;
|
|
226
|
-
isRemoved: boolean;
|
|
227
|
-
momentsLifetime: MomentLifetime;
|
|
228
|
-
name: string;
|
|
229
|
-
primaryColor?: string;
|
|
230
|
-
targetContentOwnerProfile?: Profile;
|
|
231
|
-
type: PublishTargetType;
|
|
232
|
-
};
|
|
233
|
-
export declare enum PublishTargetType {
|
|
234
|
-
Channel = "CHANNEL",
|
|
235
|
-
Group = "GROUP",
|
|
236
|
-
MediaPage = "MEDIA_PAGE",
|
|
237
|
-
User = "USER"
|
|
238
|
-
}
|
|
239
|
-
export declare enum ReactableType {
|
|
240
|
-
ChatMessage = "CHAT_MESSAGE",
|
|
241
|
-
Comment = "COMMENT",
|
|
242
|
-
CommunityMessage = "COMMUNITY_MESSAGE",
|
|
243
|
-
Post = "POST"
|
|
244
|
-
}
|
|
245
|
-
export type Reaction = {
|
|
246
|
-
code: string;
|
|
247
|
-
id: string;
|
|
248
|
-
reactableId: string;
|
|
249
|
-
reactableType: ReactableType;
|
|
250
|
-
userProfile: Profile;
|
|
251
|
-
};
|
|
252
|
-
export type ReactionCodeCount = {
|
|
253
|
-
code: string;
|
|
254
|
-
count: number;
|
|
255
|
-
};
|
|
256
|
-
export type ReactionsCount = {
|
|
257
|
-
perCode: ReactionCodeCount[];
|
|
258
|
-
total: number;
|
|
259
|
-
};
|
|
260
|
-
export type ScaledImageBlob = {
|
|
261
|
-
id: string;
|
|
262
|
-
url: string;
|
|
263
|
-
};
|
|
264
|
-
export type ShortVideoPostData = {
|
|
265
|
-
text?: string;
|
|
266
|
-
};
|
|
267
|
-
export declare enum Status {
|
|
268
|
-
Archived = "ARCHIVED",
|
|
269
|
-
Draft = "DRAFT",
|
|
270
|
-
Published = "PUBLISHED",
|
|
271
|
-
Scheduled = "SCHEDULED"
|
|
272
|
-
}
|
|
273
|
-
export type Stream = {
|
|
274
|
-
id: string;
|
|
275
|
-
cover: MediaItem;
|
|
276
|
-
};
|
|
277
|
-
export type TagPosition = {
|
|
278
|
-
itemId: string;
|
|
279
|
-
leftPCT: number;
|
|
280
|
-
topPCT: number;
|
|
281
|
-
};
|
|
282
|
-
export type TextPostData = {
|
|
283
|
-
ctaButton?: CtaButton;
|
|
284
|
-
text: string;
|
|
285
|
-
};
|
|
286
|
-
export type UserTag = {
|
|
287
|
-
id: string;
|
|
288
|
-
image: string;
|
|
289
|
-
name: string;
|
|
290
|
-
username?: string;
|
|
291
|
-
};
|
|
292
|
-
export type UserTagPosition = TagPosition & {
|
|
293
|
-
itemId: string;
|
|
294
|
-
leftPCT: number;
|
|
295
|
-
topPCT: number;
|
|
296
|
-
user?: UserTag;
|
|
297
|
-
};
|
|
298
|
-
export type VideoPostData = {
|
|
299
|
-
preferredMediaFormat: MediaFormat;
|
|
300
|
-
text?: string;
|
|
301
|
-
title?: string;
|
|
302
|
-
viewsCount?: number;
|
|
303
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { AdCampaign, Article, ContentList, Post } from './types';
|
|
2
|
-
export declare class StreamsContentApiClient {
|
|
3
|
-
private readonly gqlEndpoint;
|
|
4
|
-
private readonly organizationId;
|
|
5
|
-
private readonly siteId;
|
|
6
|
-
private readonly postStatus;
|
|
7
|
-
constructor(gqlEndpoint: string, organizationId: string, siteId: string);
|
|
8
|
-
getArticle(slug: string): Promise<Article | null>;
|
|
9
|
-
getPost(id: string): Promise<Post | undefined>;
|
|
10
|
-
getPosts(ids: string[] | null, types?: string[] | null, contentListId?: string | null): Promise<Post[] | undefined>;
|
|
11
|
-
getContentLists(): Promise<ContentList[] | undefined>;
|
|
12
|
-
getAdCampaigns(page: number, perPage: number): Promise<AdCampaign[] | undefined>;
|
|
13
|
-
private queryGql;
|
|
14
|
-
}
|