@streamscloud/streams-api-client 3.2.0 → 3.3.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.
@@ -4,6 +4,7 @@ const mapToSiteShortVideoModels = (posts) => {
4
4
  id: post.id,
5
5
  displayDate: post.displayDate,
6
6
  text: post.postData.shortVideoData.text ?? '',
7
+ coverTitle: post.postData.shortVideoData.coverTitle ?? '',
7
8
  media: post.postData.media.map((x) => {
8
9
  const media = {
9
10
  type: x.type,
@@ -2,6 +2,7 @@ import type { Media } from '../../services/types';
2
2
  export interface ShortVideoModel {
3
3
  id: string;
4
4
  text: string;
5
+ coverTitle: string;
5
6
  displayDate: string;
6
7
  media: Media[];
7
8
  }
@@ -1,8 +1,8 @@
1
1
  import type { Post, Stream } from './types';
2
2
  export declare class EmbedContentApiClient {
3
3
  private readonly gqlEndpoint;
4
- private readonly initiator;
5
- constructor(gqlEndpoint: string, initiator: string);
4
+ private readonly clientId;
5
+ constructor(gqlEndpoint: string, clientId: string);
6
6
  getPosts(ids: string[]): Promise<Post[] | undefined>;
7
7
  getStreams(ids: string[]): Promise<Stream[] | undefined>;
8
8
  private queryGql;
@@ -3,10 +3,10 @@ import EmbedStreamsQuery from './operations/streams-query.graphql.js';
3
3
 
4
4
  class EmbedContentApiClient {
5
5
  gqlEndpoint;
6
- initiator;
7
- constructor(gqlEndpoint, initiator) {
6
+ clientId;
7
+ constructor(gqlEndpoint, clientId) {
8
8
  this.gqlEndpoint = gqlEndpoint;
9
- this.initiator = initiator;
9
+ this.clientId = clientId;
10
10
  }
11
11
  async getPosts(ids) {
12
12
  const response = await this.queryGql(EmbedPostsQuery, {
@@ -33,7 +33,7 @@ class EmbedContentApiClient {
33
33
  method: 'POST',
34
34
  headers: {
35
35
  'Content-Type': 'application/json',
36
- 'x-initiator': this.initiator
36
+ 'x-initiator': this.clientId
37
37
  },
38
38
  body: JSON.stringify({
39
39
  query,
@@ -1,2 +1,2 @@
1
1
  import { EmbedContentApiClient } from './embed-content-api-client';
2
- export declare const createEmbedContentClient: (endpointUrl: string, initiator?: string) => EmbedContentApiClient;
2
+ export declare const createEmbedContentClient: (endpointUrl: string, clientId?: string) => EmbedContentApiClient;
@@ -1,5 +1,5 @@
1
1
  import { EmbedContentApiClient } from './embed-content-api-client.js';
2
2
 
3
- const createEmbedContentClient = (endpointUrl, initiator) => new EmbedContentApiClient(endpointUrl, initiator ?? 'widget');
3
+ const createEmbedContentClient = (endpointUrl, clientId) => new EmbedContentApiClient(endpointUrl, clientId ?? '');
4
4
 
5
5
  export { createEmbedContentClient };
@@ -1,3 +1,3 @@
1
- var EmbedPostsQuery = "query EmbedPosts($input: EmbedPostsInput!) {\n embedPosts(input: $input) {\n items {\n id\n postData {\n shortVideoData {\n text\n }\n media {\n type\n url\n thumbnailUrl\n }\n }\n displayDate\n }\n }\n}";
1
+ var EmbedPostsQuery = "query EmbedPosts($input: EmbedPostsInput!) {\n embedPosts(input: $input) {\n items {\n id\n postData {\n shortVideoData {\n text\n coverTitle\n }\n media {\n type\n url\n thumbnailUrl\n }\n }\n displayDate\n }\n }\n}";
2
2
 
3
3
  export { EmbedPostsQuery as default };
@@ -295,6 +295,7 @@ export type ScaledImageBlob = {
295
295
  };
296
296
  export type ShortVideoPostData = {
297
297
  text?: string;
298
+ coverTitle?: string;
298
299
  };
299
300
  export declare enum Status {
300
301
  Archived = "ARCHIVED",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/streams-api-client",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",