@raydiant/playlist-window-manager 0.23.3 → 0.24.1

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.
@@ -81,7 +81,7 @@ var PlaylistWindowManager_1 = __importDefault(require("./PlaylistWindowManager")
81
81
  var WindowTimeoutError_1 = __importDefault(require("./WindowTimeoutError"));
82
82
  var WindowLoadError_1 = __importDefault(require("./WindowLoadError"));
83
83
  // TODO: Automatically inject latest version when building in CI.
84
- var defaultAppRendererUrl = 'https://apps.raydiant.com/3.0.6/index.html';
84
+ var defaultAppRendererUrl = 'https://apps.raydiant.com/3.0.7/index.html';
85
85
  var isValidNumber = function (value) {
86
86
  return typeof value === 'number' && !isNaN(value);
87
87
  };
@@ -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.1",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@ export interface PresentationWindowOptions {
61
61
  }
62
62
 
63
63
  // TODO: Automatically inject latest version when building in CI.
64
- const defaultAppRendererUrl = 'https://apps.raydiant.com/3.0.6/index.html';
64
+ const defaultAppRendererUrl = 'https://apps.raydiant.com/3.0.7/index.html';
65
65
 
66
66
  const isValidNumber = (value: any) =>
67
67
  typeof value === 'number' && !isNaN(value);
@@ -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 {