@fugood/bricks-cli 2.25.0-beta.4 → 2.25.0-beta.6

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/lib/117.js ADDED
@@ -0,0 +1,2543 @@
1
+ export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>t0});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{lI:()=>ed,F3:()=>er,mJ:()=>es,AW:()=>eu,$V:()=>el,J6:()=>ep,Wt:()=>em,qq:()=>ec,gw:()=>e_,Yi:()=>eo});var l={};t.r(l),t.d(l,{applicationFragment:()=>ed,applicationShortFragment:()=>ey,deviceFragment:()=>er,deviceGroupFragment:()=>es,deviceShortFragment:()=>e$,instanceVersionFragment:()=>eu,mediaBoxFragment:()=>eh,mediaFileFragment:()=>eb,mediaWorkspaceFragment:()=>ev,moduleFragment:()=>el,moduleShortFragment:()=>ep,operationFragment:()=>em,publicApplicationBasicInfoFragment:()=>ec,userFavoriteFragment:()=>e_,workspaceFragment:()=>eg,workspaceShortFragment:()=>ef});var p={};t.r(p),t.d(p,{application:()=>eK,applicationByDevice:()=>eP,applicationReleaseVersion:()=>eU,applicationReleaseVersions:()=>eE,applicationTestsByDevice:()=>eO,applications:()=>eY,checkBindDevicePasscode:()=>eF,deviceUsage:()=>eL,devices:()=>eG,devicesByGroup:()=>eq,devicesByUniqueId:()=>eN,me:()=>ew,module:()=>eC,moduleReleaseVersion:()=>eR,moduleReleaseVersions:()=>eM,modules:()=>eT,publicModules:()=>ex,publicModulesByIdList:()=>eB,workspace:()=>ej,workspacePricingPlans:()=>eW,workspaces:()=>eV});var u={};t.r(u),t.d(u,{addUserFavorite:()=>iC,assignGroupPermissions:()=>iD,bindApplication:()=>ia,bindApplicationWithDeviceGroup:()=>is,changeWorkspaceAdditionalLimitSpending:()=>iB,changeWorkspaceSubscriptionPlan:()=>ix,controlDevice:()=>e2,createApplication:()=>ie,createApplicationWithShareVersion:()=>ii,createConfigChangeOperation:()=>ih,createDevice:()=>eQ,createDeviceGroup:()=>e5,createDeviceGroupWithApp:()=>il,createModule:()=>i_,createVirtualDevice:()=>eZ,createWorkspace:()=>eH,createWorkspaceOTP:()=>iE,dispatchDeviceGroupAction:()=>e3,doOperation:()=>ib,duplicateApplication:()=>iu,duplicateModule:()=>i$,forkApplication:()=>ip,moveApplication:()=>ic,moveDevice:()=>e1,moveModule:()=>iy,registerFCMNotification:()=>iA,registerRemoteDebug:()=>iS,removeApplication:()=>im,removeDevice:()=>e6,removeDeviceGroup:()=>e8,removeModule:()=>iv,removeOperation:()=>ik,removeUserFavorite:()=>iT,removeWorkspace:()=>e7,revokeWorkspaceOTP:()=>iU,shareAccessToken:()=>iw,shareApplication:()=>id,toggleShortEditApplication:()=>io,updateApplication:()=>it,updateApplicationViewportPreset:()=>ir,updateDevice:()=>e0,updateDeviceGroup:()=>e9,updateModule:()=>ig,updateOperation:()=>iI,updateVirtualDevice:()=>e4,updateWorkspace:()=>eJ,updateWorkspaceTokens:()=>eX});var m={};t.r(m),t.d(m,{application:()=>iF,applicationByDevice:()=>iN,applications:()=>iO,device:()=>iV,deviceUsage:()=>iK,devices:()=>ij,devicesByApplication:()=>iY,mediaBox:()=>iz,mediaBoxes:()=>iL,mediaFile:()=>iJ,mediaFiles:()=>iH,mediaWorkspace:()=>iG,module:()=>iW,modules:()=>iq,workspace:()=>iP});var _={};t.r(_),t.d(_,{bindApplication:()=>iZ,copyMediaFiles:()=>i3,createApplication:()=>iX,createModule:()=>i1,deleteMediaBoxFiles:()=>i7,deleteMediaFiles:()=>i8,requestFileUpload:()=>i6,setMediaFileAsBoxPreview:()=>i9,unbindApplication:()=>i0,updateApplication:()=>iQ,updateMediaFile:()=>i2,updateMediaFiles:()=>i5,updateModule:()=>i4});var g={};t.r(g),t.d(g,{mediaBox:()=>tv,mediaBoxes:()=>ty,mediaFile:()=>tb,mediaFiles:()=>th,mediaWorkspace:()=>t$,mediaWorkspaces:()=>tf});var f={};t.r(f),t.d(f,{assignGroupPermissions:()=>tU,copyMediaFiles:()=>tB,createMediaBox:()=>tD,createMediaWorkspace:()=>tI,deleteMediaFiles:()=>tx,moveMediaBox:()=>tA,requestFileUpload:()=>tw,setMediaFileAsBoxPreview:()=>tE,updateMediaBox:()=>tS,updateMediaFile:()=>tC,updateMediaFiles:()=>tT,updateMediaWorkspace:()=>tk});var y={};t.r(y),t.d(y,{mediaBox:()=>tR,mediaFile:()=>tO,mediaFiles:()=>tP});var $={};t.r($),t.d($,{deleteMediaFiles:()=>tW,requestFileUpload:()=>tF,updateMediaFile:()=>tN,updateMediaFiles:()=>tq});var v=t(99436),h=t(25326),b=t(66029),I={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},k=Object.entries(I).reduce((e,[i,t])=>(e[t]=i,e),{}),D=["HS256","RS256"],A=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],S=t(84867);let w='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var C=t(20181),T=(e,i={})=>({content:[C.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),x=t(68832),B=t(79657),E=t(79861),U=t(46123),M=t(80211),R=t(45907),P=t(99548),O=t(96423),F=M.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),N=(0,O.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function q(e){var i=[];try{var t=M(e);i.push(...(0,P.L)({errors:t,schema:F,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...R(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return N(e).forEach(t=>{var n=t.slice(0,-1),a=U(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),d&&!a.map[d]&&i.push(`${o}.map.${d} is missing`),c&&Object.values(c).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var W=t(49741),j=t(63981),V=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||Array.isArray(t)?t:t[i]??V(t,i)])):e,Y=V(W.t),K=Object.entries(W.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${Y[e]}
2
+ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i])=>` - \`${e}\`: ${JSON.stringify(i)}`).join("\n");case"property_bank":return" - `PROPERTY_BANK_DATA_NODE_*`: Value";default:return""}})(i,t)}
3
+ `.trim()).join("\n"),G=Object.keys(j.brickMapping).map(e=>`- \`${e}\``).join("\n"),L=Object.keys(j.generatorMapping).map(e=>`- \`${e}\``).join("\n");let z=w.replace("[:SYSTEM_ACTIONS:]",K).replace("[:BRICK_IDS:]",G).replace("[:GENERATOR_IDS:]",L);var H=t(44668),J=t(5018),X=t(63315),Q=t(30409),Z=t(40906),ee=t(79760),ei=t(22268),et=t(7068),en=t(26197),ea=t(94370);let eo=(0,ea.default)`
4
+ fragment workspaceArguments on Workspace {
5
+ __typename
6
+ _id
7
+ owner {
8
+ _id
9
+ id_from_user
10
+ }
11
+ name
12
+ description
13
+ bank {
14
+ enable_remote_update
15
+ spacename
16
+ keys
17
+ }
18
+ media_resource {
19
+ enable_media_workspace
20
+ workspace_id
21
+ system_media_box_id
22
+ system_media_box_passcode
23
+ editor_upload_binding {
24
+ box_id
25
+ box_passcode
26
+ }
27
+ }
28
+ emails {
29
+ address
30
+ verified
31
+ date
32
+ }
33
+ notification_messages {
34
+ _id
35
+ type
36
+ custom_message
37
+ id
38
+ name
39
+ date
40
+ read
41
+ }
42
+ auth {
43
+ tokens {
44
+ _id
45
+ name
46
+ enable_expired
47
+ expired_at
48
+ created_at
49
+ types
50
+ }
51
+ }
52
+ billing {
53
+ plan {
54
+ type
55
+ period
56
+ }
57
+ lock {
58
+ features
59
+ additional_resources
60
+ }
61
+ subscription {
62
+ status
63
+ last_active_at
64
+ billing_cycle_anchor
65
+ current_period_end
66
+ }
67
+ subscription_schedule {
68
+ status
69
+ next_plan_type
70
+ next_plan_period
71
+ next_plan_start_date
72
+ }
73
+ additional_subscription {
74
+ status
75
+ last_active_at
76
+ billing_cycle_anchor
77
+ current_period_end
78
+ }
79
+ additional_limit_spending {
80
+ devices
81
+ media
82
+ group
83
+ }
84
+ }
85
+ create_datetime
86
+ last_modify_datetime
87
+ last_modify_records {
88
+ type
89
+ query_name
90
+ instance_id
91
+ token_name
92
+ meta
93
+ updated_at
94
+ }
95
+ }
96
+ `,er=(0,ea.default)`
97
+ fragment deviceArguments on Device {
98
+ __typename
99
+ _id
100
+ create_datetime
101
+ last_modify_datetime
102
+ last_modify_records {
103
+ type
104
+ query_name
105
+ instance_id
106
+ token_name
107
+ meta
108
+ updated_at
109
+ }
110
+ name
111
+ device_name
112
+ description
113
+ tags
114
+ entry_detail {
115
+ unique_id
116
+ operation_version
117
+ type
118
+ operation_mode
119
+ update {
120
+ current_version
121
+ last_update_at
122
+ }
123
+ watch_dog_timer {
124
+ alive
125
+ last_launch_time
126
+ prev_last_launch_time
127
+ last_alive_time
128
+ threshold
129
+ }
130
+ screen {
131
+ title
132
+ master
133
+ orientation
134
+ resolution {
135
+ width
136
+ height
137
+ scale
138
+ fontScale
139
+ }
140
+ touch {
141
+ available
142
+ touch_point
143
+ }
144
+ }
145
+ local_sync {
146
+ is_main
147
+ peer_count
148
+ mean_latency
149
+ }
150
+ application {
151
+ _id
152
+ name
153
+ config_timestamp
154
+ }
155
+ memory_usage
156
+ disk_usage
157
+ }
158
+ owner {
159
+ _id
160
+ id_from_user
161
+ }
162
+ used_workspace {
163
+ _id
164
+ name
165
+ emails {
166
+ address
167
+ verified
168
+ }
169
+ billing {
170
+ plan {
171
+ type
172
+ period
173
+ }
174
+ lock {
175
+ features
176
+ }
177
+ }
178
+ }
179
+ bound_application {
180
+ _id
181
+ name
182
+ }
183
+ alert {
184
+ enabled
185
+ time_range
186
+ days_of_week {
187
+ sun
188
+ mon
189
+ tues
190
+ weds
191
+ thurs
192
+ fri
193
+ satur
194
+ }
195
+ }
196
+ activity_log {
197
+ enabled
198
+ filter
199
+ screenshot_enabled
200
+ }
201
+ local_sync {
202
+ enabled
203
+ priority_as_main
204
+ disable_dynamic_latency
205
+ latency_offset
206
+ }
207
+ preload {
208
+ disabled
209
+ skip_on_failure
210
+ force_md5_match
211
+ retry_attempt_for_failure
212
+ skip_integrity_check
213
+ }
214
+ auth {
215
+ type
216
+ tokens {
217
+ _id
218
+ name
219
+ enable_expired
220
+ expired_at
221
+ created_at
222
+ allowed_in_url_query
223
+ types
224
+ }
225
+ ip_address_allowlist
226
+ ip_address_blocklist
227
+ access_accounts {
228
+ username
229
+ }
230
+ }
231
+ application_update {
232
+ lazy_update
233
+ }
234
+ lock {
235
+ enabled
236
+ }
237
+ env {
238
+ variables
239
+ virtual_dev_url_query {
240
+ env_prefix
241
+ enable_unsafe_encryption
242
+ encryption_algorithm
243
+ encryption_key
244
+ encryption_iv
245
+ }
246
+ }
247
+ }
248
+ `,es=(0,ea.default)`
249
+ fragment deviceGroupArguments on DeviceGroup {
250
+ __typename
251
+ _id
252
+ create_datetime
253
+ last_modify_datetime
254
+ last_modify_records {
255
+ type
256
+ query_name
257
+ instance_id
258
+ token_name
259
+ meta
260
+ updated_at
261
+ }
262
+ name
263
+ description
264
+ owner {
265
+ _id
266
+ id_from_user
267
+ }
268
+ used_workspace {
269
+ _id
270
+ billing {
271
+ plan {
272
+ type
273
+ period
274
+ }
275
+ lock {
276
+ features
277
+ }
278
+ }
279
+ }
280
+ tags
281
+ devices {
282
+ device_id
283
+ device_target_name
284
+ }
285
+ }
286
+ `,ed=(0,ea.default)`
287
+ fragment applicationArguments on Application {
288
+ __typename
289
+ _id
290
+ owner {
291
+ _id
292
+ id_from_user
293
+ }
294
+ lock {
295
+ enabled
296
+ }
297
+ id_for_devices
298
+ devices {
299
+ device_id
300
+ frame
301
+ run_test
302
+ cron_tests {
303
+ test_id
304
+ update_screenshot
305
+ cron
306
+ date_range {
307
+ start
308
+ end
309
+ }
310
+ bind_id
311
+ }
312
+ short_edit
313
+ env
314
+ }
315
+ secrets {
316
+ _id
317
+ property_id
318
+ name
319
+ description
320
+ date
321
+ }
322
+ viewport_presets {
323
+ _id
324
+ name
325
+ viewports {
326
+ detail
327
+ device_target_name
328
+ run_test
329
+ cron_tests {
330
+ test_id
331
+ update_screenshot
332
+ }
333
+ }
334
+ run_test
335
+ cron_tests {
336
+ test_id
337
+ update_screenshot
338
+ }
339
+ sync_key
340
+ }
341
+ used_workspace {
342
+ _id
343
+ name
344
+ billing {
345
+ plan {
346
+ type
347
+ period
348
+ }
349
+ lock {
350
+ features
351
+ }
352
+ }
353
+ }
354
+ dev_ref {
355
+ is_dev
356
+ parent_application
357
+ }
358
+ name
359
+ description
360
+ config
361
+ short_edit {
362
+ enabled
363
+ use_unstable_features
364
+ }
365
+ canvas_control {
366
+ enabled
367
+ use_unstable_features
368
+ }
369
+ device_control {
370
+ enabled
371
+ use_unstable_features
372
+ }
373
+ has_unreleased_changes
374
+ create_datetime
375
+ last_modify_datetime
376
+ last_modify_records {
377
+ type
378
+ query_name
379
+ instance_id
380
+ token_name
381
+ meta
382
+ updated_at
383
+ }
384
+ current_version
385
+ share {
386
+ description
387
+ tags
388
+ type
389
+ usage
390
+ create_records {
391
+ total_count
392
+ # records
393
+ }
394
+ favorite {
395
+ enabled
396
+ total_count
397
+ }
398
+ preview {
399
+ enabled
400
+ }
401
+ selected_releases {
402
+ _id
403
+ version
404
+ name
405
+ note
406
+ date
407
+ used_modules
408
+ used_media_flow_generators
409
+ used_global_remote_property_bank
410
+ used_secrets
411
+ }
412
+ screenshot {
413
+ type
414
+ screenshot_payload
415
+ last_screenshot_id
416
+ }
417
+ create_settings {
418
+ module_auto_destructure
419
+ }
420
+ }
421
+ screenshot {
422
+ type
423
+ screenshot_payload
424
+ last_screenshot_id
425
+ }
426
+ ai_filters {
427
+ name
428
+ description
429
+ instruction
430
+ variable_keys
431
+ model_provider
432
+ scope
433
+ }
434
+ }
435
+ `,ec=(0,ea.default)`
436
+ fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
437
+ _id
438
+ owner {
439
+ _id
440
+ id_from_user
441
+ }
442
+ name
443
+ description
444
+ share {
445
+ description
446
+ tags
447
+ type
448
+ usage
449
+ preview {
450
+ enabled
451
+ }
452
+ create_records {
453
+ total_count
454
+ # records
455
+ }
456
+ favorite {
457
+ enabled
458
+ total_count
459
+ }
460
+ selected_releases {
461
+ _id
462
+ version
463
+ name
464
+ note
465
+ date
466
+ used_modules
467
+ used_media_flow_generators
468
+ used_global_remote_property_bank
469
+ used_secrets
470
+ }
471
+ screenshot {
472
+ last_screenshot_id
473
+ }
474
+ create_settings {
475
+ module_auto_destructure
476
+ }
477
+ }
478
+ }
479
+ `,el=(0,ea.default)`
480
+ fragment moduleArguments on Module {
481
+ __typename
482
+ _id
483
+ create_datetime
484
+ last_modify_datetime
485
+ last_modify_records {
486
+ type
487
+ query_name
488
+ instance_id
489
+ token_name
490
+ meta
491
+ updated_at
492
+ }
493
+ owner {
494
+ _id
495
+ id_from_user
496
+ }
497
+ name
498
+ description
499
+ tags
500
+ config
501
+ current_version
502
+ expose_properties
503
+ is_allow_modify
504
+ is_public
505
+ used_workspace {
506
+ _id
507
+ billing {
508
+ plan {
509
+ type
510
+ period
511
+ }
512
+ lock {
513
+ features
514
+ }
515
+ }
516
+ }
517
+ screenshot {
518
+ type
519
+ screenshot_payload
520
+ last_screenshot_id
521
+ }
522
+ }
523
+ `,ep=(0,ea.default)`
524
+ fragment moduleShortArguments on Module {
525
+ __typename
526
+ _id
527
+ create_datetime
528
+ last_modify_datetime
529
+ owner {
530
+ _id
531
+ id_from_user
532
+ }
533
+ name
534
+ description
535
+ tags
536
+ current_version
537
+ expose_properties
538
+ is_allow_modify
539
+ is_public
540
+ used_workspace {
541
+ _id
542
+ }
543
+ screenshot {
544
+ last_screenshot_id
545
+ }
546
+ }
547
+ `,eu=(0,ea.default)`
548
+ fragment instanceVersionArguments on ConfigVersion {
549
+ __typename
550
+ _id
551
+ create_datetime
552
+ last_modify_datetime
553
+ version
554
+ note
555
+ instance_id
556
+ entry
557
+ }
558
+ `,em=(0,ea.default)`
559
+ fragment operationArguments on Operation {
560
+ __typename
561
+ _id
562
+ creator
563
+ application
564
+ create_datetime
565
+ last_modify_datetime
566
+ passcode
567
+ type
568
+ expired_datetime
569
+ payload
570
+ }
571
+ `,e_=(0,ea.default)`
572
+ fragment userFavoriteArguments on UserFavorite {
573
+ _id
574
+ instance_type
575
+ instance {
576
+ _id
577
+ name
578
+ description
579
+ }
580
+ last_modify_datetime
581
+ }
582
+ `;var eg=(0,ea.default)`
583
+ fragment mcpWorkspaceArguments on Workspace {
584
+ __typename
585
+ _id
586
+ owner {
587
+ _id
588
+ id_from_user
589
+ }
590
+ name
591
+ description
592
+ bank {
593
+ enable_remote_update
594
+ spacename
595
+ keys
596
+ }
597
+ media_resource {
598
+ enable_media_workspace
599
+ workspace_id
600
+ system_media_box_id
601
+ system_media_box_passcode
602
+ editor_upload_binding {
603
+ box_id
604
+ box_passcode
605
+ }
606
+ }
607
+ emails {
608
+ address
609
+ verified
610
+ date
611
+ }
612
+ notification_messages {
613
+ _id
614
+ type
615
+ custom_message
616
+ id
617
+ name
618
+ date
619
+ read
620
+ }
621
+ billing {
622
+ plan {
623
+ type
624
+ period
625
+ }
626
+ lock {
627
+ features
628
+ additional_resources
629
+ }
630
+ subscription {
631
+ status
632
+ last_active_at
633
+ billing_cycle_anchor
634
+ current_period_end
635
+ }
636
+ subscription_schedule {
637
+ status
638
+ next_plan_type
639
+ next_plan_period
640
+ next_plan_start_date
641
+ }
642
+ additional_subscription {
643
+ status
644
+ last_active_at
645
+ billing_cycle_anchor
646
+ current_period_end
647
+ }
648
+ additional_limit_spending {
649
+ devices
650
+ media
651
+ group
652
+ }
653
+ }
654
+ create_datetime
655
+ last_modify_datetime
656
+ last_modify_records {
657
+ type
658
+ query_name
659
+ instance_id
660
+ token_name
661
+ meta
662
+ updated_at
663
+ }
664
+ }
665
+ `,ef=(0,ea.default)`
666
+ fragment mcpWorkspaceShortArguments on Workspace {
667
+ _id
668
+ name
669
+ description
670
+ }
671
+ `,ey=(0,ea.default)`
672
+ fragment mcpApplicationShortArguments on Application {
673
+ _id
674
+ name
675
+ description
676
+ }
677
+ `,e$=(0,ea.default)`
678
+ fragment mcpDeviceShortArguments on Device {
679
+ _id
680
+ name
681
+ description
682
+ }
683
+ `,ev=(0,ea.default)`
684
+ fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
685
+ id
686
+ name
687
+ description
688
+ owner
689
+ serviceBinding
690
+ createdAt
691
+ updatedAt
692
+ size
693
+ sizeLimit
694
+ }
695
+ `,eh=(0,ea.default)`
696
+ fragment workspaceMediaBoxArguments on MediaBox {
697
+ id
698
+ name
699
+ description
700
+ tags
701
+ owner
702
+ workspaceId
703
+ serviceBinding
704
+ serviceBindingType
705
+ passcodes {
706
+ id
707
+ name
708
+ code
709
+ enableExpired
710
+ expiredAt
711
+ permissions
712
+ }
713
+ createdAt
714
+ updatedAt
715
+ size
716
+ }
717
+ `,eb=(0,ea.default)`
718
+ fragment workspaceMediaFileArguments on MediaFile {
719
+ id
720
+ name
721
+ description
722
+ owner
723
+ boxId
724
+ fileType
725
+ contentType
726
+ fileSize
727
+ originalKey
728
+ userTags
729
+ versions {
730
+ key
731
+ width
732
+ height
733
+ strategy
734
+ version
735
+ etag
736
+ content_type
737
+ size
738
+ left
739
+ top
740
+ rotate
741
+ metadata
742
+ copypreview
743
+ }
744
+ previewId
745
+ isPreview
746
+ createdAt
747
+ updatedAt
748
+ meta {
749
+ parentFileId
750
+ storageEndpoint
751
+ originalFileUploaded
752
+ originalFileKey
753
+ originalFileSize
754
+ originalFileEtag
755
+ originalFileContentType
756
+ originalWidth
757
+ originalHeight
758
+ convertedFileUploaded
759
+ convertedFileKey
760
+ convertedFileSize
761
+ convertedFileEtag
762
+ convertedFileContentType
763
+ convertedFileHlsSegmentCount
764
+ videoThumbOriginalFileEtag
765
+ videoThumbOriginalFileContentType
766
+ videoThumbOriginalWidth
767
+ videoThumbOriginalHeight
768
+ videoThumbOriginalFileUploaded
769
+ videoThumbOriginalFileKey
770
+ videoThumbOriginalFileSize
771
+ uploadInfo
772
+ imageVersionRequests {
773
+ strategy
774
+ left
775
+ top
776
+ width
777
+ height
778
+ rotate
779
+ metadata
780
+ copypreview
781
+ }
782
+ allowedBiggerImageVersion
783
+ imageVersionType
784
+ videoTransformedByClient
785
+ videoTransformType
786
+ videoTransformed
787
+ customVideoWidth
788
+ customVideoHeight
789
+
790
+ updateUploadAllowSizeRange
791
+ enableAiAnalysis
792
+ aiCustomInstruction
793
+ aiDescription
794
+ aiTags
795
+ aiAnalysisStatus
796
+ aiAnalyzedAt
797
+ systemTags
798
+ }
799
+ }
800
+ `,eI={query:"query",mutation:"mutate"},ek=H(function e(i,t,n,a,o){J(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var r=(0,ee.$)({uri:`${i}${n}`}),s=(0,en.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new ei.R({link:s.concat(r),cache:new et.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=l,this.queries=a,this.mutations=o,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,n])=>{if(this[t])throw Error(`Overwriting client.${t}`);this[t]=v(function*(a={},o={}){try{var r=e.apolloClient[eI[i]],s=yield r({[i]:n,variables:a,...o}),d=s.data,c=s.errors;if(n.needResetStore)try{yield e.apolloClient.resetStore()}catch(e){console.error(e)}if(c)throw Error(c.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause)if(e.cause.result?.errors)throw Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));else console.error(e.cause);throw e}})};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(n=v(function*(e,i={}){var t=yield this.apolloClient.query({query:e,variables:i,fetchPolicy:"no-cache"}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return n.apply(this,arguments)})},{key:"mutate",value:(a=v(function*(e,i={}){var t=yield this.apolloClient.mutate({mutation:e,variables:i}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return a.apply(this,arguments)})}]);let{$V:eD,J6:eA,AW:eS}=c,ew=(0,ea.default)`
801
+ query ControllerClient_me {
802
+ me {
803
+ _id
804
+ id_from_user
805
+ }
806
+ }
807
+ `,eC=(0,ea.default)`
808
+ query ControllerClient_module($id: ID!) {
809
+ module(id: $id) {
810
+ ...moduleArguments
811
+ }
812
+ }
813
+ ${eD}
814
+ `,eT=(0,ea.default)`
815
+ query ControllerClient_modules($workspaceId: ID, $limit: Int) {
816
+ modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
817
+ ...moduleShortArguments
818
+ }
819
+ }
820
+ ${eA}
821
+ `,ex=(0,ea.default)`
822
+ query ControllerClient_publicModules($keyword: String!, $limit: Int) {
823
+ publicModules(keyword: $keyword, paginate: { limit: $limit }) {
824
+ ...moduleShortArguments
825
+ }
826
+ }
827
+ ${eA}
828
+ `,eB=(0,ea.default)`
829
+ query ControllerClient_publicModulesByIdList($idList: [ID]) {
830
+ publicModulesByIdList(idList: $idList) {
831
+ ...moduleShortArguments
832
+ }
833
+ }
834
+ ${eA}
835
+ `,eE=(0,ea.default)`
836
+ query ControllerClient_applicationReleaseVersions($id: ID!) {
837
+ applicationReleaseVersions(id: $id) {
838
+ ...instanceVersionArguments
839
+ }
840
+ }
841
+ ${eS}
842
+ `,eU=(0,ea.default)`
843
+ query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
844
+ applicationReleaseVersion(id: $id, versionId: $versionId) {
845
+ ...applicationReleaseVersionArguments
846
+ }
847
+ }
848
+ ${eS}
849
+ `,eM=(0,ea.default)`
850
+ query ControllerClient_moduleReleaseVersions($id: ID!) {
851
+ moduleReleaseVersions(id: $id) {
852
+ ...instanceVersionArguments
853
+ }
854
+ }
855
+ ${eS}
856
+ `,eR=(0,ea.default)`
857
+ query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
858
+ moduleReleaseVersion(id: $id, versionId: $versionId) {
859
+ ...instanceVersionArguments
860
+ }
861
+ }
862
+ ${eS}
863
+ `,eP=(0,ea.default)`
864
+ query ControllerClient_applicationByDevice(
865
+ $deviceId: ID!
866
+ $debug: Boolean
867
+ $composeModule: Boolean
868
+ $bankRemoteConfig: Boolean
869
+ ) {
870
+ applicationByDevice(
871
+ deviceId: $deviceId
872
+ debug: $debug
873
+ composeModule: $composeModule
874
+ bankRemoteConfig: $bankRemoteConfig
875
+ ) {
876
+ ...applicationArguments
877
+ config_tests
878
+ }
879
+ }
880
+ ${ed}
881
+ `,eO=(0,ea.default)`
882
+ query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
883
+ applicationTestsByDevice: applicationByDevice(
884
+ deviceId: $deviceId
885
+ debug: true
886
+ composeModule: false
887
+ bankRemoteConfig: false
888
+ ) {
889
+ _id
890
+ name
891
+ config_tests
892
+ }
893
+ }
894
+ `,eF=(0,ea.default)`
895
+ query ControllerClient_checkBindDevicePasscode($passcode: String!) {
896
+ checkBindDevicePasscode(passcode: $passcode)
897
+ }
898
+ `,eN=(0,ea.default)`
899
+ query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
900
+ devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
901
+ ...deviceArguments
902
+ }
903
+ }
904
+ ${er}
905
+ `,eq=(0,ea.default)`
906
+ query ControllerClient_devicesByGroup($id: ID!) {
907
+ devicesByGroup(id: $id) {
908
+ device {
909
+ __typename
910
+ _id
911
+ used_workspace {
912
+ _id
913
+ billing {
914
+ plan {
915
+ type
916
+ }
917
+ lock {
918
+ features
919
+ additional_resources
920
+ }
921
+ }
922
+ }
923
+ create_datetime
924
+ last_modify_datetime
925
+ name
926
+ device_name
927
+ description
928
+ tags
929
+ entry_detail {
930
+ unique_id
931
+ operation_version
932
+ type
933
+ operation_mode
934
+ watch_dog_timer {
935
+ alive
936
+ last_launch_time
937
+ last_alive_time
938
+ threshold
939
+ }
940
+ }
941
+ owner {
942
+ _id
943
+ id_from_user
944
+ }
945
+ bound_application {
946
+ _id
947
+ name
948
+ }
949
+ auth {
950
+ type
951
+ }
952
+ }
953
+ target_name
954
+ }
955
+ }
956
+ `,eW=(0,ea.default)`
957
+ query ControllerClient_workspacePricingPlans {
958
+ workspacePricingPlans
959
+ }
960
+ `;var ej=(0,ea.default)`
961
+ query User_workspace($id: ID!) {
962
+ workspace(id: $id) {
963
+ ...mcpWorkspaceArguments
964
+ }
965
+ }
966
+ ${eg}
967
+ `,eV=(0,ea.default)`
968
+ query User_workspaces($paginate: Paginate) {
969
+ workspaces(paginate: $paginate) {
970
+ ...mcpWorkspaceShortArguments
971
+ }
972
+ }
973
+ ${ef}
974
+ `,eY=(0,ea.default)`
975
+ query User_applications {
976
+ applications {
977
+ ...mcpApplicationShortArguments
978
+ }
979
+ }
980
+ ${ey}
981
+ `,eK=(0,ea.default)`
982
+ query User_application($id: ID!) {
983
+ application(id: $id) {
984
+ ...applicationArguments
985
+ }
986
+ }
987
+ ${ed}
988
+ `,eG=(0,ea.default)`
989
+ query User_devices {
990
+ devices {
991
+ ...mcpDeviceShortArguments
992
+ }
993
+ }
994
+ ${e$}
995
+ `,eL=(0,ea.default)`
996
+ query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
997
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
998
+ _id
999
+ device_id
1000
+ date
1001
+ uptime {
1002
+ timestamp
1003
+ }
1004
+ memory_usage {
1005
+ values
1006
+ timestamp
1007
+ }
1008
+ disk_usage {
1009
+ values
1010
+ timestamp
1011
+ }
1012
+ }
1013
+ }
1014
+ `;let ez=e=>(e.needResetStore=!0,e),eH=ez((0,ea.default)`
1015
+ mutation ControllerClient_createWorkspace($name: String, $description: String) {
1016
+ createWorkspace(name: $name, description: $description) {
1017
+ ...workspaceArguments
1018
+ }
1019
+ }
1020
+ ${eo}
1021
+ `),eJ=ez((0,ea.default)`
1022
+ mutation ControllerClient_updateWorkspace(
1023
+ $id: ID!
1024
+ $name: String
1025
+ $description: String
1026
+ $addVerifyEmail: String
1027
+ $removeVerifyEmail: String
1028
+ $enableBankRemoteUpdate: Boolean
1029
+ $newBankKey: BankKeyInput
1030
+ $revokeBankKey: String
1031
+ $enableMediaWorkspace: Boolean
1032
+ $refreshBindingBoxKey: String
1033
+ ) {
1034
+ updateWorkspace(
1035
+ id: $id
1036
+ name: $name
1037
+ description: $description
1038
+ addVerifyEmail: $addVerifyEmail
1039
+ removeVerifyEmail: $removeVerifyEmail
1040
+ enableBankRemoteUpdate: $enableBankRemoteUpdate
1041
+ newBankKey: $newBankKey
1042
+ revokeBankKey: $revokeBankKey
1043
+ enableMediaWorkspace: $enableMediaWorkspace
1044
+ refreshBindingBoxKey: $refreshBindingBoxKey
1045
+ ) {
1046
+ ...workspaceArguments
1047
+ }
1048
+ }
1049
+ ${eo}
1050
+ `),eX=ez((0,ea.default)`
1051
+ mutation ControllerClient_updateWorkspaceTokens(
1052
+ $id: ID!
1053
+ $tokens: [WorkspaceTokenInput]
1054
+ $revokeTokens: [ID!]
1055
+ ) {
1056
+ updateWorkspaceTokens(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1057
+ workspace {
1058
+ ...workspaceArguments
1059
+ }
1060
+ newTokens {
1061
+ name
1062
+ token
1063
+ }
1064
+ }
1065
+ }
1066
+ ${eo}
1067
+ `),eQ=ez((0,ea.default)`
1068
+ mutation ControllerClient_createDevice(
1069
+ $workspaceId: ID
1070
+ $name: String
1071
+ $deviceName: String
1072
+ $entry: JSON!
1073
+ $forceMoveExistingDeviceIfAllowed: Boolean
1074
+ $bindPasscode: String
1075
+ $bindRefreshTokenLegacy: String
1076
+ ) {
1077
+ createDevice(
1078
+ workspaceId: $workspaceId
1079
+ name: $name
1080
+ deviceName: $deviceName
1081
+ entry: $entry
1082
+ forceMoveExistingDeviceIfAllowed: $forceMoveExistingDeviceIfAllowed
1083
+ bindPasscode: $bindPasscode
1084
+ bindRefreshTokenLegacy: $bindRefreshTokenLegacy
1085
+ ) {
1086
+ ...deviceArguments
1087
+ }
1088
+ }
1089
+ ${er}
1090
+ `),eZ=ez((0,ea.default)`
1091
+ mutation ControllerClient_createVirtualDevice(
1092
+ $workspaceId: ID
1093
+ $name: String
1094
+ $deviceName: String
1095
+ $entry: JSON!
1096
+ ) {
1097
+ createVirtualDevice(
1098
+ workspaceId: $workspaceId
1099
+ name: $name
1100
+ deviceName: $deviceName
1101
+ entry: $entry
1102
+ ) {
1103
+ ...deviceArguments
1104
+ }
1105
+ }
1106
+ ${er}
1107
+ `),e0=ez((0,ea.default)`
1108
+ mutation ControllerClient_updateDevice(
1109
+ $id: ID!
1110
+ $name: String
1111
+ $deviceName: String
1112
+ $description: String
1113
+ $tags: [String]
1114
+ $alert: DeviceAlertInput
1115
+ $activityLog: ActivityLogInput
1116
+ $localSync: LocalSyncInput
1117
+ $preload: PreloadInput
1118
+ $applicationUpdate: ApplicationUpdateInput
1119
+ $lock: DeviceLockInput
1120
+ $env: DeviceEnvInput
1121
+ $accessControl: DeviceAccessControlInput
1122
+ $forceNotifyDevice: Boolean
1123
+ ) {
1124
+ updateDevice(
1125
+ id: $id
1126
+ name: $name
1127
+ deviceName: $deviceName
1128
+ description: $description
1129
+ tags: $tags
1130
+ alert: $alert
1131
+ activityLog: $activityLog
1132
+ localSync: $localSync
1133
+ preload: $preload
1134
+ applicationUpdate: $applicationUpdate
1135
+ lock: $lock
1136
+ env: $env
1137
+ accessControl: $accessControl
1138
+ forceNotifyDevice: $forceNotifyDevice
1139
+ ) {
1140
+ ...deviceArguments
1141
+ }
1142
+ }
1143
+ ${er}
1144
+ `),e1=ez((0,ea.default)`
1145
+ mutation ControllerClient_moveDevice(
1146
+ $id: ID!
1147
+ $workspaceId: ID!
1148
+ $forceNotifyDevice: Boolean
1149
+ $forceUnbindApplicationIfNeeded: Boolean
1150
+ $forceRemoveInDeviceGroupsIfNeeded: Boolean
1151
+ ) {
1152
+ moveDevice(
1153
+ id: $id
1154
+ workspaceId: $workspaceId
1155
+ forceNotifyDevice: $forceNotifyDevice
1156
+ forceUnbindApplicationIfNeeded: $forceUnbindApplicationIfNeeded
1157
+ forceRemoveInDeviceGroupsIfNeeded: $forceRemoveInDeviceGroupsIfNeeded
1158
+ ) {
1159
+ ...deviceArguments
1160
+ }
1161
+ }
1162
+ ${er}
1163
+ `),e4=ez((0,ea.default)`
1164
+ mutation ControllerClient_updateVirtualDevice(
1165
+ $id: ID!
1166
+ $tokens: [DeviceTokenInput]
1167
+ $revokeTokens: [ID!]
1168
+ ) {
1169
+ updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1170
+ device {
1171
+ ...deviceArguments
1172
+ }
1173
+ newTokens {
1174
+ name
1175
+ token
1176
+ }
1177
+ }
1178
+ }
1179
+ ${er}
1180
+ `),e6=ez((0,ea.default)`
1181
+ mutation ControllerClient_removeDevice($id: ID!) {
1182
+ removeDevice(id: $id)
1183
+ }
1184
+ `),e2=ez((0,ea.default)`
1185
+ mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
1186
+ controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
1187
+ ...deviceArguments
1188
+ }
1189
+ }
1190
+ ${er}
1191
+ `),e5=ez((0,ea.default)`
1192
+ mutation ControllerClient_createDeviceGroup(
1193
+ $workspaceId: ID!
1194
+ $name: String!
1195
+ $description: String
1196
+ ) {
1197
+ createDeviceGroup(workspaceId: $workspaceId, name: $name, description: $description) {
1198
+ ...deviceGroupArguments
1199
+ }
1200
+ }
1201
+ ${es}
1202
+ `),e9=ez((0,ea.default)`
1203
+ mutation ControllerClient_updateDeviceGroup(
1204
+ $id: ID!
1205
+ $name: String
1206
+ $description: String
1207
+ $tags: [String]
1208
+ $upsertDevices: [DeviceInGroupInput]
1209
+ $removeDevices: [ID!]
1210
+ $deployDeviceSetting: DeviceSettingInGroup
1211
+ $deployDeviceAdvancedSetting: DeviceAdvancedSettingInGroup
1212
+ ) {
1213
+ updateDeviceGroup(
1214
+ id: $id
1215
+ name: $name
1216
+ description: $description
1217
+ tags: $tags
1218
+ upsertDevices: $upsertDevices
1219
+ removeDevices: $removeDevices
1220
+ deployDeviceSetting: $deployDeviceSetting
1221
+ deployDeviceAdvancedSetting: $deployDeviceAdvancedSetting
1222
+ ) {
1223
+ ...deviceGroupArguments
1224
+ }
1225
+ }
1226
+ ${es}
1227
+ `),e3=ez((0,ea.default)`
1228
+ mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
1229
+ dispatchDeviceGroupAction(id: $id, action: $action) {
1230
+ devices
1231
+ dispatched
1232
+ }
1233
+ }
1234
+ `),e8=ez((0,ea.default)`
1235
+ mutation ControllerClient_removeDeviceGroup($id: ID!) {
1236
+ removeDeviceGroup(id: $id)
1237
+ }
1238
+ `),e7=ez((0,ea.default)`
1239
+ mutation ControllerClient_removeWorkspace($id: ID!) {
1240
+ removeWorkspace(id: $id)
1241
+ }
1242
+ `),ie=ez((0,ea.default)`
1243
+ mutation ControllerClient_createApplication(
1244
+ $workspaceId: ID
1245
+ $name: String
1246
+ $description: String
1247
+ $layoutWidth: Int
1248
+ $layoutHeight: Int
1249
+ $createExampleKey: String
1250
+ ) {
1251
+ createApplication(
1252
+ workspaceId: $workspaceId
1253
+ name: $name
1254
+ description: $description
1255
+ layoutWidth: $layoutWidth
1256
+ layoutHeight: $layoutHeight
1257
+ createExampleKey: $createExampleKey
1258
+ ) {
1259
+ ...applicationArguments
1260
+ }
1261
+ }
1262
+ ${ed}
1263
+ `),ii=ez((0,ea.default)`
1264
+ mutation ControllerClient_createApplicationWithShareVersion(
1265
+ $workspaceId: ID
1266
+ $name: String
1267
+ $description: String
1268
+ $shareVersionId: ID
1269
+ ) {
1270
+ createApplicationWithShareVersion(
1271
+ workspaceId: $workspaceId
1272
+ name: $name
1273
+ description: $description
1274
+ shareVersionId: $shareVersionId
1275
+ ) {
1276
+ ...applicationArguments
1277
+ }
1278
+ }
1279
+ ${ed}
1280
+ `),it=ez((0,ea.default)`
1281
+ mutation ControllerClient_updateApplication(
1282
+ $id: ID!
1283
+ $name: String
1284
+ $description: String
1285
+ $tags: [String]
1286
+ $config: String
1287
+ $runtimeEdit: RuntimeEditInput
1288
+ $canvasControlEdit: CanvasControlEditInput
1289
+ $deviceControlEdit: DeviceControlEditInput
1290
+ $releaseCurrentVersion: String
1291
+ $releaseCurrentVersionNote: String
1292
+ $useReleaseVersion: ID
1293
+ $parentUseThisVersion: Boolean
1294
+ $syncParent: Boolean
1295
+ $newSecrets: [ApplicationSecretInput]
1296
+ $updateSecrets: [ApplicationSecretUpdateInput]
1297
+ $removeSecrets: [ID!]
1298
+ $lock: ApplicationLockInput
1299
+ $aiFilters: [ApplicationAiFilterInput]
1300
+ ) {
1301
+ updateApplication(
1302
+ id: $id
1303
+ name: $name
1304
+ description: $description
1305
+ tags: $tags
1306
+ config: $config
1307
+ runtimeEdit: $runtimeEdit
1308
+ canvasControlEdit: $canvasControlEdit
1309
+ deviceControlEdit: $deviceControlEdit
1310
+ releaseCurrentVersion: $releaseCurrentVersion
1311
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1312
+ useReleaseVersion: $useReleaseVersion
1313
+ parentUseThisVersion: $parentUseThisVersion
1314
+ syncParent: $syncParent
1315
+ newSecrets: $newSecrets
1316
+ updateSecrets: $updateSecrets
1317
+ removeSecrets: $removeSecrets
1318
+ lock: $lock
1319
+ aiFilters: $aiFilters
1320
+ ) {
1321
+ ...applicationArguments
1322
+ }
1323
+ }
1324
+ ${ed}
1325
+ `),ia=ez((0,ea.default)`
1326
+ mutation ControllerClient_bindApplication(
1327
+ $id: ID!
1328
+ $devices: [ID]
1329
+ $bindDevices: [ID]
1330
+ $unbindDevices: [ID]
1331
+ $deviceFrames: JSON
1332
+ $deviceSettings: [DeviceSettingInput]
1333
+ $forceUnbindDevicesIfNeeded: Boolean
1334
+ ) {
1335
+ bindApplication(
1336
+ id: $id
1337
+ devices: $devices
1338
+ bindDevices: $bindDevices
1339
+ unbindDevices: $unbindDevices
1340
+ deviceFrames: $deviceFrames
1341
+ deviceSettings: $deviceSettings
1342
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1343
+ ) {
1344
+ ...applicationArguments
1345
+ }
1346
+ }
1347
+ ${ed}
1348
+ `),io=ez((0,ea.default)`
1349
+ mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
1350
+ toggleShortEditApplication(id: $id, enabled: $enabled)
1351
+ }
1352
+ `),ir=ez((0,ea.default)`
1353
+ mutation ControllerClient_updateApplicationViewportPreset(
1354
+ $id: ID!
1355
+ $newViewportPresets: [ApplicationViewportPresetInput]
1356
+ $updateViewportPresets: [ApplicationViewportPresetUpdateInput]
1357
+ $removeViewportPresets: [ID!]
1358
+ ) {
1359
+ updateApplicationViewportPreset(
1360
+ id: $id
1361
+ newViewportPresets: $newViewportPresets
1362
+ updateViewportPresets: $updateViewportPresets
1363
+ removeViewportPresets: $removeViewportPresets
1364
+ ) {
1365
+ ...applicationArguments
1366
+ }
1367
+ }
1368
+ ${ed}
1369
+ `),is=ez((0,ea.default)`
1370
+ mutation ControllerClient_bindApplicationWithDeviceGroup(
1371
+ $id: ID!
1372
+ $bindDeviceGroup: ApplicationBindDeviceGroupInput
1373
+ $unbindDeviceGroup: ApplicationUnbindDeviceGroupInput
1374
+ $forceUnbindDevicesIfNeeded: Boolean
1375
+ ) {
1376
+ bindApplicationWithDeviceGroup(
1377
+ id: $id
1378
+ bindDeviceGroup: $bindDeviceGroup
1379
+ unbindDeviceGroup: $unbindDeviceGroup
1380
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1381
+ ) {
1382
+ ...applicationArguments
1383
+ }
1384
+ }
1385
+ ${ed}
1386
+ `),id=ez((0,ea.default)`
1387
+ mutation ControllerClient_shareApplication(
1388
+ $id: ID!
1389
+ $shareSetting: ApplicationShareSettingInput
1390
+ $favoriteSetting: ApplicationFavoriteSettingInput
1391
+ $previewSetting: ApplicationPreviewSettingInput
1392
+ $releaseVersion: ApplicationReleaseVersionInput
1393
+ $screenshotSetting: ApplicationScreenshotSettingInput
1394
+ ) {
1395
+ shareApplication(
1396
+ id: $id
1397
+ shareSetting: $shareSetting
1398
+ favoriteSetting: $favoriteSetting
1399
+ previewSetting: $previewSetting
1400
+ releaseVersion: $releaseVersion
1401
+ screenshotSetting: $screenshotSetting
1402
+ ) {
1403
+ ...applicationArguments
1404
+ }
1405
+ }
1406
+ ${ed}
1407
+ `),ic=ez((0,ea.default)`
1408
+ mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
1409
+ moveApplication(id: $id, workspaceId: $workspaceId) {
1410
+ ...applicationArguments
1411
+ }
1412
+ }
1413
+ ${ed}
1414
+ `),il=ez((0,ea.default)`
1415
+ mutation ControllerClient_createDeviceGroupWithApp(
1416
+ $applicationId: ID!
1417
+ $name: String!
1418
+ $description: String
1419
+ $targetDeviceFields: [TargetDeviceField]
1420
+ $presetName: String
1421
+ ) {
1422
+ createDeviceGroupWithApp(
1423
+ applicationId: $applicationId
1424
+ name: $name
1425
+ description: $description
1426
+ targetDeviceFields: $targetDeviceFields
1427
+ presetName: $presetName
1428
+ ) {
1429
+ deviceGroup {
1430
+ _id
1431
+ name
1432
+ description
1433
+ }
1434
+ application {
1435
+ ...applicationArguments
1436
+ }
1437
+ }
1438
+ }
1439
+ ${ed}
1440
+ `),ip=ez((0,ea.default)`
1441
+ mutation ControllerClient_forkApplication($id: ID!) {
1442
+ forkApplication(id: $id) {
1443
+ ...applicationArguments
1444
+ }
1445
+ }
1446
+ ${ed}
1447
+ `),iu=ez((0,ea.default)`
1448
+ mutation ControllerClient_duplicateApplication(
1449
+ $id: ID!
1450
+ $includeVersions: Boolean
1451
+ $includeSecrets: Boolean
1452
+ ) {
1453
+ duplicateApplication(
1454
+ id: $id
1455
+ includeVersions: $includeVersions
1456
+ includeSecrets: $includeSecrets
1457
+ ) {
1458
+ ...applicationArguments
1459
+ }
1460
+ }
1461
+ ${ed}
1462
+ `),im=ez((0,ea.default)`
1463
+ mutation ControllerClient_removeApplication($id: ID!) {
1464
+ removeApplication(id: $id)
1465
+ }
1466
+ `),i_=ez((0,ea.default)`
1467
+ mutation ControllerClient_createModule(
1468
+ $workspaceId: ID
1469
+ $name: String
1470
+ $description: String
1471
+ $exposeProperties: [String]
1472
+ $isAllowModify: Boolean
1473
+ $isPublic: Boolean
1474
+ $layoutWidth: Int
1475
+ $layoutHeight: Int
1476
+ $config: String
1477
+ ) {
1478
+ createModule(
1479
+ workspaceId: $workspaceId
1480
+ name: $name
1481
+ description: $description
1482
+ exposeProperties: $exposeProperties
1483
+ isAllowModify: $isAllowModify
1484
+ isPublic: $isPublic
1485
+ layoutWidth: $layoutWidth
1486
+ layoutHeight: $layoutHeight
1487
+ config: $config
1488
+ ) {
1489
+ ...moduleArguments
1490
+ }
1491
+ }
1492
+ ${el}
1493
+ `),ig=ez((0,ea.default)`
1494
+ mutation ControllerClient_updateModule(
1495
+ $id: ID!
1496
+ $name: String
1497
+ $description: String
1498
+ $tags: [String]
1499
+ $exposeProperties: [String]
1500
+ $isAllowModify: Boolean
1501
+ $isPublic: Boolean
1502
+ $config: String
1503
+ $useReleaseVersion: ID
1504
+ $releaseCurrentVersion: String
1505
+ $releaseCurrentVersionNote: String
1506
+ ) {
1507
+ updateModule(
1508
+ id: $id
1509
+ name: $name
1510
+ description: $description
1511
+ tags: $tags
1512
+ exposeProperties: $exposeProperties
1513
+ isAllowModify: $isAllowModify
1514
+ isPublic: $isPublic
1515
+ config: $config
1516
+ useReleaseVersion: $useReleaseVersion
1517
+ releaseCurrentVersion: $releaseCurrentVersion
1518
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1519
+ ) {
1520
+ ...moduleArguments
1521
+ }
1522
+ }
1523
+ ${el}
1524
+ `),iy=ez((0,ea.default)`
1525
+ mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
1526
+ moveModule(id: $id, workspaceId: $workspaceId) {
1527
+ ...moduleArguments
1528
+ }
1529
+ }
1530
+ ${el}
1531
+ `),i$=ez((0,ea.default)`
1532
+ mutation ControllerClient_duplicateModule($id: ID!) {
1533
+ duplicateModule(id: $id) {
1534
+ ...moduleArguments
1535
+ }
1536
+ }
1537
+ ${el}
1538
+ `),iv=ez((0,ea.default)`
1539
+ mutation ControllerClient_removeModule($id: ID!) {
1540
+ removeModule(id: $id)
1541
+ }
1542
+ `),ih=ez((0,ea.default)`
1543
+ mutation ControllerClient_createConfigChangeOperation(
1544
+ $applicationId: ID!
1545
+ $config: JSON!
1546
+ $expires: Int
1547
+ ) {
1548
+ createConfigChangeOperation(applicationId: $applicationId, config: $config, expires: $expires) {
1549
+ ...operationArguments
1550
+ }
1551
+ }
1552
+ ${em}
1553
+ `),ib=ez((0,ea.default)`
1554
+ mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
1555
+ doOperation(id: $id, applicationId: $applicationId)
1556
+ }
1557
+ `),iI=ez((0,ea.default)`
1558
+ mutation ControllerClient_updateOperation(
1559
+ $id: ID!
1560
+ $applicationId: ID!
1561
+ $config: JSON!
1562
+ $expires: Int
1563
+ ) {
1564
+ updateOperation(id: $id, applicationId: $applicationId, config: $config, expires: $expires) {
1565
+ ...operationArguments
1566
+ }
1567
+ }
1568
+ ${em}
1569
+ `),ik=ez((0,ea.default)`
1570
+ mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
1571
+ removeOperation(id: $id, applicationId: $applicationId)
1572
+ }
1573
+ `),iD=ez((0,ea.default)`
1574
+ mutation ControllerClient_assignGroupPermissions(
1575
+ $roleId: String!
1576
+ $instanceType: String!
1577
+ $instanceId: ID!
1578
+ $permissions: [String]!
1579
+ ) {
1580
+ assignGroupPermissions(
1581
+ roleId: $roleId
1582
+ instanceType: $instanceType
1583
+ instanceId: $instanceId
1584
+ permissions: $permissions
1585
+ )
1586
+ }
1587
+ `),iA=(0,ea.default)`
1588
+ mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
1589
+ registerFCMNotification(workspaceId: $workspaceId, token: $token)
1590
+ }
1591
+ `,iS=(0,ea.default)`
1592
+ mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
1593
+ registerRemoteDebug(deviceId: $deviceId) {
1594
+ deviceId
1595
+ token
1596
+ }
1597
+ }
1598
+ `,iw=(0,ea.default)`
1599
+ mutation ControllerClient_shareAccessToken(
1600
+ $workspaceId: ID
1601
+ $passcode: String!
1602
+ $refreshToken: String!
1603
+ ) {
1604
+ shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
1605
+ }
1606
+ `,iC=ez((0,ea.default)`
1607
+ mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1608
+ addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
1609
+ _id
1610
+ instance_type
1611
+ instance {
1612
+ _id
1613
+ name
1614
+ description
1615
+ }
1616
+ last_modify_datetime
1617
+ }
1618
+ }
1619
+ `),iT=ez((0,ea.default)`
1620
+ mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1621
+ removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
1622
+ }
1623
+ `),ix=ez((0,ea.default)`
1624
+ mutation ControllerClient_changeWorkspaceSubscriptionPlan(
1625
+ $workspaceId: ID!
1626
+ $type: String!
1627
+ $period: String!
1628
+ ) {
1629
+ changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
1630
+ }
1631
+ `),iB=ez((0,ea.default)`
1632
+ mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
1633
+ $workspaceId: ID!
1634
+ $boundDevicesLimit: Float
1635
+ $groupMembersLimit: Float
1636
+ ) {
1637
+ changeWorkspaceAdditionalLimitSpending(
1638
+ workspaceId: $workspaceId
1639
+ boundDevicesLimit: $boundDevicesLimit
1640
+ groupMembersLimit: $groupMembersLimit
1641
+ )
1642
+ }
1643
+ `),iE=(0,ea.default)`
1644
+ mutation ControllerClient_createWorkspaceOTP(
1645
+ $workspaceId: ID!
1646
+ $tokenTypes: [WorkspaceTokenType]!
1647
+ $tokenName: String
1648
+ ) {
1649
+ createWorkspaceOTP(workspaceId: $workspaceId, tokenTypes: $tokenTypes, tokenName: $tokenName) {
1650
+ _id
1651
+ passcode
1652
+ expired_datetime
1653
+ }
1654
+ }
1655
+ `,iU=(0,ea.default)`
1656
+ mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
1657
+ revokeWorkspaceOTP(id: $id)
1658
+ }
1659
+ `;function iM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iM=function(){return!!e})()}var iR=function(e){function i(e,t){var n,a,o;return J(this,i),a=i,o=[e,t,"/api/graphql",p,u],a=Q(a),(n=X(this,iM()?Reflect.construct(a,o||[],Q(this).constructor):a.apply(this,o))).tokenType="user",n}return Z(i,e),H(i)}(ek),iP=(0,ea.default)`
1660
+ query Workspace_workspace {
1661
+ workspace {
1662
+ ...mcpWorkspaceArguments
1663
+ }
1664
+ }
1665
+ ${eg}
1666
+ `,iO=(0,ea.default)`
1667
+ query Workspace_applications($keyword: String, $paginate: Paginate) {
1668
+ applications(keyword: $keyword, paginate: $paginate) {
1669
+ ...mcpApplicationShortArguments
1670
+ }
1671
+ }
1672
+ ${ey}
1673
+ `,iF=(0,ea.default)`
1674
+ query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
1675
+ application(id: $id, composed: $composed, debug: $debug) {
1676
+ ...applicationArguments
1677
+ }
1678
+ }
1679
+ ${ed}
1680
+ `,iN=(0,ea.default)`
1681
+ query Workspace_applicationByDevice(
1682
+ $deviceId: ID!
1683
+ $composeModule: Boolean
1684
+ $bankRemoteConfig: Boolean
1685
+ $debug: Boolean
1686
+ ) {
1687
+ applicationByDevice(
1688
+ deviceId: $deviceId
1689
+ composeModule: $composeModule
1690
+ bankRemoteConfig: $bankRemoteConfig
1691
+ debug: $debug
1692
+ ) {
1693
+ ...applicationArguments
1694
+ }
1695
+ }
1696
+ ${ed}
1697
+ `,iq=(0,ea.default)`
1698
+ query Workspace_modules($keyword: String, $paginate: Paginate) {
1699
+ modules(keyword: $keyword, paginate: $paginate) {
1700
+ ...moduleShortArguments
1701
+ }
1702
+ }
1703
+ ${ep}
1704
+ `,iW=(0,ea.default)`
1705
+ query Workspace_module($id: ID!) {
1706
+ module(id: $id) {
1707
+ ...moduleArguments
1708
+ }
1709
+ }
1710
+ ${el}
1711
+ `,ij=(0,ea.default)`
1712
+ query Workspace_devices($keyword: String, $paginate: Paginate) {
1713
+ devices(keyword: $keyword, paginate: $paginate) {
1714
+ ...deviceArguments
1715
+ }
1716
+ }
1717
+ ${er}
1718
+ `,iV=(0,ea.default)`
1719
+ query Workspace_device($id: ID) {
1720
+ device(id: $id) {
1721
+ ...deviceArguments
1722
+ }
1723
+ }
1724
+ ${er}
1725
+ `,iY=(0,ea.default)`
1726
+ query Workspace_devicesByApplication($id: ID!) {
1727
+ devicesByApplication(id: $id) {
1728
+ ...deviceArguments
1729
+ }
1730
+ }
1731
+ ${er}
1732
+ `,iK=(0,ea.default)`
1733
+ query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1734
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1735
+ _id
1736
+ device_id
1737
+ date
1738
+ uptime {
1739
+ timestamp
1740
+ }
1741
+ memory_usage {
1742
+ values
1743
+ timestamp
1744
+ }
1745
+ disk_usage {
1746
+ values
1747
+ timestamp
1748
+ }
1749
+ }
1750
+ }
1751
+ `,iG=(0,ea.default)`
1752
+ query Workspace_mediaWorkspace {
1753
+ mediaWorkspace {
1754
+ ...workspaceMediaWorkspaceArguments
1755
+ }
1756
+ }
1757
+ ${ev}
1758
+ `,iL=(0,ea.default)`
1759
+ query Workspace_mediaBoxes {
1760
+ mediaBoxes {
1761
+ ...workspaceMediaBoxArguments
1762
+ }
1763
+ }
1764
+ ${eh}
1765
+ `,iz=(0,ea.default)`
1766
+ query Workspace_mediaBox($boxId: ID!) {
1767
+ mediaBox(id: $boxId) {
1768
+ ...workspaceMediaBoxArguments
1769
+ }
1770
+ }
1771
+ ${eh}
1772
+ `,iH=(0,ea.default)`
1773
+ query Workspace_mediaFiles(
1774
+ $boxId: ID!
1775
+ $includeTypes: [String]
1776
+ $userTags: [String]
1777
+ $limit: Int
1778
+ $offset: Int
1779
+ ) {
1780
+ mediaFiles(
1781
+ boxId: $boxId
1782
+ includeTypes: $includeTypes
1783
+ userTags: $userTags
1784
+ limit: $limit
1785
+ offset: $offset
1786
+ ) {
1787
+ ...workspaceMediaFileArguments
1788
+ }
1789
+ }
1790
+ ${eb}
1791
+ `,iJ=(0,ea.default)`
1792
+ query Workspace_mediaFile($id: ID!) {
1793
+ mediaFile(id: $id) {
1794
+ ...workspaceMediaFileArguments
1795
+ }
1796
+ }
1797
+ ${eb}
1798
+ `,iX=(0,ea.default)`
1799
+ mutation Workspace_createApplication(
1800
+ $name: String
1801
+ $description: String
1802
+ $layoutWidth: Int
1803
+ $layoutHeight: Int
1804
+ ) {
1805
+ createApplication(
1806
+ name: $name
1807
+ description: $description
1808
+ layoutWidth: $layoutWidth
1809
+ layoutHeight: $layoutHeight
1810
+ ) {
1811
+ ...mcpApplicationShortArguments
1812
+ config
1813
+ }
1814
+ }
1815
+ ${ey}
1816
+ `,iQ=(0,ea.default)`
1817
+ mutation Workspace_updateApplication(
1818
+ $id: ID!
1819
+ $config: String
1820
+ $name: String
1821
+ $description: String
1822
+ $validateConfig: Boolean
1823
+ ) {
1824
+ updateApplication(
1825
+ id: $id
1826
+ config: $config
1827
+ name: $name
1828
+ description: $description
1829
+ validateConfig: $validateConfig
1830
+ ) {
1831
+ ...mcpApplicationShortArguments
1832
+ config
1833
+ has_unreleased_changes
1834
+ }
1835
+ }
1836
+ ${ey}
1837
+ `,iZ=(0,ea.default)`
1838
+ mutation Workspace_bindApplication($id: ID!, $bindDevices: [ID], $deviceFrames: JSON) {
1839
+ bindApplication(id: $id, bindDevices: $bindDevices, deviceFrames: $deviceFrames) {
1840
+ _id
1841
+ devices {
1842
+ device_id
1843
+ status
1844
+ frame
1845
+ }
1846
+ }
1847
+ }
1848
+ `,i0=(0,ea.default)`
1849
+ mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
1850
+ bindApplication(id: $id, unbindDevices: $unbindDevices) {
1851
+ _id
1852
+ devices {
1853
+ device_id
1854
+ status
1855
+ frame
1856
+ }
1857
+ }
1858
+ }
1859
+ `,i1=(0,ea.default)`
1860
+ mutation Workspace_createModule(
1861
+ $name: String
1862
+ $description: String
1863
+ $exposeProperties: [String]
1864
+ $isAllowModify: Boolean
1865
+ $isPublic: Boolean
1866
+ $layoutWidth: Int
1867
+ $layoutHeight: Int
1868
+ ) {
1869
+ createModule(
1870
+ name: $name
1871
+ description: $description
1872
+ exposeProperties: $exposeProperties
1873
+ isAllowModify: $isAllowModify
1874
+ isPublic: $isPublic
1875
+ layoutWidth: $layoutWidth
1876
+ layoutHeight: $layoutHeight
1877
+ ) {
1878
+ ...moduleArguments
1879
+ }
1880
+ }
1881
+ ${el}
1882
+ `,i4=(0,ea.default)`
1883
+ mutation Workspace_updateModule(
1884
+ $id: ID!
1885
+ $config: String
1886
+ $name: String
1887
+ $description: String
1888
+ $validateConfig: Boolean
1889
+ ) {
1890
+ updateModule(
1891
+ id: $id
1892
+ config: $config
1893
+ name: $name
1894
+ description: $description
1895
+ validateConfig: $validateConfig
1896
+ ) {
1897
+ ...moduleArguments
1898
+ }
1899
+ }
1900
+ ${el}
1901
+ `,i6=(0,ea.default)`
1902
+ mutation Workspace_createMediaFileUploadRequest(
1903
+ $name: String!
1904
+ $description: String!
1905
+ $boxId: ID!
1906
+ $fileType: String!
1907
+ $contentType: String!
1908
+ $userTags: [String]
1909
+ $meta: RequestUploadMetaInput!
1910
+ ) {
1911
+ createMediaFileUploadRequest(
1912
+ name: $name
1913
+ description: $description
1914
+ boxId: $boxId
1915
+ fileType: $fileType
1916
+ contentType: $contentType
1917
+ userTags: $userTags
1918
+ meta: $meta
1919
+ ) {
1920
+ id
1921
+ name
1922
+ description
1923
+ boxId
1924
+ fileType
1925
+ contentType
1926
+ userTags
1927
+ meta {
1928
+ uploadInfo
1929
+ }
1930
+ }
1931
+ }
1932
+ `,i2=(0,ea.default)`
1933
+ mutation Workspace_updateMediaFile(
1934
+ $id: ID!
1935
+ $name: String
1936
+ $description: String
1937
+ $userTags: [String]
1938
+ $requestUploadAgain: Boolean!
1939
+ ) {
1940
+ updateMediaFile(
1941
+ id: $id
1942
+ name: $name
1943
+ description: $description
1944
+ userTags: $userTags
1945
+ requestUploadAgain: $requestUploadAgain
1946
+ ) {
1947
+ id
1948
+ name
1949
+ description
1950
+ userTags
1951
+ updatedAt
1952
+ }
1953
+ }
1954
+ `,i5=(0,ea.default)`
1955
+ mutation Workspace_updateMediaFiles(
1956
+ $fileIds: [ID!]!
1957
+ $name: String
1958
+ $description: String
1959
+ $userTags: [String]
1960
+ ) {
1961
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
1962
+ }
1963
+ `,i9=(0,ea.default)`
1964
+ mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
1965
+ setMediaFileAsBoxPreview(id: $id)
1966
+ }
1967
+ `,i3=(0,ea.default)`
1968
+ mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
1969
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
1970
+ }
1971
+ `,i8=(0,ea.default)`
1972
+ mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
1973
+ deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
1974
+ }
1975
+ `,i7=(0,ea.default)`
1976
+ mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
1977
+ deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
1978
+ }
1979
+ `;function te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(te=function(){return!!e})()}var ti=function(e){function i(e,t){var n,a,o;return J(this,i),a=i,o=[e,t,"/api/graphql-workspace",m,_],a=Q(a),(n=X(this,te()?Reflect.construct(a,o||[],Q(this).constructor):a.apply(this,o))).tokenType="workspace",n}return Z(i,e),H(i)}(ek),tt=t(19074),tn=t(36054),ta=t(78342),to=t(74114),tr=t(42028),ts=t(99815),td=t(79556),tc=t(17681),tl=t.n(tc),tp=t(10655);let tu=(0,ea.default)`
1980
+ fragment mediaWorkspaceArguments on MediaWorkspace {
1981
+ __typename
1982
+ id
1983
+ name
1984
+ description
1985
+ owner
1986
+ serviceBinding
1987
+ createdAt
1988
+ updatedAt
1989
+ size
1990
+ sizeLimit
1991
+ aiFeaturesEnabled
1992
+ }
1993
+ `,tm=(0,ea.default)`
1994
+ fragment boxArguments on MediaBox {
1995
+ __typename
1996
+ id
1997
+ name
1998
+ description
1999
+ tags
2000
+ owner
2001
+ workspaceId
2002
+ serviceBinding
2003
+ serviceBindingType
2004
+ passcodes {
2005
+ id
2006
+ name
2007
+ code
2008
+ enableExpired
2009
+ expiredAt
2010
+ removeable
2011
+ permissions
2012
+ }
2013
+ createdAt
2014
+ updatedAt
2015
+ previewUrl
2016
+ size
2017
+ }
2018
+ `,t_=(0,ea.default)`
2019
+ fragment fileArguments on MediaFile {
2020
+ __typename
2021
+ id
2022
+ name
2023
+ description
2024
+ boxId
2025
+ owner
2026
+ userTags
2027
+ fileType
2028
+ meta {
2029
+ storageEndpoint
2030
+ originalFileUploaded
2031
+ originalFileKey
2032
+ originalFileSize
2033
+ originalFileEtag
2034
+ originalFileContentType
2035
+ originalWidth
2036
+ originalHeight
2037
+ convertedFileUploaded
2038
+ convertedFileKey
2039
+ convertedFileSize
2040
+ convertedFileEtag
2041
+ convertedFileContentType
2042
+ videoThumbOriginalFileUploaded
2043
+ videoThumbOriginalFileKey
2044
+ videoThumbOriginalFileSize
2045
+ videoThumbOriginalFileEtag
2046
+ videoThumbOriginalFileContentType
2047
+ videoThumbOriginalWidth
2048
+ videoThumbOriginalHeight
2049
+ uploadInfo
2050
+ imageVersions {
2051
+ key
2052
+ version
2053
+ etag
2054
+ contentType
2055
+ width
2056
+ height
2057
+ strategy
2058
+ }
2059
+ videoTransformed
2060
+ videoTransformedByClient
2061
+ videoTransformType
2062
+ customVideoWidth
2063
+ customVideoHeight
2064
+
2065
+ enableAiAnalysis
2066
+ aiCustomInstruction
2067
+ aiDescription
2068
+ aiTags
2069
+ aiAnalysisStatus
2070
+ aiAnalyzedAt
2071
+ }
2072
+ createdAt
2073
+ updatedAt
2074
+ }
2075
+ `,tg=(0,ea.default)`
2076
+ fragment fileShortArguments on MediaFile {
2077
+ __typename
2078
+ id
2079
+ name
2080
+ description
2081
+ boxId
2082
+ owner
2083
+ userTags
2084
+ fileType
2085
+ meta {
2086
+ storageEndpoint
2087
+ originalFileKey
2088
+ originalFileSize
2089
+ originalFileContentType
2090
+ originalFileEtag
2091
+ originalWidth
2092
+ originalHeight
2093
+ convertedFileKey
2094
+ convertedFileSize
2095
+ convertedFileContentType
2096
+ convertedFileEtag
2097
+ videoThumbOriginalFileKey
2098
+ videoThumbOriginalFileSize
2099
+ videoThumbOriginalFileContentType
2100
+ videoThumbOriginalFileEtag
2101
+ videoThumbOriginalWidth
2102
+ videoThumbOriginalHeight
2103
+ imageVersions {
2104
+ key
2105
+ version
2106
+ etag
2107
+ size
2108
+ contentType
2109
+ width
2110
+ height
2111
+ strategy
2112
+ }
2113
+ enableAiAnalysis
2114
+ aiCustomInstruction
2115
+ aiDescription
2116
+ aiTags
2117
+ aiAnalysisStatus
2118
+ aiAnalyzedAt
2119
+ }
2120
+ createdAt
2121
+ updatedAt
2122
+ }
2123
+ `,tf=(0,ea.default)`
2124
+ query MediaClient_workspaces {
2125
+ mediaWorkspaces {
2126
+ ...mediaWorkspaceArguments
2127
+ }
2128
+ }
2129
+ ${tu}
2130
+ `,ty=(0,ea.default)`
2131
+ query MediaClient_boxes($workspaceId: UUID, $filter: String) {
2132
+ mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
2133
+ ...boxArguments
2134
+ }
2135
+ }
2136
+ ${tm}
2137
+ `,t$=(0,ea.default)`
2138
+ query MediaClient_workspace($workspaceId: UUID!) {
2139
+ mediaWorkspace(id: $workspaceId) {
2140
+ ...mediaWorkspaceArguments
2141
+ }
2142
+ }
2143
+ ${tu}
2144
+ `,tv=(0,ea.default)`
2145
+ query MediaClient_box($boxId: UUID!) {
2146
+ mediaBox(boxId: $boxId) {
2147
+ ...boxArguments
2148
+ }
2149
+ }
2150
+ ${tm}
2151
+ `,th=(0,ea.default)`
2152
+ query MediaClient_files(
2153
+ $boxId: UUID!
2154
+ $includeTypes: [FileType!]
2155
+ $userTags: [String!]
2156
+ $limit: Int
2157
+ $offset: Int
2158
+ ) {
2159
+ mediaFiles(
2160
+ boxId: $boxId
2161
+ includeTypes: $includeTypes
2162
+ userTags: $userTags
2163
+ limit: $limit
2164
+ offset: $offset
2165
+ ) {
2166
+ ...fileShortArguments
2167
+ }
2168
+ }
2169
+ ${tg}
2170
+ `,tb=(0,ea.default)`
2171
+ query MediaClient_file($fileId: UUID!) {
2172
+ mediaFile(fileId: $fileId) {
2173
+ ...fileArguments
2174
+ }
2175
+ }
2176
+ ${t_}
2177
+ `,tI=(0,ea.default)`
2178
+ mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
2179
+ createMediaWorkspace(name: $name, description: $description) {
2180
+ ...mediaWorkspaceArguments
2181
+ }
2182
+ }
2183
+ ${tu}
2184
+ `,tk=(0,ea.default)`
2185
+ mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
2186
+ updateMediaWorkspace(id: $id, name: $name, description: $description) {
2187
+ ...mediaWorkspaceArguments
2188
+ }
2189
+ }
2190
+ ${tu}
2191
+ `,tD=(0,ea.default)`
2192
+ mutation MediaClient_createMediaBox(
2193
+ $name: String!
2194
+ $description: String!
2195
+ $newPasscodes: [InputNewBoxPasscode!]!
2196
+ $workspaceId: UUID
2197
+ $tags: [String!]
2198
+ ) {
2199
+ createMediaBox(
2200
+ name: $name
2201
+ description: $description
2202
+ newPasscodes: $newPasscodes
2203
+ workspaceId: $workspaceId
2204
+ tags: $tags
2205
+ ) {
2206
+ ...boxArguments
2207
+ }
2208
+ }
2209
+ ${tm}
2210
+ `,tA=(0,ea.default)`
2211
+ mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
2212
+ moveMediaBox(id: $id, workspaceId: $workspaceId) {
2213
+ ...boxArguments
2214
+ }
2215
+ }
2216
+ ${tm}
2217
+ `,tS=(0,ea.default)`
2218
+ mutation MediaClient_updateMediaBox(
2219
+ $id: UUID!
2220
+ $name: String
2221
+ $description: String
2222
+ $newPasscodes: [InputNewBoxPasscode!]
2223
+ $removePasscodes: [UUID!]
2224
+ $tags: [String!]
2225
+ ) {
2226
+ updateMediaBox(
2227
+ id: $id
2228
+ name: $name
2229
+ description: $description
2230
+ newPasscodes: $newPasscodes
2231
+ removePasscodes: $removePasscodes
2232
+ tags: $tags
2233
+ ) {
2234
+ ...boxArguments
2235
+ }
2236
+ }
2237
+ ${tm}
2238
+ `,tw=(0,ea.default)`
2239
+ mutation MediaClient_requestFileUpload(
2240
+ $name: String!
2241
+ $description: String!
2242
+ $boxId: UUID!
2243
+ $fileType: FileType!
2244
+ $contentType: String!
2245
+ $userTags: [String!]
2246
+ $meta: RequestUploadMeta!
2247
+ ) {
2248
+ requestFileUpload(
2249
+ name: $name
2250
+ description: $description
2251
+ boxId: $boxId
2252
+ fileType: $fileType
2253
+ contentType: $contentType
2254
+ userTags: $userTags
2255
+ meta: $meta
2256
+ ) {
2257
+ ...fileArguments
2258
+ }
2259
+ }
2260
+ ${t_}
2261
+ `,tC=(0,ea.default)`
2262
+ mutation MediaClient_updateMediaFile(
2263
+ $fileId: UUID!
2264
+ $name: String!
2265
+ $description: String!
2266
+ $userTags: [String!]
2267
+ $requestUploadAgain: Boolean!
2268
+ ) {
2269
+ updateMediaFile(
2270
+ fileId: $fileId
2271
+ name: $name
2272
+ description: $description
2273
+ userTags: $userTags
2274
+ requestUploadAgain: $requestUploadAgain
2275
+ ) {
2276
+ ...fileArguments
2277
+ }
2278
+ }
2279
+ ${t_}
2280
+ `,tT=(0,ea.default)`
2281
+ mutation MediaClient_updateMediaFiles(
2282
+ $fileIds: [UUID!]!
2283
+ $name: String
2284
+ $description: String
2285
+ $userTags: [String!]
2286
+ ) {
2287
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2288
+ }
2289
+ `,tx=(0,ea.default)`
2290
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
2291
+ deleteMediaFiles(boxId: $boxId, list: $list)
2292
+ }
2293
+ `,tB=(0,ea.default)`
2294
+ mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
2295
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
2296
+ }
2297
+ `,tE=(0,ea.default)`
2298
+ mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
2299
+ setMediaFileAsBoxPreview(id: $id)
2300
+ }
2301
+ `,tU=(0,ea.default)`
2302
+ mutation MediaClient_assignGroupPermissions(
2303
+ $roleId: String!
2304
+ $instanceType: InstanceType!
2305
+ $instanceId: UUID!
2306
+ $permissions: [String!]!
2307
+ ) {
2308
+ assignGroupPermissions(
2309
+ roleId: $roleId
2310
+ instanceType: $instanceType
2311
+ instanceId: $instanceId
2312
+ permissions: $permissions
2313
+ )
2314
+ }
2315
+ `,tM=(0,ea.default)`
2316
+ subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
2317
+ mediaBoxChanged(boxId: $boxId, types: $types) {
2318
+ createType
2319
+ id
2320
+ file {
2321
+ ...fileArguments
2322
+ }
2323
+ boxPayload {
2324
+ fileList
2325
+ includeTypes
2326
+ }
2327
+ }
2328
+ }
2329
+ ${t_}
2330
+ `,tR=(0,ea.default)`
2331
+ query MediaClient_box($boxId: UUID!, $passcode: String!) {
2332
+ mediaBox(boxId: $boxId, passcode: $passcode) {
2333
+ ...boxArguments
2334
+ }
2335
+ }
2336
+ ${tm}
2337
+ `,tP=(0,ea.default)`
2338
+ query MediaClient_files(
2339
+ $boxId: UUID!
2340
+ $passcode: String!
2341
+ $includeTypes: [FileType!]
2342
+ $userTags: [String!]
2343
+ $limit: Int
2344
+ $offset: Int
2345
+ ) {
2346
+ mediaFiles(
2347
+ boxId: $boxId
2348
+ passcode: $passcode
2349
+ includeTypes: $includeTypes
2350
+ userTags: $userTags
2351
+ limit: $limit
2352
+ offset: $offset
2353
+ ) {
2354
+ ...fileShortArguments
2355
+ }
2356
+ }
2357
+ ${tg}
2358
+ `,tO=(0,ea.default)`
2359
+ query MediaClient_file($fileId: UUID!, $passcode: String!) {
2360
+ mediaFile(fileId: $fileId, passcode: $passcode) {
2361
+ ...fileArguments
2362
+ }
2363
+ }
2364
+ ${t_}
2365
+ `,tF=(0,ea.default)`
2366
+ mutation MediaClient_requestFileUpload(
2367
+ $name: String!
2368
+ $description: String!
2369
+ $boxId: UUID!
2370
+ $passcode: String!
2371
+ $fileType: FileType!
2372
+ $contentType: String!
2373
+ $userTags: [String!]
2374
+ $meta: RequestUploadMeta!
2375
+ ) {
2376
+ requestFileUpload(
2377
+ name: $name
2378
+ description: $description
2379
+ boxId: $boxId
2380
+ passcode: $passcode
2381
+ fileType: $fileType
2382
+ contentType: $contentType
2383
+ userTags: $userTags
2384
+ meta: $meta
2385
+ ) {
2386
+ ...fileArguments
2387
+ }
2388
+ }
2389
+ ${t_}
2390
+ `,tN=(0,ea.default)`
2391
+ mutation MediaClient_updateMediaFile(
2392
+ $boxId: UUID!
2393
+ $passcode: String!
2394
+ $fileId: UUID!
2395
+ $name: String
2396
+ $description: String
2397
+ $userTags: [String!]
2398
+ $requestUploadAgain: Boolean!
2399
+ ) {
2400
+ updateMediaFile(
2401
+ boxId: $boxId
2402
+ passcode: $passcode
2403
+ fileId: $fileId
2404
+ name: $name
2405
+ description: $description
2406
+ userTags: $userTags
2407
+ requestUploadAgain: $requestUploadAgain
2408
+ ) {
2409
+ ...fileArguments
2410
+ }
2411
+ }
2412
+ ${t_}
2413
+ `,tq=(0,ea.default)`
2414
+ mutation MediaClient_updateMediaFiles(
2415
+ $boxId: UUID!
2416
+ $passcode: String!
2417
+ $fileIds: [UUID!]!
2418
+ $name: String
2419
+ $description: String
2420
+ $userTags: [String!]
2421
+ ) {
2422
+ updateMediaFiles(
2423
+ boxId: $boxId
2424
+ passcode: $passcode
2425
+ fileIds: $fileIds
2426
+ name: $name
2427
+ description: $description
2428
+ userTags: $userTags
2429
+ )
2430
+ }
2431
+ `,tW=(0,ea.default)`
2432
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
2433
+ deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
2434
+ }
2435
+ `,tj=(0,ea.default)`
2436
+ subscription MediaClient_listenBoxChanged(
2437
+ $boxId: UUID!
2438
+ $passcode: String!
2439
+ $types: [ChangeType!]
2440
+ ) {
2441
+ mediaBoxChanged(boxId: $boxId, passcode: $passcode, types: $types) {
2442
+ createType
2443
+ id
2444
+ file {
2445
+ ...fileArguments
2446
+ }
2447
+ boxPayload {
2448
+ fileList
2449
+ includeTypes
2450
+ }
2451
+ }
2452
+ }
2453
+ ${t_}
2454
+ `,tV={query:"query",mutation:"mutate"},tY=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{let t=await e[tV[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tK=e=>({data:i,errors:t})=>{var n;let a=(n=!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload",t?.length?Error(t.map(e=>e.message).join("\n")):n?Error(n):null);return a?e(a):e(null,i.mediaBoxChanged)};var tG=`
2455
+ query AL_events($filter: EventsFilter!) {
2456
+ events(filter: $filter) {
2457
+ device_id
2458
+ event_type
2459
+ event_name
2460
+ subspace_id
2461
+ sender
2462
+ payload
2463
+ timestamp
2464
+ }
2465
+ }
2466
+ `,tL=`
2467
+ query AL_screenshots($filter: ScreenshotFilter!) {
2468
+ screenshots(filter: $filter) {
2469
+ timestamp
2470
+ }
2471
+ }
2472
+ `,tz=H(function e(i,t){J(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=v(function*(e,i){var t=yield(0,B.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=v(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tG,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=v(function*(e){return(yield this.graphql(tL,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=v(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,B.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tH="bricks-mcp",tJ={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tX=t(1639);let tQ=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tX.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=V(j.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,tX.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=V(j.dK.Basic),d=V(j.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes).map(([e])=>[e,{description:c.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};case"generator":var l=V(j.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(j.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,tX.M4)("property_bank_command"),u=(0,tX.M4)("property_bank_command"),m=(0,tX.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return T({id:o,example:n,extraInfo:a})};var tZ="2.25.0-beta.6";function t0(){return t1.apply(this,arguments)}function t1(){return(t1=v(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!D.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=A.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=k[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(I);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new h._({name:tH,version:tZ}),o={...n,client:function(e,i,t){switch(t){case"user":return new iR(e,i);case"workspace":return new ti(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tJ.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},v(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2473
+
2474
+ Before doing any complex work (application design, deployments, etc.),
2475
+ always consult the official docs rather than guessing.
2476
+
2477
+ IMPORTANT: BRICKS users interact through a GUI editor, not raw config files.
2478
+ Never show users JSON config details, schema fields, or technical implementation.
2479
+ Focus on user-friendly descriptions of what the app will do and how it will look.
2480
+
2481
+ Golden rules for working with BRICKS:
2482
+ 1) Read before you act
2483
+ - Open these resources first, then proceed:
2484
+ - \`getting-started\` — overview & architecture
2485
+ - \`config-schema\` — canonical schema for apps, subspaces, bricks, generators, etc.
2486
+ - \`components-index\` — available bricks/generators
2487
+ 2) Source of truth
2488
+ - Rely on the docs above; do not invent fields not present in the schema
2489
+ 3) No guessing
2490
+ - If names, constraints, or device details are missing, ask to fetch them first
2491
+ 4) Plan then execute
2492
+ - Propose a clear step-by-step plan and wait for approval before writing or mutating data
2493
+ 5) User-friendly communication
2494
+ - Describe features in terms of what users see and do, not technical config
2495
+ - Use visual/functional language: "text display", "button", "screen transition"
2496
+ - Avoid exposing JSON, IDs, or schema details to end users
2497
+
2498
+ BRICKS essentials:
2499
+ - Applications: interactive digital signage experiences
2500
+ - Devices: deployment targets (screens/players)
2501
+ - Modules: Reusable module across applications
2502
+ - Grid system: default 96\xd754; 1 unit = device_width/96 (e.g., 20px at 1920\xd71080)
2503
+ - Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)
2504
+
2505
+ Quick actions:
2506
+ - "Create a new application" → use the \`create-application\` prompt
2507
+ - "Deploy an application to a device" → use the \`deploy-to-device\` prompt
2508
+
2509
+ Try asking:
2510
+ - "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),a.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:S.Yj().describe("Name for the new application"),description:S.Yj().describe("Short description for the new application").optional()},(i=v(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".
2511
+
2512
+ ${t?`Goal: ${t}`:""}
2513
+
2514
+ IMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:
2515
+ - "text display" not "BRICK_TEXT"
2516
+ - "image" not "BRICK_IMAGE"
2517
+ - "canvas name" not "CANVAS_xxx"
2518
+ - "data storage" not "PROPERTY_BANK"
2519
+ - Focus on what users see and do, not technical implementation
2520
+
2521
+ How we'll proceed (no guessing, schema-first):
2522
+ 1) Confirm intent
2523
+ - Restate objectives and success criteria in 1–3 bullets
2524
+ 2) Consult docs (as needed)
2525
+ - getting-started, config-schema, components-index
2526
+ - Ensure proposed fields exist in the schema
2527
+ 3) Ask missing questions before changes
2528
+ - Target device(s) and resolution(s)
2529
+ - Layout needs (pages/screens), content types, data sources
2530
+ - Localization, scheduling, or interaction needs
2531
+ 4) Propose a minimal viable design (After confirming intent)
2532
+ - App structure: screens → visual elements
2533
+ - Initial component selection with rationale
2534
+ - Grid usage: default 96\xd754 (≈20px at 1920\xd71080)
2535
+ 5) Produce a schema-valid skeleton (no side effects yet)
2536
+ - Include only fields defined by config-schema
2537
+ - Use clear placeholders for text/assets/URLs/ids
2538
+
2539
+ What I'll produce first:
2540
+ - Short recap of requirements
2541
+ - Clarifying questions (only what's necessary)
2542
+ - High-level architecture plan
2543
+ - Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),a.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},v(function*(){return T(w,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i){var t,n="user"===i.tokenType,a=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),o=e=>({...e,...n?{workspace_id:S.Yj().describe("Workspace ID")}:{}}),r=i.client,s=n?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new to.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,ts.UU)({url:i,lazy:!0,connectionParams:_,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{f(),d?.(e)},opened:e=>{d?.(),u=e,f()},ping:e=>{e||(f(),m=setTimeout(()=>{u&&u.readyState===WebSocket.OPEN&&u.close(4205,"Client Restart")},5e3))},pong:e=>{e&&f()},closed:()=>{f()}}}),p=new tr.c(l));let y=tt.C.from([(0,td.S)(({networkError:e,operation:i})=>{if(e){c(e,i);let t=e?.message||"";if("Aborted"===t||e?.name==="AbortError"||t.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403)return new tn.c(e=>e.complete())}}),s&&new ta.z({attempts:{max:3,retryIf:e=>{let i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(!e||i.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||e?.statusCode===403||e?.status===403||e?.timeout||"Timeout exceeded"===i)&&"Aborted"!==i&&e?.name!=="AbortError"}}}),new(tl())(3e4),r?tt.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tp.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,g):g].filter(Boolean));return y.closeSubscriptionClient=()=>r&&l.dispose(),y}({endpointURL:u,subscriptionEndpointURL:u.replace("http:","ws:"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new et.D,(l=new ei.R({link:d,cache:c,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})).close=()=>d.closeSubscriptionClient(),l})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=y,i.mutations=$;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(y).forEach(tY(i,"query",t)),Object.entries($).forEach(tY(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tj,variables:{...t,...e}}).subscribe({next:tK(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=g,i.mutations=f,Object.entries(g).forEach(tY(i,"query")),Object.entries(f).forEach(tY(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tM,variables:e}).subscribe({next:tK(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:tJ.media,accessToken:i.token}):r;if(n&&e.tool("list_workspaces","List all workspaces",{},v(function*(){return T((yield r.workspaces()))})),a({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:o({}),permission:"info"},(d=v(function*({workspace_id:e}){var i=x((yield Promise.all([r.workspace({id:e}),r.applications({workspaceId:e,paginate:{limit:50,offset:0}}),r.modules({workspaceId:e,paginate:{limit:50,offset:0}}),r.devices({workspaceId:e,paginate:{limit:50,offset:0}}),n?s.mediaWorkspace({workspaceId:e}).catch(()=>null):s.mediaWorkspace().catch(()=>null),n?s.mediaBoxes({workspaceId:e}).catch(()=>[]):s.mediaBoxes().catch(()=>[])])),6),t=i[0],a=i[1],o=i[2],d=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return T({workspace:t,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:d?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:a?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return d.apply(this,arguments)})),a({name:"get_applications",description:"List all applications in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of applications to return").optional().default(50),offset:S.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(c=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return c.apply(this,arguments)})),a({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:o({id:S.Yj().describe("Application ID")}),permission:"query_application"},(l=v(function*({workspace_id:e,id:i}){return T((yield r.application({workspaceId:e,id:i})))}),function(e){return l.apply(this,arguments)})),a({name:"get_modules",description:"List all modules in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of modules to return").optional().default(50),offset:S.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(p=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return p.apply(this,arguments)})),a({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:o({id:S.Yj().describe("Module ID")}),permission:"query_module"},(u=v(function*({workspace_id:e,id:i}){return T((yield r.module({workspaceId:e,id:i})))}),function(e){return u.apply(this,arguments)})),a({name:"update_module_info",description:"Update a specific module info",inputSchema:o({id:S.Yj().describe("Module ID"),name:S.Yj().describe("Module name"),description:S.Yj().describe("Module description")}),permission:"update_module"},(m=v(function*({workspace_id:e,id:i,name:t,description:n}){return T((yield r.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return m.apply(this,arguments)})),a({name:"update_module_config",description:"Update a specific module configuration",inputSchema:o({id:S.Yj().describe("Module ID"),config:S.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(_=v(function*({workspace_id:e,id:i,config:t}){var n=yield q(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return T((yield r.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return _.apply(this,arguments)})),a({name:"get_devices",description:"List all devices in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of devices to return").optional().default(50),offset:S.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(h=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return h.apply(this,arguments)})),a({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:o({name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description").optional(),grid_width:S.ai().describe("Grid width in units").optional().default(96),grid_height:S.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(b=v(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return T((yield r.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return b.apply(this,arguments)})),a({name:"update_application_info",description:"Update application info",inputSchema:{id:S.Yj().describe("Application ID"),name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description")},permission:"update_application"},(I=v(function*({id:e,name:i,description:t}){return T((yield r.updateApplication({id:e,name:i,description:t})))}),function(e){return I.apply(this,arguments)})),a({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:S.Yj().describe("Application ID"),config:S.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(k=v(function*({id:e,config:i}){var t=yield q(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return T((yield r.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return k.apply(this,arguments)})),a({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:S.Yj().describe("Application ID"),viewports:S.YO(S.Ik({device_id:S.Yj().describe("Device ID"),x:S.ai().describe("X coordinate"),y:S.ai().describe("Y coordinate"),width:S.ai().describe("Width"),height:S.ai().describe("Height"),rotate:S.ai().describe("Rotation"),rotateType:S.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(D=v(function*({app_id:e,viewports:i}){return T((yield r.bindApplication({id:e,bind_devices:i.map(e=>e.device_id),device_frames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})})))}),function(e){return D.apply(this,arguments)})),a({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:S.Yj().describe("Application ID"),device_id:S.Yj().describe("Device ID")},permission:"bind_application"},(A=v(function*({app_id:e,device_id:i}){return T((yield r.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return A.apply(this,arguments)})),n&&a({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},v(function*(){return T((yield s.mediaWorkspaces()))})),a({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:o({}),permission:"query_media_flow"},(w=v(function*({workspace_id:e}){return T((yield s.mediaWorkspace({workspaceId:e})))}),function(e){return w.apply(this,arguments)})),a({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:o({}),permission:"query_media_flow"},(U=v(function*({workspace_id:e}){return T((yield s.mediaBoxes({workspaceId:e})))}),function(e){return U.apply(this,arguments)})),a({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:S.Yj().describe("Media box ID")},permission:"query_media_flow"},(M=v(function*({box_id:e}){return T((yield s.mediaBox({boxId:e})))}),function(e){return M.apply(this,arguments)})),a({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:S.YO(S.Yj()).optional().describe("Filter by user tags"),limit:S.ai().optional().default(50).describe("Maximum number of files to return"),offset:S.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(R=v(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return T((yield s.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return R.apply(this,arguments)})),a({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:S.Yj().describe("Media file ID")},permission:"query_media_flow"},(P=v(function*({file_id:e}){return T((yield s.mediaFile({fileId:e})))}),function(e){return P.apply(this,arguments)})),a({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:S.Yj().describe("Target media box ID"),name:S.Yj().describe("File name"),description:S.Yj().optional().default("").describe("File description"),file_type:S.k5(["image","video","audio","file"]).describe("File type"),source_url:S.Yj().optional().describe("URL to download the file from"),base64_data:S.Yj().optional().describe("Base64 encoded file data"),user_tags:S.YO(S.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(O=v(function*({box_id:e,name:i,description:t,source_url:a,base64_data:o,file_type:r,user_tags:d}){if(!a&&!o)throw Error("Either source_url or base64_data must be provided");if(a&&o)throw Error("Provide either source_url OR base64_data, not both");var c=a?null:"application/octet-stream",l=a?yield(0,B.Ay)(a,{agent:(0,E.fJ)(a)}).then(e=>(c=e.headers.get("content-type"),e.blob())):new Blob([C.Buffer.from(o,"base64")],{type:c}),p=yield s.requestFileUpload({name:i,description:t,boxId:e,fileType:n?r.toUpperCase():r,contentType:c,userTags:d,meta:{}}),u=JSON.parse(p?.meta.uploadInfo),m=new FormData;m.append("file",l),m.append("Content-Type",c),m.append("AWSAccessKeyId",u.AWSAccessKeyId),m.append("Signature",u.Signature),m.append("Policy",u.Policy),m.append("acl",u.acl),m.append("key",u.key);var _=yield(0,B.Ay)(u.url,{method:"POST",body:m}).then(e=>e.ok).catch(()=>!1);return T({file_id:p.id,upload_success:_,upload_info:{content_type:c,file_type:r,source_type:a?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return O.apply(this,arguments)})),a({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:S.Yj().describe("Media file ID"),name:S.Yj().optional().describe("New file name"),description:S.Yj().optional().describe("New file description"),user_tags:S.YO(S.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(F=v(function*({file_id:e,name:i,description:t,user_tags:n}){return T((yield s.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return F.apply(this,arguments)})),a({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:S.Yj().describe("Source media box ID"),to_box_id:S.Yj().describe("Target media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(N=v(function*({from_box_id:e,to_box_id:i,file_ids:t}){return T((yield s.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t})))}),function(e){return N.apply(this,arguments)})),a({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:S.Yj().describe("Media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(W=v(function*({box_id:e,file_ids:i}){return T((yield s.deleteMediaFiles({boxId:e,list:i})))}),function(e){return W.apply(this,arguments)})),a({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(j=v(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in s)return T((yield s.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield s.mediaFiles({boxId:e,includeTypes:i});return T((yield s.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return j.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:S.ai().describe("Device width in pixels"),device_height:S.ai().describe("Device height in pixels"),app_grid_width:S.ai().describe("Application grid width").optional().default(96),app_grid_height:S.ai().describe("Application grid height").optional().default(54)},(V=v(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o=(a=e/t,{deviceBrickWidth:e/a,deviceBrickHeight:i/a,deviceBrickUnit:a}),r=function(e,i,t=96){var n=e/t;return i>e&&(n=i/t),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(i/n),deviceBrickUnit:n}}(e,i,t);return T({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:r.deviceBrickWidth,height:r.deviceBrickHeight,unit_size_px:r.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return V.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:S.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:S.Yj().describe("Item title"),template_key:S.Yj().optional().describe("Template key for brick or generator")},tQ),e.tool("getting_started","Get documentation content for getting started",{},v(function*(){return T(z)})),!n){var d,c,l,p,u,m,_,h,b,I,k,D,A,w,U,M,R,P,O,F,N,W,j,V,Y,K,G,L=()=>new tz(tJ.activityLog,i.token);a({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:o({start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)"),device_id:S.Yj().optional().describe("Filter by device ID"),event_type:S.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:S.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:S.Yj().optional().describe("Filter by subspace ID"),sender:S.Yj().optional().describe("Filter by sender"),limit:S.ai().optional().default(50).describe("Max events to return per page"),offset:S.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(Y=v(function*({start_time:e,end_time:i,device_id:t,event_type:n,event_name:a,subspace_id:o,sender:r,limit:s=50,offset:d=0}){var c=L(),l={start_time:e,end_time:i};return t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r),T((yield c.events(l,{limit:s,offset:d})))}),function(e){return Y.apply(this,arguments)})),a({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:o({device_id:S.Yj().describe("Device ID (required)"),start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(K=v(function*({device_id:e,start_time:i,end_time:t}){var n=L();return T((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return K.apply(this,arguments)})),a({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:o({device_id:S.Yj().describe("Device ID"),ts:S.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(G=v(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw Error("Could not determine workspace ID");var o=L(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return T((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return G.apply(this,arguments)}))}a({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:o({device_id:S.Yj().describe("Device ID"),start_date:S.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:S.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(t=v(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString();return T((yield r.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return t.apply(this,arguments)}))}(a,o);var r=new b.S;try{yield a.connect(r),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${tH} v${tZ}`),console.error(`Token Type: ${n.tokenType}`),console.error(`Permissions: ${n.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};