@fugood/bricks-cli 2.25.0-beta.8 → 2.25.0-beta.81

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