|
1 | 1 | module.exports = { |
2 | | - "SDKSpecVersion": "master", |
3 | | - "langConfig": { |
4 | | - newInstanceSyntax: 'new #name(#req)#optional', |
5 | | - lang: 'Javascript', |
6 | | - methodDelimiter: '.', |
7 | | - groupDelimiter: '.', |
8 | | - openQualifiersChar: '', |
9 | | - closeQualifiersChar: '', |
10 | | - closeTransformationChar: '', |
| 2 | + SDKSpecVersion: "master", |
| 3 | + langConfig: { |
| 4 | + newInstanceSyntax: "new #name(#req)#optional", |
| 5 | + lang: "Javascript", |
| 6 | + methodDelimiter: ".", |
| 7 | + groupDelimiter: ".", |
| 8 | + openQualifiersChar: "", |
| 9 | + closeQualifiersChar: "", |
| 10 | + closeTransformationChar: "", |
11 | 11 | hideActionGroups: true, |
12 | | - useSimpleQualifierValuesForGroups: ['Compass','AudioCodec','AnimatedFormat','ArtisticFilter','blendMode','Flag','FontStyle','FontAntialias','FontWeight','FontHinting','textAlignment','textDecoration', 'GradientDirection','ImproveMode','OutlineMode','Progressive','SimulateColorBlind','StreamingProfile'], |
| 12 | + useSimpleQualifierValuesForGroups: [ |
| 13 | + "Compass", |
| 14 | + "AudioCodec", |
| 15 | + "AnimatedFormat", |
| 16 | + "ArtisticFilter", |
| 17 | + "blendMode", |
| 18 | + "Flag", |
| 19 | + "FontStyle", |
| 20 | + "FontAntialias", |
| 21 | + "FontWeight", |
| 22 | + "FontHinting", |
| 23 | + "textAlignment", |
| 24 | + "textDecoration", |
| 25 | + "GradientDirection", |
| 26 | + "ImproveMode", |
| 27 | + "OutlineMode", |
| 28 | + "Progressive", |
| 29 | + "SimulateColorBlind", |
| 30 | + "StreamingProfile", |
| 31 | + ], |
13 | 32 | mainTransformationString: { |
14 | 33 | openSyntaxString: { |
15 | | - image: 'new CloudinaryImage(\'#publicID\')', |
16 | | - video: 'new CloudinaryVideo(\'#publicID\')', |
17 | | - media: 'new CloudinaryMedia(\'#publicID\')' |
| 34 | + image: "new CloudinaryImage('#publicID')", |
| 35 | + video: "new CloudinaryVideo('#publicID')", |
| 36 | + media: "new CloudinaryMedia('#publicID')", |
18 | 37 | }, |
19 | | - closeSyntaxString: ';' |
| 38 | + closeSyntaxString: ";", |
20 | 39 | }, |
21 | | - openActionChar: '(', |
22 | | - closeActionChar: ')', |
23 | | - overwritePreset: 'javascript', |
24 | | - arraySeparator: ', ', |
25 | | - arrayOpen: '[', |
26 | | - arrayClose: ']', |
| 40 | + openActionChar: "(", |
| 41 | + closeActionChar: ")", |
| 42 | + overwritePreset: "javascript", |
| 43 | + arraySeparator: ", ", |
| 44 | + arrayOpen: "[", |
| 45 | + arrayClose: "]", |
27 | 46 | prettier: { |
28 | | - parser: 'babel' |
| 47 | + parser: "babel", |
29 | 48 | }, |
30 | 49 | formats: { |
31 | | - formatClassOrEnum: 'PascalCase', |
32 | | - formatMethod: 'camelCase', |
| 50 | + formatClassOrEnum: "PascalCase", |
| 51 | + formatMethod: "camelCase", |
33 | 52 | formatFloat: (f) => { |
34 | | - if (!f.toString().includes('.')) { |
35 | | - return `'${f}.0'` // In JS world, 1.0 is 1, so we make sure 1.0 stays 1.0 |
| 53 | + if (!f.toString().includes(".")) { |
| 54 | + return `'${f}.0'`; // In JS world, 1.0 is 1, so we make sure 1.0 stays 1.0 |
36 | 55 | } else { |
37 | 56 | return f; |
38 | 57 | } |
39 | | - } |
| 58 | + }, |
40 | 59 | }, |
41 | 60 | methodNameMap: { |
42 | | - 'delivery_type': 'set_delivery_type', |
43 | | - 'asset_type': 'set_asset_type', |
44 | | - 'deliveryType': 'set_delivery_type', |
45 | | - 'assetType': 'set_asset_type', |
46 | | - 'signature': 'setSignature', |
| 61 | + delivery_type: "set_delivery_type", |
| 62 | + asset_type: "set_asset_type", |
| 63 | + deliveryType: "set_delivery_type", |
| 64 | + assetType: "set_asset_type", |
| 65 | + signature: "setSignature", |
47 | 66 | }, |
48 | | - canGenerateSignature:false, |
| 67 | + canGenerateSignature: false, |
49 | 68 | classNameMap: {}, |
50 | 69 | childTransformations: { |
51 | 70 | image: { |
52 | 71 | open: "new ImageTransformation()", |
53 | | - close: '', |
| 72 | + close: "", |
54 | 73 | }, |
55 | 74 | video: { |
56 | 75 | open: "new VideoTransformation()", |
57 | | - close: '', |
| 76 | + close: "", |
58 | 77 | }, |
59 | 78 | media: { |
60 | 79 | open: "new Transformation()", |
61 | | - close: '', |
62 | | - } |
| 80 | + close: "", |
| 81 | + }, |
63 | 82 | }, |
64 | | - unsupportedTxParams: ['fl_waveform', 'fl_animated', 'e_tint', 'e_theme', 'af_'], |
65 | | - unsupportedSyntaxList: ['.stroke(', '.textFit(', 'Animated.edit', '.RoundCorners(', 'getVideoFrame', '.transcode('] |
| 83 | + unsupportedTxParams: [ |
| 84 | + "fl_waveform", |
| 85 | + "fl_animated", |
| 86 | + "e_tint", |
| 87 | + "e_theme", |
| 88 | + "af_", |
| 89 | + ], |
| 90 | + unsupportedSyntaxList: [ |
| 91 | + ".stroke(", |
| 92 | + ".textFit(", |
| 93 | + "Animated.edit", |
| 94 | + ".RoundCorners(", |
| 95 | + "getVideoFrame", |
| 96 | + ".transcode(", |
| 97 | + ], |
66 | 98 | }, |
67 | | - "overwrites": { |
| 99 | + overwrites: { |
68 | 100 | qualifiers: { |
69 | 101 | // colorOverride is a qualifier of Reshape.trim action. |
70 | 102 | color_override: (payload) => { |
71 | | - const {qualifierDTO} = payload; |
| 103 | + const { qualifierDTO } = payload; |
72 | 104 | const colorName = qualifierDTO.qualifiers[0].name; |
73 | 105 |
|
74 | 106 | // TODO this should be streamlined with how we deal with color. |
75 | | - return `.colorOverride("${colorName}")` |
| 107 | + return `.colorOverride("${colorName}")`; |
76 | 108 | }, |
77 | 109 | color: (payload) => { |
78 | | - const {qualifierDTO} = payload; |
| 110 | + const { qualifierDTO } = payload; |
79 | 111 | // This case supports three types of qualifiers |
80 | 112 | // TODO this DTO structure needs to be aligned |
81 | 113 | // {name:color, is_required:true qualifiers: [{group:'color', name: 'red', is_required:true}]} |
82 | 114 | // {group:'color', name: 'red', is_required:true} |
83 | 115 | // {group:'color', name: 'rgb', qualifiers: [{ "name": "color", "value": "#d5d2ca", "is_required": true, "value_type": "string" }]} |
84 | 116 |
|
85 | 117 | let colorName; |
86 | | - if (qualifierDTO.qualifiers && qualifierDTO.name === 'rgb') { |
| 118 | + if (qualifierDTO.qualifiers && qualifierDTO.name === "rgb") { |
87 | 119 | colorName = qualifierDTO.qualifiers[0].value; |
88 | 120 | } else { |
89 | | - colorName = qualifierDTO.qualifiers ? qualifierDTO.qualifiers[0].name : qualifierDTO.name; |
| 121 | + colorName = qualifierDTO.qualifiers |
| 122 | + ? qualifierDTO.qualifiers[0].name |
| 123 | + : qualifierDTO.name; |
90 | 124 | } |
91 | 125 |
|
92 | 126 | return `'${colorName}'`; |
93 | | - } |
94 | | - } |
95 | | - } |
96 | | -} |
| 127 | + }, |
| 128 | + }, |
| 129 | + }, |
| 130 | +}; |
0 commit comments