@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.
- package/build/embeddedApps.js +3 -0
- package/build/embeddedApps.test.js +7 -0
- package/build/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/embeddedApps.test.ts +11 -0
- package/src/embeddedApps.ts +2 -0
- package/src/types.ts +1 -0
- package/tasks/npm-publish.sh +1 -1
package/build/embeddedApps.js
CHANGED
|
@@ -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
package/package.json
CHANGED
package/src/embeddedApps.test.ts
CHANGED
|
@@ -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
|
+
});
|
package/src/embeddedApps.ts
CHANGED
|
@@ -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
package/tasks/npm-publish.sh
CHANGED