@fugood/bricks-ctor 2.24.0-beta.40
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/compile/action-name-map.ts +988 -0
- package/compile/index.ts +1245 -0
- package/compile/util.ts +358 -0
- package/index.ts +6 -0
- package/package.json +28 -0
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/skills/bricks-project/SKILL.md +32 -0
- package/skills/bricks-project/rules/animation.md +159 -0
- package/skills/bricks-project/rules/architecture-patterns.md +69 -0
- package/skills/bricks-project/rules/automations.md +221 -0
- package/skills/bricks-project/rules/buttress.md +156 -0
- package/skills/bricks-project/rules/data-calculation.md +208 -0
- package/skills/bricks-project/rules/local-sync.md +129 -0
- package/skills/bricks-project/rules/media-flow.md +158 -0
- package/skills/bricks-project/rules/remote-data-bank.md +196 -0
- package/skills/bricks-project/rules/standby-transition.md +124 -0
- package/skills/rive-marketplace/SKILL.md +99 -0
- package/tools/deploy.ts +151 -0
- package/tools/icons/.gitattributes +1 -0
- package/tools/icons/fa6pro-glyphmap.json +4686 -0
- package/tools/icons/fa6pro-meta.json +3671 -0
- package/tools/mcp-server.ts +28 -0
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +229 -0
- package/tools/preview-main.mjs +293 -0
- package/tools/preview.ts +143 -0
- package/tools/pull.ts +116 -0
- package/tsconfig.json +16 -0
- package/types/animation.ts +100 -0
- package/types/automation.ts +235 -0
- package/types/brick-base.ts +80 -0
- package/types/bricks/Camera.ts +246 -0
- package/types/bricks/Chart.ts +372 -0
- package/types/bricks/GenerativeMedia.ts +276 -0
- package/types/bricks/Icon.ts +98 -0
- package/types/bricks/Image.ts +114 -0
- package/types/bricks/Items.ts +476 -0
- package/types/bricks/Lottie.ts +168 -0
- package/types/bricks/Maps.ts +262 -0
- package/types/bricks/QrCode.ts +117 -0
- package/types/bricks/Rect.ts +150 -0
- package/types/bricks/RichText.ts +128 -0
- package/types/bricks/Rive.ts +220 -0
- package/types/bricks/Slideshow.ts +201 -0
- package/types/bricks/Svg.ts +99 -0
- package/types/bricks/Text.ts +148 -0
- package/types/bricks/TextInput.ts +242 -0
- package/types/bricks/Video.ts +175 -0
- package/types/bricks/VideoStreaming.ts +112 -0
- package/types/bricks/WebRtcStream.ts +65 -0
- package/types/bricks/WebView.ts +168 -0
- package/types/bricks/index.ts +21 -0
- package/types/canvas.ts +82 -0
- package/types/common.ts +144 -0
- package/types/data-calc-command.ts +7005 -0
- package/types/data-calc-script.ts +21 -0
- package/types/data-calc.ts +11 -0
- package/types/data.ts +95 -0
- package/types/generators/AlarmClock.ts +110 -0
- package/types/generators/Assistant.ts +621 -0
- package/types/generators/BleCentral.ts +247 -0
- package/types/generators/BlePeripheral.ts +208 -0
- package/types/generators/CanvasMap.ts +74 -0
- package/types/generators/CastlesPay.ts +87 -0
- package/types/generators/DataBank.ts +160 -0
- package/types/generators/File.ts +432 -0
- package/types/generators/GraphQl.ts +132 -0
- package/types/generators/Http.ts +222 -0
- package/types/generators/HttpServer.ts +176 -0
- package/types/generators/Information.ts +103 -0
- package/types/generators/Intent.ts +168 -0
- package/types/generators/Iterator.ts +108 -0
- package/types/generators/Keyboard.ts +105 -0
- package/types/generators/LlmAnthropicCompat.ts +212 -0
- package/types/generators/LlmAppleBuiltin.ts +159 -0
- package/types/generators/LlmGgml.ts +861 -0
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +213 -0
- package/types/generators/LlmOpenAiCompat.ts +244 -0
- package/types/generators/LlmQualcommAiEngine.ts +247 -0
- package/types/generators/Mcp.ts +637 -0
- package/types/generators/McpServer.ts +289 -0
- package/types/generators/MediaFlow.ts +170 -0
- package/types/generators/MqttBroker.ts +141 -0
- package/types/generators/MqttClient.ts +141 -0
- package/types/generators/Question.ts +408 -0
- package/types/generators/RealtimeTranscription.ts +279 -0
- package/types/generators/RerankerGgml.ts +191 -0
- package/types/generators/SerialPort.ts +151 -0
- package/types/generators/SoundPlayer.ts +94 -0
- package/types/generators/SoundRecorder.ts +130 -0
- package/types/generators/SpeechToTextGgml.ts +415 -0
- package/types/generators/SpeechToTextOnnx.ts +236 -0
- package/types/generators/SpeechToTextPlatform.ts +85 -0
- package/types/generators/SqLite.ts +159 -0
- package/types/generators/Step.ts +107 -0
- package/types/generators/SttAppleBuiltin.ts +130 -0
- package/types/generators/Tcp.ts +126 -0
- package/types/generators/TcpServer.ts +147 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
- package/types/generators/TextToSpeechGgml.ts +221 -0
- package/types/generators/TextToSpeechOnnx.ts +178 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
- package/types/generators/ThermalPrinter.ts +191 -0
- package/types/generators/Tick.ts +83 -0
- package/types/generators/Udp.ts +120 -0
- package/types/generators/VadGgml.ts +250 -0
- package/types/generators/VadOnnx.ts +231 -0
- package/types/generators/VadTraditional.ts +138 -0
- package/types/generators/VectorStore.ts +257 -0
- package/types/generators/Watchdog.ts +107 -0
- package/types/generators/WebCrawler.ts +103 -0
- package/types/generators/WebRtc.ts +181 -0
- package/types/generators/WebSocket.ts +148 -0
- package/types/generators/index.ts +57 -0
- package/types/index.ts +13 -0
- package/types/subspace.ts +59 -0
- package/types/switch.ts +51 -0
- package/types/system.ts +707 -0
- package/utils/calc.ts +126 -0
- package/utils/data.ts +497 -0
- package/utils/event-props.ts +836 -0
- package/utils/id.ts +80 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Access and subscribe to shared Data properties from the project Data Bank
|
|
4
|
+
*/
|
|
5
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
|
+
import type { Data, DataLink } from '../data'
|
|
7
|
+
import type {
|
|
8
|
+
Brick,
|
|
9
|
+
Generator,
|
|
10
|
+
EventAction,
|
|
11
|
+
ActionWithDataParams,
|
|
12
|
+
ActionWithParams,
|
|
13
|
+
Action,
|
|
14
|
+
EventProperty,
|
|
15
|
+
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
17
|
+
|
|
18
|
+
/* Run Data Bank fetch */
|
|
19
|
+
export type GeneratorDataBankActionFetch = Action & {
|
|
20
|
+
__actionName: 'GENERATOR_DATA_BANK_FETCH'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Run Data Bank update */
|
|
24
|
+
export type GeneratorDataBankActionUpdateProperty = ActionWithParams & {
|
|
25
|
+
__actionName: 'GENERATOR_DATA_BANK_UPDATE_PROPERTY'
|
|
26
|
+
params?: Array<
|
|
27
|
+
| {
|
|
28
|
+
input: 'propertyId'
|
|
29
|
+
value?: string | DataLink | EventProperty
|
|
30
|
+
mapping?: string
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
input: 'propertyValue'
|
|
34
|
+
value?: any | EventProperty
|
|
35
|
+
mapping?: string
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Run Data Bank remove */
|
|
41
|
+
export type GeneratorDataBankActionRemoveProperty = ActionWithParams & {
|
|
42
|
+
__actionName: 'GENERATOR_DATA_BANK_REMOVE_PROPERTY'
|
|
43
|
+
params?: Array<{
|
|
44
|
+
input: 'propertyId'
|
|
45
|
+
value?: string | DataLink | EventProperty
|
|
46
|
+
mapping?: string
|
|
47
|
+
}>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Reset cache of Data Bank */
|
|
51
|
+
export type GeneratorDataBankActionResetCache = Action & {
|
|
52
|
+
__actionName: 'GENERATOR_DATA_BANK_RESET_CACHE'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Cancel current running subscription */
|
|
56
|
+
export type GeneratorDataBankActionCancelSubscription = Action & {
|
|
57
|
+
__actionName: 'GENERATOR_DATA_BANK_CANCEL_SUBSCRIPTION'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface GeneratorDataBankDef {
|
|
61
|
+
/*
|
|
62
|
+
Default property:
|
|
63
|
+
{
|
|
64
|
+
"init": false,
|
|
65
|
+
"fetchPolicy": "cache-first",
|
|
66
|
+
"subscribeDataChange": false
|
|
67
|
+
}
|
|
68
|
+
*/
|
|
69
|
+
property?: {
|
|
70
|
+
/* Start generator initialization execution immediately */
|
|
71
|
+
init?: boolean | DataLink
|
|
72
|
+
/* Data Bank Space ID */
|
|
73
|
+
spacename?: string | DataLink
|
|
74
|
+
/* Data Bank Space secret key */
|
|
75
|
+
spacekey?: string | DataLink
|
|
76
|
+
/* Data need to be fetched */
|
|
77
|
+
properties?: Array<string | DataLink> | DataLink
|
|
78
|
+
/* Determine the cache behavior
|
|
79
|
+
|
|
80
|
+
cache-first: Cache first if existing, then fetch from network
|
|
81
|
+
network-and-cache: Fetch from network, then save cache
|
|
82
|
+
network-only: Fetch from network only */
|
|
83
|
+
fetchPolicy?: 'cache-first' | 'network-and-cache' | 'network-only' | DataLink
|
|
84
|
+
/* Subscribe Data change */
|
|
85
|
+
subscribeDataChange?: boolean | DataLink
|
|
86
|
+
}
|
|
87
|
+
events?: {
|
|
88
|
+
/* Event of Data Bank fetch response */
|
|
89
|
+
onFetchResponse?: Array<
|
|
90
|
+
EventAction<string & keyof TemplateEventPropsMap['DataBank']['onFetchResponse']>
|
|
91
|
+
>
|
|
92
|
+
/* Event of Data Bank change from subscription */
|
|
93
|
+
onChange?: Array<EventAction>
|
|
94
|
+
/* Event of Data Bank fetch error */
|
|
95
|
+
onFetchError?: Array<EventAction>
|
|
96
|
+
/* Event of error */
|
|
97
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['DataBank']['onError']>>
|
|
98
|
+
/* Event of subscription on connection */
|
|
99
|
+
subscribeDataOnConnect?: Array<EventAction>
|
|
100
|
+
/* Server connections error of subscription */
|
|
101
|
+
subscribeDataOnConnectError?: Array<
|
|
102
|
+
EventAction<string & keyof TemplateEventPropsMap['DataBank']['subscribeDataOnConnectError']>
|
|
103
|
+
>
|
|
104
|
+
}
|
|
105
|
+
outlets?: {
|
|
106
|
+
/* Response for Data Bank fetch request, it will save to 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
|
+
>
|
|
135
|
+
/* Server response error of Data Bank fetch request, it will save to Data */
|
|
136
|
+
error?: () => Data<string>
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Access and subscribe to shared Data properties from the project Data Bank */
|
|
141
|
+
export type GeneratorDataBank = Generator &
|
|
142
|
+
GeneratorDataBankDef & {
|
|
143
|
+
templateKey: 'GENERATOR_DATA_BANK'
|
|
144
|
+
switches?: Array<
|
|
145
|
+
SwitchDef &
|
|
146
|
+
GeneratorDataBankDef & {
|
|
147
|
+
conds?: Array<{
|
|
148
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
149
|
+
cond:
|
|
150
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
151
|
+
| SwitchCondData
|
|
152
|
+
| {
|
|
153
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
154
|
+
outlet: 'response' | 'error'
|
|
155
|
+
value: any
|
|
156
|
+
}
|
|
157
|
+
}>
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
}
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* File system operations: read, write, copy, delete, and list files
|
|
4
|
+
*/
|
|
5
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
|
+
import type { Data, DataLink } from '../data'
|
|
7
|
+
import type {
|
|
8
|
+
Brick,
|
|
9
|
+
Generator,
|
|
10
|
+
EventAction,
|
|
11
|
+
ActionWithDataParams,
|
|
12
|
+
ActionWithParams,
|
|
13
|
+
Action,
|
|
14
|
+
EventProperty,
|
|
15
|
+
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
17
|
+
|
|
18
|
+
/* Read stats */
|
|
19
|
+
export type GeneratorFileActionReadStats = Action & {
|
|
20
|
+
__actionName: 'GENERATOR_FILE_READ_STATS'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Read (Currently only support text file) */
|
|
24
|
+
export type GeneratorFileActionReadContent = ActionWithParams & {
|
|
25
|
+
__actionName: 'GENERATOR_FILE_READ_CONTENT'
|
|
26
|
+
params?: Array<{
|
|
27
|
+
input: 'encoding'
|
|
28
|
+
value?: 'utf8' | 'base64' | DataLink | EventProperty
|
|
29
|
+
mapping?: string
|
|
30
|
+
}>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Delete */
|
|
34
|
+
export type GeneratorFileActionDelete = Action & {
|
|
35
|
+
__actionName: 'GENERATOR_FILE_DELETE'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Append (Currently only support text file) */
|
|
39
|
+
export type GeneratorFileActionAppendContent = ActionWithParams & {
|
|
40
|
+
__actionName: 'GENERATOR_FILE_APPEND_CONTENT'
|
|
41
|
+
params?: Array<
|
|
42
|
+
| {
|
|
43
|
+
input: 'content'
|
|
44
|
+
value?: string | DataLink | EventProperty
|
|
45
|
+
mapping?: string
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
input: 'encoding'
|
|
49
|
+
value?: 'utf8' | 'base64' | DataLink | EventProperty
|
|
50
|
+
mapping?: string
|
|
51
|
+
}
|
|
52
|
+
| {
|
|
53
|
+
input: 'contentList'
|
|
54
|
+
value?: Array<any> | DataLink | EventProperty
|
|
55
|
+
mapping?: string
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Write (Currently only support text file) */
|
|
61
|
+
export type GeneratorFileActionWriteContent = ActionWithParams & {
|
|
62
|
+
__actionName: 'GENERATOR_FILE_WRITE_CONTENT'
|
|
63
|
+
params?: Array<
|
|
64
|
+
| {
|
|
65
|
+
input: 'content'
|
|
66
|
+
value?: string | DataLink | EventProperty
|
|
67
|
+
mapping?: string
|
|
68
|
+
}
|
|
69
|
+
| {
|
|
70
|
+
input: 'encoding'
|
|
71
|
+
value?: 'utf8' | 'base64' | DataLink | EventProperty
|
|
72
|
+
mapping?: string
|
|
73
|
+
}
|
|
74
|
+
| {
|
|
75
|
+
input: 'position'
|
|
76
|
+
value?: number | DataLink | EventProperty
|
|
77
|
+
mapping?: string
|
|
78
|
+
}
|
|
79
|
+
| {
|
|
80
|
+
input: 'contentList'
|
|
81
|
+
value?: Array<any> | DataLink | EventProperty
|
|
82
|
+
mapping?: string
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Start upload (All or By ID or By Index) */
|
|
88
|
+
export type GeneratorFileActionStartUpload = ActionWithParams & {
|
|
89
|
+
__actionName: 'GENERATOR_FILE_START_UPLOAD'
|
|
90
|
+
params?: Array<
|
|
91
|
+
| {
|
|
92
|
+
input: 'withAll'
|
|
93
|
+
value?: boolean | DataLink | EventProperty
|
|
94
|
+
mapping?: string
|
|
95
|
+
}
|
|
96
|
+
| {
|
|
97
|
+
input: 'withId'
|
|
98
|
+
value?: string | DataLink | EventProperty
|
|
99
|
+
mapping?: string
|
|
100
|
+
}
|
|
101
|
+
| {
|
|
102
|
+
input: 'withIndex'
|
|
103
|
+
value?: number | DataLink | EventProperty
|
|
104
|
+
mapping?: string
|
|
105
|
+
}
|
|
106
|
+
>
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Stop upload (All or By ID or By Index) */
|
|
110
|
+
export type GeneratorFileActionStopUpload = ActionWithParams & {
|
|
111
|
+
__actionName: 'GENERATOR_FILE_STOP_UPLOAD'
|
|
112
|
+
params?: Array<
|
|
113
|
+
| {
|
|
114
|
+
input: 'withAll'
|
|
115
|
+
value?: boolean | DataLink | EventProperty
|
|
116
|
+
mapping?: string
|
|
117
|
+
}
|
|
118
|
+
| {
|
|
119
|
+
input: 'withId'
|
|
120
|
+
value?: string | DataLink | EventProperty
|
|
121
|
+
mapping?: string
|
|
122
|
+
}
|
|
123
|
+
| {
|
|
124
|
+
input: 'withIndex'
|
|
125
|
+
value?: number | DataLink | EventProperty
|
|
126
|
+
mapping?: string
|
|
127
|
+
}
|
|
128
|
+
>
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Start download (All or By ID or By Index) */
|
|
132
|
+
export type GeneratorFileActionStartDownload = ActionWithParams & {
|
|
133
|
+
__actionName: 'GENERATOR_FILE_START_DOWNLOAD'
|
|
134
|
+
params?: Array<
|
|
135
|
+
| {
|
|
136
|
+
input: 'withAll'
|
|
137
|
+
value?: boolean | DataLink | EventProperty
|
|
138
|
+
mapping?: string
|
|
139
|
+
}
|
|
140
|
+
| {
|
|
141
|
+
input: 'withId'
|
|
142
|
+
value?: string | DataLink | EventProperty
|
|
143
|
+
mapping?: string
|
|
144
|
+
}
|
|
145
|
+
| {
|
|
146
|
+
input: 'withIndex'
|
|
147
|
+
value?: number | DataLink | EventProperty
|
|
148
|
+
mapping?: string
|
|
149
|
+
}
|
|
150
|
+
>
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Stop download (All or By ID or By Index) */
|
|
154
|
+
export type GeneratorFileActionStopDownload = ActionWithParams & {
|
|
155
|
+
__actionName: 'GENERATOR_FILE_STOP_DOWNLOAD'
|
|
156
|
+
params?: Array<
|
|
157
|
+
| {
|
|
158
|
+
input: 'withAll'
|
|
159
|
+
value?: boolean | DataLink | EventProperty
|
|
160
|
+
mapping?: string
|
|
161
|
+
}
|
|
162
|
+
| {
|
|
163
|
+
input: 'withId'
|
|
164
|
+
value?: string | DataLink | EventProperty
|
|
165
|
+
mapping?: string
|
|
166
|
+
}
|
|
167
|
+
| {
|
|
168
|
+
input: 'withIndex'
|
|
169
|
+
value?: number | DataLink | EventProperty
|
|
170
|
+
mapping?: string
|
|
171
|
+
}
|
|
172
|
+
>
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Clear download */
|
|
176
|
+
export type GeneratorFileActionClearDownload = Action & {
|
|
177
|
+
__actionName: 'GENERATOR_FILE_CLEAR_DOWNLOAD'
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
interface GeneratorFileDef {
|
|
181
|
+
/*
|
|
182
|
+
Default property:
|
|
183
|
+
{
|
|
184
|
+
"type": "single",
|
|
185
|
+
"targetDirectory": "none",
|
|
186
|
+
"hashType": "sha256",
|
|
187
|
+
"header": {},
|
|
188
|
+
"fields": {},
|
|
189
|
+
"list": [],
|
|
190
|
+
"downloadAllowLoadSizeLimitExceed": false,
|
|
191
|
+
"downloadRetryCount": 3,
|
|
192
|
+
"downloadMode": "sequence",
|
|
193
|
+
"downloadProgressFrequency": 1000,
|
|
194
|
+
"uploadRetryCount": 3,
|
|
195
|
+
"uploadMode": "sequence",
|
|
196
|
+
"uploadProgressFrequency": 1000
|
|
197
|
+
}
|
|
198
|
+
*/
|
|
199
|
+
property?: {
|
|
200
|
+
/* Type (Single or Multiple) */
|
|
201
|
+
type?: 'single' | 'multiple' | DataLink
|
|
202
|
+
/* Target directory (Default: document directory in app) */
|
|
203
|
+
targetDirectory?: 'none' | 'custom' | 'document' | 'cache' | 'tmp' | DataLink
|
|
204
|
+
/* Target directory (Default: document directory in app) */
|
|
205
|
+
customTargetDirectory?: string | DataLink
|
|
206
|
+
/* File path (If type is single) */
|
|
207
|
+
path?: string | DataLink
|
|
208
|
+
/* File encoding (If type is single) */
|
|
209
|
+
encoding?: 'utf8' | 'base64' | DataLink
|
|
210
|
+
/* URL (If type is single) */
|
|
211
|
+
url?: string | DataLink
|
|
212
|
+
/* Hash value */
|
|
213
|
+
hash?: string | DataLink
|
|
214
|
+
/* Hash type */
|
|
215
|
+
hashType?: 'md5' | 'sha256' | 'sha1' | DataLink
|
|
216
|
+
/* Request method */
|
|
217
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink
|
|
218
|
+
/* Header */
|
|
219
|
+
header?: {} | DataLink
|
|
220
|
+
/* Fields */
|
|
221
|
+
fields?: {} | DataLink
|
|
222
|
+
/* File list (If type is multiple) */
|
|
223
|
+
list?:
|
|
224
|
+
| Array<
|
|
225
|
+
| DataLink
|
|
226
|
+
| {
|
|
227
|
+
id?: string | DataLink
|
|
228
|
+
path?: string | DataLink
|
|
229
|
+
encoding?: 'utf8' | 'base64' | DataLink
|
|
230
|
+
url?: string | DataLink
|
|
231
|
+
hash?: string | DataLink
|
|
232
|
+
hashType?: 'sha256' | 'sha1' | 'md5' | DataLink
|
|
233
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | DataLink
|
|
234
|
+
header?: {} | DataLink
|
|
235
|
+
fields?: {} | DataLink
|
|
236
|
+
}
|
|
237
|
+
>
|
|
238
|
+
| DataLink
|
|
239
|
+
/* Enable download (URL is required) */
|
|
240
|
+
downloadEnabled?: boolean | DataLink
|
|
241
|
+
/* Download load size limit */
|
|
242
|
+
downloadLoadSizeLimit?: number | DataLink
|
|
243
|
+
/* Download allow load size limit exceed */
|
|
244
|
+
downloadAllowLoadSizeLimitExceed?: boolean | DataLink
|
|
245
|
+
/* Download retry count */
|
|
246
|
+
downloadRetryCount?: number | DataLink
|
|
247
|
+
/* Download mode (if type is multiple) */
|
|
248
|
+
downloadMode?: 'concurrent' | 'sequence' | DataLink
|
|
249
|
+
/* Limit of download concurrent mode */
|
|
250
|
+
downloadConcurrentLimit?: number | DataLink
|
|
251
|
+
/* Download progress frequency */
|
|
252
|
+
downloadProgressFrequency?: number | DataLink
|
|
253
|
+
/* Enable upload (Path & URL is required) */
|
|
254
|
+
uploadEnabled?: boolean | DataLink
|
|
255
|
+
/* Upload retry count */
|
|
256
|
+
uploadRetryCount?: number | DataLink
|
|
257
|
+
/* Upload mode (if type is multiple) */
|
|
258
|
+
uploadMode?: 'concurrent' | 'sequence' | DataLink
|
|
259
|
+
/* Limit of upload concurrent mode */
|
|
260
|
+
uploadConcurrentLimit?: number | DataLink
|
|
261
|
+
/* Upload progress frequency */
|
|
262
|
+
uploadProgressFrequency?: number | DataLink
|
|
263
|
+
}
|
|
264
|
+
events?: {
|
|
265
|
+
/* On file handler init error */
|
|
266
|
+
initError?: Array<EventAction<string & keyof TemplateEventPropsMap['File']['initError']>>
|
|
267
|
+
/* On file status change */
|
|
268
|
+
onFileStatusChange?: Array<
|
|
269
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onFileStatusChange']>
|
|
270
|
+
>
|
|
271
|
+
/* On read stats error */
|
|
272
|
+
onReadStatsError?: Array<
|
|
273
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onReadStatsError']>
|
|
274
|
+
>
|
|
275
|
+
/* On read content error */
|
|
276
|
+
onReadContentError?: Array<
|
|
277
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onReadContentError']>
|
|
278
|
+
>
|
|
279
|
+
/* On read content error */
|
|
280
|
+
onAppendContentError?: Array<
|
|
281
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onAppendContentError']>
|
|
282
|
+
>
|
|
283
|
+
/* On write content error */
|
|
284
|
+
onWriteContentError?: Array<
|
|
285
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onWriteContentError']>
|
|
286
|
+
>
|
|
287
|
+
/* On upload progress */
|
|
288
|
+
onUploadProgress?: Array<
|
|
289
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onUploadProgress']>
|
|
290
|
+
>
|
|
291
|
+
/* On upload error */
|
|
292
|
+
onUploadError?: Array<
|
|
293
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onUploadError']>
|
|
294
|
+
>
|
|
295
|
+
/* On upload complete */
|
|
296
|
+
onUploadComplete?: Array<
|
|
297
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onUploadComplete']>
|
|
298
|
+
>
|
|
299
|
+
/* On upload all done */
|
|
300
|
+
onUploadAllComplete?: Array<
|
|
301
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onUploadAllComplete']>
|
|
302
|
+
>
|
|
303
|
+
/* On download progress */
|
|
304
|
+
onDownloadProgress?: Array<
|
|
305
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadProgress']>
|
|
306
|
+
>
|
|
307
|
+
/* On download error */
|
|
308
|
+
onDownloadError?: Array<
|
|
309
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadError']>
|
|
310
|
+
>
|
|
311
|
+
/* On download complete */
|
|
312
|
+
onDownloadComplete?: Array<
|
|
313
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadComplete']>
|
|
314
|
+
>
|
|
315
|
+
/* On download all done */
|
|
316
|
+
onDownloadAllComplete?: Array<
|
|
317
|
+
EventAction<string & keyof TemplateEventPropsMap['File']['onDownloadAllComplete']>
|
|
318
|
+
>
|
|
319
|
+
}
|
|
320
|
+
outlets?: {
|
|
321
|
+
/* File init error result will be stored in Data */
|
|
322
|
+
initError?: () => Data<string>
|
|
323
|
+
/* File read stats result will be stored in 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
|
+
}>
|
|
334
|
+
/* File read content result will be stored in Data */
|
|
335
|
+
readContent?: () => Data<any>
|
|
336
|
+
/* File read details result will be stored in Data */
|
|
337
|
+
readDetails?: () => Data<{
|
|
338
|
+
path?: string
|
|
339
|
+
content?: any
|
|
340
|
+
size?: number
|
|
341
|
+
exists?: boolean
|
|
342
|
+
[key: string]: any
|
|
343
|
+
}>
|
|
344
|
+
/* File read error result will be stored in Data */
|
|
345
|
+
readError?: () => Data<string>
|
|
346
|
+
/* File append content result will be stored in Data */
|
|
347
|
+
appendDetails?: () => Data<{
|
|
348
|
+
path?: string
|
|
349
|
+
appended?: boolean
|
|
350
|
+
contentLength?: number
|
|
351
|
+
[key: string]: any
|
|
352
|
+
}>
|
|
353
|
+
/* File append error result will be stored in Data */
|
|
354
|
+
appendError?: () => Data<string>
|
|
355
|
+
/* File write details result will be stored in Data */
|
|
356
|
+
writeDetails?: () => Data<{
|
|
357
|
+
path?: string
|
|
358
|
+
written?: boolean
|
|
359
|
+
contentLength?: number
|
|
360
|
+
[key: string]: any
|
|
361
|
+
}>
|
|
362
|
+
/* File write error result will be stored in Data */
|
|
363
|
+
writeError?: () => Data<string>
|
|
364
|
+
/* File upload progress result will be stored in 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
|
+
}>
|
|
378
|
+
/* File upload complete result will be stored in Data */
|
|
379
|
+
uploadResult?: () => Data<any>
|
|
380
|
+
/* File download progress result will be stored in 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
|
+
}>
|
|
394
|
+
/* File download complete result will be stored in Data */
|
|
395
|
+
downloadResult?: () => Data<any>
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* File system operations: read, write, copy, delete, and list files */
|
|
400
|
+
export type GeneratorFile = Generator &
|
|
401
|
+
GeneratorFileDef & {
|
|
402
|
+
templateKey: 'GENERATOR_FILE'
|
|
403
|
+
switches?: Array<
|
|
404
|
+
SwitchDef &
|
|
405
|
+
GeneratorFileDef & {
|
|
406
|
+
conds?: Array<{
|
|
407
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
408
|
+
cond:
|
|
409
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
410
|
+
| SwitchCondData
|
|
411
|
+
| {
|
|
412
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
413
|
+
outlet:
|
|
414
|
+
| 'initError'
|
|
415
|
+
| 'readStats'
|
|
416
|
+
| 'readContent'
|
|
417
|
+
| 'readDetails'
|
|
418
|
+
| 'readError'
|
|
419
|
+
| 'appendDetails'
|
|
420
|
+
| 'appendError'
|
|
421
|
+
| 'writeDetails'
|
|
422
|
+
| 'writeError'
|
|
423
|
+
| 'uploadProgress'
|
|
424
|
+
| 'uploadResult'
|
|
425
|
+
| 'downloadProgress'
|
|
426
|
+
| 'downloadResult'
|
|
427
|
+
value: any
|
|
428
|
+
}
|
|
429
|
+
}>
|
|
430
|
+
}
|
|
431
|
+
>
|
|
432
|
+
}
|