@fugood/bricks-project 2.24.0-beta.4 → 2.24.0-beta.41

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.
Files changed (126) hide show
  1. package/compile/action-name-map.ts +38 -0
  2. package/compile/index.ts +429 -160
  3. package/compile/util.ts +2 -0
  4. package/package.json +7 -3
  5. package/package.json.bak +27 -0
  6. package/skills/{bricks-project → bricks-ctor}/SKILL.md +2 -2
  7. package/skills/{bricks-project → bricks-ctor}/rules/animation.md +1 -1
  8. package/skills/{bricks-project → bricks-ctor}/rules/architecture-patterns.md +7 -0
  9. package/skills/bricks-ctor/rules/automations.md +221 -0
  10. package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
  11. package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
  12. package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
  13. package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
  14. package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
  15. package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
  16. package/skills/bricks-design/LICENSE.txt +180 -0
  17. package/skills/bricks-design/SKILL.md +66 -0
  18. package/tools/deploy.ts +66 -12
  19. package/tools/icons/fa6pro-meta.json +3669 -26125
  20. package/tools/mcp-server.ts +11 -878
  21. package/tools/mcp-tools/compile.ts +91 -0
  22. package/tools/mcp-tools/huggingface.ts +762 -0
  23. package/tools/mcp-tools/icons.ts +70 -0
  24. package/tools/mcp-tools/lottie.ts +102 -0
  25. package/tools/mcp-tools/media.ts +110 -0
  26. package/tools/postinstall.ts +137 -40
  27. package/tools/preview-main.mjs +146 -9
  28. package/tools/preview.ts +30 -2
  29. package/tools/pull.ts +37 -19
  30. package/tsconfig.json +16 -0
  31. package/types/animation.ts +4 -0
  32. package/types/automation.ts +4 -1
  33. package/types/brick-base.ts +1 -1
  34. package/types/bricks/Camera.ts +48 -13
  35. package/types/bricks/Chart.ts +10 -4
  36. package/types/bricks/GenerativeMedia.ts +30 -14
  37. package/types/bricks/Icon.ts +9 -5
  38. package/types/bricks/Image.ts +10 -6
  39. package/types/bricks/Items.ts +29 -15
  40. package/types/bricks/Lottie.ts +15 -7
  41. package/types/bricks/Maps.ts +16 -8
  42. package/types/bricks/QrCode.ts +9 -5
  43. package/types/bricks/Rect.ts +45 -6
  44. package/types/bricks/RichText.ts +9 -5
  45. package/types/bricks/Rive.ts +21 -11
  46. package/types/bricks/Slideshow.ts +20 -10
  47. package/types/bricks/Svg.ts +8 -4
  48. package/types/bricks/Text.ts +9 -5
  49. package/types/bricks/TextInput.ts +23 -13
  50. package/types/bricks/Video.ts +11 -7
  51. package/types/bricks/VideoStreaming.ts +8 -4
  52. package/types/bricks/WebRtcStream.ts +7 -3
  53. package/types/bricks/WebView.ts +12 -8
  54. package/types/canvas.ts +4 -2
  55. package/types/common.ts +19 -12
  56. package/types/data-calc-command.ts +2 -0
  57. package/types/data-calc.ts +1 -0
  58. package/types/data.ts +2 -0
  59. package/types/generators/AlarmClock.ts +17 -11
  60. package/types/generators/Assistant.ts +69 -18
  61. package/types/generators/BleCentral.ts +31 -11
  62. package/types/generators/BlePeripheral.ts +11 -7
  63. package/types/generators/CanvasMap.ts +10 -6
  64. package/types/generators/CastlesPay.ts +15 -7
  65. package/types/generators/DataBank.ts +44 -9
  66. package/types/generators/File.ts +109 -30
  67. package/types/generators/GraphQl.ts +12 -6
  68. package/types/generators/Http.ts +33 -10
  69. package/types/generators/HttpServer.ts +23 -15
  70. package/types/generators/Information.ts +9 -5
  71. package/types/generators/Intent.ts +15 -5
  72. package/types/generators/Iterator.ts +15 -11
  73. package/types/generators/Keyboard.ts +27 -13
  74. package/types/generators/LlmAnthropicCompat.ts +33 -11
  75. package/types/generators/LlmAppleBuiltin.ts +25 -10
  76. package/types/generators/LlmGgml.ts +140 -31
  77. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  78. package/types/generators/LlmMlx.ts +227 -0
  79. package/types/generators/LlmOnnx.ts +34 -14
  80. package/types/generators/LlmOpenAiCompat.ts +47 -11
  81. package/types/generators/LlmQualcommAiEngine.ts +45 -13
  82. package/types/generators/Mcp.ts +375 -34
  83. package/types/generators/McpServer.ts +58 -19
  84. package/types/generators/MediaFlow.ts +38 -12
  85. package/types/generators/MqttBroker.ts +29 -11
  86. package/types/generators/MqttClient.ts +19 -9
  87. package/types/generators/Question.ts +13 -9
  88. package/types/generators/RealtimeTranscription.ts +108 -19
  89. package/types/generators/RerankerGgml.ts +43 -12
  90. package/types/generators/SerialPort.ts +18 -10
  91. package/types/generators/SoundPlayer.ts +10 -4
  92. package/types/generators/SoundRecorder.ts +24 -9
  93. package/types/generators/SpeechToTextGgml.ts +52 -18
  94. package/types/generators/SpeechToTextOnnx.ts +18 -11
  95. package/types/generators/SpeechToTextPlatform.ts +15 -7
  96. package/types/generators/SqLite.ts +20 -10
  97. package/types/generators/Step.ts +9 -5
  98. package/types/generators/SttAppleBuiltin.ts +22 -9
  99. package/types/generators/Tcp.ts +13 -9
  100. package/types/generators/TcpServer.ts +20 -14
  101. package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
  102. package/types/generators/TextToSpeechGgml.ts +29 -11
  103. package/types/generators/TextToSpeechOnnx.ts +19 -12
  104. package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
  105. package/types/generators/ThermalPrinter.ts +13 -9
  106. package/types/generators/Tick.ts +11 -7
  107. package/types/generators/Udp.ts +17 -8
  108. package/types/generators/VadGgml.ts +51 -14
  109. package/types/generators/VadOnnx.ts +42 -12
  110. package/types/generators/VadTraditional.ts +28 -13
  111. package/types/generators/VectorStore.ts +33 -12
  112. package/types/generators/Watchdog.ts +19 -10
  113. package/types/generators/WebCrawler.ts +11 -7
  114. package/types/generators/WebRtc.ts +30 -16
  115. package/types/generators/WebSocket.ts +11 -7
  116. package/types/generators/index.ts +2 -0
  117. package/types/subspace.ts +3 -0
  118. package/types/system.ts +1 -1
  119. package/utils/calc.ts +12 -8
  120. package/utils/event-props.ts +833 -1022
  121. package/utils/id.ts +4 -0
  122. package/api/index.ts +0 -1
  123. package/api/instance.ts +0 -213
  124. package/skills/bricks-project/rules/automations.md +0 -175
  125. package/types/generators/TextToSpeechApple.ts +0 -113
  126. package/types/generators/TtsAppleBuiltin.ts +0 -105
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Bluetooth Low Energy central: scan, connect, and communicate with BLE peripherals
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Start scan */
15
19
  export type GeneratorBleCentralActionStartScan = Action & {
@@ -178,37 +182,53 @@ Default property:
178
182
  /* Event for state change */
179
183
  onStateChange?: Array<EventAction>
180
184
  /* Event for error occurred */
181
- onError?: Array<EventAction>
185
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onError']>>
182
186
  /* Event for start scan */
183
187
  onStartScan?: Array<EventAction>
184
188
  /* Event for stop scan */
185
189
  onStopScan?: Array<EventAction>
186
190
  /* Event for discover device */
187
- onDiscoverDevice?: Array<EventAction>
191
+ onDiscoverDevice?: Array<
192
+ EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onDiscoverDevice']>
193
+ >
188
194
  /* Event for device connected */
189
- onConnectDevice?: Array<EventAction>
195
+ onConnectDevice?: Array<
196
+ EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onConnectDevice']>
197
+ >
190
198
  /* Event for device disconnected */
191
199
  onDisconnectDevice?: Array<EventAction>
192
200
  /* Event for receive on read */
193
- onReadReceive?: Array<EventAction>
201
+ onReadReceive?: Array<
202
+ EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onReadReceive']>
203
+ >
194
204
  /* Event for receive on monitor */
195
- onMonitorReceive?: Array<EventAction>
205
+ onMonitorReceive?: Array<
206
+ EventAction<string & keyof TemplateEventPropsMap['BleCentral']['onMonitorReceive']>
207
+ >
196
208
  }
197
209
  outlets?: {
198
210
  /* Is scaning */
199
- isScaning?: () => Data
211
+ isScaning?: () => Data<boolean>
200
212
  /* Discovered device list */
201
- discoveredDeviceList?: () => Data
213
+ discoveredDeviceList?: () => Data<
214
+ Array<{
215
+ id?: string
216
+ name?: string
217
+ rssi?: number
218
+ advertising?: { [key: string]: any }
219
+ [key: string]: any
220
+ }>
221
+ >
202
222
  /* Error message */
203
- errorMessage?: () => Data
223
+ errorMessage?: () => Data<string>
204
224
  }
205
225
  }
206
226
 
207
- /* BLE Central Mode Generator */
227
+ /* Bluetooth Low Energy central: scan, connect, and communicate with BLE peripherals */
208
228
  export type GeneratorBleCentral = Generator &
209
229
  GeneratorBleCentralDef & {
210
230
  templateKey: 'GENERATOR_BLE_CENTRAL'
211
- switches: Array<
231
+ switches?: Array<
212
232
  SwitchDef &
213
233
  GeneratorBleCentralDef & {
214
234
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Bluetooth Low Energy peripheral: advertise services and respond to central connections
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Start advertise */
15
19
  export type GeneratorBlePeripheralActionStart = Action & {
@@ -149,7 +153,7 @@ Default property:
149
153
  beaconsEnable?: boolean | DataLink
150
154
  /* Measured RSSI @ 1m, used for calculate distance */
151
155
  beaconsTxPower?: number | DataLink
152
- /* Beacon configs
156
+ /* Beacon configs
153
157
  presets has pre-defined layout and manufacturerId
154
158
  layout string is like AltBeacon's Beacon Layout, but replace "x" as extra data
155
159
  id and data could be 0x prefixed hex, hex string, decimal or UUID
@@ -173,19 +177,19 @@ Default property:
173
177
  events?: {}
174
178
  outlets?: {
175
179
  /* Is advertising */
176
- isAdvertising?: () => Data
180
+ isAdvertising?: () => Data<boolean>
177
181
  /* Last receive written */
178
- lastWrite?: () => Data
182
+ lastWrite?: () => Data<{ [key: string]: any }>
179
183
  /* Error message */
180
- errorMessage?: () => Data
184
+ errorMessage?: () => Data<string>
181
185
  }
182
186
  }
183
187
 
184
- /* BLE Peripheral Mode Generator */
188
+ /* Bluetooth Low Energy peripheral: advertise services and respond to central connections */
185
189
  export type GeneratorBlePeripheral = Generator &
186
190
  GeneratorBlePeripheralDef & {
187
191
  templateKey: 'GENERATOR_BLE_PERIPHERAL'
188
- switches: Array<
192
+ switches?: Array<
189
193
  SwitchDef &
190
194
  GeneratorBlePeripheralDef & {
191
195
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Trigger canvas navigation by setup rules
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  interface GeneratorCanvasMapDef {
15
19
  /*
@@ -35,15 +39,15 @@ Default property:
35
39
  }
36
40
  events?: {
37
41
  /* Event triggered when a rule matches and canvas navigation occurs */
38
- onNavigate?: Array<EventAction>
42
+ onNavigate?: Array<EventAction<string & keyof TemplateEventPropsMap['CanvasMap']['onNavigate']>>
39
43
  }
40
44
  outlets?: {
41
45
  /* Last matched trigger rule that caused canvas navigation */
42
- lastMatchedRule?: () => Data
46
+ lastMatchedRule?: () => Data<{ [key: string]: any }>
43
47
  /* Index of the last matched rule in triggerList */
44
- lastMatchedIndex?: () => Data
48
+ lastMatchedIndex?: () => Data<number>
45
49
  /* Total count of canvas navigations triggered by this generator */
46
- navigationCount?: () => Data
50
+ navigationCount?: () => Data<number>
47
51
  }
48
52
  }
49
53
 
@@ -51,7 +55,7 @@ Default property:
51
55
  export type GeneratorCanvasMap = Generator &
52
56
  GeneratorCanvasMapDef & {
53
57
  templateKey: 'GENERATOR_CANVAS_MAP'
54
- switches: Array<
58
+ switches?: Array<
55
59
  SwitchDef &
56
60
  GeneratorCanvasMapDef & {
57
61
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Payment processing integration for Castles payment terminals
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Sale */
15
19
  export type GeneratorCastlesPayActionSale = ActionWithParams & {
@@ -44,23 +48,27 @@ Default property:
44
48
  property?: {}
45
49
  events?: {
46
50
  /* Action Success */
47
- onActionSuccess?: Array<EventAction>
51
+ onActionSuccess?: Array<
52
+ EventAction<string & keyof TemplateEventPropsMap['CastlesPay']['onActionSuccess']>
53
+ >
48
54
  /* Action Error */
49
- onActionError?: Array<EventAction>
55
+ onActionError?: Array<
56
+ EventAction<string & keyof TemplateEventPropsMap['CastlesPay']['onActionError']>
57
+ >
50
58
  }
51
59
  outlets?: {
52
60
  /* Last Transaction Result */
53
- lastTransactionResult?: () => Data
61
+ lastTransactionResult?: () => Data<{ [key: string]: any }>
54
62
  /* Last Error */
55
- lastError?: () => Data
63
+ lastError?: () => Data<string>
56
64
  }
57
65
  }
58
66
 
59
- /* Castles Pay */
67
+ /* Payment processing integration for Castles payment terminals */
60
68
  export type GeneratorCastlesPay = Generator &
61
69
  GeneratorCastlesPayDef & {
62
70
  templateKey: 'GENERATOR_CASTLES_PAY'
63
- switches: Array<
71
+ switches?: Array<
64
72
  SwitchDef &
65
73
  GeneratorCastlesPayDef & {
66
74
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Access and subscribe to shared Data properties from the project Data Bank
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Run Data Bank fetch */
15
19
  export type GeneratorDataBankActionFetch = Action & {
@@ -71,7 +75,7 @@ Default property:
71
75
  spacekey?: string | DataLink
72
76
  /* Data need to be fetched */
73
77
  properties?: Array<string | DataLink> | DataLink
74
- /* Determine the cache behavior
78
+ /* Determine the cache behavior
75
79
 
76
80
  cache-first: Cache first if existing, then fetch from network
77
81
  network-and-cache: Fetch from network, then save cache
@@ -82,31 +86,62 @@ Default property:
82
86
  }
83
87
  events?: {
84
88
  /* Event of Data Bank fetch response */
85
- onFetchResponse?: Array<EventAction>
89
+ onFetchResponse?: Array<
90
+ EventAction<string & keyof TemplateEventPropsMap['DataBank']['onFetchResponse']>
91
+ >
86
92
  /* Event of Data Bank change from subscription */
87
93
  onChange?: Array<EventAction>
88
94
  /* Event of Data Bank fetch error */
89
95
  onFetchError?: Array<EventAction>
90
96
  /* Event of error */
91
- onError?: Array<EventAction>
97
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['DataBank']['onError']>>
92
98
  /* Event of subscription on connection */
93
99
  subscribeDataOnConnect?: Array<EventAction>
94
100
  /* Server connections error of subscription */
95
- subscribeDataOnConnectError?: Array<EventAction>
101
+ subscribeDataOnConnectError?: Array<
102
+ EventAction<string & keyof TemplateEventPropsMap['DataBank']['subscribeDataOnConnectError']>
103
+ >
96
104
  }
97
105
  outlets?: {
98
106
  /* Response for Data Bank fetch request, it will save to Data */
99
- response?: () => Data
107
+ response?: () => Data<
108
+ Array<{
109
+ __typename?: string
110
+ id?: string
111
+ createAt?: string
112
+ updateAt?: string
113
+ spaceId?: string
114
+ propertyId?: string
115
+ definition?: {
116
+ type?: string
117
+ title?: string
118
+ schema?: { [key: string]: any }
119
+ [key: string]: any
120
+ }
121
+ meta?: string
122
+ value?: any
123
+ lastUpdateHash?: string
124
+ lastUpdateNote?: string
125
+ lastUpdateKey?: {
126
+ name?: string
127
+ enable_expired?: boolean
128
+ expired_at?: any
129
+ jwt?: boolean
130
+ [key: string]: any
131
+ }
132
+ [key: string]: any
133
+ }>
134
+ >
100
135
  /* Server response error of Data Bank fetch request, it will save to Data */
101
- error?: () => Data
136
+ error?: () => Data<string>
102
137
  }
103
138
  }
104
139
 
105
- /* Get Data or subscribe to Data changes from Data Bank */
140
+ /* Access and subscribe to shared Data properties from the project Data Bank */
106
141
  export type GeneratorDataBank = Generator &
107
142
  GeneratorDataBankDef & {
108
143
  templateKey: 'GENERATOR_DATA_BANK'
109
- switches: Array<
144
+ switches?: Array<
110
145
  SwitchDef &
111
146
  GeneratorDataBankDef & {
112
147
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * File system operations: read, write, copy, delete, and list files
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Read stats */
15
19
  export type GeneratorFileActionReadStats = Action & {
@@ -259,69 +263,144 @@ Default property:
259
263
  }
260
264
  events?: {
261
265
  /* On file handler init error */
262
- initError?: Array<EventAction>
266
+ initError?: Array<EventAction<string & keyof TemplateEventPropsMap['File']['initError']>>
263
267
  /* On file status change */
264
- onFileStatusChange?: Array<EventAction>
268
+ onFileStatusChange?: Array<
269
+ EventAction<string & keyof TemplateEventPropsMap['File']['onFileStatusChange']>
270
+ >
265
271
  /* On read stats error */
266
- onReadStatsError?: Array<EventAction>
272
+ onReadStatsError?: Array<
273
+ EventAction<string & keyof TemplateEventPropsMap['File']['onReadStatsError']>
274
+ >
267
275
  /* On read content error */
268
- onReadContentError?: Array<EventAction>
276
+ onReadContentError?: Array<
277
+ EventAction<string & keyof TemplateEventPropsMap['File']['onReadContentError']>
278
+ >
269
279
  /* On read content error */
270
- onAppendContentError?: Array<EventAction>
280
+ onAppendContentError?: Array<
281
+ EventAction<string & keyof TemplateEventPropsMap['File']['onAppendContentError']>
282
+ >
271
283
  /* On write content error */
272
- onWriteContentError?: Array<EventAction>
284
+ onWriteContentError?: Array<
285
+ EventAction<string & keyof TemplateEventPropsMap['File']['onWriteContentError']>
286
+ >
273
287
  /* On upload progress */
274
- onUploadProgress?: Array<EventAction>
288
+ onUploadProgress?: Array<
289
+ EventAction<string & keyof TemplateEventPropsMap['File']['onUploadProgress']>
290
+ >
275
291
  /* On upload error */
276
- onUploadError?: Array<EventAction>
292
+ onUploadError?: Array<
293
+ EventAction<string & keyof TemplateEventPropsMap['File']['onUploadError']>
294
+ >
277
295
  /* On upload complete */
278
- onUploadComplete?: Array<EventAction>
296
+ onUploadComplete?: Array<
297
+ EventAction<string & keyof TemplateEventPropsMap['File']['onUploadComplete']>
298
+ >
279
299
  /* On upload all done */
280
- onUploadAllComplete?: Array<EventAction>
300
+ onUploadAllComplete?: Array<
301
+ EventAction<string & keyof TemplateEventPropsMap['File']['onUploadAllComplete']>
302
+ >
281
303
  /* On download progress */
282
- onDownloadProgress?: Array<EventAction>
304
+ onDownloadProgress?: Array<
305
+ EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadProgress']>
306
+ >
283
307
  /* On download error */
284
- onDownloadError?: Array<EventAction>
308
+ onDownloadError?: Array<
309
+ EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadError']>
310
+ >
285
311
  /* On download complete */
286
- onDownloadComplete?: Array<EventAction>
312
+ onDownloadComplete?: Array<
313
+ EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadComplete']>
314
+ >
287
315
  /* On download all done */
288
- onDownloadAllComplete?: Array<EventAction>
316
+ onDownloadAllComplete?: Array<
317
+ EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadAllComplete']>
318
+ >
289
319
  }
290
320
  outlets?: {
291
321
  /* File init error result will be stored in Data */
292
- initError?: () => Data
322
+ initError?: () => Data<string>
293
323
  /* File read stats result will be stored in Data */
294
- readStats?: () => Data
324
+ readStats?: () => Data<{
325
+ path?: string
326
+ size?: number
327
+ isDirectory?: boolean
328
+ mtime?: string
329
+ ctime?: string
330
+ mode?: number
331
+ originalFilepath?: string
332
+ [key: string]: any
333
+ }>
295
334
  /* File read content result will be stored in Data */
296
- readContent?: () => Data
335
+ readContent?: () => Data<any>
297
336
  /* File read details result will be stored in Data */
298
- readDetails?: () => Data
337
+ readDetails?: () => Data<{
338
+ path?: string
339
+ content?: any
340
+ size?: number
341
+ exists?: boolean
342
+ [key: string]: any
343
+ }>
299
344
  /* File read error result will be stored in Data */
300
- readError?: () => Data
345
+ readError?: () => Data<string>
301
346
  /* File append content result will be stored in Data */
302
- appendDetails?: () => Data
347
+ appendDetails?: () => Data<{
348
+ path?: string
349
+ appended?: boolean
350
+ contentLength?: number
351
+ [key: string]: any
352
+ }>
303
353
  /* File append error result will be stored in Data */
304
- appendError?: () => Data
354
+ appendError?: () => Data<string>
305
355
  /* File write details result will be stored in Data */
306
- writeDetails?: () => Data
356
+ writeDetails?: () => Data<{
357
+ path?: string
358
+ written?: boolean
359
+ contentLength?: number
360
+ [key: string]: any
361
+ }>
307
362
  /* File write error result will be stored in Data */
308
- writeError?: () => Data
363
+ writeError?: () => Data<string>
309
364
  /* File upload progress result will be stored in Data */
310
- uploadProgress?: () => Data
365
+ uploadProgress?: () => Data<{
366
+ id?: string
367
+ path?: string
368
+ uri?: string
369
+ hash?: string
370
+ hashType?: string
371
+ headers?: { [key: string]: any }
372
+ fields?: { [key: string]: any }
373
+ method?: string
374
+ progress?: number
375
+ isLastUpdated?: boolean
376
+ [key: string]: any
377
+ }>
311
378
  /* File upload complete result will be stored in Data */
312
- uploadResult?: () => Data
379
+ uploadResult?: () => Data<any>
313
380
  /* File download progress result will be stored in Data */
314
- downloadProgress?: () => Data
381
+ downloadProgress?: () => Data<{
382
+ id?: string
383
+ path?: string
384
+ uri?: string
385
+ hash?: string
386
+ hashType?: string
387
+ headers?: { [key: string]: any }
388
+ fields?: { [key: string]: any }
389
+ method?: string
390
+ progress?: number
391
+ isLastUpdated?: boolean
392
+ [key: string]: any
393
+ }>
315
394
  /* File download complete result will be stored in Data */
316
- downloadResult?: () => Data
395
+ downloadResult?: () => Data<any>
317
396
  }
318
397
  }
319
398
 
320
- /* File handling */
399
+ /* File system operations: read, write, copy, delete, and list files */
321
400
  export type GeneratorFile = Generator &
322
401
  GeneratorFileDef & {
323
402
  templateKey: 'GENERATOR_FILE'
324
- switches: Array<
403
+ switches?: Array<
325
404
  SwitchDef &
326
405
  GeneratorFileDef & {
327
406
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * GraphQL client for Query, Mutation, and Subscription (WebSocket) with response caching and optional Firebase Realtime Database link
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Execute GraphQL request with defined properties */
15
19
  export type GeneratorGraphQLActionRunQuery = ActionWithParams & {
@@ -93,21 +97,23 @@ Default property:
93
97
  /* Event triggered when subscription connection is successful */
94
98
  subscriptionOnConnection?: Array<EventAction>
95
99
  /* Event triggered when subscription connection error occurs */
96
- subscriptionOnConnectionError?: Array<EventAction>
100
+ subscriptionOnConnectionError?: Array<
101
+ EventAction<string & keyof TemplateEventPropsMap['Graphql']['subscriptionOnConnectionError']>
102
+ >
97
103
  }
98
104
  outlets?: {
99
105
  /* Response for GraphQL request, it will save to Data */
100
- response?: () => Data
106
+ response?: () => Data<{ [key: string]: any }>
101
107
  /* Server response error of GraphQL request, it will save to Data */
102
- error?: () => Data
108
+ error?: () => Data<string>
103
109
  }
104
110
  }
105
111
 
106
- /* Execute GraphQL Query / Mutation / Subscriptions */
112
+ /* GraphQL client for Query, Mutation, and Subscription (WebSocket) with response caching and optional Firebase Realtime Database link */
107
113
  export type GeneratorGraphQL = Generator &
108
114
  GeneratorGraphQLDef & {
109
115
  templateKey: 'GENERATOR_GRAPHQL'
110
- switches: Array<
116
+ switches?: Array<
111
117
  SwitchDef &
112
118
  GeneratorGraphQLDef & {
113
119
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * HTTP client supporting all methods (GET/POST/PUT/DELETE/PATCH/...), response parsing (JSON/text/XML/CSV), SSE event streams, and multipart file uploads
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Run HTTP request with defined properties */
15
19
  export type GeneratorHTTPActionRunRequest = ActionWithParams & {
@@ -141,7 +145,7 @@ Default property:
141
145
  redirect?: 'manual' | 'follow' | 'error' | DataLink
142
146
  /* Referrer of HTTP request */
143
147
  referrer?: 'no-referrer' | 'client' | DataLink
144
- /* HTTP request body, it will transform depends on `headers.Content-Type` (`application/json`, `application/x-www-form-urlencoded` or `multipart/form-data`)
148
+ /* HTTP request body, it will transform depends on `headers.Content-Type` (`application/json`, `application/x-www-form-urlencoded` or `multipart/form-data`)
145
149
  The multipart schema like `{ file: { uri: File, type: File MIME, name: File Name }, field: "value" }` */
146
150
  body?: {} | DataLink
147
151
  /* HTTP response type */
@@ -156,25 +160,44 @@ Default property:
156
160
  events?: {}
157
161
  outlets?: {
158
162
  /* Response for HTTP request */
159
- response?: () => Data
163
+ response?: () => Data<string | { [key: string]: any }>
160
164
  /* Response details for HTTP request */
161
- responseDetails?: () => Data
165
+ responseDetails?: () => Data<{
166
+ ok?: boolean
167
+ redirected?: boolean
168
+ type?: string
169
+ status?: number
170
+ statusText?: string
171
+ headers?: { [key: string]: any }
172
+ body?: any
173
+ event?: string
174
+ id?: string
175
+ data?: any
176
+ [key: string]: any
177
+ }>
162
178
  /* All received data from event stream */
163
- eventLog?: () => Data
179
+ eventLog?: () => Data<Array<any>>
164
180
  /* All received event details from event stream */
165
- eventLogDetails?: () => Data
181
+ eventLogDetails?: () => Data<
182
+ Array<{
183
+ event?: string
184
+ id?: string
185
+ data?: any
186
+ [key: string]: any
187
+ }>
188
+ >
166
189
  /* EventSource state */
167
- sseState?: () => Data
190
+ sseState?: () => Data<string>
168
191
  /* Server response error of HTTP request */
169
- error?: () => Data
192
+ error?: () => Data<string>
170
193
  }
171
194
  }
172
195
 
173
- /* Execute HTTP requests */
196
+ /* HTTP client supporting all methods (GET/POST/PUT/DELETE/PATCH/...), response parsing (JSON/text/XML/CSV), SSE event streams, and multipart file uploads */
174
197
  export type GeneratorHTTP = Generator &
175
198
  GeneratorHTTPDef & {
176
199
  templateKey: 'GENERATOR_HTTP'
177
- switches: Array<
200
+ switches?: Array<
178
201
  SwitchDef &
179
202
  GeneratorHTTPDef & {
180
203
  conds?: Array<{