@fugood/bricks-cli 2.23.7 → 2.23.8

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