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

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