-
Notifications
You must be signed in to change notification settings - Fork 98
/
buildShortcutTemplate.ts
44 lines (42 loc) · 1.34 KB
/
buildShortcutTemplate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { flatten } from './flatten';
import BuildShortcutOptions from '../interfaces/BuildShortcutOptions';
import WFWorkflow from '../interfaces/WF/WFWorkflow';
import WFWorkflowActionsInterface from '../interfaces/WF/WFWorkflowAction';
import WFWorkflowType from '../interfaces/WF/WFWorkflowType';
/** @ignore */
export const buildShortcutTemplate = (
actions: WFWorkflowActionsInterface[] = [],
options: BuildShortcutOptions,
): WFWorkflow => ({
WFWorkflowClientVersion: '724',
WFWorkflowClientRelease: '2.1',
WFWorkflowIcon: {
WFWorkflowIconStartColor: options.icon.color,
WFWorkflowIconGlyphNumber: options.icon.glyph,
},
WFWorkflowImportQuestions: [],
WFWorkflowTypes: [
'WatchKit',
...(options.showInWidget ? ['NCWidget' as WFWorkflowType] : []),
],
WFWorkflowInputContentItemClasses: [
'WFAppStoreAppContentItem',
'WFArticleContentItem',
'WFContactContentItem',
'WFDateContentItem',
'WFEmailAddressContentItem',
'WFGenericFileContentItem',
'WFImageContentItem',
'WFiTunesProductContentItem',
'WFLocationContentItem',
'WFDCMapsLinkContentItem',
'WFAVAssetContentItem',
'WFPDFContentItem',
'WFPhoneNumberContentItem',
'WFRichTextContentItem',
'WFSafariWebPageContentItem',
'WFStringContentItem',
'WFURLContentItem',
],
WFWorkflowActions: flatten(actions),
});