@fugood/bricks-cli 2.24.0-beta.41 → 2.24.0-beta.43

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/737.js ADDED
@@ -0,0 +1,2451 @@
1
+ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];export const __webpack_esm_modules__={18737:(e,i,t)=>{t.d(i,{startStdioServer:()=>Wn}),t.r(i);var n={};t.r(n),t.d(n,{lI:()=>ae,F3:()=>te,mJ:()=>ne,AW:()=>de,$V:()=>re,J6:()=>se,Wt:()=>ce,qq:()=>oe,gw:()=>pe,Yi:()=>ie});var a={};t.r(a),t.d(a,{applicationFragment:()=>ae,applicationShortFragment:()=>ge,deviceFragment:()=>te,deviceGroupFragment:()=>ne,deviceShortFragment:()=>fe,instanceVersionFragment:()=>de,mediaBoxFragment:()=>$e,mediaFileFragment:()=>ve,mediaWorkspaceFragment:()=>ye,moduleFragment:()=>re,moduleShortFragment:()=>se,operationFragment:()=>ce,publicApplicationBasicInfoFragment:()=>oe,userFavoriteFragment:()=>pe,workspaceFragment:()=>me,workspaceShortFragment:()=>_e});var o={};t.r(o),t.d(o,{application:()=>ze,applicationByDevice:()=>Re,applicationReleaseVersion:()=>Ee,applicationReleaseVersions:()=>xe,applicationTestsByDevice:()=>Me,applications:()=>Le,checkBindDevicePasscode:()=>Pe,deviceUsage:()=>Je,devices:()=>He,devicesByGroup:()=>Fe,devicesByUniqueId:()=>Oe,me:()=>we,module:()=>Ae,moduleReleaseVersion:()=>Ue,moduleReleaseVersions:()=>Be,modules:()=>Se,publicModules:()=>Ce,publicModulesByIdList:()=>Te,workspace:()=>Ke,workspacePricingPlans:()=>Ne,workspaces:()=>Ge});var r={};t.r(r),t.d(r,{addUserFavorite:()=>Ni,assignGroupPermissions:()=>Mi,bindApplication:()=>fi,bindApplicationWithDeviceGroup:()=>vi,changeWorkspaceAdditionalLimitSpending:()=>ji,changeWorkspaceSubscriptionPlan:()=>Wi,controlDevice:()=>si,createApplication:()=>mi,createApplicationWithShareVersion:()=>_i,createConfigChangeOperation:()=>Ei,createDevice:()=>ii,createDeviceGroup:()=>di,createDeviceGroupWithApp:()=>Ii,createModule:()=>Ai,createVirtualDevice:()=>ti,createWorkspace:()=>Qe,createWorkspaceOTP:()=>Vi,dispatchDeviceGroupAction:()=>pi,doOperation:()=>Bi,duplicateApplication:()=>Di,duplicateModule:()=>Ti,forkApplication:()=>ki,moveApplication:()=>bi,moveDevice:()=>ai,moveModule:()=>Ci,registerFCMNotification:()=>Pi,registerRemoteDebug:()=>Oi,removeApplication:()=>wi,removeDevice:()=>ri,removeDeviceGroup:()=>li,removeModule:()=>xi,removeOperation:()=>Ri,removeUserFavorite:()=>qi,removeWorkspace:()=>ui,revokeWorkspaceOTP:()=>Yi,shareAccessToken:()=>Fi,shareApplication:()=>hi,toggleShortEditApplication:()=>yi,updateApplication:()=>gi,updateApplicationViewportPreset:()=>$i,updateDevice:()=>ni,updateDeviceGroup:()=>ci,updateModule:()=>Si,updateOperation:()=>Ui,updateVirtualDevice:()=>oi,updateWorkspace:()=>Ze,updateWorkspaceTokens:()=>ei});var s={};t.r(s),t.d(s,{application:()=>at,applicationByDevice:()=>ot,applications:()=>nt,device:()=>ct,deviceUsage:()=>lt,devices:()=>dt,devicesByApplication:()=>pt,mediaBox:()=>_t,mediaBoxes:()=>mt,mediaFile:()=>ft,mediaFiles:()=>gt,mediaWorkspace:()=>ut,module:()=>st,modules:()=>rt,workspace:()=>tt});var d={};t.r(d),t.d(d,{bindApplication:()=>bt,copyMediaFiles:()=>Tt,createApplication:()=>vt,createModule:()=>kt,deleteMediaBoxFiles:()=>Et,deleteMediaFiles:()=>xt,requestFileUpload:()=>wt,setMediaFileAsBoxPreview:()=>Ct,unbindApplication:()=>It,updateApplication:()=>ht,updateMediaFile:()=>At,updateMediaFiles:()=>St,updateModule:()=>Dt});var c={};t.r(c),t.d(c,{mediaBox:()=>en,mediaBoxes:()=>Qt,mediaFile:()=>nn,mediaFiles:()=>tn,mediaWorkspace:()=>Zt,mediaWorkspaces:()=>Xt});var p={};t.r(p),t.d(p,{assignGroupPermissions:()=>gn,copyMediaFiles:()=>mn,createMediaBox:()=>rn,createMediaWorkspace:()=>an,deleteMediaFiles:()=>un,moveMediaBox:()=>sn,requestFileUpload:()=>cn,setMediaFileAsBoxPreview:()=>_n,updateMediaBox:()=>dn,updateMediaFile:()=>pn,updateMediaFiles:()=>ln,updateMediaWorkspace:()=>on});var l={};t.r(l),t.d(l,{mediaBox:()=>yn,mediaFile:()=>vn,mediaFiles:()=>$n});var u={};t.r(u),t.d(u,{deleteMediaFiles:()=>kn,requestFileUpload:()=>hn,updateMediaFile:()=>bn,updateMediaFiles:()=>In});var m=t(99436),_=t(6732),g=t(36565),f={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"},y=Object.entries(f).reduce((e,[i,t])=>(e[t]=i,e),{}),$=["HS256","RS256"],v=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"];function h(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());return $.includes(t?.alg)?JSON.parse(Buffer.from(i[1],"base64url").toString()):null}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=v.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=y[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(f);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}var b=t(17609);const I='# 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×54 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×1080 | 96×54 | 20px |\n| 3840×2160 | 96×54 | 40px |\n| 1280×720 | 96×54 | 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×54)\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×54 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 k=t(20181),D=(e,i={})=>({content:[k.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});var w=t(68832),A=t(79657),S=t(79861),C=t(46123),T=t(80211),x=t(45907),E=t(99548),B=t(33095),U=T.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),R=(0,B.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function M(e){var i=[];try{var t=T(e);i.push(...(0,E.L)({errors:t,schema:U,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...x(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return R(e).forEach(t=>{var n=t.slice(0,-1),a=C(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,p=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`)}),p&&!a.map[p]&&i.push(`${o}.map.${p} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var P=t(49741),O=t(63981),F=(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]??F(t,i)])):e,N=F(P.systemActionDescriptions),q=Object.entries(P.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${N[e]}\n${((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)}\n`.trim()).join("\n"),W=Object.keys(O.brickMapping).map(e=>`- \`${e}\``).join("\n"),j=Object.keys(O.generatorMapping).map(e=>`- \`${e}\``).join("\n");const V=I.replace("[:SYSTEM_ACTIONS:]",q).replace("[:BRICK_IDS:]",W).replace("[:GENERATOR_IDS:]",j);var Y=(e,i)=>!i||e.tokenInfo.permissions?.includes(i)||!1,K=t(44668),G=t(5018),L=t(63315),z=t(30409),H=t(40906),J=t(79760),X=t(56078),Q=t(29222),Z=t(26197),ee=t(94370);const ie=ee.default`
2
+ fragment workspaceArguments on Workspace {
3
+ __typename
4
+ _id
5
+ owner {
6
+ _id
7
+ id_from_user
8
+ }
9
+ name
10
+ description
11
+ bank {
12
+ enable_remote_update
13
+ spacename
14
+ keys
15
+ }
16
+ media_resource {
17
+ enable_media_workspace
18
+ workspace_id
19
+ system_media_box_id
20
+ system_media_box_passcode
21
+ editor_upload_binding {
22
+ box_id
23
+ box_passcode
24
+ }
25
+ }
26
+ emails {
27
+ address
28
+ verified
29
+ date
30
+ }
31
+ notification_messages {
32
+ _id
33
+ type
34
+ custom_message
35
+ id
36
+ name
37
+ date
38
+ read
39
+ }
40
+ auth {
41
+ tokens {
42
+ _id
43
+ name
44
+ enable_expired
45
+ expired_at
46
+ created_at
47
+ types
48
+ }
49
+ }
50
+ billing {
51
+ plan {
52
+ type
53
+ period
54
+ }
55
+ lock {
56
+ features
57
+ additional_resources
58
+ }
59
+ subscription {
60
+ status
61
+ last_active_at
62
+ billing_cycle_anchor
63
+ current_period_end
64
+ }
65
+ subscription_schedule {
66
+ status
67
+ next_plan_type
68
+ next_plan_period
69
+ next_plan_start_date
70
+ }
71
+ additional_subscription {
72
+ status
73
+ last_active_at
74
+ billing_cycle_anchor
75
+ current_period_end
76
+ }
77
+ additional_limit_spending {
78
+ devices
79
+ media
80
+ group
81
+ }
82
+ }
83
+ create_datetime
84
+ last_modify_datetime
85
+ last_modify_records {
86
+ type
87
+ query_name
88
+ instance_id
89
+ token_name
90
+ meta
91
+ updated_at
92
+ }
93
+ }
94
+ `,te=ee.default`
95
+ fragment deviceArguments on Device {
96
+ __typename
97
+ _id
98
+ create_datetime
99
+ last_modify_datetime
100
+ last_modify_records {
101
+ type
102
+ query_name
103
+ instance_id
104
+ token_name
105
+ meta
106
+ updated_at
107
+ }
108
+ name
109
+ device_name
110
+ description
111
+ tags
112
+ entry_detail {
113
+ unique_id
114
+ operation_version
115
+ type
116
+ operation_mode
117
+ update {
118
+ current_version
119
+ last_update_at
120
+ }
121
+ watch_dog_timer {
122
+ alive
123
+ last_launch_time
124
+ prev_last_launch_time
125
+ last_alive_time
126
+ threshold
127
+ }
128
+ screen {
129
+ title
130
+ master
131
+ orientation
132
+ resolution {
133
+ width
134
+ height
135
+ scale
136
+ fontScale
137
+ }
138
+ touch {
139
+ available
140
+ touch_point
141
+ }
142
+ }
143
+ local_sync {
144
+ is_main
145
+ peer_count
146
+ mean_latency
147
+ }
148
+ application {
149
+ _id
150
+ name
151
+ config_timestamp
152
+ }
153
+ memory_usage
154
+ disk_usage
155
+ }
156
+ owner {
157
+ _id
158
+ id_from_user
159
+ }
160
+ used_workspace {
161
+ _id
162
+ name
163
+ emails {
164
+ address
165
+ verified
166
+ }
167
+ billing {
168
+ plan {
169
+ type
170
+ period
171
+ }
172
+ lock {
173
+ features
174
+ }
175
+ }
176
+ }
177
+ bound_application {
178
+ _id
179
+ name
180
+ }
181
+ alert {
182
+ enabled
183
+ time_range
184
+ days_of_week {
185
+ sun
186
+ mon
187
+ tues
188
+ weds
189
+ thurs
190
+ fri
191
+ satur
192
+ }
193
+ }
194
+ activity_log {
195
+ enabled
196
+ filter
197
+ }
198
+ local_sync {
199
+ enabled
200
+ priority_as_main
201
+ disable_dynamic_latency
202
+ latency_offset
203
+ }
204
+ preload {
205
+ disabled
206
+ skip_on_failure
207
+ force_md5_match
208
+ retry_attempt_for_failure
209
+ skip_integrity_check
210
+ }
211
+ auth {
212
+ type
213
+ tokens {
214
+ _id
215
+ name
216
+ enable_expired
217
+ expired_at
218
+ created_at
219
+ allowed_in_url_query
220
+ types
221
+ }
222
+ ip_address_allowlist
223
+ ip_address_blocklist
224
+ access_accounts {
225
+ username
226
+ }
227
+ }
228
+ application_update {
229
+ lazy_update
230
+ }
231
+ lock {
232
+ enabled
233
+ }
234
+ env {
235
+ variables
236
+ virtual_dev_url_query {
237
+ env_prefix
238
+ enable_unsafe_encryption
239
+ encryption_algorithm
240
+ encryption_key
241
+ encryption_iv
242
+ }
243
+ }
244
+ }
245
+ `,ne=ee.default`
246
+ fragment deviceGroupArguments on DeviceGroup {
247
+ __typename
248
+ _id
249
+ create_datetime
250
+ last_modify_datetime
251
+ last_modify_records {
252
+ type
253
+ query_name
254
+ instance_id
255
+ token_name
256
+ meta
257
+ updated_at
258
+ }
259
+ name
260
+ description
261
+ owner {
262
+ _id
263
+ id_from_user
264
+ }
265
+ used_workspace {
266
+ _id
267
+ billing {
268
+ plan {
269
+ type
270
+ period
271
+ }
272
+ lock {
273
+ features
274
+ }
275
+ }
276
+ }
277
+ tags
278
+ devices {
279
+ device_id
280
+ device_target_name
281
+ }
282
+ }
283
+ `,ae=ee.default`
284
+ fragment applicationArguments on Application {
285
+ __typename
286
+ _id
287
+ owner {
288
+ _id
289
+ id_from_user
290
+ }
291
+ lock {
292
+ enabled
293
+ }
294
+ id_for_devices
295
+ devices {
296
+ device_id
297
+ frame
298
+ run_test
299
+ cron_tests {
300
+ test_id
301
+ update_screenshot
302
+ cron
303
+ date_range {
304
+ start
305
+ end
306
+ }
307
+ bind_id
308
+ }
309
+ short_edit
310
+ env
311
+ }
312
+ secrets {
313
+ _id
314
+ property_id
315
+ name
316
+ description
317
+ date
318
+ }
319
+ viewport_presets {
320
+ _id
321
+ name
322
+ viewports {
323
+ detail
324
+ device_target_name
325
+ run_test
326
+ cron_tests {
327
+ test_id
328
+ update_screenshot
329
+ }
330
+ }
331
+ run_test
332
+ cron_tests {
333
+ test_id
334
+ update_screenshot
335
+ }
336
+ sync_key
337
+ }
338
+ used_workspace {
339
+ _id
340
+ name
341
+ billing {
342
+ plan {
343
+ type
344
+ period
345
+ }
346
+ lock {
347
+ features
348
+ }
349
+ }
350
+ }
351
+ dev_ref {
352
+ is_dev
353
+ parent_application
354
+ }
355
+ name
356
+ description
357
+ config
358
+ short_edit {
359
+ enabled
360
+ use_unstable_features
361
+ }
362
+ canvas_control {
363
+ enabled
364
+ use_unstable_features
365
+ }
366
+ device_control {
367
+ enabled
368
+ use_unstable_features
369
+ }
370
+ has_unreleased_changes
371
+ create_datetime
372
+ last_modify_datetime
373
+ last_modify_records {
374
+ type
375
+ query_name
376
+ instance_id
377
+ token_name
378
+ meta
379
+ updated_at
380
+ }
381
+ current_version
382
+ share {
383
+ description
384
+ tags
385
+ type
386
+ usage
387
+ create_records {
388
+ total_count
389
+ # records
390
+ }
391
+ favorite {
392
+ enabled
393
+ total_count
394
+ }
395
+ preview {
396
+ enabled
397
+ }
398
+ selected_releases {
399
+ _id
400
+ version
401
+ name
402
+ note
403
+ date
404
+ used_modules
405
+ used_media_flow_generators
406
+ used_global_remote_property_bank
407
+ used_secrets
408
+ }
409
+ screenshot {
410
+ type
411
+ screenshot_payload
412
+ last_screenshot_id
413
+ }
414
+ create_settings {
415
+ module_auto_destructure
416
+ }
417
+ }
418
+ screenshot {
419
+ type
420
+ screenshot_payload
421
+ last_screenshot_id
422
+ }
423
+ ai_filters {
424
+ name
425
+ description
426
+ instruction
427
+ variable_keys
428
+ model_provider
429
+ scope
430
+ }
431
+ }
432
+ `,oe=ee.default`
433
+ fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
434
+ _id
435
+ owner {
436
+ _id
437
+ id_from_user
438
+ }
439
+ name
440
+ description
441
+ share {
442
+ description
443
+ tags
444
+ type
445
+ usage
446
+ preview {
447
+ enabled
448
+ }
449
+ create_records {
450
+ total_count
451
+ # records
452
+ }
453
+ favorite {
454
+ enabled
455
+ total_count
456
+ }
457
+ selected_releases {
458
+ _id
459
+ version
460
+ name
461
+ note
462
+ date
463
+ used_modules
464
+ used_media_flow_generators
465
+ used_global_remote_property_bank
466
+ used_secrets
467
+ }
468
+ screenshot {
469
+ last_screenshot_id
470
+ }
471
+ create_settings {
472
+ module_auto_destructure
473
+ }
474
+ }
475
+ }
476
+ `,re=ee.default`
477
+ fragment moduleArguments on Module {
478
+ __typename
479
+ _id
480
+ create_datetime
481
+ last_modify_datetime
482
+ last_modify_records {
483
+ type
484
+ query_name
485
+ instance_id
486
+ token_name
487
+ meta
488
+ updated_at
489
+ }
490
+ owner {
491
+ _id
492
+ id_from_user
493
+ }
494
+ name
495
+ description
496
+ tags
497
+ config
498
+ current_version
499
+ expose_properties
500
+ is_allow_modify
501
+ is_public
502
+ used_workspace {
503
+ _id
504
+ billing {
505
+ plan {
506
+ type
507
+ period
508
+ }
509
+ lock {
510
+ features
511
+ }
512
+ }
513
+ }
514
+ screenshot {
515
+ type
516
+ screenshot_payload
517
+ last_screenshot_id
518
+ }
519
+ }
520
+ `,se=ee.default`
521
+ fragment moduleShortArguments on Module {
522
+ __typename
523
+ _id
524
+ create_datetime
525
+ last_modify_datetime
526
+ owner {
527
+ _id
528
+ id_from_user
529
+ }
530
+ name
531
+ description
532
+ tags
533
+ current_version
534
+ expose_properties
535
+ is_allow_modify
536
+ is_public
537
+ used_workspace {
538
+ _id
539
+ }
540
+ screenshot {
541
+ last_screenshot_id
542
+ }
543
+ }
544
+ `,de=ee.default`
545
+ fragment instanceVersionArguments on ConfigVersion {
546
+ __typename
547
+ _id
548
+ create_datetime
549
+ last_modify_datetime
550
+ version
551
+ note
552
+ instance_id
553
+ entry
554
+ }
555
+ `,ce=ee.default`
556
+ fragment operationArguments on Operation {
557
+ __typename
558
+ _id
559
+ creator
560
+ application
561
+ create_datetime
562
+ last_modify_datetime
563
+ passcode
564
+ type
565
+ expired_datetime
566
+ payload
567
+ }
568
+ `,pe=ee.default`
569
+ fragment userFavoriteArguments on UserFavorite {
570
+ _id
571
+ instance_type
572
+ instance {
573
+ _id
574
+ name
575
+ description
576
+ }
577
+ last_modify_datetime
578
+ }
579
+ `;var le,ue,me=ee.default`
580
+ fragment mcpWorkspaceArguments on Workspace {
581
+ __typename
582
+ _id
583
+ owner {
584
+ _id
585
+ id_from_user
586
+ }
587
+ name
588
+ description
589
+ bank {
590
+ enable_remote_update
591
+ spacename
592
+ keys
593
+ }
594
+ media_resource {
595
+ enable_media_workspace
596
+ workspace_id
597
+ system_media_box_id
598
+ system_media_box_passcode
599
+ editor_upload_binding {
600
+ box_id
601
+ box_passcode
602
+ }
603
+ }
604
+ emails {
605
+ address
606
+ verified
607
+ date
608
+ }
609
+ notification_messages {
610
+ _id
611
+ type
612
+ custom_message
613
+ id
614
+ name
615
+ date
616
+ read
617
+ }
618
+ billing {
619
+ plan {
620
+ type
621
+ period
622
+ }
623
+ lock {
624
+ features
625
+ additional_resources
626
+ }
627
+ subscription {
628
+ status
629
+ last_active_at
630
+ billing_cycle_anchor
631
+ current_period_end
632
+ }
633
+ subscription_schedule {
634
+ status
635
+ next_plan_type
636
+ next_plan_period
637
+ next_plan_start_date
638
+ }
639
+ additional_subscription {
640
+ status
641
+ last_active_at
642
+ billing_cycle_anchor
643
+ current_period_end
644
+ }
645
+ additional_limit_spending {
646
+ devices
647
+ media
648
+ group
649
+ }
650
+ }
651
+ create_datetime
652
+ last_modify_datetime
653
+ last_modify_records {
654
+ type
655
+ query_name
656
+ instance_id
657
+ token_name
658
+ meta
659
+ updated_at
660
+ }
661
+ }
662
+ `,_e=ee.default`
663
+ fragment mcpWorkspaceShortArguments on Workspace {
664
+ _id
665
+ name
666
+ description
667
+ }
668
+ `,ge=ee.default`
669
+ fragment mcpApplicationShortArguments on Application {
670
+ _id
671
+ name
672
+ description
673
+ }
674
+ `,fe=ee.default`
675
+ fragment mcpDeviceShortArguments on Device {
676
+ _id
677
+ name
678
+ description
679
+ }
680
+ `,ye=ee.default`
681
+ fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
682
+ id
683
+ name
684
+ description
685
+ owner
686
+ serviceBinding
687
+ createdAt
688
+ updatedAt
689
+ size
690
+ sizeLimit
691
+ }
692
+ `,$e=ee.default`
693
+ fragment workspaceMediaBoxArguments on MediaBox {
694
+ id
695
+ name
696
+ description
697
+ tags
698
+ owner
699
+ workspaceId
700
+ serviceBinding
701
+ serviceBindingType
702
+ passcodes {
703
+ id
704
+ name
705
+ code
706
+ enableExpired
707
+ expiredAt
708
+ permissions
709
+ }
710
+ createdAt
711
+ updatedAt
712
+ size
713
+ }
714
+ `,ve=ee.default`
715
+ fragment workspaceMediaFileArguments on MediaFile {
716
+ id
717
+ name
718
+ description
719
+ owner
720
+ boxId
721
+ fileType
722
+ contentType
723
+ fileSize
724
+ originalKey
725
+ userTags
726
+ versions {
727
+ key
728
+ width
729
+ height
730
+ strategy
731
+ version
732
+ etag
733
+ content_type
734
+ size
735
+ left
736
+ top
737
+ rotate
738
+ metadata
739
+ copypreview
740
+ }
741
+ previewId
742
+ isPreview
743
+ createdAt
744
+ updatedAt
745
+ meta {
746
+ parentFileId
747
+ storageEndpoint
748
+ originalFileUploaded
749
+ originalFileKey
750
+ originalFileSize
751
+ originalFileEtag
752
+ originalFileContentType
753
+ originalWidth
754
+ originalHeight
755
+ convertedFileUploaded
756
+ convertedFileKey
757
+ convertedFileSize
758
+ convertedFileEtag
759
+ convertedFileContentType
760
+ convertedFileHlsSegmentCount
761
+ videoThumbOriginalFileEtag
762
+ videoThumbOriginalFileContentType
763
+ videoThumbOriginalWidth
764
+ videoThumbOriginalHeight
765
+ videoThumbOriginalFileUploaded
766
+ videoThumbOriginalFileKey
767
+ videoThumbOriginalFileSize
768
+ uploadInfo
769
+ imageVersionRequests {
770
+ strategy
771
+ left
772
+ top
773
+ width
774
+ height
775
+ rotate
776
+ metadata
777
+ copypreview
778
+ }
779
+ allowedBiggerImageVersion
780
+ imageVersionType
781
+ videoTransformedByClient
782
+ videoTransformType
783
+ videoTransformed
784
+ customVideoWidth
785
+ customVideoHeight
786
+
787
+ updateUploadAllowSizeRange
788
+ enableAiAnalysis
789
+ aiCustomInstruction
790
+ aiDescription
791
+ aiTags
792
+ aiAnalysisStatus
793
+ aiAnalyzedAt
794
+ systemTags
795
+ }
796
+ }
797
+ `,he={query:"query",mutation:"mutate"},be=K(function e(i,t,n,o,r){G(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var s=(0,J.$)({uri:`${i}${n}`}),d=(0,Z.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new X.R({link:d.concat(s),cache:new Q.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=a,this.queries=o,this.mutations=r,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,n])=>{if(this[t])throw new Error(`Overwriting client.${t}`);this[t]=m(function*(a={},o={}){try{var r=e.apolloClient[he[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 new Error(c.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause){if(e.cause.result?.errors)throw new Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));console.error(e.cause)}throw e}})};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(ue=m(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 new Error(r);if(a&&a.length>0)throw new Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return ue.apply(this,arguments)})},{key:"mutate",value:(le=m(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 new Error(r);if(a&&a.length>0)throw new Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return le.apply(this,arguments)})}]);const{$V:Ie,J6:ke,AW:De}=n,we=ee.default`
798
+ query ControllerClient_me {
799
+ me {
800
+ _id
801
+ id_from_user
802
+ }
803
+ }
804
+ `,Ae=ee.default`
805
+ query ControllerClient_module($id: ID!) {
806
+ module(id: $id) {
807
+ ...moduleArguments
808
+ }
809
+ }
810
+ ${Ie}
811
+ `,Se=ee.default`
812
+ query ControllerClient_modules($workspaceId: ID, $limit: Int) {
813
+ modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
814
+ ...moduleShortArguments
815
+ }
816
+ }
817
+ ${ke}
818
+ `,Ce=ee.default`
819
+ query ControllerClient_publicModules($keyword: String!, $limit: Int) {
820
+ publicModules(keyword: $keyword, paginate: { limit: $limit }) {
821
+ ...moduleShortArguments
822
+ }
823
+ }
824
+ ${ke}
825
+ `,Te=ee.default`
826
+ query ControllerClient_publicModulesByIdList($idList: [ID]) {
827
+ publicModulesByIdList(idList: $idList) {
828
+ ...moduleShortArguments
829
+ }
830
+ }
831
+ ${ke}
832
+ `,xe=ee.default`
833
+ query ControllerClient_applicationReleaseVersions($id: ID!) {
834
+ applicationReleaseVersions(id: $id) {
835
+ ...instanceVersionArguments
836
+ }
837
+ }
838
+ ${De}
839
+ `,Ee=ee.default`
840
+ query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
841
+ applicationReleaseVersion(id: $id, versionId: $versionId) {
842
+ ...applicationReleaseVersionArguments
843
+ }
844
+ }
845
+ ${De}
846
+ `,Be=ee.default`
847
+ query ControllerClient_moduleReleaseVersions($id: ID!) {
848
+ moduleReleaseVersions(id: $id) {
849
+ ...instanceVersionArguments
850
+ }
851
+ }
852
+ ${De}
853
+ `,Ue=ee.default`
854
+ query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
855
+ moduleReleaseVersion(id: $id, versionId: $versionId) {
856
+ ...instanceVersionArguments
857
+ }
858
+ }
859
+ ${De}
860
+ `,Re=ee.default`
861
+ query ControllerClient_applicationByDevice(
862
+ $deviceId: ID!
863
+ $debug: Boolean
864
+ $composeModule: Boolean
865
+ $bankRemoteConfig: Boolean
866
+ ) {
867
+ applicationByDevice(
868
+ deviceId: $deviceId
869
+ debug: $debug
870
+ composeModule: $composeModule
871
+ bankRemoteConfig: $bankRemoteConfig
872
+ ) {
873
+ ...applicationArguments
874
+ config_tests
875
+ }
876
+ }
877
+ ${ae}
878
+ `,Me=ee.default`
879
+ query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
880
+ applicationTestsByDevice: applicationByDevice(
881
+ deviceId: $deviceId
882
+ debug: true
883
+ composeModule: false
884
+ bankRemoteConfig: false
885
+ ) {
886
+ _id
887
+ name
888
+ config_tests
889
+ }
890
+ }
891
+ `,Pe=ee.default`
892
+ query ControllerClient_checkBindDevicePasscode($passcode: String!) {
893
+ checkBindDevicePasscode(passcode: $passcode)
894
+ }
895
+ `,Oe=ee.default`
896
+ query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
897
+ devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
898
+ ...deviceArguments
899
+ }
900
+ }
901
+ ${te}
902
+ `,Fe=ee.default`
903
+ query ControllerClient_devicesByGroup($id: ID!) {
904
+ devicesByGroup(id: $id) {
905
+ device {
906
+ __typename
907
+ _id
908
+ used_workspace {
909
+ _id
910
+ billing {
911
+ plan {
912
+ type
913
+ }
914
+ lock {
915
+ features
916
+ additional_resources
917
+ }
918
+ }
919
+ }
920
+ create_datetime
921
+ last_modify_datetime
922
+ name
923
+ device_name
924
+ description
925
+ tags
926
+ entry_detail {
927
+ unique_id
928
+ operation_version
929
+ type
930
+ operation_mode
931
+ watch_dog_timer {
932
+ alive
933
+ last_launch_time
934
+ last_alive_time
935
+ threshold
936
+ }
937
+ }
938
+ owner {
939
+ _id
940
+ id_from_user
941
+ }
942
+ bound_application {
943
+ _id
944
+ name
945
+ }
946
+ auth {
947
+ type
948
+ }
949
+ }
950
+ target_name
951
+ }
952
+ }
953
+ `,Ne=ee.default`
954
+ query ControllerClient_workspacePricingPlans {
955
+ workspacePricingPlans
956
+ }
957
+ `;var qe=fe,We=ge,je=ae,Ve=_e,Ye=me,Ke=ee.default`
958
+ query User_workspace($id: ID!) {
959
+ workspace(id: $id) {
960
+ ...mcpWorkspaceArguments
961
+ }
962
+ }
963
+ ${Ye}
964
+ `,Ge=ee.default`
965
+ query User_workspaces($paginate: Paginate) {
966
+ workspaces(paginate: $paginate) {
967
+ ...mcpWorkspaceShortArguments
968
+ }
969
+ }
970
+ ${Ve}
971
+ `,Le=ee.default`
972
+ query User_applications {
973
+ applications {
974
+ ...mcpApplicationShortArguments
975
+ }
976
+ }
977
+ ${We}
978
+ `,ze=ee.default`
979
+ query User_application($id: ID!) {
980
+ application(id: $id) {
981
+ ...applicationArguments
982
+ }
983
+ }
984
+ ${je}
985
+ `,He=ee.default`
986
+ query User_devices {
987
+ devices {
988
+ ...mcpDeviceShortArguments
989
+ }
990
+ }
991
+ ${qe}
992
+ `,Je=ee.default`
993
+ query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
994
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
995
+ _id
996
+ device_id
997
+ date
998
+ uptime {
999
+ timestamp
1000
+ }
1001
+ memory_usage {
1002
+ values
1003
+ timestamp
1004
+ }
1005
+ disk_usage {
1006
+ values
1007
+ timestamp
1008
+ }
1009
+ }
1010
+ }
1011
+ `;const Xe=e=>(e.needResetStore=!0,e),Qe=Xe(ee.default`
1012
+ mutation ControllerClient_createWorkspace($name: String, $description: String) {
1013
+ createWorkspace(name: $name, description: $description) {
1014
+ ...workspaceArguments
1015
+ }
1016
+ }
1017
+ ${ie}
1018
+ `),Ze=Xe(ee.default`
1019
+ mutation ControllerClient_updateWorkspace(
1020
+ $id: ID!
1021
+ $name: String
1022
+ $description: String
1023
+ $addVerifyEmail: String
1024
+ $removeVerifyEmail: String
1025
+ $enableBankRemoteUpdate: Boolean
1026
+ $newBankKey: BankKeyInput
1027
+ $revokeBankKey: String
1028
+ $enableMediaWorkspace: Boolean
1029
+ $refreshBindingBoxKey: String
1030
+ ) {
1031
+ updateWorkspace(
1032
+ id: $id
1033
+ name: $name
1034
+ description: $description
1035
+ addVerifyEmail: $addVerifyEmail
1036
+ removeVerifyEmail: $removeVerifyEmail
1037
+ enableBankRemoteUpdate: $enableBankRemoteUpdate
1038
+ newBankKey: $newBankKey
1039
+ revokeBankKey: $revokeBankKey
1040
+ enableMediaWorkspace: $enableMediaWorkspace
1041
+ refreshBindingBoxKey: $refreshBindingBoxKey
1042
+ ) {
1043
+ ...workspaceArguments
1044
+ }
1045
+ }
1046
+ ${ie}
1047
+ `),ei=Xe(ee.default`
1048
+ mutation ControllerClient_updateWorkspaceTokens(
1049
+ $id: ID!
1050
+ $tokens: [WorkspaceTokenInput]
1051
+ $revokeTokens: [ID!]
1052
+ ) {
1053
+ updateWorkspaceTokens(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1054
+ workspace {
1055
+ ...workspaceArguments
1056
+ }
1057
+ newTokens {
1058
+ name
1059
+ token
1060
+ }
1061
+ }
1062
+ }
1063
+ ${ie}
1064
+ `),ii=Xe(ee.default`
1065
+ mutation ControllerClient_createDevice(
1066
+ $workspaceId: ID
1067
+ $name: String
1068
+ $deviceName: String
1069
+ $entry: JSON!
1070
+ $forceMoveExistingDeviceIfAllowed: Boolean
1071
+ $bindPasscode: String
1072
+ $bindRefreshTokenLegacy: String
1073
+ ) {
1074
+ createDevice(
1075
+ workspaceId: $workspaceId
1076
+ name: $name
1077
+ deviceName: $deviceName
1078
+ entry: $entry
1079
+ forceMoveExistingDeviceIfAllowed: $forceMoveExistingDeviceIfAllowed
1080
+ bindPasscode: $bindPasscode
1081
+ bindRefreshTokenLegacy: $bindRefreshTokenLegacy
1082
+ ) {
1083
+ ...deviceArguments
1084
+ }
1085
+ }
1086
+ ${te}
1087
+ `),ti=Xe(ee.default`
1088
+ mutation ControllerClient_createVirtualDevice(
1089
+ $workspaceId: ID
1090
+ $name: String
1091
+ $deviceName: String
1092
+ $entry: JSON!
1093
+ ) {
1094
+ createVirtualDevice(
1095
+ workspaceId: $workspaceId
1096
+ name: $name
1097
+ deviceName: $deviceName
1098
+ entry: $entry
1099
+ ) {
1100
+ ...deviceArguments
1101
+ }
1102
+ }
1103
+ ${te}
1104
+ `),ni=Xe(ee.default`
1105
+ mutation ControllerClient_updateDevice(
1106
+ $id: ID!
1107
+ $name: String
1108
+ $deviceName: String
1109
+ $description: String
1110
+ $tags: [String]
1111
+ $alert: DeviceAlertInput
1112
+ $activityLog: ActivityLogInput
1113
+ $localSync: LocalSyncInput
1114
+ $preload: PreloadInput
1115
+ $applicationUpdate: ApplicationUpdateInput
1116
+ $lock: DeviceLockInput
1117
+ $env: DeviceEnvInput
1118
+ $accessControl: DeviceAccessControlInput
1119
+ $forceNotifyDevice: Boolean
1120
+ ) {
1121
+ updateDevice(
1122
+ id: $id
1123
+ name: $name
1124
+ deviceName: $deviceName
1125
+ description: $description
1126
+ tags: $tags
1127
+ alert: $alert
1128
+ activityLog: $activityLog
1129
+ localSync: $localSync
1130
+ preload: $preload
1131
+ applicationUpdate: $applicationUpdate
1132
+ lock: $lock
1133
+ env: $env
1134
+ accessControl: $accessControl
1135
+ forceNotifyDevice: $forceNotifyDevice
1136
+ ) {
1137
+ ...deviceArguments
1138
+ }
1139
+ }
1140
+ ${te}
1141
+ `),ai=Xe(ee.default`
1142
+ mutation ControllerClient_moveDevice(
1143
+ $id: ID!
1144
+ $workspaceId: ID!
1145
+ $forceNotifyDevice: Boolean
1146
+ $forceUnbindApplicationIfNeeded: Boolean
1147
+ $forceRemoveInDeviceGroupsIfNeeded: Boolean
1148
+ ) {
1149
+ moveDevice(
1150
+ id: $id
1151
+ workspaceId: $workspaceId
1152
+ forceNotifyDevice: $forceNotifyDevice
1153
+ forceUnbindApplicationIfNeeded: $forceUnbindApplicationIfNeeded
1154
+ forceRemoveInDeviceGroupsIfNeeded: $forceRemoveInDeviceGroupsIfNeeded
1155
+ ) {
1156
+ ...deviceArguments
1157
+ }
1158
+ }
1159
+ ${te}
1160
+ `),oi=Xe(ee.default`
1161
+ mutation ControllerClient_updateVirtualDevice(
1162
+ $id: ID!
1163
+ $tokens: [DeviceTokenInput]
1164
+ $revokeTokens: [ID!]
1165
+ ) {
1166
+ updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1167
+ device {
1168
+ ...deviceArguments
1169
+ }
1170
+ newTokens {
1171
+ name
1172
+ token
1173
+ }
1174
+ }
1175
+ }
1176
+ ${te}
1177
+ `),ri=Xe(ee.default`
1178
+ mutation ControllerClient_removeDevice($id: ID!) {
1179
+ removeDevice(id: $id)
1180
+ }
1181
+ `),si=Xe(ee.default`
1182
+ mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
1183
+ controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
1184
+ ...deviceArguments
1185
+ }
1186
+ }
1187
+ ${te}
1188
+ `),di=Xe(ee.default`
1189
+ mutation ControllerClient_createDeviceGroup(
1190
+ $workspaceId: ID!
1191
+ $name: String!
1192
+ $description: String
1193
+ ) {
1194
+ createDeviceGroup(workspaceId: $workspaceId, name: $name, description: $description) {
1195
+ ...deviceGroupArguments
1196
+ }
1197
+ }
1198
+ ${ne}
1199
+ `),ci=Xe(ee.default`
1200
+ mutation ControllerClient_updateDeviceGroup(
1201
+ $id: ID!
1202
+ $name: String
1203
+ $description: String
1204
+ $tags: [String]
1205
+ $upsertDevices: [DeviceInGroupInput]
1206
+ $removeDevices: [ID!]
1207
+ $deployDeviceSetting: DeviceSettingInGroup
1208
+ $deployDeviceAdvancedSetting: DeviceAdvancedSettingInGroup
1209
+ ) {
1210
+ updateDeviceGroup(
1211
+ id: $id
1212
+ name: $name
1213
+ description: $description
1214
+ tags: $tags
1215
+ upsertDevices: $upsertDevices
1216
+ removeDevices: $removeDevices
1217
+ deployDeviceSetting: $deployDeviceSetting
1218
+ deployDeviceAdvancedSetting: $deployDeviceAdvancedSetting
1219
+ ) {
1220
+ ...deviceGroupArguments
1221
+ }
1222
+ }
1223
+ ${ne}
1224
+ `),pi=Xe(ee.default`
1225
+ mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
1226
+ dispatchDeviceGroupAction(id: $id, action: $action) {
1227
+ devices
1228
+ dispatched
1229
+ }
1230
+ }
1231
+ `),li=Xe(ee.default`
1232
+ mutation ControllerClient_removeDeviceGroup($id: ID!) {
1233
+ removeDeviceGroup(id: $id)
1234
+ }
1235
+ `),ui=Xe(ee.default`
1236
+ mutation ControllerClient_removeWorkspace($id: ID!) {
1237
+ removeWorkspace(id: $id)
1238
+ }
1239
+ `),mi=Xe(ee.default`
1240
+ mutation ControllerClient_createApplication(
1241
+ $workspaceId: ID
1242
+ $name: String
1243
+ $description: String
1244
+ $layoutWidth: Int
1245
+ $layoutHeight: Int
1246
+ $createExampleKey: String
1247
+ ) {
1248
+ createApplication(
1249
+ workspaceId: $workspaceId
1250
+ name: $name
1251
+ description: $description
1252
+ layoutWidth: $layoutWidth
1253
+ layoutHeight: $layoutHeight
1254
+ createExampleKey: $createExampleKey
1255
+ ) {
1256
+ ...applicationArguments
1257
+ }
1258
+ }
1259
+ ${ae}
1260
+ `),_i=Xe(ee.default`
1261
+ mutation ControllerClient_createApplicationWithShareVersion(
1262
+ $workspaceId: ID
1263
+ $name: String
1264
+ $description: String
1265
+ $shareVersionId: ID
1266
+ ) {
1267
+ createApplicationWithShareVersion(
1268
+ workspaceId: $workspaceId
1269
+ name: $name
1270
+ description: $description
1271
+ shareVersionId: $shareVersionId
1272
+ ) {
1273
+ ...applicationArguments
1274
+ }
1275
+ }
1276
+ ${ae}
1277
+ `),gi=Xe(ee.default`
1278
+ mutation ControllerClient_updateApplication(
1279
+ $id: ID!
1280
+ $name: String
1281
+ $description: String
1282
+ $tags: [String]
1283
+ $config: String
1284
+ $runtimeEdit: RuntimeEditInput
1285
+ $canvasControlEdit: CanvasControlEditInput
1286
+ $deviceControlEdit: DeviceControlEditInput
1287
+ $releaseCurrentVersion: String
1288
+ $releaseCurrentVersionNote: String
1289
+ $useReleaseVersion: ID
1290
+ $parentUseThisVersion: Boolean
1291
+ $syncParent: Boolean
1292
+ $newSecrets: [ApplicationSecretInput]
1293
+ $updateSecrets: [ApplicationSecretUpdateInput]
1294
+ $removeSecrets: [ID!]
1295
+ $lock: ApplicationLockInput
1296
+ $aiFilters: [ApplicationAiFilterInput]
1297
+ ) {
1298
+ updateApplication(
1299
+ id: $id
1300
+ name: $name
1301
+ description: $description
1302
+ tags: $tags
1303
+ config: $config
1304
+ runtimeEdit: $runtimeEdit
1305
+ canvasControlEdit: $canvasControlEdit
1306
+ deviceControlEdit: $deviceControlEdit
1307
+ releaseCurrentVersion: $releaseCurrentVersion
1308
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1309
+ useReleaseVersion: $useReleaseVersion
1310
+ parentUseThisVersion: $parentUseThisVersion
1311
+ syncParent: $syncParent
1312
+ newSecrets: $newSecrets
1313
+ updateSecrets: $updateSecrets
1314
+ removeSecrets: $removeSecrets
1315
+ lock: $lock
1316
+ aiFilters: $aiFilters
1317
+ ) {
1318
+ ...applicationArguments
1319
+ }
1320
+ }
1321
+ ${ae}
1322
+ `),fi=Xe(ee.default`
1323
+ mutation ControllerClient_bindApplication(
1324
+ $id: ID!
1325
+ $devices: [ID]
1326
+ $bindDevices: [ID]
1327
+ $unbindDevices: [ID]
1328
+ $deviceFrames: JSON
1329
+ $deviceSettings: [DeviceSettingInput]
1330
+ $forceUnbindDevicesIfNeeded: Boolean
1331
+ ) {
1332
+ bindApplication(
1333
+ id: $id
1334
+ devices: $devices
1335
+ bindDevices: $bindDevices
1336
+ unbindDevices: $unbindDevices
1337
+ deviceFrames: $deviceFrames
1338
+ deviceSettings: $deviceSettings
1339
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1340
+ ) {
1341
+ ...applicationArguments
1342
+ }
1343
+ }
1344
+ ${ae}
1345
+ `),yi=Xe(ee.default`
1346
+ mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
1347
+ toggleShortEditApplication(id: $id, enabled: $enabled)
1348
+ }
1349
+ `),$i=Xe(ee.default`
1350
+ mutation ControllerClient_updateApplicationViewportPreset(
1351
+ $id: ID!
1352
+ $newViewportPresets: [ApplicationViewportPresetInput]
1353
+ $updateViewportPresets: [ApplicationViewportPresetUpdateInput]
1354
+ $removeViewportPresets: [ID!]
1355
+ ) {
1356
+ updateApplicationViewportPreset(
1357
+ id: $id
1358
+ newViewportPresets: $newViewportPresets
1359
+ updateViewportPresets: $updateViewportPresets
1360
+ removeViewportPresets: $removeViewportPresets
1361
+ ) {
1362
+ ...applicationArguments
1363
+ }
1364
+ }
1365
+ ${ae}
1366
+ `),vi=Xe(ee.default`
1367
+ mutation ControllerClient_bindApplicationWithDeviceGroup(
1368
+ $id: ID!
1369
+ $bindDeviceGroup: ApplicationBindDeviceGroupInput
1370
+ $unbindDeviceGroup: ApplicationUnbindDeviceGroupInput
1371
+ $forceUnbindDevicesIfNeeded: Boolean
1372
+ ) {
1373
+ bindApplicationWithDeviceGroup(
1374
+ id: $id
1375
+ bindDeviceGroup: $bindDeviceGroup
1376
+ unbindDeviceGroup: $unbindDeviceGroup
1377
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1378
+ ) {
1379
+ ...applicationArguments
1380
+ }
1381
+ }
1382
+ ${ae}
1383
+ `),hi=Xe(ee.default`
1384
+ mutation ControllerClient_shareApplication(
1385
+ $id: ID!
1386
+ $shareSetting: ApplicationShareSettingInput
1387
+ $favoriteSetting: ApplicationFavoriteSettingInput
1388
+ $previewSetting: ApplicationPreviewSettingInput
1389
+ $releaseVersion: ApplicationReleaseVersionInput
1390
+ $screenshotSetting: ApplicationScreenshotSettingInput
1391
+ ) {
1392
+ shareApplication(
1393
+ id: $id
1394
+ shareSetting: $shareSetting
1395
+ favoriteSetting: $favoriteSetting
1396
+ previewSetting: $previewSetting
1397
+ releaseVersion: $releaseVersion
1398
+ screenshotSetting: $screenshotSetting
1399
+ ) {
1400
+ ...applicationArguments
1401
+ }
1402
+ }
1403
+ ${ae}
1404
+ `),bi=Xe(ee.default`
1405
+ mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
1406
+ moveApplication(id: $id, workspaceId: $workspaceId) {
1407
+ ...applicationArguments
1408
+ }
1409
+ }
1410
+ ${ae}
1411
+ `),Ii=Xe(ee.default`
1412
+ mutation ControllerClient_createDeviceGroupWithApp(
1413
+ $applicationId: ID!
1414
+ $name: String!
1415
+ $description: String
1416
+ $targetDeviceFields: [TargetDeviceField]
1417
+ $presetName: String
1418
+ ) {
1419
+ createDeviceGroupWithApp(
1420
+ applicationId: $applicationId
1421
+ name: $name
1422
+ description: $description
1423
+ targetDeviceFields: $targetDeviceFields
1424
+ presetName: $presetName
1425
+ ) {
1426
+ deviceGroup {
1427
+ _id
1428
+ name
1429
+ description
1430
+ }
1431
+ application {
1432
+ ...applicationArguments
1433
+ }
1434
+ }
1435
+ }
1436
+ ${ae}
1437
+ `),ki=Xe(ee.default`
1438
+ mutation ControllerClient_forkApplication($id: ID!) {
1439
+ forkApplication(id: $id) {
1440
+ ...applicationArguments
1441
+ }
1442
+ }
1443
+ ${ae}
1444
+ `),Di=Xe(ee.default`
1445
+ mutation ControllerClient_duplicateApplication(
1446
+ $id: ID!
1447
+ $includeVersions: Boolean
1448
+ $includeSecrets: Boolean
1449
+ ) {
1450
+ duplicateApplication(
1451
+ id: $id
1452
+ includeVersions: $includeVersions
1453
+ includeSecrets: $includeSecrets
1454
+ ) {
1455
+ ...applicationArguments
1456
+ }
1457
+ }
1458
+ ${ae}
1459
+ `),wi=Xe(ee.default`
1460
+ mutation ControllerClient_removeApplication($id: ID!) {
1461
+ removeApplication(id: $id)
1462
+ }
1463
+ `),Ai=Xe(ee.default`
1464
+ mutation ControllerClient_createModule(
1465
+ $workspaceId: ID
1466
+ $name: String
1467
+ $description: String
1468
+ $exposeProperties: [String]
1469
+ $isAllowModify: Boolean
1470
+ $isPublic: Boolean
1471
+ $layoutWidth: Int
1472
+ $layoutHeight: Int
1473
+ $config: String
1474
+ ) {
1475
+ createModule(
1476
+ workspaceId: $workspaceId
1477
+ name: $name
1478
+ description: $description
1479
+ exposeProperties: $exposeProperties
1480
+ isAllowModify: $isAllowModify
1481
+ isPublic: $isPublic
1482
+ layoutWidth: $layoutWidth
1483
+ layoutHeight: $layoutHeight
1484
+ config: $config
1485
+ ) {
1486
+ ...moduleArguments
1487
+ }
1488
+ }
1489
+ ${re}
1490
+ `),Si=Xe(ee.default`
1491
+ mutation ControllerClient_updateModule(
1492
+ $id: ID!
1493
+ $name: String
1494
+ $description: String
1495
+ $tags: [String]
1496
+ $exposeProperties: [String]
1497
+ $isAllowModify: Boolean
1498
+ $isPublic: Boolean
1499
+ $config: String
1500
+ $useReleaseVersion: ID
1501
+ $releaseCurrentVersion: String
1502
+ $releaseCurrentVersionNote: String
1503
+ ) {
1504
+ updateModule(
1505
+ id: $id
1506
+ name: $name
1507
+ description: $description
1508
+ tags: $tags
1509
+ exposeProperties: $exposeProperties
1510
+ isAllowModify: $isAllowModify
1511
+ isPublic: $isPublic
1512
+ config: $config
1513
+ useReleaseVersion: $useReleaseVersion
1514
+ releaseCurrentVersion: $releaseCurrentVersion
1515
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1516
+ ) {
1517
+ ...moduleArguments
1518
+ }
1519
+ }
1520
+ ${re}
1521
+ `),Ci=Xe(ee.default`
1522
+ mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
1523
+ moveModule(id: $id, workspaceId: $workspaceId) {
1524
+ ...moduleArguments
1525
+ }
1526
+ }
1527
+ ${re}
1528
+ `),Ti=Xe(ee.default`
1529
+ mutation ControllerClient_duplicateModule($id: ID!) {
1530
+ duplicateModule(id: $id) {
1531
+ ...moduleArguments
1532
+ }
1533
+ }
1534
+ ${re}
1535
+ `),xi=Xe(ee.default`
1536
+ mutation ControllerClient_removeModule($id: ID!) {
1537
+ removeModule(id: $id)
1538
+ }
1539
+ `),Ei=Xe(ee.default`
1540
+ mutation ControllerClient_createConfigChangeOperation(
1541
+ $applicationId: ID!
1542
+ $config: JSON!
1543
+ $expires: Int
1544
+ ) {
1545
+ createConfigChangeOperation(applicationId: $applicationId, config: $config, expires: $expires) {
1546
+ ...operationArguments
1547
+ }
1548
+ }
1549
+ ${ce}
1550
+ `),Bi=Xe(ee.default`
1551
+ mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
1552
+ doOperation(id: $id, applicationId: $applicationId)
1553
+ }
1554
+ `),Ui=Xe(ee.default`
1555
+ mutation ControllerClient_updateOperation(
1556
+ $id: ID!
1557
+ $applicationId: ID!
1558
+ $config: JSON!
1559
+ $expires: Int
1560
+ ) {
1561
+ updateOperation(id: $id, applicationId: $applicationId, config: $config, expires: $expires) {
1562
+ ...operationArguments
1563
+ }
1564
+ }
1565
+ ${ce}
1566
+ `),Ri=Xe(ee.default`
1567
+ mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
1568
+ removeOperation(id: $id, applicationId: $applicationId)
1569
+ }
1570
+ `),Mi=Xe(ee.default`
1571
+ mutation ControllerClient_assignGroupPermissions(
1572
+ $roleId: String!
1573
+ $instanceType: String!
1574
+ $instanceId: ID!
1575
+ $permissions: [String]!
1576
+ ) {
1577
+ assignGroupPermissions(
1578
+ roleId: $roleId
1579
+ instanceType: $instanceType
1580
+ instanceId: $instanceId
1581
+ permissions: $permissions
1582
+ )
1583
+ }
1584
+ `),Pi=ee.default`
1585
+ mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
1586
+ registerFCMNotification(workspaceId: $workspaceId, token: $token)
1587
+ }
1588
+ `,Oi=ee.default`
1589
+ mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
1590
+ registerRemoteDebug(deviceId: $deviceId) {
1591
+ deviceId
1592
+ token
1593
+ }
1594
+ }
1595
+ `,Fi=ee.default`
1596
+ mutation ControllerClient_shareAccessToken(
1597
+ $workspaceId: ID
1598
+ $passcode: String!
1599
+ $refreshToken: String!
1600
+ ) {
1601
+ shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
1602
+ }
1603
+ `,Ni=Xe(ee.default`
1604
+ mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1605
+ addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
1606
+ _id
1607
+ instance_type
1608
+ instance {
1609
+ _id
1610
+ name
1611
+ description
1612
+ }
1613
+ last_modify_datetime
1614
+ }
1615
+ }
1616
+ `),qi=Xe(ee.default`
1617
+ mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1618
+ removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
1619
+ }
1620
+ `),Wi=Xe(ee.default`
1621
+ mutation ControllerClient_changeWorkspaceSubscriptionPlan(
1622
+ $workspaceId: ID!
1623
+ $type: String!
1624
+ $period: String!
1625
+ ) {
1626
+ changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
1627
+ }
1628
+ `),ji=Xe(ee.default`
1629
+ mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
1630
+ $workspaceId: ID!
1631
+ $boundDevicesLimit: Float
1632
+ $groupMembersLimit: Float
1633
+ ) {
1634
+ changeWorkspaceAdditionalLimitSpending(
1635
+ workspaceId: $workspaceId
1636
+ boundDevicesLimit: $boundDevicesLimit
1637
+ groupMembersLimit: $groupMembersLimit
1638
+ )
1639
+ }
1640
+ `),Vi=ee.default`
1641
+ mutation ControllerClient_createWorkspaceOTP(
1642
+ $workspaceId: ID!
1643
+ $tokenTypes: [WorkspaceTokenType]!
1644
+ $tokenName: String
1645
+ ) {
1646
+ createWorkspaceOTP(workspaceId: $workspaceId, tokenTypes: $tokenTypes, tokenName: $tokenName) {
1647
+ _id
1648
+ passcode
1649
+ expired_datetime
1650
+ }
1651
+ }
1652
+ `,Yi=ee.default`
1653
+ mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
1654
+ revokeWorkspaceOTP(id: $id)
1655
+ }
1656
+ `;function Ki(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ki=function(){return!!e})()}var Gi=function(e){function i(e,t){var n,a,s,d;return G(this,i),a=this,d=[e,t,"/api/graphql",o,r],s=z(s=i),(n=L(a,Ki()?Reflect.construct(s,d||[],z(a).constructor):s.apply(a,d))).tokenType="user",n}return H(i,e),K(i)}(be),Li=me,zi=te,Hi=ae,Ji=ge,Xi=re,Qi=se,Zi=ye,et=$e,it=ve,tt=ee.default`
1657
+ query Workspace_workspace {
1658
+ workspace {
1659
+ ...mcpWorkspaceArguments
1660
+ }
1661
+ }
1662
+ ${Li}
1663
+ `,nt=ee.default`
1664
+ query Workspace_applications($keyword: String, $paginate: Paginate) {
1665
+ applications(keyword: $keyword, paginate: $paginate) {
1666
+ ...mcpApplicationShortArguments
1667
+ }
1668
+ }
1669
+ ${Ji}
1670
+ `,at=ee.default`
1671
+ query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
1672
+ application(id: $id, composed: $composed, debug: $debug) {
1673
+ ...applicationArguments
1674
+ }
1675
+ }
1676
+ ${Hi}
1677
+ `,ot=ee.default`
1678
+ query Workspace_applicationByDevice(
1679
+ $deviceId: ID!
1680
+ $composeModule: Boolean
1681
+ $bankRemoteConfig: Boolean
1682
+ $debug: Boolean
1683
+ ) {
1684
+ applicationByDevice(
1685
+ deviceId: $deviceId
1686
+ composeModule: $composeModule
1687
+ bankRemoteConfig: $bankRemoteConfig
1688
+ debug: $debug
1689
+ ) {
1690
+ ...applicationArguments
1691
+ }
1692
+ }
1693
+ ${Hi}
1694
+ `,rt=ee.default`
1695
+ query Workspace_modules($keyword: String, $paginate: Paginate) {
1696
+ modules(keyword: $keyword, paginate: $paginate) {
1697
+ ...moduleShortArguments
1698
+ }
1699
+ }
1700
+ ${Qi}
1701
+ `,st=ee.default`
1702
+ query Workspace_module($id: ID!) {
1703
+ module(id: $id) {
1704
+ ...moduleArguments
1705
+ }
1706
+ }
1707
+ ${Xi}
1708
+ `,dt=ee.default`
1709
+ query Workspace_devices($keyword: String, $paginate: Paginate) {
1710
+ devices(keyword: $keyword, paginate: $paginate) {
1711
+ ...deviceArguments
1712
+ }
1713
+ }
1714
+ ${zi}
1715
+ `,ct=ee.default`
1716
+ query Workspace_device($id: ID) {
1717
+ device(id: $id) {
1718
+ ...deviceArguments
1719
+ }
1720
+ }
1721
+ ${zi}
1722
+ `,pt=ee.default`
1723
+ query Workspace_devicesByApplication($id: ID!) {
1724
+ devicesByApplication(id: $id) {
1725
+ ...deviceArguments
1726
+ }
1727
+ }
1728
+ ${zi}
1729
+ `,lt=ee.default`
1730
+ query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1731
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1732
+ _id
1733
+ device_id
1734
+ date
1735
+ uptime {
1736
+ timestamp
1737
+ }
1738
+ memory_usage {
1739
+ values
1740
+ timestamp
1741
+ }
1742
+ disk_usage {
1743
+ values
1744
+ timestamp
1745
+ }
1746
+ }
1747
+ }
1748
+ `,ut=ee.default`
1749
+ query Workspace_mediaWorkspace {
1750
+ mediaWorkspace {
1751
+ ...workspaceMediaWorkspaceArguments
1752
+ }
1753
+ }
1754
+ ${Zi}
1755
+ `,mt=ee.default`
1756
+ query Workspace_mediaBoxes {
1757
+ mediaBoxes {
1758
+ ...workspaceMediaBoxArguments
1759
+ }
1760
+ }
1761
+ ${et}
1762
+ `,_t=ee.default`
1763
+ query Workspace_mediaBox($boxId: ID!) {
1764
+ mediaBox(id: $boxId) {
1765
+ ...workspaceMediaBoxArguments
1766
+ }
1767
+ }
1768
+ ${et}
1769
+ `,gt=ee.default`
1770
+ query Workspace_mediaFiles(
1771
+ $boxId: ID!
1772
+ $includeTypes: [String]
1773
+ $userTags: [String]
1774
+ $limit: Int
1775
+ $offset: Int
1776
+ ) {
1777
+ mediaFiles(
1778
+ boxId: $boxId
1779
+ includeTypes: $includeTypes
1780
+ userTags: $userTags
1781
+ limit: $limit
1782
+ offset: $offset
1783
+ ) {
1784
+ ...workspaceMediaFileArguments
1785
+ }
1786
+ }
1787
+ ${it}
1788
+ `,ft=ee.default`
1789
+ query Workspace_mediaFile($id: ID!) {
1790
+ mediaFile(id: $id) {
1791
+ ...workspaceMediaFileArguments
1792
+ }
1793
+ }
1794
+ ${it}
1795
+ `,yt=ge,$t=re,vt=ee.default`
1796
+ mutation Workspace_createApplication(
1797
+ $name: String
1798
+ $description: String
1799
+ $layoutWidth: Int
1800
+ $layoutHeight: Int
1801
+ ) {
1802
+ createApplication(
1803
+ name: $name
1804
+ description: $description
1805
+ layoutWidth: $layoutWidth
1806
+ layoutHeight: $layoutHeight
1807
+ ) {
1808
+ ...mcpApplicationShortArguments
1809
+ config
1810
+ }
1811
+ }
1812
+ ${yt}
1813
+ `,ht=ee.default`
1814
+ mutation Workspace_updateApplication(
1815
+ $id: ID!
1816
+ $config: String
1817
+ $name: String
1818
+ $description: String
1819
+ $validateConfig: Boolean
1820
+ ) {
1821
+ updateApplication(
1822
+ id: $id
1823
+ config: $config
1824
+ name: $name
1825
+ description: $description
1826
+ validateConfig: $validateConfig
1827
+ ) {
1828
+ ...mcpApplicationShortArguments
1829
+ config
1830
+ has_unreleased_changes
1831
+ }
1832
+ }
1833
+ ${yt}
1834
+ `,bt=ee.default`
1835
+ mutation Workspace_bindApplication($id: ID!, $bindDevices: [ID], $deviceFrames: JSON) {
1836
+ bindApplication(id: $id, bindDevices: $bindDevices, deviceFrames: $deviceFrames) {
1837
+ _id
1838
+ devices {
1839
+ device_id
1840
+ status
1841
+ frame
1842
+ }
1843
+ }
1844
+ }
1845
+ `,It=ee.default`
1846
+ mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
1847
+ bindApplication(id: $id, unbindDevices: $unbindDevices) {
1848
+ _id
1849
+ devices {
1850
+ device_id
1851
+ status
1852
+ frame
1853
+ }
1854
+ }
1855
+ }
1856
+ `,kt=ee.default`
1857
+ mutation Workspace_createModule(
1858
+ $name: String
1859
+ $description: String
1860
+ $exposeProperties: [String]
1861
+ $isAllowModify: Boolean
1862
+ $isPublic: Boolean
1863
+ $layoutWidth: Int
1864
+ $layoutHeight: Int
1865
+ ) {
1866
+ createModule(
1867
+ name: $name
1868
+ description: $description
1869
+ exposeProperties: $exposeProperties
1870
+ isAllowModify: $isAllowModify
1871
+ isPublic: $isPublic
1872
+ layoutWidth: $layoutWidth
1873
+ layoutHeight: $layoutHeight
1874
+ ) {
1875
+ ...moduleArguments
1876
+ }
1877
+ }
1878
+ ${$t}
1879
+ `,Dt=ee.default`
1880
+ mutation Workspace_updateModule(
1881
+ $id: ID!
1882
+ $config: String
1883
+ $name: String
1884
+ $description: String
1885
+ $validateConfig: Boolean
1886
+ ) {
1887
+ updateModule(
1888
+ id: $id
1889
+ config: $config
1890
+ name: $name
1891
+ description: $description
1892
+ validateConfig: $validateConfig
1893
+ ) {
1894
+ ...moduleArguments
1895
+ }
1896
+ }
1897
+ ${$t}
1898
+ `,wt=ee.default`
1899
+ mutation Workspace_createMediaFileUploadRequest(
1900
+ $name: String!
1901
+ $description: String!
1902
+ $boxId: ID!
1903
+ $fileType: String!
1904
+ $contentType: String!
1905
+ $userTags: [String]
1906
+ $meta: RequestUploadMetaInput!
1907
+ ) {
1908
+ createMediaFileUploadRequest(
1909
+ name: $name
1910
+ description: $description
1911
+ boxId: $boxId
1912
+ fileType: $fileType
1913
+ contentType: $contentType
1914
+ userTags: $userTags
1915
+ meta: $meta
1916
+ ) {
1917
+ id
1918
+ name
1919
+ description
1920
+ boxId
1921
+ fileType
1922
+ contentType
1923
+ userTags
1924
+ meta {
1925
+ uploadInfo
1926
+ }
1927
+ }
1928
+ }
1929
+ `,At=ee.default`
1930
+ mutation Workspace_updateMediaFile(
1931
+ $id: ID!
1932
+ $name: String
1933
+ $description: String
1934
+ $userTags: [String]
1935
+ $requestUploadAgain: Boolean!
1936
+ ) {
1937
+ updateMediaFile(
1938
+ id: $id
1939
+ name: $name
1940
+ description: $description
1941
+ userTags: $userTags
1942
+ requestUploadAgain: $requestUploadAgain
1943
+ ) {
1944
+ id
1945
+ name
1946
+ description
1947
+ userTags
1948
+ updatedAt
1949
+ }
1950
+ }
1951
+ `,St=ee.default`
1952
+ mutation Workspace_updateMediaFiles(
1953
+ $fileIds: [ID!]!
1954
+ $name: String
1955
+ $description: String
1956
+ $userTags: [String]
1957
+ ) {
1958
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
1959
+ }
1960
+ `,Ct=ee.default`
1961
+ mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
1962
+ setMediaFileAsBoxPreview(id: $id)
1963
+ }
1964
+ `,Tt=ee.default`
1965
+ mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
1966
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
1967
+ }
1968
+ `,xt=ee.default`
1969
+ mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
1970
+ deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
1971
+ }
1972
+ `,Et=ee.default`
1973
+ mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
1974
+ deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
1975
+ }
1976
+ `;function Bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Bt=function(){return!!e})()}var Ut=function(e){function i(e,t){var n,a,o,r;return G(this,i),a=this,r=[e,t,"/api/graphql-workspace",s,d],o=z(o=i),(n=L(a,Bt()?Reflect.construct(o,r||[],z(a).constructor):o.apply(a,r))).tokenType="workspace",n}return H(i,e),K(i)}(be),Rt=t(19074),Mt=t(36054),Pt=t(5010),Ot=t(70807),Ft=t(42028),Nt=t(35928),qt=t(79556),Wt=t(17681),jt=t.n(Wt),Vt=t(52067);const Yt=403,Kt=429;const Gt=ee.default`
1977
+ fragment mediaWorkspaceArguments on MediaWorkspace {
1978
+ __typename
1979
+ id
1980
+ name
1981
+ description
1982
+ owner
1983
+ serviceBinding
1984
+ createdAt
1985
+ updatedAt
1986
+ size
1987
+ sizeLimit
1988
+ aiFeaturesEnabled
1989
+ }
1990
+ `,Lt=ee.default`
1991
+ fragment boxArguments on MediaBox {
1992
+ __typename
1993
+ id
1994
+ name
1995
+ description
1996
+ tags
1997
+ owner
1998
+ workspaceId
1999
+ serviceBinding
2000
+ serviceBindingType
2001
+ passcodes {
2002
+ id
2003
+ name
2004
+ code
2005
+ enableExpired
2006
+ expiredAt
2007
+ removeable
2008
+ permissions
2009
+ }
2010
+ createdAt
2011
+ updatedAt
2012
+ previewUrl
2013
+ size
2014
+ }
2015
+ `,zt=ee.default`
2016
+ fragment fileArguments on MediaFile {
2017
+ __typename
2018
+ id
2019
+ name
2020
+ description
2021
+ boxId
2022
+ owner
2023
+ userTags
2024
+ fileType
2025
+ meta {
2026
+ storageEndpoint
2027
+ originalFileUploaded
2028
+ originalFileKey
2029
+ originalFileSize
2030
+ originalFileEtag
2031
+ originalFileContentType
2032
+ originalWidth
2033
+ originalHeight
2034
+ convertedFileUploaded
2035
+ convertedFileKey
2036
+ convertedFileSize
2037
+ convertedFileEtag
2038
+ convertedFileContentType
2039
+ videoThumbOriginalFileUploaded
2040
+ videoThumbOriginalFileKey
2041
+ videoThumbOriginalFileSize
2042
+ videoThumbOriginalFileEtag
2043
+ videoThumbOriginalFileContentType
2044
+ videoThumbOriginalWidth
2045
+ videoThumbOriginalHeight
2046
+ uploadInfo
2047
+ imageVersions {
2048
+ key
2049
+ version
2050
+ etag
2051
+ contentType
2052
+ width
2053
+ height
2054
+ strategy
2055
+ }
2056
+ videoTransformed
2057
+ videoTransformedByClient
2058
+ videoTransformType
2059
+ customVideoWidth
2060
+ customVideoHeight
2061
+
2062
+ enableAiAnalysis
2063
+ aiCustomInstruction
2064
+ aiDescription
2065
+ aiTags
2066
+ aiAnalysisStatus
2067
+ aiAnalyzedAt
2068
+ }
2069
+ createdAt
2070
+ updatedAt
2071
+ }
2072
+ `,Ht=ee.default`
2073
+ fragment fileShortArguments on MediaFile {
2074
+ __typename
2075
+ id
2076
+ name
2077
+ description
2078
+ boxId
2079
+ owner
2080
+ userTags
2081
+ fileType
2082
+ meta {
2083
+ storageEndpoint
2084
+ originalFileKey
2085
+ originalFileSize
2086
+ originalFileContentType
2087
+ originalFileEtag
2088
+ originalWidth
2089
+ originalHeight
2090
+ convertedFileKey
2091
+ convertedFileSize
2092
+ convertedFileContentType
2093
+ convertedFileEtag
2094
+ videoThumbOriginalFileKey
2095
+ videoThumbOriginalFileSize
2096
+ videoThumbOriginalFileContentType
2097
+ videoThumbOriginalFileEtag
2098
+ videoThumbOriginalWidth
2099
+ videoThumbOriginalHeight
2100
+ imageVersions {
2101
+ key
2102
+ version
2103
+ etag
2104
+ size
2105
+ contentType
2106
+ width
2107
+ height
2108
+ strategy
2109
+ }
2110
+ enableAiAnalysis
2111
+ aiCustomInstruction
2112
+ aiDescription
2113
+ aiTags
2114
+ aiAnalysisStatus
2115
+ aiAnalyzedAt
2116
+ }
2117
+ createdAt
2118
+ updatedAt
2119
+ }
2120
+ `,Jt=e=>{const i=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){const p=n&&a,l={};o&&(l.origin=o),p||(l.authorization=`Bearer ${t}`);const u=new Ot.z({uri:e,headers:l});let m,_,g,f;const y=()=>{f&&(clearTimeout(f),f=void 0)};r&&(m=(0,Nt.UU)({url:i,lazy:!0,connectionParams:l,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{y(),d?.(e)},opened:e=>{d?.(),g=e,y()},ping:e=>{e||(y(),f=setTimeout(()=>{g&&g.readyState===WebSocket.OPEN&&g.close(4205,"Client Restart")},5e3))},pong:e=>{e&&y()},closed:()=>{y()}}}),_=new Ft.c(m));const $=Rt.C.from([(0,qt.S)(({networkError:e,operation:i})=>{if(e){c(e,i);const t=e?.message||"";if("Aborted"===t||"AbortError"===e?.name||t.includes("Too many requests")||e?.response?.status===Kt||e?.statusCode===Kt||e?.status===Kt||"Timeout exceeded"===t||e?.timeout||e?.statusCode===Yt||e?.status===Yt)return new Mt.c(e=>e.complete())}}),s&&new Pt.z({attempts:{max:3,retryIf:e=>{const i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!!e&&!i.includes("Too many requests")&&e?.response?.status!==Kt&&e?.statusCode!==Kt&&e?.status!==Kt&&e?.statusCode!==Yt&&e?.status!==Yt&&!e?.timeout&&"Timeout exceeded"!==i&&"Aborted"!==i&&"AbortError"!==e?.name}}}),new(jt())(3e4),r?Rt.C.split(({query:e})=>{const{kind:i,operation:t}=(0,Vt.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},_,u):u].filter(Boolean));return $.closeSubscriptionClient=()=>r&&m.dispose(),$}(e),t=new Q.D,n=new X.R({link:i,cache:t,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return n.close=()=>i.closeSubscriptionClient(),n},Xt=ee.default`
2121
+ query MediaClient_workspaces {
2122
+ mediaWorkspaces {
2123
+ ...mediaWorkspaceArguments
2124
+ }
2125
+ }
2126
+ ${Gt}
2127
+ `,Qt=ee.default`
2128
+ query MediaClient_boxes($workspaceId: UUID, $filter: String) {
2129
+ mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
2130
+ ...boxArguments
2131
+ }
2132
+ }
2133
+ ${Lt}
2134
+ `,Zt=ee.default`
2135
+ query MediaClient_workspace($workspaceId: UUID!) {
2136
+ mediaWorkspace(id: $workspaceId) {
2137
+ ...mediaWorkspaceArguments
2138
+ }
2139
+ }
2140
+ ${Gt}
2141
+ `,en=ee.default`
2142
+ query MediaClient_box($boxId: UUID!) {
2143
+ mediaBox(boxId: $boxId) {
2144
+ ...boxArguments
2145
+ }
2146
+ }
2147
+ ${Lt}
2148
+ `,tn=ee.default`
2149
+ query MediaClient_files(
2150
+ $boxId: UUID!
2151
+ $includeTypes: [FileType!]
2152
+ $userTags: [String!]
2153
+ $limit: Int
2154
+ $offset: Int
2155
+ ) {
2156
+ mediaFiles(
2157
+ boxId: $boxId
2158
+ includeTypes: $includeTypes
2159
+ userTags: $userTags
2160
+ limit: $limit
2161
+ offset: $offset
2162
+ ) {
2163
+ ...fileShortArguments
2164
+ }
2165
+ }
2166
+ ${Ht}
2167
+ `,nn=ee.default`
2168
+ query MediaClient_file($fileId: UUID!) {
2169
+ mediaFile(fileId: $fileId) {
2170
+ ...fileArguments
2171
+ }
2172
+ }
2173
+ ${zt}
2174
+ `,an=ee.default`
2175
+ mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
2176
+ createMediaWorkspace(name: $name, description: $description) {
2177
+ ...mediaWorkspaceArguments
2178
+ }
2179
+ }
2180
+ ${Gt}
2181
+ `,on=ee.default`
2182
+ mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
2183
+ updateMediaWorkspace(id: $id, name: $name, description: $description) {
2184
+ ...mediaWorkspaceArguments
2185
+ }
2186
+ }
2187
+ ${Gt}
2188
+ `,rn=ee.default`
2189
+ mutation MediaClient_createMediaBox(
2190
+ $name: String!
2191
+ $description: String!
2192
+ $newPasscodes: [InputNewBoxPasscode!]!
2193
+ $workspaceId: UUID
2194
+ $tags: [String!]
2195
+ ) {
2196
+ createMediaBox(
2197
+ name: $name
2198
+ description: $description
2199
+ newPasscodes: $newPasscodes
2200
+ workspaceId: $workspaceId
2201
+ tags: $tags
2202
+ ) {
2203
+ ...boxArguments
2204
+ }
2205
+ }
2206
+ ${Lt}
2207
+ `,sn=ee.default`
2208
+ mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
2209
+ moveMediaBox(id: $id, workspaceId: $workspaceId) {
2210
+ ...boxArguments
2211
+ }
2212
+ }
2213
+ ${Lt}
2214
+ `,dn=ee.default`
2215
+ mutation MediaClient_updateMediaBox(
2216
+ $id: UUID!
2217
+ $name: String
2218
+ $description: String
2219
+ $newPasscodes: [InputNewBoxPasscode!]
2220
+ $removePasscodes: [UUID!]
2221
+ $tags: [String!]
2222
+ ) {
2223
+ updateMediaBox(
2224
+ id: $id
2225
+ name: $name
2226
+ description: $description
2227
+ newPasscodes: $newPasscodes
2228
+ removePasscodes: $removePasscodes
2229
+ tags: $tags
2230
+ ) {
2231
+ ...boxArguments
2232
+ }
2233
+ }
2234
+ ${Lt}
2235
+ `,cn=ee.default`
2236
+ mutation MediaClient_requestFileUpload(
2237
+ $name: String!
2238
+ $description: String!
2239
+ $boxId: UUID!
2240
+ $fileType: FileType!
2241
+ $contentType: String!
2242
+ $userTags: [String!]
2243
+ $meta: RequestUploadMeta!
2244
+ ) {
2245
+ requestFileUpload(
2246
+ name: $name
2247
+ description: $description
2248
+ boxId: $boxId
2249
+ fileType: $fileType
2250
+ contentType: $contentType
2251
+ userTags: $userTags
2252
+ meta: $meta
2253
+ ) {
2254
+ ...fileArguments
2255
+ }
2256
+ }
2257
+ ${zt}
2258
+ `,pn=ee.default`
2259
+ mutation MediaClient_updateMediaFile(
2260
+ $fileId: UUID!
2261
+ $name: String!
2262
+ $description: String!
2263
+ $userTags: [String!]
2264
+ $requestUploadAgain: Boolean!
2265
+ ) {
2266
+ updateMediaFile(
2267
+ fileId: $fileId
2268
+ name: $name
2269
+ description: $description
2270
+ userTags: $userTags
2271
+ requestUploadAgain: $requestUploadAgain
2272
+ ) {
2273
+ ...fileArguments
2274
+ }
2275
+ }
2276
+ ${zt}
2277
+ `,ln=ee.default`
2278
+ mutation MediaClient_updateMediaFiles(
2279
+ $fileIds: [UUID!]!
2280
+ $name: String
2281
+ $description: String
2282
+ $userTags: [String!]
2283
+ ) {
2284
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2285
+ }
2286
+ `,un=ee.default`
2287
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
2288
+ deleteMediaFiles(boxId: $boxId, list: $list)
2289
+ }
2290
+ `,mn=ee.default`
2291
+ mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
2292
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
2293
+ }
2294
+ `,_n=ee.default`
2295
+ mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
2296
+ setMediaFileAsBoxPreview(id: $id)
2297
+ }
2298
+ `,gn=ee.default`
2299
+ mutation MediaClient_assignGroupPermissions(
2300
+ $roleId: String!
2301
+ $instanceType: InstanceType!
2302
+ $instanceId: UUID!
2303
+ $permissions: [String!]!
2304
+ ) {
2305
+ assignGroupPermissions(
2306
+ roleId: $roleId
2307
+ instanceType: $instanceType
2308
+ instanceId: $instanceId
2309
+ permissions: $permissions
2310
+ )
2311
+ }
2312
+ `,fn=ee.default`
2313
+ subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
2314
+ mediaBoxChanged(boxId: $boxId, types: $types) {
2315
+ createType
2316
+ id
2317
+ file {
2318
+ ...fileArguments
2319
+ }
2320
+ boxPayload {
2321
+ fileList
2322
+ includeTypes
2323
+ }
2324
+ }
2325
+ }
2326
+ ${zt}
2327
+ `,yn=ee.default`
2328
+ query MediaClient_box($boxId: UUID!, $passcode: String!) {
2329
+ mediaBox(boxId: $boxId, passcode: $passcode) {
2330
+ ...boxArguments
2331
+ }
2332
+ }
2333
+ ${Lt}
2334
+ `,$n=ee.default`
2335
+ query MediaClient_files(
2336
+ $boxId: UUID!
2337
+ $passcode: String!
2338
+ $includeTypes: [FileType!]
2339
+ $userTags: [String!]
2340
+ $limit: Int
2341
+ $offset: Int
2342
+ ) {
2343
+ mediaFiles(
2344
+ boxId: $boxId
2345
+ passcode: $passcode
2346
+ includeTypes: $includeTypes
2347
+ userTags: $userTags
2348
+ limit: $limit
2349
+ offset: $offset
2350
+ ) {
2351
+ ...fileShortArguments
2352
+ }
2353
+ }
2354
+ ${Ht}
2355
+ `,vn=ee.default`
2356
+ query MediaClient_file($fileId: UUID!, $passcode: String!) {
2357
+ mediaFile(fileId: $fileId, passcode: $passcode) {
2358
+ ...fileArguments
2359
+ }
2360
+ }
2361
+ ${zt}
2362
+ `,hn=ee.default`
2363
+ mutation MediaClient_requestFileUpload(
2364
+ $name: String!
2365
+ $description: String!
2366
+ $boxId: UUID!
2367
+ $passcode: String!
2368
+ $fileType: FileType!
2369
+ $contentType: String!
2370
+ $userTags: [String!]
2371
+ $meta: RequestUploadMeta!
2372
+ ) {
2373
+ requestFileUpload(
2374
+ name: $name
2375
+ description: $description
2376
+ boxId: $boxId
2377
+ passcode: $passcode
2378
+ fileType: $fileType
2379
+ contentType: $contentType
2380
+ userTags: $userTags
2381
+ meta: $meta
2382
+ ) {
2383
+ ...fileArguments
2384
+ }
2385
+ }
2386
+ ${zt}
2387
+ `,bn=ee.default`
2388
+ mutation MediaClient_updateMediaFile(
2389
+ $boxId: UUID!
2390
+ $passcode: String!
2391
+ $fileId: UUID!
2392
+ $name: String
2393
+ $description: String
2394
+ $userTags: [String!]
2395
+ $requestUploadAgain: Boolean!
2396
+ ) {
2397
+ updateMediaFile(
2398
+ boxId: $boxId
2399
+ passcode: $passcode
2400
+ fileId: $fileId
2401
+ name: $name
2402
+ description: $description
2403
+ userTags: $userTags
2404
+ requestUploadAgain: $requestUploadAgain
2405
+ ) {
2406
+ ...fileArguments
2407
+ }
2408
+ }
2409
+ ${zt}
2410
+ `,In=ee.default`
2411
+ mutation MediaClient_updateMediaFiles(
2412
+ $boxId: UUID!
2413
+ $passcode: String!
2414
+ $fileIds: [UUID!]!
2415
+ $name: String
2416
+ $description: String
2417
+ $userTags: [String!]
2418
+ ) {
2419
+ updateMediaFiles(
2420
+ boxId: $boxId
2421
+ passcode: $passcode
2422
+ fileIds: $fileIds
2423
+ name: $name
2424
+ description: $description
2425
+ userTags: $userTags
2426
+ )
2427
+ }
2428
+ `,kn=ee.default`
2429
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
2430
+ deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
2431
+ }
2432
+ `,Dn=ee.default`
2433
+ subscription MediaClient_listenBoxChanged(
2434
+ $boxId: UUID!
2435
+ $passcode: String!
2436
+ $types: [ChangeType!]
2437
+ ) {
2438
+ mediaBoxChanged(boxId: $boxId, passcode: $passcode, types: $types) {
2439
+ createType
2440
+ id
2441
+ file {
2442
+ ...fileArguments
2443
+ }
2444
+ boxPayload {
2445
+ fileList
2446
+ includeTypes
2447
+ }
2448
+ }
2449
+ }
2450
+ ${zt}
2451
+ `,wn={query:"query",mutation:"mutate"},An=(e,i,t)=>([n,a])=>{if(e[n])throw new Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d;const 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{const t=await e[wn[i]](c);({data:s,errors:d}=t||{})}if(d)throw new Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},Sn=e=>({data:i,errors:t})=>{const n=((e,i)=>e?.length?new Error(e.map(e=>e.message).join("\n")):i?new Error(i):null)(t,!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload");return n?e(n):e(null,i.mediaBoxChanged)},Cn=(e={})=>{const i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{const d=t&&n;let c=`${e}/api/graphql`;return d&&(c=`${e}/api/graphql_with_passcode`),Jt({endpointURL:c,subscriptionEndpointURL:c.replace("http:","ws:"),accessToken:i,enableSubscription:!d&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s})})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=l,i.mutations=u;const t={boxId:e.boxId,passcode:e.passcode};Object.entries(l).forEach(An(i,"query",t)),Object.entries(u).forEach(An(i,"mutation",t)),i.listenBoxChanged=(e,n)=>{const a=i.subscribe({query:Dn,variables:{...t,...e}}).subscribe({next:Sn(n),error(e){n(e)}});return a}}else i.accessToken=e.accessToken,i.type="token",i.queries=c,i.mutations=p,Object.entries(c).forEach(An(i,"query")),Object.entries(p).forEach(An(i,"mutation")),i.listenBoxChanged=(e,t)=>{const n=i.subscribe({query:fn,variables:e}).subscribe({next:Sn(t),error(e){t(e)}});return n};return i};var Tn,xn,En,Bn,Un=K(function e(i,t){G(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(Bn=m(function*(e,i){var t=yield(0,A.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 new Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw new Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return Bn.apply(this,arguments)})},{key:"events",value:(En=m(function*(e){return(yield this.graphql("\n query AL_events($filter: EventsFilter!) {\n events(filter: $filter) {\n device_id\n event_type\n event_name\n subspace_id\n sender\n payload\n timestamp\n }\n }\n",{filter:e})).events}),function(e){return En.apply(this,arguments)})},{key:"screenshots",value:(xn=m(function*(e){return(yield this.graphql("\n query AL_screenshots($filter: ScreenshotFilter!) {\n screenshots(filter: $filter) {\n timestamp\n }\n }\n",{filter:e})).screenshots}),function(e){return xn.apply(this,arguments)})},{key:"downloadScreenshot",value:(Tn=m(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,A.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw new Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from(yield a.arrayBuffer())}),function(e,i,t){return Tn.apply(this,arguments)})}]);function Rn(e,i,t){switch(t){case"user":return new Gi(e,i);case"workspace":return new Ut(e,i);default:throw new Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var Mn="bricks-mcp",Pn={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"},On=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,t(1639));const Fn=({type:e,title:i,template_key:t})=>{var n,a,o=(0,On.makeId)(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=F(O.canvas);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,On.makeId)("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=F(O.components.Basic),d=F(O.brickMapping[t]);if(!d)throw new 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 p=F(O.generatorMapping[t]);if(!p)throw new Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(p.propTypes).map(([e,i])=>[e,{...i,description:p.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(p.eventTypes).map(([e])=>[e,{description:p.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(p.outletTypes).map(([e])=>[e,{description:p.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(O.propertyBank.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 l=(0,On.makeId)("property_bank_command"),u=(0,On.makeId)("property_bank_command"),m=(0,On.makeId)("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> | ${l}`,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> | ${l}`,port:"obj | inputs"}]}},[l]:{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:l,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:l,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 D({id:o,example:n,extraInfo:a})};function Nn(e,i){var t,n,a,o,r,s,d,c,p,l,u,_,g,f,y,$,v,h,I,C,T,x,E,B,U,R,P,O,F="user"===i.tokenType,N=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{Y(i,o)&&e.tool(t,n,a,r)})(e,i),q=e=>({...e,...F?{workspace_id:b.Yj().describe("Workspace ID")}:{}}),W=i.client,j=F?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw new Error("Media API endpoint is required");if(!t)throw new Error("Access token is required");return Cn({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:Pn.media,accessToken:i.token}):W;if(F&&e.tool("list_workspaces","List all workspaces",{},m(function*(){return D(yield W.workspaces())})),N({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:q({}),permission:"info"},(t=m(function*({workspace_id:e}){var i=yield Promise.all([W.workspace({id:e}),W.applications({workspaceId:e,paginate:{limit:50,offset:0}}),W.modules({workspaceId:e,paginate:{limit:50,offset:0}}),W.devices({workspaceId:e,paginate:{limit:50,offset:0}}),F?j.mediaWorkspace({workspaceId:e}).catch(()=>null):j.mediaWorkspace().catch(()=>null),F?j.mediaBoxes({workspaceId:e}).catch(()=>[]):j.mediaBoxes().catch(()=>[])]),t=w(i,6),n=t[0],a=t[1],o=t[2],r=t[3],s=t[4],d=t[5];if(!n)throw new Error("Authentication failed, please check your token");return D({workspace:n,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:d?.length??"No permission",media_enabled:!!s,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:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:d?.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 t.apply(this,arguments)})),N({name:"get_applications",description:"List all applications in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of applications to return").optional().default(50),offset:b.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(n=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.applications({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return n.apply(this,arguments)})),N({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:q({id:b.Yj().describe("Application ID")}),permission:"query_application"},(a=m(function*({workspace_id:e,id:i}){return D(yield W.application({workspaceId:e,id:i}))}),function(e){return a.apply(this,arguments)})),N({name:"get_modules",description:"List all modules in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of modules to return").optional().default(50),offset:b.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(o=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.modules({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return o.apply(this,arguments)})),N({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:q({id:b.Yj().describe("Module ID")}),permission:"query_module"},(r=m(function*({workspace_id:e,id:i}){return D(yield W.module({workspaceId:e,id:i}))}),function(e){return r.apply(this,arguments)})),N({name:"update_module_info",description:"Update a specific module info",inputSchema:q({id:b.Yj().describe("Module ID"),name:b.Yj().describe("Module name"),description:b.Yj().describe("Module description")}),permission:"update_module"},(s=m(function*({workspace_id:e,id:i,name:t,description:n}){return D(yield W.updateModule({workspaceId:e,id:i,name:t,description:n}))}),function(e){return s.apply(this,arguments)})),N({name:"update_module_config",description:"Update a specific module configuration",inputSchema:q({id:b.Yj().describe("Module ID"),config:b.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(d=m(function*({workspace_id:e,id:i,config:t}){var n=yield M(t);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return D(yield W.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0}))}),function(e){return d.apply(this,arguments)})),N({name:"get_devices",description:"List all devices in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of devices to return").optional().default(50),offset:b.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(c=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.devices({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return c.apply(this,arguments)})),N({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:q({name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description").optional(),grid_width:b.ai().describe("Grid width in units").optional().default(96),grid_height:b.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(p=m(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return D(yield W.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a}))}),function(e){return p.apply(this,arguments)})),N({name:"update_application_info",description:"Update application info",inputSchema:{id:b.Yj().describe("Application ID"),name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description")},permission:"update_application"},(l=m(function*({id:e,name:i,description:t}){return D(yield W.updateApplication({id:e,name:i,description:t}))}),function(e){return l.apply(this,arguments)})),N({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:b.Yj().describe("Application ID"),config:b.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(u=m(function*({id:e,config:i}){var t=yield M(i);if(!t.valid)throw new Error(`Config validation failed: ${t.errors.join(", ")}`);return D(yield W.updateApplication({id:e,config:JSON.stringify(i)}))}),function(e){return u.apply(this,arguments)})),N({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:b.Yj().describe("Application ID"),viewports:b.YO(b.Ik({device_id:b.Yj().describe("Device ID"),x:b.ai().describe("X coordinate"),y:b.ai().describe("Y coordinate"),width:b.ai().describe("Width"),height:b.ai().describe("Height"),rotate:b.ai().describe("Rotation"),rotateType:b.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(_=m(function*({app_id:e,viewports:i}){return D(yield W.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 _.apply(this,arguments)})),N({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:b.Yj().describe("Application ID"),device_id:b.Yj().describe("Device ID")},permission:"bind_application"},(g=m(function*({app_id:e,device_id:i}){return D(yield W.bindApplication({id:e,unbindDevices:[i]}))}),function(e){return g.apply(this,arguments)})),F&&N({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},m(function*(){return D(yield j.mediaWorkspaces())})),N({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:q({}),permission:"query_media_flow"},(f=m(function*({workspace_id:e}){return D(yield j.mediaWorkspace({workspaceId:e}))}),function(e){return f.apply(this,arguments)})),N({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:q({}),permission:"query_media_flow"},(y=m(function*({workspace_id:e}){return D(yield j.mediaBoxes({workspaceId:e}))}),function(e){return y.apply(this,arguments)})),N({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:b.Yj().describe("Media box ID")},permission:"query_media_flow"},($=m(function*({box_id:e}){return D(yield j.mediaBox({boxId:e}))}),function(e){return $.apply(this,arguments)})),N({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:b.YO(b.Yj()).optional().describe("Filter by user tags"),limit:b.ai().optional().default(50).describe("Maximum number of files to return"),offset:b.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(v=m(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return D(yield j.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a}))}),function(e){return v.apply(this,arguments)})),N({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:b.Yj().describe("Media file ID")},permission:"query_media_flow"},(h=m(function*({file_id:e}){return D(yield j.mediaFile({fileId:e}))}),function(e){return h.apply(this,arguments)})),N({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:b.Yj().describe("Target media box ID"),name:b.Yj().describe("File name"),description:b.Yj().optional().default("").describe("File description"),file_type:b.k5(["image","video","audio","file"]).describe("File type"),source_url:b.Yj().optional().describe("URL to download the file from"),base64_data:b.Yj().optional().describe("Base64 encoded file data"),user_tags:b.YO(b.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(I=m(function*({box_id:e,name:i,description:t,source_url:n,base64_data:a,file_type:o,user_tags:r}){if(!n&&!a)throw new Error("Either source_url or base64_data must be provided");if(n&&a)throw new Error("Provide either source_url OR base64_data, not both");var s=n?null:"application/octet-stream",d=n?yield(0,A.Ay)(n,{agent:(0,S.fJ)(n)}).then(e=>(s=e.headers.get("content-type"),e.blob())):new Blob([k.Buffer.from(a,"base64")],{type:s}),c=yield j.requestFileUpload({name:i,description:t,boxId:e,fileType:F?o.toUpperCase():o,contentType:s,userTags:r,meta:{}}),p=JSON.parse(c?.meta.uploadInfo),l=new FormData;l.append("file",d),l.append("Content-Type",s),l.append("AWSAccessKeyId",p.AWSAccessKeyId),l.append("Signature",p.Signature),l.append("Policy",p.Policy),l.append("acl",p.acl),l.append("key",p.key);var u=yield(0,A.Ay)(p.url,{method:"POST",body:l}).then(e=>e.ok).catch(()=>!1);return D({file_id:c.id,upload_success:u,upload_info:{content_type:s,file_type:o,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return I.apply(this,arguments)})),N({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:b.Yj().describe("Media file ID"),name:b.Yj().optional().describe("New file name"),description:b.Yj().optional().describe("New file description"),user_tags:b.YO(b.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(C=m(function*({file_id:e,name:i,description:t,user_tags:n}){return D(yield j.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1}))}),function(e){return C.apply(this,arguments)})),N({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:b.Yj().describe("Source media box ID"),to_box_id:b.Yj().describe("Target media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(T=m(function*({from_box_id:e,to_box_id:i,file_ids:t}){return D(yield j.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t}))}),function(e){return T.apply(this,arguments)})),N({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:b.Yj().describe("Media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(x=m(function*({box_id:e,file_ids:i}){return D(yield j.deleteMediaFiles({boxId:e,list:i}))}),function(e){return x.apply(this,arguments)})),N({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(E=m(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in j)return D(yield j.deleteMediaBoxFiles({boxId:e,includeTypes:i}));var t=yield j.mediaFiles({boxId:e,includeTypes:i});return D(yield j.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)}))}),function(e){return E.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:b.ai().describe("Device width in pixels"),device_height:b.ai().describe("Device height in pixels"),app_grid_width:b.ai().describe("Application grid width").optional().default(96),app_grid_height:b.ai().describe("Application grid height").optional().default(54)},(B=m(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o,r={deviceBrickWidth:(a=e)/(o=a/t),deviceBrickHeight:i/o,deviceBrickUnit:o},s=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 D({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:r.deviceBrickUnit.toFixed(2),total_pixels:{width:r.deviceBrickWidth.toFixed(2),height:r.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:s.deviceBrickWidth,height:s.deviceBrickHeight,unit_size_px:s.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return B.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:b.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:b.Yj().describe("Item title"),template_key:b.Yj().optional().describe("Template key for brick or generator")},Fn),e.tool("getting_started","Get documentation content for getting started",{},m(function*(){return D(V)})),!F){var K=()=>{return e=Pn.activityLog,t=i.token,new Un(e,t);var e,t};N({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:q({start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)"),device_id:b.Yj().optional().describe("Filter by device ID"),event_type:b.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:b.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:b.Yj().optional().describe("Filter by subspace ID"),sender:b.Yj().optional().describe("Filter by sender"),limit:b.ai().optional().default(50).describe("Max events to return")}),permission:"query_activity_log"},(P=m(function*({start_time:e,end_time:i,device_id:t,event_type:n,event_name:a,subspace_id:o,sender:r,limit:s}){var d=K(),c={start_time:e,end_time:i};t&&(c.device_id=t),n&&(c.event_type=n),a&&(c.event_name=a),o&&(c.subspace_id=o),r&&(c.sender=r);var p=yield d.events(c);return D(p.slice(0,s||50))}),function(e){return P.apply(this,arguments)})),N({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:q({device_id:b.Yj().describe("Device ID (required)"),start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(R=m(function*({device_id:e,start_time:i,end_time:t}){var n=K(),a=yield n.screenshots({device_id:e,start_time:i,end_time:t});return D(a)}),function(e){return R.apply(this,arguments)})),N({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:q({device_id:b.Yj().describe("Device ID"),ts:b.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(U=m(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw new Error("Could not determine workspace ID");var o=K(),r=/^\d+$/.test(n)?n:new Date(n).getTime(),s=yield o.downloadScreenshot(a,t,r);return D(s,{mimeType:"image/jpeg"})}),function(e){return U.apply(this,arguments)}))}N({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:q({device_id:b.Yj().describe("Device ID"),start_date:b.Yj().optional().describe("Start date (YYYY-MM-DD, default: today)"),end_date:b.Yj().optional().describe("End date (YYYY-MM-DD, default: today)")}),permission:"query_device"},(O=m(function*({device_id:e,start_date:i,end_date:t}){var n=(new Date).toISOString().slice(0,10),a=yield W.deviceUsage({deviceId:e,startDate:i||n,endDate:t||n});return D(a)}),function(e){return O.apply(this,arguments)}))}var qn="2.24.0-beta.43";function Wn(){return jn.apply(this,arguments)}function jn(){return jn=m(function*(e={}){var i=e.token||process.env.BRICKS_API_TOKEN;if(!i)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),new Error("API token is required");var t=h({queryStringParameters:{token:i}});if(!t.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(t.message),new Error("Invalid BRICKS_API_TOKEN");var n,a,o=new _._({name:Mn,version:qn}),r={...t,client:Rn(Pn.bricks,t.token,t.tokenType)};(n=o).prompt("getting-started","Getting started with BRICKS",{},m(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:b.Yj().describe("Name for the new application"),description:b.Yj().describe("Short description for the new application").optional()},(a=m(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}".\n\n${t?`Goal: ${t}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. 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\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}}),function(e){return a.apply(this,arguments)})),function(e){e.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"},m(function*(){return D(I,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(o),Nn(o,r);var s=new g.S;try{yield o.connect(s),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${Mn} v${qn}`),console.error(`Token Type: ${t.tokenType}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}}),jn.apply(this,arguments)}}};