@fugood/bricks-cli 2.26.0-beta.2 → 2.26.0-beta.21

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