@raydiant/playlist-window-manager 0.23.3 → 0.24.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.
@@ -24,6 +24,9 @@ function createEmbeddedApp(presentation, applicationVersion, metadata) {
24
24
  if (metadataKey === 'renderMode') {
25
25
  value = metadata.renderMode;
26
26
  }
27
+ else if (metadataKey === 'token') {
28
+ value = presentation.token;
29
+ }
27
30
  }
28
31
  else {
29
32
  // Don't replace variables that are numbers to allow setting
@@ -121,3 +121,10 @@ test('File input uses url as value', function () {
121
121
  presentationProperties: [{ type: 'file', name: 'file' }],
122
122
  }), createMetadata())).toBe("https://example.come?image=".concat(encodeURIComponent('https://image.png')));
123
123
  });
124
+ test('Replaces $token with presentation token', function () {
125
+ var presentation = createPresentation({ token: 'abc' });
126
+ var applicationVersion = createApplicationVersion({
127
+ embeddedUrlFormat: 'https://example.com?token=:$token',
128
+ });
129
+ expect((0, embeddedApps_1.default)(presentation, applicationVersion, createMetadata())).toBe('https://example.com?token=abc');
130
+ });
package/build/types.d.ts CHANGED
@@ -19,6 +19,7 @@ export interface Presentation {
19
19
  playlistId: string;
20
20
  }>;
21
21
  };
22
+ token?: string;
22
23
  }
23
24
  export interface ApplicationVersion {
24
25
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.23.3",
3
+ "version": "0.24.0",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -229,3 +229,14 @@ test('File input uses url as value', () => {
229
229
  `https://example.come?image=${encodeURIComponent('https://image.png')}`
230
230
  );
231
231
  });
232
+
233
+ test('Replaces $token with presentation token', () => {
234
+ const presentation = createPresentation({ token: 'abc' });
235
+ const applicationVersion = createApplicationVersion({
236
+ embeddedUrlFormat: 'https://example.com?token=:$token',
237
+ });
238
+
239
+ expect(
240
+ createEmbeddedApp(presentation, applicationVersion, createMetadata())
241
+ ).toBe('https://example.com?token=abc');
242
+ });
@@ -32,6 +32,8 @@ export default function createEmbeddedApp(
32
32
  const metadataKey = variableName.slice(1);
33
33
  if (metadataKey === 'renderMode') {
34
34
  value = metadata.renderMode;
35
+ } else if (metadataKey === 'token') {
36
+ value = presentation.token;
35
37
  }
36
38
  } else {
37
39
  // Don't replace variables that are numbers to allow setting
package/src/types.ts CHANGED
@@ -16,6 +16,7 @@ export interface Presentation {
16
16
  };
17
17
  presentationsPlaylists: Array<{ playlistId: string }>;
18
18
  };
19
+ token?: string;
19
20
  }
20
21
 
21
22
  export interface ApplicationVersion {
@@ -10,4 +10,4 @@ mkdir build
10
10
  yarn build
11
11
 
12
12
  # Publish
13
- yarn publish --access public
13
+ yarn publish --non-interactive --access public